|
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.mxConnectionHandler
public class mxConnectionHandler
Connection handler creates new connections between cells. This control is used to display the connector icon, while the preview is used to draw the line.
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 ImageIcon |
connectIcon
Specifies the icon to be used for creating new connections. |
protected boolean |
createTarget
|
protected Point |
current
|
static Cursor |
DEFAULT_CURSOR
|
protected String |
error
|
protected mxGraphComponent |
graphComponent
|
protected boolean |
handleEnabled
Specifies if a handle should be used for creating new connections. |
protected int |
handleSize
Specifies the size of the handle to be used for creating new connections. |
protected boolean |
keepOnTop
Appearance and event handling order wrt subhandles. |
protected mxCellMarker |
marker
|
protected JPanel |
preview
|
protected mxEventSource.mxIEventListener |
resetHandler
|
protected boolean |
select
|
protected mxCellState |
source
|
protected Point |
start
|
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 | |
---|---|
mxConnectionHandler(mxGraphComponent graphComponent)
|
Method Summary | |
---|---|
protected void |
connect(Object source,
Object target,
MouseEvent e)
|
Object |
createTargetVertex(MouseEvent e,
Object source)
|
ImageIcon |
getConnecIcon()
|
int |
getHandleSize()
|
mxCellMarker |
getMarker()
|
protected Object |
insertEdge(Object parent,
String id,
Object value,
Object source,
Object target)
Creates, inserts and returns a new edge using mxGraph.insertEdge. |
boolean |
isConnecting()
Returns true if the source terminal has been clicked and a new connection is currently being previewed. |
boolean |
isCreateTarget()
|
boolean |
isHandleEnabled()
|
boolean |
isHighlighting()
Returns true if no connectIcon is specified and handleEnabled is false. |
boolean |
isKeepOnTop()
|
boolean |
isSelect()
|
boolean |
isValidSource(Object cell)
|
boolean |
isValidTarget(Object cell)
Returns true. |
void |
mouseDragged(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
paint(Graphics g)
|
void |
reset()
|
void |
setConnectIcon(ImageIcon connectIcon)
|
void |
setCreateTarget(boolean createTarget)
|
void |
setHandleEnabled(boolean handleEnabled)
|
void |
setHandleSize(int size)
|
void |
setKeepOnTop(boolean keepOnTop)
|
void |
setMarker(mxCellMarker marker)
|
void |
setSelect(boolean select)
|
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.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 DEFAULT_CURSOR
protected mxGraphComponent graphComponent
protected ImageIcon connectIcon
protected int handleSize
protected boolean handleEnabled
protected boolean select
protected boolean createTarget
protected boolean keepOnTop
protected transient Point start
protected transient Point current
protected transient mxCellState source
protected transient mxCellMarker marker
protected transient String error
protected transient JPanel preview
protected transient mxEventSource.mxIEventListener resetHandler
Constructor Detail |
---|
public mxConnectionHandler(mxGraphComponent graphComponent)
graphComponent
- Method Detail |
---|
public boolean isConnecting()
public boolean isHighlighting()
public boolean isKeepOnTop()
public void setKeepOnTop(boolean keepOnTop)
public void setConnectIcon(ImageIcon connectIcon)
public ImageIcon getConnecIcon()
public void setHandleEnabled(boolean handleEnabled)
public boolean isHandleEnabled()
public void setHandleSize(int size)
public int getHandleSize()
public mxCellMarker getMarker()
public void setMarker(mxCellMarker marker)
public void setCreateTarget(boolean createTarget)
public boolean isCreateTarget()
public void setSelect(boolean select)
public boolean isSelect()
public void reset()
protected void connect(Object source, Object target, MouseEvent e)
source
- target
- e
- protected Object insertEdge(Object parent, String id, Object value, Object source, Object target)
public Object createTargetVertex(MouseEvent e, Object source)
public boolean isValidSource(Object cell)
public boolean isValidTarget(Object cell)
public String validateConnection(Object source, Object target)
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
mousePressed
in class mxMouseControl
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class mxMouseControl
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class mxMouseControl
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class mxMouseControl
public void paint(Graphics g)
paint
in class JComponent
|
JGraph X 1.2.0.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |