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 void
private void
clearShape
(Graphics2D graphics) private void
private void
drawShapeXOR
(Graphics2D graphics, Shape shape, String label, Point labelLoc) private String
getLabel()
protected Shape
getShape()
Gets the shape for displaying the current state of the action.boolean
Important for XOR drawing.void
void
private void
recordLabel
(Point p) protected void
private void
redrawShape
(Graphics2D graphics) private void
setIndicatorVisible
(boolean isIndicatorVisible) private void
setup
(Graphics2D graphics) private void
teardown
(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:
mouseDragged
in interfaceMouseMotionListener
- Overrides:
mouseDragged
in classBasicTool
-
mouseMoved
- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classBasicTool
-