Record Class PanelView.Image

java.lang.Object
java.lang.Record
dev.turboism.sdk.ui.PanelView.Image
All Implemented Interfaces:
PanelView
Enclosing interface:
PanelView

public static record PanelView.Image(byte[] pngBytes, String altText) extends Record implements PanelView
PNG image node (for example a recent-file preview thumbnail) with accessibility alt text. The runtime renders it as an image label sized to the decoded pixels.

Equality compares the PNG bytes by content, so a repaint that rebuilds the same image keeps the rendered component instead of decoding the PNG again.

  • Constructor Details

    • Image

      public Image(byte[] pngBytes, String altText)
      Creates an instance of a Image record class.
      Parameters:
      pngBytes - the value for the pngBytes record component
      altText - the value for the altText record component
  • Method Details

    • pngBytes

      public byte[] pngBytes()
      Returns the value of the pngBytes record component.
      Returns:
      the value of the pngBytes record component
    • equals

      public boolean equals(Object other)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • altText

      public String altText()
      Returns the value of the altText record component.
      Returns:
      the value of the altText record component