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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprivate voidclearShape(Graphics2D graphics) private voidprivate voiddrawShapeXOR(Graphics2D graphics, Shape shape, String label, Point labelLoc) private StringgetLabel()protected ShapegetShape()Gets the shape for displaying the current state of the action.booleanImportant for XOR drawing.voidvoidprivate voidrecordLabel(Point p) protected voidprivate voidredrawShape(Graphics2D graphics) private voidsetIndicatorVisible(boolean isIndicatorVisible) private voidsetup(Graphics2D graphics) private voidteardown(Graphics2D graphics) Methods inherited from class org.locationtech.jtstest.testbuilder.ui.tools.BasicTool
activate, deactivate, geomModel, getCursor, getGraphics2D, getModelSnapTolerance, gridSize, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved, panel, toModel, toModel, toModelCoordinate, toModelSnapped, toModelSnappedIfCloseToViewGrid, toModelSnappedToViewGrid, toView, toView
-
Field Details
-
bandColor
-
mousePoint
-
lastShapeDrawn
-
lastLabelDrawn
-
lastLabelLoc
-
isIndicatorVisible
private boolean isIndicatorVisible -
originalColor
-
originalStroke
-
originalFont
-
-
Constructor Details
-
IndicatorTool
public IndicatorTool() -
IndicatorTool
-
-
Method Details
-
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
-
redrawShape
- Throws:
Exception
-
drawShapeXOR
- Throws:
Exception
-
drawShapeXOR
-
setup
-
teardown
-
recordLabel
-
getLabel
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classBasicTool
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classBasicTool
-