Class CharBox


  • public class CharBox
    extends Box
    A box representing a single character.
    • Constructor Detail

      • CharBox

        public CharBox​(Char c)
        Create a new CharBox that will represent the character defined by the given Char-object.
        Parameters:
        c - a Char-object containing the character's font information.
    • Method Detail

      • draw

        public void draw​(java.awt.Graphics2D g2,
                         float x,
                         float y)
        Description copied from class: Box
        Paints this box at the given coordinates using the given graphics context.
        Specified by:
        draw in class Box
        Parameters:
        g2 - the graphics (2D) context to use for painting
        x - the x-coordinate
        y - the y-coordinate
      • getLastFontId

        public int getLastFontId()
        Description copied from class: Box
        Get the id of the font that will be used the last when this box will be painted.
        Specified by:
        getLastFontId in class Box
        Returns:
        the id of the last font that will be used.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object