Class mxRotationHandler
java.lang.Object
com.mxgraph.swing.util.mxMouseAdapter
com.mxgraph.swing.handler.mxRotationHandler
- All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener
Basic example of implementing a handler for rotation. This can be used as follows:
new mxRotationHandler(graphComponent)
Note that the Java core does actually not support rotation for the selection handles,
perimeter points etc. Feel free to contribute a fix!
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected doubleprotected mxCellStateprotected booleanSpecifies if this handler is enabled.protected Pointprotected mxGraphComponentReference to the enclosing graph component.protected JComponentprotected doublestatic ImageIcon -
Constructor Summary
ConstructorsConstructorDescriptionmxRotationHandler(mxGraphComponent graphComponent) Constructs a new rotation handler. -
Method Summary
Modifier and TypeMethodDescriptionprotected JComponentbooleanbooleanisStateHandled(mxCellState state) voidvoidvoidvoidvoidvoidreset()voidsetEnabled(boolean value) voidstart(MouseEvent e) Methods inherited from class mxMouseAdapter
mouseClicked, mouseEntered, mouseExited
-
Field Details
-
ROTATE_ICON
-
graphComponent
Reference to the enclosing graph component. -
enabled
protected boolean enabledSpecifies if this handler is enabled. Default is true. -
handle
-
currentState
-
initialAngle
protected double initialAngle -
currentAngle
protected double currentAngle -
first
-
-
Constructor Details
-
mxRotationHandler
Constructs a new rotation handler.
-
-
Method Details
-
getGraphComponent
-
isEnabled
public boolean isEnabled() -
setEnabled
public void setEnabled(boolean value) -
createHandle
-
isStateHandled
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classmxMouseAdapter
-
start
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classmxMouseAdapter
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classmxMouseAdapter
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classmxMouseAdapter
-
reset
public void reset() -
paint
-