Class HTMLImage

java.lang.Object
com.amalgamasimulation.desktop.html.HTMLTag
com.amalgamasimulation.desktop.html.ui.HTMLImage
All Implemented Interfaces:
HTMLConvertable

public class HTMLImage extends HTMLTag
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 Details

    • HTMLImage

      public HTMLImage(org.eclipse.swt.graphics.Image image, String title)
      Constructs a new HTMLImage instance with the specified image and title.
      Parameters:
      image - the image to display
      title - the title of the image
    • HTMLImage

      public HTMLImage(com.amalgamasimulation.animation.AnimationView animationView, String title)
      Constructs a new HTMLImage instance with the specified animation view and title.
      Parameters:
      animationView - the animation view to display
      title - the title of the image
  • Method Details

    • withTitle

      public HTMLImage withTitle(String title)
      Sets the title of the image.
      Parameters:
      title - the title text
      Returns:
      this HTMLImage instance for method chaining
    • titleColor

      public HTMLImage titleColor(Color color)
      Sets the color of the image title.
      Parameters:
      color - the color of the title
      Returns:
      this HTMLImage instance for method chaining
    • titleFont

      public HTMLImage titleFont(FontDescriptor fontDescriptor)
      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

      public HTMLImage titleAlignment(TextAlignment alignment)
      Sets the alignment of the image title.
      Parameters:
      alignment - the alignment of the title
      Returns:
      this HTMLImage instance for method chaining
    • toHTML

      public String toHTML(Set<String> outStrings)
      Converts this HTML image and its title to an HTML string.
      Specified by:
      toHTML in interface HTMLConvertable
      Overrides:
      toHTML in class HTMLTag
      Parameters:
      outStrings - set of unique strings of text content
      Returns:
      the HTML representation of the image and its title