Class IndicatorTool

java.lang.Object
org.locationtech.jtstest.testbuilder.ui.tools.BasicTool
org.locationtech.jtstest.testbuilder.ui.tools.IndicatorTool
All Implemented Interfaces:
KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, EventListener, Tool
Direct Known Subclasses:
BoxBandTool, EditVertexTool, LineBandTool

public abstract class IndicatorTool extends BasicTool
  • Field Details

    • bandColor

      private Color bandColor
    • mousePoint

      private Point mousePoint
    • lastShapeDrawn

      private Shape lastShapeDrawn
    • lastLabelDrawn

      private String lastLabelDrawn
    • lastLabelLoc

      private Point lastLabelLoc
    • isIndicatorVisible

      private boolean isIndicatorVisible
    • originalColor

      private Color originalColor
    • originalStroke

      private Stroke originalStroke
    • originalFont

      private Font originalFont
  • Constructor Details

    • IndicatorTool

      public IndicatorTool()
    • IndicatorTool

      public IndicatorTool(Cursor cursor)
  • Method Details

    • getShape

      protected Shape getShape()
      Gets the shape for displaying the current state of the action. Subclasses should override.
      Returns:
      null if nothing should be drawn
    • isIndicatorVisible

      public boolean isIndicatorVisible()
      Important for XOR drawing. Even if #getShape returns null, this method will return true between calls of #redrawShape and #clearShape.
    • setIndicatorVisible

      private void setIndicatorVisible(boolean isIndicatorVisible)
    • clearIndicator

      protected void clearIndicator()
    • redrawIndicator

      protected void redrawIndicator()
    • clearShape

      private void clearShape(Graphics2D graphics)
    • redrawShape

      private void redrawShape(Graphics2D graphics) throws Exception
      Throws:
      Exception
    • drawShapeXOR

      private void drawShapeXOR(Graphics2D g) throws Exception
      Throws:
      Exception
    • drawShapeXOR

      private void drawShapeXOR(Graphics2D graphics, Shape shape, String label, Point labelLoc)
    • setup

      private void setup(Graphics2D graphics)
    • teardown

      private void teardown(Graphics2D graphics)
    • recordLabel

      private void recordLabel(Point p)
    • getLabel

      private String getLabel()
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
      Overrides:
      mouseDragged in class BasicTool
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener
      Overrides:
      mouseMoved in class BasicTool