Class InteractiveLabel

All Implemented Interfaces:
Drawable, Interactive, Measurable

public class InteractiveLabel extends MeasuredCircle implements Interactive
  • Field Details

    • TOP_LEFT_LOCATION

      public static final int TOP_LEFT_LOCATION
      See Also:
    • CENTER_LOCATION

      public static final int CENTER_LOCATION
      See Also:
    • TOP_CENTER_LOCATION

      public static final int TOP_CENTER_LOCATION
      See Also:
    • connection_location

      public int connection_location
    • text

      protected String text
    • font

      protected Font font
    • fontname

      protected String fontname
    • fontsize

      protected int fontsize
    • fontstyle

      protected int fontstyle
  • Constructor Details

    • InteractiveLabel

      public InteractiveLabel()
      Constructor InteractiveLabel
    • InteractiveLabel

      public InteractiveLabel(String str)
      Constructor InteractiveLabel
      Parameters:
      str -
  • Method Details

    • setXY

      public void setXY(double _x, double _y)
      Description copied from class: Circle
      Sets the x and y coordinates.
      Specified by:
      setXY in interface Interactive
      Overrides:
      setXY in class Circle
    • setText

      public void setText(String _text)
    • setText

      public void setText(String _text, double _x, double _y)
    • resetBoxSize

      public void resetBoxSize()
    • setConnectionPoint

      public void setConnectionPoint(int location)
      Sets the location of the connection point. Location values are:TOP_LEFT_LOCATION, TOP_CENTER_LOCATION
      Parameters:
      location - int
    • setOffsetX

      public void setOffsetX(int offset)
      Sets the label's offset in the x direction.
      Parameters:
      offset - int
    • getOffsetX

      public int getOffsetX()
      Gets the label's offset in the x direction.
    • setOffsetY

      public void setOffsetY(int offset)
      Sets the label's offset in the y direction.
      Parameters:
      offset - int
    • getOffsetY

      public int getOffsetY()
      Gets the label's offset in the y direction.
    • draw

      public void draw(DrawingPanel panel, Graphics g)
      Description copied from class: Circle
      Draws the circle.
      Specified by:
      draw in interface Drawable
      Overrides:
      draw in class Circle
    • findInteractive

      public Interactive findInteractive(DrawingPanel panel, int xpix, int ypix)
      Specified by:
      findInteractive in interface Interactive
    • isInside

      public boolean isInside(DrawingPanel panel, int xpix, int ypix)
      Checks to see if this object is enabled and if the pixel coordinates are inside the drawable.
      Parameters:
      panel -
      xpix -
      ypix -
      Returns:
      true if the pixel coordinates are inside; false otherwise
    • setEnabled

      public void setEnabled(boolean enabled)
      Enables mouse interactions
      Specified by:
      setEnabled in interface Interactive
      Parameters:
      enabled - boolean
    • isEnabled

      public boolean isEnabled()
      Gets the mouse interaction enabled property.
      Specified by:
      isEnabled in interface Interactive
      Returns:
      boolean