Class Text

  • All Implemented Interfaces:
    java.lang.Comparable<TackboardItem>

    public class Text
    extends Bitmap
    Text is a raw bitmap image.
    • Constructor Summary

      Constructors 
      Constructor Description
      Text​(int x, int y, int z, java.lang.String text, java.awt.Font font, int fontSize, java.awt.Color color)
      Public constructor.
      Text​(int x, int y, int z, java.lang.String text, java.lang.String fontName, int fontSize, java.awt.Color color)
      Public constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object rhs)
      Comparison check.
      java.awt.image.BufferedImage getImage​(int textWidth, int textHeight)
      Get this item rendered to a bitmap, offset to align on a grid of cells with pixel dimensions (textWidth, textHeight).
      int hashCode()
      Hashcode uses all fields in equals().
      java.lang.String toString()
      Make human-readable description of this item.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Text

        public Text​(int x,
                    int y,
                    int z,
                    java.lang.String text,
                    java.lang.String fontName,
                    int fontSize,
                    java.awt.Color color)
        Public constructor.
        Parameters:
        x - X pixel coordinate
        y - Y pixel coordinate
        z - Z coordinate
        text - the text string
        fontName - the font name
        fontSize - the font size in points
        color - the color of the text
      • Text

        public Text​(int x,
                    int y,
                    int z,
                    java.lang.String text,
                    java.awt.Font font,
                    int fontSize,
                    java.awt.Color color)
        Public constructor.
        Parameters:
        x - X pixel coordinate
        y - Y pixel coordinate
        z - Z coordinate
        text - the text string
        font - the font
        fontSize - the font size in points
        color - the color of the text
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object rhs)
        Comparison check. All fields must match to return true.
        Overrides:
        equals in class Bitmap
        Parameters:
        rhs - another Text instance
        Returns:
        true if all fields are equal
      • hashCode

        public int hashCode()
        Hashcode uses all fields in equals().
        Overrides:
        hashCode in class Bitmap
        Returns:
        the hash
      • toString

        public java.lang.String toString()
        Make human-readable description of this item.
        Overrides:
        toString in class Bitmap
        Returns:
        displayable String
      • getImage

        public java.awt.image.BufferedImage getImage​(int textWidth,
                                                     int textHeight)
        Get this item rendered to a bitmap, offset to align on a grid of cells with pixel dimensions (textWidth, textHeight).
        Overrides:
        getImage in class Bitmap
        Parameters:
        textWidth - the width of a text cell
        textHeight - the height of a text cell
        Returns:
        the image, or null if this item does not have any pixels to show