|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.mxgraph.swing.util.mxMouseControl
com.mxgraph.swing.handler.mxGraphHandler
public class mxGraphHandler
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected mxRectangle |
bbox
Scaled, translated bounding box of the selection cells. |
protected boolean |
canImport
|
protected Object |
cell
|
protected mxRectangle |
cellBounds
Scaled, translated bounds of the selection cells. |
protected Object[] |
cells
Holds the cells that are being moved by this handler. |
protected boolean |
centerPreview
Specifies if the preview should be centered around the mouse cursor if there was no mouse click to define the offset within the shape (eg. |
protected boolean |
cloneEnabled
Specifies if cloning by control-drag is enabled. |
protected boolean |
constrainedEvent
Workaround for shift-key-state not correct in mouseReleased. |
protected Object[] |
dragCells
|
protected ImageIcon |
dragImage
Holds the image that is being used for the preview. |
protected Point |
first
Holds the start location of the mouse gesture. |
protected mxGraphComponent |
graphComponent
Reference to the enclosing graph component. |
protected boolean |
imagePreview
Specifies if an image should be used for preview. |
protected Object |
initialCell
|
protected boolean |
keepOnTop
Specifies if this handler should be painted on top of all other components. |
protected mxCellMarker |
marker
|
static Cursor |
MOVE_CURSOR
|
protected boolean |
moveEnabled
Specifies if moving is enabled. |
protected boolean |
removeCellsFromParent
Specifies if cells may be moved out of their parents. |
protected boolean |
selectEnabled
Specifies if moving is enabled. |
protected mxRectangle |
transferBounds
Unscaled, untranslated bounding box of the selection cells. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
mxGraphHandler(mxGraphComponent graphComponent)
|
Method Summary | |
---|---|
Point |
convertPoint(Point pt)
|
protected MouseEvent |
createEvent(DropTargetEvent e)
|
protected mxCellMarker |
createMarker()
|
void |
dragEnter(DropTargetDragEvent e)
|
void |
dragExit(DropTargetEvent e)
|
void |
dragOver(DropTargetDragEvent e)
|
void |
drop(DropTargetDropEvent e)
|
void |
dropActionChanged(DropTargetDragEvent e)
|
protected void |
fold(Object cell)
|
Object[] |
getCells(Object initialCell)
|
protected Cursor |
getCursor(MouseEvent e)
|
protected static JComponent |
getDropTarget(DropTargetEvent e)
Helper method to return the component for a drop target event. |
mxGraphComponent |
getGraphComponent()
|
protected static mxGraphTransferHandler |
getGraphTransferHandler(DropTargetEvent e)
Helper method to return the component for a drop target event. |
protected Point |
getPreviewLocation(MouseEvent e,
boolean gridEnabled)
|
boolean |
isCenterPreview()
|
boolean |
isCloneEnabled()
|
boolean |
isImagePreview()
|
boolean |
isMoveEnabled()
|
boolean |
isRemoveCellsFromParent()
|
boolean |
isSelectEnabled()
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
protected void |
moveCells(Object[] cells,
double dx,
double dy,
Object target,
MouseEvent e)
|
void |
paint(Graphics g)
|
void |
reset()
|
void |
setCenterPreview(boolean value)
|
void |
setCloneEnabled(boolean value)
|
void |
setImagePreview(boolean value)
|
void |
setMoveEnabled(boolean value)
|
void |
setRemoveCellsFromParent(boolean value)
|
void |
setSelectEnabled(boolean value)
|
protected boolean |
shouldRemoveCellFromParent(Object parent,
Object[] cells,
MouseEvent e)
Returns true if the given cells should be removed from the parent for the specified mousereleased event. |
void |
start(MouseEvent e)
|
void |
updateDragImage(Object[] cells)
|
Methods inherited from class com.mxgraph.swing.util.mxMouseControl |
---|
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static Cursor MOVE_CURSOR
protected mxGraphComponent graphComponent
protected boolean cloneEnabled
protected boolean moveEnabled
protected boolean selectEnabled
protected boolean removeCellsFromParent
protected boolean imagePreview
protected boolean centerPreview
protected boolean keepOnTop
protected transient Object[] cells
protected transient ImageIcon dragImage
protected transient Point first
protected transient Object cell
protected transient Object initialCell
protected transient Object[] dragCells
protected transient mxCellMarker marker
protected transient boolean canImport
protected transient mxRectangle cellBounds
protected transient mxRectangle bbox
protected transient mxRectangle transferBounds
protected transient boolean constrainedEvent
Constructor Detail |
---|
public mxGraphHandler(mxGraphComponent graphComponent)
graphComponent
- Method Detail |
---|
protected mxCellMarker createMarker()
public mxGraphComponent getGraphComponent()
public boolean isCloneEnabled()
public void setCloneEnabled(boolean value)
public boolean isMoveEnabled()
public void setMoveEnabled(boolean value)
public boolean isSelectEnabled()
public void setSelectEnabled(boolean value)
public boolean isRemoveCellsFromParent()
public void setRemoveCellsFromParent(boolean value)
public boolean isImagePreview()
public void setImagePreview(boolean value)
public boolean isCenterPreview()
public void setCenterPreview(boolean value)
public void updateDragImage(Object[] cells)
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class mxMouseControl
protected Cursor getCursor(MouseEvent e)
public void dragEnter(DropTargetDragEvent e)
dragEnter
in interface DropTargetListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class mxMouseControl
public Object[] getCells(Object initialCell)
public void start(MouseEvent e)
public void dropActionChanged(DropTargetDragEvent e)
dropActionChanged
in interface DropTargetListener
public void dragOver(DropTargetDragEvent e)
dragOver
in interface DropTargetListener
e
- public Point convertPoint(Point pt)
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class mxMouseControl
protected Point getPreviewLocation(MouseEvent e, boolean gridEnabled)
public void dragExit(DropTargetEvent e)
dragExit
in interface DropTargetListener
e
- public void drop(DropTargetDropEvent e)
drop
in interface DropTargetListener
e
- public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class mxMouseControl
protected void fold(Object cell)
public void reset()
protected boolean shouldRemoveCellFromParent(Object parent, Object[] cells, MouseEvent e)
protected void moveCells(Object[] cells, double dx, double dy, Object target, MouseEvent e)
dx
- dy
- e
- public void paint(Graphics g)
paint
in class JComponent
protected MouseEvent createEvent(DropTargetEvent e)
protected static final mxGraphTransferHandler getGraphTransferHandler(DropTargetEvent e)
protected static final JComponent getDropTarget(DropTargetEvent e)
|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |