public class MeasureToolController extends java.awt.event.MouseAdapter implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, SelectListener, PositionListener, RenderingListener
MeasureTool
.MeasureTool
Modifier and Type | Field and Description |
---|---|
protected boolean |
active |
protected boolean |
armed |
protected BasicDragger |
dragger |
protected boolean |
freeHand |
protected double |
freeHandMinSpacing |
protected MeasureTool.ControlPoint |
lastPickedObject |
protected MeasureTool |
measureTool |
protected boolean |
moving |
protected MeasureTool.ControlPoint |
movingTarget |
protected MeasureTool.ControlPoint |
rubberBandTarget |
protected boolean |
useRubberBand |
Constructor and Description |
---|
MeasureToolController() |
Modifier and Type | Method and Description |
---|---|
protected void |
autoDisarm() |
protected void |
doMoved(PositionEvent event) |
protected void |
doSelected(SelectEvent event) |
protected void |
dragSelected(SelectEvent event) |
double |
getFreeHandMinSpacing()
Get the minimum distance in meters between two control points for free hand drawing.
|
MeasureTool |
getMeasureTool()
Get the
MeasureTool that this controller is operating on. |
protected void |
highlight(java.lang.Object o) |
boolean |
isActive()
Returns true if the controller is in the middle of a rubber band operation.
|
boolean |
isArmed()
Identifies whether the measure tool controller is armed.
|
boolean |
isFreeHand()
Get whether this controller allows free hand drawing of path and polygons while using rubber band mode.
|
boolean |
isMoving()
Returns true if the controller is moving the measure shape as a whole.
|
boolean |
isUseRubberBand()
Returns true if this controller is using rubber band during shape creation.
|
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent) |
void |
mouseDragged(java.awt.event.MouseEvent mouseEvent) |
void |
mouseMoved(java.awt.event.MouseEvent mouseEvent) |
void |
mousePressed(java.awt.event.MouseEvent mouseEvent) |
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent) |
void |
moved(PositionEvent event) |
protected void |
moveToPosition(Position oldPosition,
Position newPosition)
Move the shape to the specified new position
|
void |
selected(SelectEvent event) |
protected java.awt.Cursor |
selectResizeCursor(Angle azimuth) |
protected void |
setActive(boolean state) |
void |
setArmed(boolean armed)
Arms and disarms the measure tool controller.
|
protected void |
setComponentCursor(java.awt.Cursor cursor) |
protected void |
setCursor(MeasureTool.ControlPoint controlPoint) |
void |
setFreeHand(boolean state)
Set whether this controller allows free hand drawing of path and polygons while using rubber band mode.
|
void |
setFreeHandMinSpacing(double distance)
Set the minimum distance in meters between two control points for free hand drawing.
|
void |
setMeasureTool(MeasureTool measureTool)
Set the
MeasureTool that this controller will be operating on. |
protected void |
setMoving(boolean state) |
void |
setUseRubberBand(boolean state)
Set whether this controller should use rubber band during shape creation.
|
void |
stageChanged(RenderingEvent event) |
protected boolean active
protected boolean armed
protected BasicDragger dragger
protected boolean freeHand
protected double freeHandMinSpacing
protected MeasureTool.ControlPoint lastPickedObject
protected MeasureTool measureTool
protected boolean moving
protected MeasureTool.ControlPoint movingTarget
protected MeasureTool.ControlPoint rubberBandTarget
protected boolean useRubberBand
protected void autoDisarm()
protected void doMoved(PositionEvent event)
protected void doSelected(SelectEvent event)
protected void dragSelected(SelectEvent event)
public double getFreeHandMinSpacing()
public MeasureTool getMeasureTool()
MeasureTool
that this controller is operating on.MeasureTool
that this controller is operating on.protected void highlight(java.lang.Object o)
public boolean isActive()
public boolean isArmed()
public boolean isFreeHand()
public boolean isMoving()
public boolean isUseRubberBand()
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class java.awt.event.MouseAdapter
public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class java.awt.event.MouseAdapter
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
public void moved(PositionEvent event)
moved
in interface PositionListener
protected void moveToPosition(Position oldPosition, Position newPosition)
oldPosition
- Previous position of shapenewPosition
- New position for shapepublic void selected(SelectEvent event)
selected
in interface SelectListener
protected java.awt.Cursor selectResizeCursor(Angle azimuth)
protected void setActive(boolean state)
public void setArmed(boolean armed)
armed
- true to arm the controller, false to disarm it.protected void setComponentCursor(java.awt.Cursor cursor)
protected void setCursor(MeasureTool.ControlPoint controlPoint)
public void setFreeHand(boolean state)
state
- true to allow free hand drawing of path and polygons in rubber band mode.public void setFreeHandMinSpacing(double distance)
distance
- the minimum distance in meters between two control points for free hand drawing.public void setMeasureTool(MeasureTool measureTool)
MeasureTool
that this controller will be operating on.measureTool
- the MeasureTool
that this controller will be operating on.protected void setMoving(boolean state)
public void setUseRubberBand(boolean state)
state
- true if this controller should use rubber band during shape creation.public void stageChanged(RenderingEvent event)
stageChanged
in interface RenderingListener