Class HTMLImage
java.lang.Object
com.amalgamasimulation.desktop.html.HTMLTag
com.amalgamasimulation.desktop.html.ui.HTMLImage
- All Implemented Interfaces:
HTMLConvertable
The HTMLImage class represents an HTML image element that can be embedded in
an HTML page. It extends
HTMLTag and provides methods for configuring
and rendering images, including support for titles, fonts, colors, and
alignment.- Author:
- Alexey Glazyrin
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new HTMLImage instance with the specified animation view and title.Constructs a new HTMLImage instance with the specified image and title. -
Method Summary
Modifier and TypeMethodDescriptiontitleAlignment(TextAlignment alignment) Sets the alignment of the image title.titleColor(Color color) Sets the color of the image title.titleFont(FontDescriptor fontDescriptor) Sets the font of the image title.Converts this HTML image and its title to an HTML string.Sets the title of the image.Methods inherited from class com.amalgamasimulation.desktop.html.HTMLTag
append, attr, backgroundColor, colorToRGBA, copy, fillCopy, font, fontColor, fontFamily, fontSizeInPx, fontStyle, fontWeight, getAttributes, getChildren, lineHeight, marginInPx, maxHeightInPx, maxWidthInPx, paddingInPx, relativeHeight, relativeWidth, removeChildren, style, tag, tag, textAlignment, toCSSMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.amalgamasimulation.desktop.html.HTMLConvertable
copy, toHTML
-
Constructor Details
-
HTMLImage
Constructs a new HTMLImage instance with the specified image and title.- Parameters:
image- the image to displaytitle- the title of the image
-
HTMLImage
Constructs a new HTMLImage instance with the specified animation view and title.- Parameters:
animationView- the animation view to displaytitle- the title of the image
-
-
Method Details
-
withTitle
Sets the title of the image.- Parameters:
title- the title text- Returns:
- this HTMLImage instance for method chaining
-
titleColor
Sets the color of the image title.- Parameters:
color- the color of the title- Returns:
- this HTMLImage instance for method chaining
-
titleFont
Sets the font of the image title.- Parameters:
fontDescriptor- the font descriptor to use for the title- Returns:
- this HTMLImage instance for method chaining
-
titleAlignment
Sets the alignment of the image title.- Parameters:
alignment- the alignment of the title- Returns:
- this HTMLImage instance for method chaining
-
toHTML
Converts this HTML image and its title to an HTML string.- Specified by:
toHTMLin interfaceHTMLConvertable- Overrides:
toHTMLin classHTMLTag- Parameters:
outStrings- set of unique strings of text content- Returns:
- the HTML representation of the image and its title
-