mxGraph 1.10.3.1


com.mxgraph.swing.handler
Class mxRotationHandler

java.lang.Object
  extended by com.mxgraph.swing.util.mxMouseAdapter
      extended by com.mxgraph.swing.handler.mxRotationHandler
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener

public class mxRotationHandler
extends mxMouseAdapter

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
protected  double currentAngle
           
protected  mxCellState currentState
           
protected  boolean enabled
          Specifies if this handler is enabled.
protected  Point first
           
protected  mxGraphComponent graphComponent
          Reference to the enclosing graph component.
protected  JComponent handle
           
protected  double initialAngle
           
static ImageIcon ROTATE_ICON
           
 
Constructor Summary
mxRotationHandler(mxGraphComponent graphComponent)
          Constructs a new rotation handler.
 
Method Summary
protected  JComponent createHandle()
           
 mxGraphComponent getGraphComponent()
           
 boolean isEnabled()
           
 boolean isStateHandled(mxCellState state)
           
 void mouseDragged(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paint(Graphics g)
           
 void reset()
           
 void setEnabled(boolean value)
           
 void start(MouseEvent e)
           
 
Methods inherited from class com.mxgraph.swing.util.mxMouseAdapter
mouseClicked, mouseEntered, mouseExited
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROTATE_ICON

public static ImageIcon ROTATE_ICON

graphComponent

protected mxGraphComponent graphComponent
Reference to the enclosing graph component.


enabled

protected boolean enabled
Specifies if this handler is enabled. Default is true.


handle

protected JComponent handle

currentState

protected mxCellState currentState

initialAngle

protected double initialAngle

currentAngle

protected double currentAngle

first

protected Point first
Constructor Detail

mxRotationHandler

public mxRotationHandler(mxGraphComponent graphComponent)
Constructs a new rotation handler.

Method Detail

getGraphComponent

public mxGraphComponent getGraphComponent()

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean value)

createHandle

protected JComponent createHandle()

isStateHandled

public boolean isStateHandled(mxCellState state)

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class mxMouseAdapter

start

public void start(MouseEvent e)

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener
Overrides:
mouseMoved in class mxMouseAdapter

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener
Overrides:
mouseDragged in class mxMouseAdapter

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener
Overrides:
mouseReleased in class mxMouseAdapter

reset

public void reset()

paint

public void paint(Graphics g)

mxGraph 1.10.3.1


Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.