public class CanvasCharacter extends AbstractCoordinateShape
Represents a single character on the text canvas.
  • Constructor Details

    • CanvasCharacter

      public CanvasCharacter(Point3D centerLocation, char character, Color foregroundColor, Color backgroundColor)
  • Method Details

    • getFont

      public static Font getFont(int size)
      Returns a font of the specified size.

      If the font of the specified size is already cached, it will be returned. Otherwise, a new font will be created, cached and returned.

      Parameters:
      size - the size of the font
      Returns:
      the font
    • getBackgroundColor

      public Color getBackgroundColor()
      Returns color of the background.
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
      Sets color of the background.
    • getForegroundColor

      public Color getForegroundColor()
      Returns color of the foreground.
      Returns:
      the color
    • setForegroundColor

      public void setForegroundColor(Color foregroundColor)
      Sets color of the foreground.
      Parameters:
      foregroundColor - the color
    • paint

      public void paint(RenderingContext renderingContext)
      Paints the character on the screen.
      Specified by:
      paint in class AbstractCoordinateShape
      Parameters:
      renderingContext - the rendering context
    • setValue

      public void setValue(char value)