|
mxGraph 2.5.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.mxgraph.swing.handler.mxCellHandler com.mxgraph.swing.handler.mxEdgeHandler
public class mxEdgeHandler
Field Summary | |
---|---|
protected boolean |
cloneEnabled
|
protected boolean |
constrainedEvent
Workaround for shift-key-state not correct in mouseReleased. |
protected String |
error
|
protected boolean |
gridEnabledEvent
Workaround for alt-key-state not correct in mouseReleased. |
protected mxCellMarker |
marker
|
protected Point[] |
p
|
Fields inherited from class com.mxgraph.swing.handler.mxCellHandler |
---|
bounds, first, graphComponent, handles, handlesVisible, index, preview, state |
Constructor Summary | |
---|---|
mxEdgeHandler(mxGraphComponent graphComponent,
mxCellState state)
|
Method Summary | |
---|---|
protected void |
connect(Object edge,
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 Rectangle |
createHandle(Point center)
|
protected Rectangle |
createHandle(Point center,
int size)
|
protected Rectangle[] |
createHandles()
Creates the rectangles that define the handles. |
protected Point[] |
createPoints(mxCellState s)
|
protected JComponent |
createPreview()
Creates the preview for this handler. |
protected Cursor |
getCursor(MouseEvent e,
int index)
Returns the cursor for the given event and handle. |
protected 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 Rectangle |
getPreviewBounds()
|
Color |
getSelectionColor()
Returns the color used to draw the selection border. |
Stroke |
getSelectionStroke()
Returns the stroke used to draw the selection border. |
protected boolean |
isCellBendable()
|
boolean |
isCloneEnabled()
|
protected boolean |
isFlipEvent(MouseEvent e)
|
protected boolean |
isHandleVisible(int index)
Hides the middle handle if the edge is not bendable. |
protected boolean |
isIgnoredEvent(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(MouseEvent e)
Processes the given event. |
void |
mousePressed(MouseEvent e)
Processes the given event. |
void |
mouseReleased(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(Object edge,
int pointIndex,
mxPoint point)
Moves the edges control point with the given index to the given point. |
void |
paint(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)
|
String |
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 com.mxgraph.swing.handler.mxCellHandler |
---|
destroy, getBounds, getGraphComponent, getHandleBorderColor, getHandleCount, getIndex, getState, getToolTipText, isActive, isHandleEnabled, isHandlesVisible, isLabel, isLabelMovable, mouseMoved, refresh, setHandlesVisible, start |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean cloneEnabled
protected Point[] p
protected transient String error
protected transient boolean gridEnabledEvent
protected transient boolean constrainedEvent
protected mxCellMarker marker
Constructor Detail |
---|
public mxEdgeHandler(mxGraphComponent graphComponent, mxCellState state)
graphComponent
- state
- Method Detail |
---|
public void setCloneEnabled(boolean cloneEnabled)
public boolean isCloneEnabled()
protected boolean isIgnoredEvent(MouseEvent e)
isIgnoredEvent
in class mxCellHandler
protected boolean isFlipEvent(MouseEvent e)
public String validateConnection(Object source, Object target)
public boolean isSource(int index)
public boolean isTarget(int index)
protected boolean isHandleVisible(int index)
isHandleVisible
in class mxCellHandler
protected boolean isCellBendable()
protected Rectangle[] createHandles()
mxCellHandler
createHandles
in class mxCellHandler
protected Color getHandleFillColor(int index)
mxCellHandler
getHandleFillColor
in class mxCellHandler
public int getIndexAt(int x, int y)
mxCellHandler
getIndexAt
in class mxCellHandler
x
- y
-
protected Rectangle createHandle(Point center)
protected Rectangle createHandle(Point center, int size)
protected Point[] createPoints(mxCellState s)
protected JComponent createPreview()
mxCellHandler
createPreview
in class mxCellHandler
protected mxPoint convertPoint(mxPoint point, boolean gridEnabled)
point
- gridEnabled
-
protected Rectangle getPreviewBounds()
public void mousePressed(MouseEvent e)
mxCellHandler
mousePressed
in class mxCellHandler
public void mouseDragged(MouseEvent e)
mxCellHandler
mouseDragged
in class mxCellHandler
public void mouseReleased(MouseEvent e)
mxCellHandler
mouseReleased
in class mxCellHandler
public void reset()
reset
in class mxCellHandler
protected void movePoint(Object edge, int pointIndex, mxPoint point)
protected void connect(Object edge, Object terminal, boolean isSource, boolean isClone)
edge
- terminal
- isSource
- protected void moveLabelTo(mxCellState edgeState, double x, double y)
protected Cursor getCursor(MouseEvent e, int index)
mxCellHandler
getCursor
in class mxCellHandler
public Color getSelectionColor()
mxCellHandler
getSelectionColor
in class mxCellHandler
public Stroke getSelectionStroke()
mxCellHandler
getSelectionStroke
in class mxCellHandler
public void paint(Graphics g)
mxCellHandler
paint
in class mxCellHandler
|
mxGraph 2.5.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |