public class mxCellHandler
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.awt.Rectangle |
bounds
Holds the bounding box of the handler.
|
protected java.awt.Point |
first
Holds the start location of the mouse gesture.
|
protected mxGraphComponent |
graphComponent
Reference to the enclosing graph component.
|
protected java.awt.Rectangle[] |
handles
Holds the rectangles that define the handles.
|
protected boolean |
handlesVisible
Specifies if the handles should be painted.
|
protected int |
index
Holds the index of the handle that was clicked.
|
protected javax.swing.JComponent |
preview
Holds the component that is used for preview.
|
protected mxCellState |
state
Holds the cell state associated with this handler.
|
Constructor and Description |
---|
mxCellHandler(mxGraphComponent graphComponent,
mxCellState state)
Constructs a new cell handler for the given cell state.
|
Modifier and Type | Method and Description |
---|---|
protected java.awt.Rectangle[] |
createHandles()
Creates the rectangles that define the handles.
|
protected javax.swing.JComponent |
createPreview()
Creates the preview for this handler.
|
protected void |
destroy()
Invoked when the handler is no longer used.
|
java.awt.Rectangle |
getBounds()
Returns the bounding box of this handler.
|
protected java.awt.Cursor |
getCursor(java.awt.event.MouseEvent e,
int index)
Returns the cursor for the given event and handle.
|
mxGraphComponent |
getGraphComponent() |
protected java.awt.Color |
getHandleBorderColor(int index)
Returns the border color of the handle at the specified index.
|
protected int |
getHandleCount()
Returns the number of handles in this handler.
|
protected java.awt.Color |
getHandleFillColor(int index)
Returns the color to be used to fill the handle at the specified index.
|
int |
getIndex()
Returns the index of the current handle.
|
int |
getIndexAt(int x,
int y)
Returns the index of the handle at the given location.
|
java.awt.Color |
getSelectionColor()
Returns the color used to draw the selection border.
|
java.awt.Stroke |
getSelectionStroke()
Returns the stroke used to draw the selection border.
|
mxCellState |
getState()
Returns the cell state that is associated with this handler.
|
java.lang.String |
getToolTipText(java.awt.event.MouseEvent e)
Hook for subclassers to return tooltip texts for certain points on the
handle.
|
boolean |
isActive() |
protected boolean |
isHandleEnabled(int index)
Returns true if the handle at the specified index is enabled.
|
boolean |
isHandlesVisible()
Returns true if the handles should be painted.
|
protected boolean |
isHandleVisible(int index)
Returns true if the handle at the specified index is visible.
|
protected boolean |
isIgnoredEvent(java.awt.event.MouseEvent e)
Returns true if the given event should be ignored.
|
boolean |
isLabel(int index)
Returns true if the given index is the index of the last handle.
|
boolean |
isLabelMovable()
Returns true if the label is movable.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Processes the given event.
|
void |
mouseMoved(java.awt.event.MouseEvent e)
Processes the given event.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Processes the given event.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Processes the given event.
|
void |
paint(java.awt.Graphics g)
Paints the visible handles of this handler.
|
void |
refresh(mxCellState state)
Refreshes the cell handler.
|
void |
reset()
Resets the state of the handler and removes the preview.
|
void |
setHandlesVisible(boolean handlesVisible)
Specifies if the handles should be painted.
|
void |
start(java.awt.event.MouseEvent e,
int index)
Starts handling a gesture at the given handle index.
|
protected mxGraphComponent graphComponent
protected mxCellState state
protected java.awt.Rectangle[] handles
protected boolean handlesVisible
protected transient java.awt.Rectangle bounds
protected transient javax.swing.JComponent preview
protected transient java.awt.Point first
protected transient int index
public mxCellHandler(mxGraphComponent graphComponent, mxCellState state)
graphComponent
- Enclosing graph component.state
- Cell state for which the handler is created.public boolean isActive()
public void refresh(mxCellState state)
public mxGraphComponent getGraphComponent()
public mxCellState getState()
public int getIndex()
public java.awt.Rectangle getBounds()
public boolean isLabelMovable()
public boolean isHandlesVisible()
public void setHandlesVisible(boolean handlesVisible)
public boolean isLabel(int index)
protected java.awt.Rectangle[] createHandles()
protected int getHandleCount()
public java.lang.String getToolTipText(java.awt.event.MouseEvent e)
public int getIndexAt(int x, int y)
x
- X-coordinate of the location.y
- Y-coordinate of the location.public void mousePressed(java.awt.event.MouseEvent e)
public void mouseMoved(java.awt.event.MouseEvent e)
public void mouseDragged(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void start(java.awt.event.MouseEvent e, int index)
protected boolean isIgnoredEvent(java.awt.event.MouseEvent e)
protected javax.swing.JComponent createPreview()
public void reset()
protected java.awt.Cursor getCursor(java.awt.event.MouseEvent e, int index)
public void paint(java.awt.Graphics g)
public java.awt.Color getSelectionColor()
public java.awt.Stroke getSelectionStroke()
protected boolean isHandleEnabled(int index)
protected boolean isHandleVisible(int index)
protected java.awt.Color getHandleFillColor(int index)
protected java.awt.Color getHandleBorderColor(int index)
protected void destroy()
Copyright (c) 2010 Gaudenz Alder, David Benson. All rights reserved.