public class MeasureToolController extends MouseAdapter implements MouseListener, 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(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(MouseEvent mouseEvent) |
void |
mouseDragged(MouseEvent mouseEvent) |
void |
mouseMoved(MouseEvent mouseEvent) |
void |
mousePressed(MouseEvent mouseEvent) |
void |
mouseReleased(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 Cursor |
selectResizeCursor(Angle azimuth) |
protected void |
setActive(boolean state) |
void |
setArmed(boolean armed)
Arms and disarms the measure tool controller.
|
protected void |
setComponentCursor(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) |
mouseEntered, mouseExited, mouseWheelMovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitmouseEntered, mouseExitedprotected 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(Object o)
public boolean isActive()
public boolean isArmed()
public boolean isFreeHand()
public boolean isMoving()
public boolean isUseRubberBand()
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked in interface MouseListenermouseClicked in class MouseAdapterpublic void mouseDragged(MouseEvent mouseEvent)
mouseDragged in interface MouseMotionListenermouseDragged in class MouseAdapterpublic void mouseMoved(MouseEvent mouseEvent)
mouseMoved in interface MouseMotionListenermouseMoved in class MouseAdapterpublic void mousePressed(MouseEvent mouseEvent)
mousePressed in interface MouseListenermousePressed in class MouseAdapterpublic void mouseReleased(MouseEvent mouseEvent)
mouseReleased in interface MouseListenermouseReleased in class MouseAdapterpublic void moved(PositionEvent event)
moved in interface PositionListenerprotected void moveToPosition(Position oldPosition, Position newPosition)
oldPosition - Previous position of shapenewPosition - New position for shapepublic void selected(SelectEvent event)
selected in interface SelectListenerprotected void setActive(boolean state)
public void setArmed(boolean armed)
armed - true to arm the controller, false to disarm it.protected void setComponentCursor(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