public class mxEdgeHandler extends mxCellHandler
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
cloneEnabled |
protected boolean |
constrainedEvent
Workaround for shift-key-state not correct in mouseReleased.
|
protected java.lang.String |
error |
protected boolean |
gridEnabledEvent
Workaround for alt-key-state not correct in mouseReleased.
|
protected mxCellMarker |
marker |
protected java.awt.Point[] |
p |
bounds, first, graphComponent, handles, handlesVisible, index, preview, state| Constructor and Description |
|---|
mxEdgeHandler(mxGraphComponent graphComponent,
mxCellState state) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
connect(java.lang.Object edge,
java.lang.Object terminal,
boolean isSource,
boolean isClone)
Connects the given edge to the given source or target terminal.
|
protected mxPoint |
convertPoint(mxPoint point,
boolean gridEnabled) |
protected java.awt.Rectangle |
createHandle(java.awt.Point center) |
protected java.awt.Rectangle |
createHandle(java.awt.Point center,
int size) |
protected java.awt.Rectangle[] |
createHandles()
Creates the rectangles that define the handles.
|
protected java.awt.Point[] |
createPoints(mxCellState s) |
protected javax.swing.JComponent |
createPreview()
Creates the preview for this handler.
|
protected java.awt.Cursor |
getCursor(java.awt.event.MouseEvent e,
int index)
Returns the cursor for the given event and handle.
|
protected java.awt.Color |
getHandleFillColor(int index)
Returns the color to be used to fill the handle at the specified index.
|
int |
getIndexAt(int x,
int y)
Returns the index of the handle at the given location.
|
protected java.awt.Rectangle |
getPreviewBounds() |
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.
|
protected boolean |
isCellBendable() |
boolean |
isCloneEnabled() |
protected boolean |
isFlipEvent(java.awt.event.MouseEvent e) |
protected boolean |
isHandleVisible(int index)
Hides the middle handle if the edge is not bendable.
|
protected boolean |
isIgnoredEvent(java.awt.event.MouseEvent e)
No flip event is ignored.
|
boolean |
isSource(int index)
Returns true if the current index is 0.
|
boolean |
isTarget(int index)
Returns true if the current index is the last index.
|
void |
mouseDragged(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.
|
protected void |
moveLabelTo(mxCellState edgeState,
double x,
double y)
Moves the label to the given position.
|
protected void |
movePoint(java.lang.Object edge,
int pointIndex,
mxPoint point)
Moves the edges control point with the given index to the given point.
|
void |
paint(java.awt.Graphics g)
Paints the visible handles of this handler.
|
void |
reset()
Extends the implementation to reset the current error and marker.
|
void |
setCloneEnabled(boolean cloneEnabled) |
java.lang.String |
validateConnection(java.lang.Object source,
java.lang.Object target)
Returns the error message or an empty string if the connection for the
given source target pair is not valid.
|
destroy, getBounds, getGraphComponent, getHandleBorderColor, getHandleCount, getIndex, getState, getToolTipText, isActive, isHandleEnabled, isHandlesVisible, isLabel, isLabelMovable, mouseMoved, refresh, setHandlesVisible, startprotected boolean cloneEnabled
protected java.awt.Point[] p
protected transient java.lang.String error
protected transient boolean gridEnabledEvent
protected transient boolean constrainedEvent
protected mxCellMarker marker
public mxEdgeHandler(mxGraphComponent graphComponent, mxCellState state)
graphComponent - state - public void setCloneEnabled(boolean cloneEnabled)
public boolean isCloneEnabled()
protected boolean isIgnoredEvent(java.awt.event.MouseEvent e)
isIgnoredEvent in class mxCellHandlerprotected boolean isFlipEvent(java.awt.event.MouseEvent e)
public java.lang.String validateConnection(java.lang.Object source,
java.lang.Object target)
public boolean isSource(int index)
public boolean isTarget(int index)
protected boolean isHandleVisible(int index)
isHandleVisible in class mxCellHandlerprotected boolean isCellBendable()
protected java.awt.Rectangle[] createHandles()
mxCellHandlercreateHandles in class mxCellHandlerprotected java.awt.Color getHandleFillColor(int index)
mxCellHandlergetHandleFillColor in class mxCellHandlerpublic int getIndexAt(int x,
int y)
mxCellHandlergetIndexAt in class mxCellHandlerx - y - protected java.awt.Rectangle createHandle(java.awt.Point center)
protected java.awt.Rectangle createHandle(java.awt.Point center,
int size)
protected java.awt.Point[] createPoints(mxCellState s)
protected javax.swing.JComponent createPreview()
mxCellHandlercreatePreview in class mxCellHandlerprotected mxPoint convertPoint(mxPoint point, boolean gridEnabled)
point - gridEnabled - protected java.awt.Rectangle getPreviewBounds()
public void mousePressed(java.awt.event.MouseEvent e)
mxCellHandlermousePressed in class mxCellHandlerpublic void mouseDragged(java.awt.event.MouseEvent e)
mxCellHandlermouseDragged in class mxCellHandlerpublic void mouseReleased(java.awt.event.MouseEvent e)
mxCellHandlermouseReleased in class mxCellHandlerpublic void reset()
reset in class mxCellHandlerprotected void movePoint(java.lang.Object edge,
int pointIndex,
mxPoint point)
protected void connect(java.lang.Object edge,
java.lang.Object terminal,
boolean isSource,
boolean isClone)
edge - terminal - isSource - protected void moveLabelTo(mxCellState edgeState, double x, double y)
protected java.awt.Cursor getCursor(java.awt.event.MouseEvent e,
int index)
mxCellHandlergetCursor in class mxCellHandlerpublic java.awt.Color getSelectionColor()
mxCellHandlergetSelectionColor in class mxCellHandlerpublic java.awt.Stroke getSelectionStroke()
mxCellHandlergetSelectionStroke in class mxCellHandlerpublic void paint(java.awt.Graphics g)
mxCellHandlerpaint in class mxCellHandler