com.mxgraph.swing.handler
public class mxConnectionHandler extends mxMouseAdapter
Modifier and Type | Field and Description |
---|---|
protected Rectangle |
bounds |
static Cursor |
CONNECT_CURSOR |
protected ImageIcon |
connectIcon
Specifies the icon to be used for creating new connections.
|
protected mxConnectPreview |
connectPreview |
protected boolean |
createTarget
Specifies if the source should be cloned and used as a target if no
target was selected.
|
protected boolean |
enabled |
protected String |
error |
protected Point |
first |
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 mxEventSource.mxIEventListener |
resetHandler |
protected boolean |
select |
protected mxCellState |
source |
Constructor and Description |
---|
mxConnectionHandler(mxGraphComponent graphComponent) |
Modifier and Type | Method and Description |
---|---|
protected mxConnectPreview |
createConnectPreview() |
Object |
createTargetVertex(MouseEvent e,
Object source) |
ImageIcon |
getConnecIcon() |
mxConnectPreview |
getConnectPreview() |
int |
getHandleSize() |
mxCellMarker |
getMarker() |
boolean |
isConnecting()
Returns true if the source terminal has been clicked and a new
connection is currently being previewed.
|
boolean |
isCreateTarget() |
boolean |
isEnabled() |
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 |
setBounds(Rectangle value) |
void |
setConnectIcon(ImageIcon value) |
void |
setConnectPreview(mxConnectPreview value) |
void |
setCreateTarget(boolean value) |
void |
setEnabled(boolean value) |
void |
setHandleEnabled(boolean value) |
void |
setHandleSize(int value) |
void |
setKeepOnTop(boolean value) |
void |
setMarker(mxCellMarker value) |
void |
setSelect(boolean value) |
void |
start(MouseEvent e,
mxCellState state) |
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.
|
mouseClicked, mouseEntered, mouseExited
public static Cursor CONNECT_CURSOR
protected mxGraphComponent graphComponent
protected mxConnectPreview connectPreview
protected ImageIcon connectIcon
protected int handleSize
protected boolean handleEnabled
protected boolean select
protected boolean createTarget
protected boolean keepOnTop
protected transient Point first
protected transient Rectangle bounds
protected transient mxCellState source
protected transient mxCellMarker marker
protected transient String error
protected boolean enabled
protected transient mxEventSource.mxIEventListener resetHandler
public mxConnectionHandler(mxGraphComponent graphComponent)
graphComponent
- protected mxConnectPreview createConnectPreview()
public mxConnectPreview getConnectPreview()
public void setConnectPreview(mxConnectPreview value)
public boolean isConnecting()
public boolean isHighlighting()
public boolean isEnabled()
public void setEnabled(boolean value)
public boolean isKeepOnTop()
public void setKeepOnTop(boolean value)
public void setConnectIcon(ImageIcon value)
public ImageIcon getConnecIcon()
public void setHandleEnabled(boolean value)
public boolean isHandleEnabled()
public void setHandleSize(int value)
public int getHandleSize()
public mxCellMarker getMarker()
public void setMarker(mxCellMarker value)
public void setCreateTarget(boolean value)
public boolean isCreateTarget()
public void setSelect(boolean value)
public boolean isSelect()
public void reset()
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 mxMouseAdapter
public void start(MouseEvent e, mxCellState state)
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
mouseMoved
in class mxMouseAdapter
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
mouseDragged
in class mxMouseAdapter
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
mouseReleased
in class mxMouseAdapter
public void setBounds(Rectangle value)
public void paint(Graphics g)
Copyright (c) 2010 Gaudenz Alder. All rights reserved.