Package com.kheops.jmap.client.tools
Class ToolDrawBox
java.lang.Object
com.kheops.jmap.client.tools.Tool
com.kheops.jmap.client.tools.ToolDraw
com.kheops.jmap.client.tools.ToolDrawState
com.kheops.jmap.client.tools.ToolDrawBox
- All Implemented Interfaces:
JMapEventDispatcher,ViewEventListener,ViewManagerEventListener,KeyListener,EventListener
- Direct Known Subclasses:
ToolSelectBox,ToolZoomInBox,ToolZoomOutBox
This subclass of Tool automatically draws a rectangle on the view when the
mouse is dragged.
- See Also:
-
Field Summary
FieldsFields inherited from class com.kheops.jmap.client.tools.ToolDrawState
state, STATE_FIRST_CLICK, STATE_NONE, STATE_SECOND_CLICKFields inherited from class com.kheops.jmap.client.tools.ToolDraw
altKeyEventManager, altLastPressed, createStyledElement, cursorCrosshair, cursorWait, df, displayLabel, drawLayer, drawLayerId, eventDispatcher, firstPointWc, ID_DISTANCE_LINE, ID_LABEL, ID_LINE_TMP, ID_SNAP_POINT, isPersistant, lastMousePositionDc, secPointWc, showAttributesEditor, snapLayers, styleContainer, t, toRedrawDc, useHighlightHandles, useUndoManager -
Constructor Summary
ConstructorsConstructorDescriptionToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer) ToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer, boolean useUndoManager) ToolDrawBox(StyleContainer styleContainer) -
Method Summary
Modifier and TypeMethodDescriptionvoidKeyListener methodsvoidThis method is called by the view (View instance) after mouse clicked events generated by the user.voidThis method overrides onToolDragged in Tool.voidThis method is called by the view (View instance) after mouse moved events generated by the user.voidThis method overrides onToolPressed in Tool.voidThis method overrides onToolReleased in Tool.voidTerminates the current toolvoidThis method handles viewRepaintOccurredMethods inherited from class com.kheops.jmap.client.tools.ToolDrawState
initMethods inherited from class com.kheops.jmap.client.tools.ToolDraw
addEditionEventListener, altIsPressed, altLastPressed, ctrlIsPressed, dispatchEvent, fireEditionEvent, genTrnsprntFillContainer, getCursor, getDrawLayer, getLabelAlignment, getLabelStyle, getLineStyle, getStyleContainer, initEventDispatcher, isCreateStyledElement, isPersistant, isPersistent, isUseUndoManager, keyReleased, keyTyped, offsetGeometry, removeEditionEventListener, setCreateStyledElement, setDrawLayer, setPersistant, setPersistent, setShowAttributesEditor, setStyleContainer, setUseUndoManager, shiftIsPressed, unoffsetGeometry, updatePtMouseVars, updatePtMouseVars, viewActivated, viewAdded, viewChangedOccurred, viewDeactivated, viewPopupMenuShowing, viewReadyOccurred, viewRedrawOccurred, viewRemoved, viewStaticElementChanged, viewToolChangedOccurredMethods inherited from class com.kheops.jmap.client.tools.Tool
getView, isAutoPan, setAutoPan, toWCPoint
-
Field Details
-
styledPoly
-
styledLabel
-
-
Constructor Details
-
ToolDrawBox
public ToolDrawBox() -
ToolDrawBox
-
ToolDrawBox
public ToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer) -
ToolDrawBox
public ToolDrawBox(int nbDecimals, boolean displayLabel, boolean isPersistant, int drawLayerId, StyleContainer styleContainer, boolean useUndoManager)
-
-
Method Details
-
onToolPressed
This method overrides onToolPressed in Tool. It is called after a mouse pressed event on the view to determine the starting corner coordinates of the box.- Overrides:
onToolPressedin classTool- Parameters:
e- the MouseEvent
-
onToolDragged
This method overrides onToolDragged in Tool. It is called after an mouse drag event on the view to draw dynamically a box from the starting corner location (where the mouse pressed event occurred.) to the ending corner location (the present mouse location)- Overrides:
onToolDraggedin classTool- Parameters:
e- the corresponding the MouveEvent
-
onToolReleased
This method overrides onToolReleased in Tool. It is called after an mouse released event on the view.- Overrides:
onToolReleasedin classTool- Parameters:
e- the corresponding MouveEvent
-
onToolMoved
Description copied from class:ToolThis method is called by the view (View instance) after mouse moved events generated by the user. It will handle these events by making the necessary changes. This method should be overridden by the subclasses that needs to perform specific tasks when such events occur.- Overrides:
onToolMovedin classTool- Parameters:
e- the corresponding mouse event.
-
terminate
public void terminate()Description copied from class:ToolDrawTerminates the current tool- Overrides:
terminatein classToolDrawState
-
keyPressed
Description copied from class:ToolDrawKeyListener methods- Specified by:
keyPressedin interfaceKeyListener- Overrides:
keyPressedin classToolDraw
-
viewRepaintOccurred
Description copied from interface:ViewEventListenerThis method handles viewRepaintOccurred- Specified by:
viewRepaintOccurredin interfaceViewEventListener- Overrides:
viewRepaintOccurredin classToolDraw- Parameters:
e- the corresponding ViewRepaintEvent object
-
onToolClicked
Description copied from class:ToolThis method is called by the view (View instance) after mouse clicked events generated by the user. It will handle these events by making the necessary changes. This method should be overridden by the subclasses that needs to perform specific tasks when such events occur.- Overrides:
onToolClickedin classTool- Parameters:
e- the corresponding mouse event.
-