Class mxEdgeHandler
java.lang.Object
com.mxgraph.swing.handler.mxCellHandler
com.mxgraph.swing.handler.mxEdgeHandler
- Direct Known Subclasses:
mxElbowEdgeHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanWorkaround for shift-key-state not correct in mouseReleased.protected Stringprotected booleanWorkaround for alt-key-state not correct in mouseReleased.protected mxCellMarkerprotected Point[]Fields inherited from class mxCellHandler
bounds, first, graphComponent, handles, handlesVisible, index, preview, state -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConnects the given edge to the given source or target terminal.protected mxPointconvertPoint(mxPoint point, boolean gridEnabled) protected RectanglecreateHandle(Point center) protected RectanglecreateHandle(Point center, int size) protected Rectangle[]Creates the rectangles that define the handles.protected Point[]protected JComponentCreates the preview for this handler.protected CursorgetCursor(MouseEvent e, int index) Returns the cursor for the given event and handle.protected ColorgetHandleFillColor(int index) Returns the color to be used to fill the handle at the specified index.intgetIndexAt(int x, int y) Returns the index of the handle at the given location.protected RectangleReturns the color used to draw the selection border.Returns the stroke used to draw the selection border.protected booleanbooleanprotected booleanprotected booleanisHandleVisible(int index) Hides the middle handle if the edge is not bendable.protected booleanNo flip event is ignored.booleanisSource(int index) Returns true if the current index is 0.booleanisTarget(int index) Returns true if the current index is the last index.voidProcesses the given event.voidProcesses the given event.voidProcesses the given event.protected voidmoveLabelTo(mxCellState edgeState, double x, double y) Moves the label to the given position.protected voidMoves the edges control point with the given index to the given point.voidPaints the visible handles of this handler.voidreset()Extends the implementation to reset the current error and marker.voidsetCloneEnabled(boolean cloneEnabled) validateConnection(Object source, Object target) Returns the error message or an empty string if the connection for the given source target pair is not valid.Methods inherited from class mxCellHandler
destroy, getBounds, getGraphComponent, getHandleBorderColor, getHandleCount, getIndex, getState, getToolTipText, isActive, isHandleEnabled, isHandlesVisible, isLabel, isLabelMovable, mouseMoved, refresh, setHandlesVisible, start
-
Field Details
-
cloneEnabled
protected boolean cloneEnabled -
p
-
error
-
gridEnabledEvent
protected transient boolean gridEnabledEventWorkaround for alt-key-state not correct in mouseReleased. -
constrainedEvent
protected transient boolean constrainedEventWorkaround for shift-key-state not correct in mouseReleased. -
marker
-
-
Constructor Details
-
mxEdgeHandler
- Parameters:
graphComponent-state-
-
-
Method Details
-
setCloneEnabled
public void setCloneEnabled(boolean cloneEnabled) -
isCloneEnabled
public boolean isCloneEnabled() -
isIgnoredEvent
No flip event is ignored.- Overrides:
isIgnoredEventin classmxCellHandler
-
isFlipEvent
-
validateConnection
-
isSource
public boolean isSource(int index) Returns true if the current index is 0. -
isTarget
public boolean isTarget(int index) Returns true if the current index is the last index. -
isHandleVisible
protected boolean isHandleVisible(int index) Hides the middle handle if the edge is not bendable.- Overrides:
isHandleVisiblein classmxCellHandler
-
isCellBendable
protected boolean isCellBendable() -
createHandles
Description copied from class:mxCellHandlerCreates the rectangles that define the handles.- Overrides:
createHandlesin classmxCellHandler
-
getHandleFillColor
Description copied from class:mxCellHandlerReturns the color to be used to fill the handle at the specified index.- Overrides:
getHandleFillColorin classmxCellHandler
-
getIndexAt
public int getIndexAt(int x, int y) Description copied from class:mxCellHandlerReturns the index of the handle at the given location.- Overrides:
getIndexAtin classmxCellHandler- Parameters:
x-y-- Returns:
- Returns the inde of the handle at the given location.
-
createHandle
-
createHandle
-
createPoints
-
createPreview
Description copied from class:mxCellHandlerCreates the preview for this handler.- Overrides:
createPreviewin classmxCellHandler
-
convertPoint
-
getPreviewBounds
- Returns:
- Returns the bounds of the preview.
-
mousePressed
Description copied from class:mxCellHandlerProcesses the given event.- Overrides:
mousePressedin classmxCellHandler
-
mouseDragged
Description copied from class:mxCellHandlerProcesses the given event.- Overrides:
mouseDraggedin classmxCellHandler
-
mouseReleased
Description copied from class:mxCellHandlerProcesses the given event.- Overrides:
mouseReleasedin classmxCellHandler
-
reset
public void reset()Extends the implementation to reset the current error and marker.- Overrides:
resetin classmxCellHandler
-
movePoint
-
connect
-
moveLabelTo
Moves the label to the given position. -
getCursor
Description copied from class:mxCellHandlerReturns the cursor for the given event and handle.- Overrides:
getCursorin classmxCellHandler
-
getSelectionColor
Description copied from class:mxCellHandlerReturns the color used to draw the selection border. This implementation returns null.- Overrides:
getSelectionColorin classmxCellHandler
-
getSelectionStroke
Description copied from class:mxCellHandlerReturns the stroke used to draw the selection border. This implementation returns null.- Overrides:
getSelectionStrokein classmxCellHandler
-
paint
Description copied from class:mxCellHandlerPaints the visible handles of this handler.- Overrides:
paintin classmxCellHandler
-