Class InteractiveTextLine

All Implemented Interfaces:
Drawable, Interactive, Measurable
Direct Known Subclasses:
PencilCaption

public class InteractiveTextLine extends InteractiveShape
An InteractiveTextLine is a single line of text that can be moved and rotated like other interactive shapes.
Version:
1.0
Author:
Wolfgang Christian
  • Field Details

    • textLine

      protected TextLine textLine
  • Constructor Details

    • InteractiveTextLine

      public InteractiveTextLine(String text, double x, double y)
      Constructs an interactive TextLinme with the given text and location.
      Parameters:
      text - String
      x - double
      y - double
  • Method Details

    • setJustification

      public void setJustification(int justification)
      Sets the justification to center, left, or right. TextLine.CENTER, TextLine.LEFT, TextLine.RIGHT
      Parameters:
      justification - int
    • setText

      public void setText(String text)
      Sets the text to be displayed.
      Parameters:
      text - String
    • getText

      public String getText()
      Gets the text to be dispalyed.
      Returns:
      String
    • setFont

      public void setFont(Font font)
      Sets the font used to display the text.
      Parameters:
      font - Font
    • getFont

      public Font getFont()
      Gets the font used to display the text.
      Returns:
      Font
    • isInside

      public boolean isInside(DrawingPanel panel, int xpix, int ypix)
      Determines if the shape is enabled and if the given pixel coordinates are within the image.
      Overrides:
      isInside in class InteractiveShape
      Parameters:
      panel - DrawingPanel
      xpix - int
      ypix - int
      Returns:
      boolean
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Draws the text.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class InteractiveShape
      Parameters:
      panel - the world in which the arrow is viewed
      g - the graphics context upon which to draw
    • getLoader

      public static XML.ObjectLoader getLoader()
      Gets the XML object loader for this class.
      Returns:
      ObjectLoader