public class CreateLinkInputHandler extends InputAdapter implements CanvasMarker
Modifier and Type | Field and Description |
---|---|
protected java.lang.Class |
elementType |
protected Node |
fromNode |
protected TNetwork |
network |
protected Node |
toNode |
Constructor and Description |
---|
CreateLinkInputHandler(TNetwork network)
Constructs this handler initializes by given network component.
|
CreateLinkInputHandler(TNetwork network,
java.lang.Class elementType) |
Modifier and Type | Method and Description |
---|---|
protected Link |
createLink() |
protected java.lang.Class |
getLinkClass() |
protected boolean |
isLegalFromNode(Node fromNode) |
protected boolean |
isLegalToNode(Node toNode) |
void |
mark(java.awt.Graphics2D g)
Draw the marker.
|
void |
mouseDragged(java.awt.event.MouseEvent e)
Handles the mouseDragged event by invoking the
mouseDragged methods on listener-a and listener-b.
|
void |
mousePressed(java.awt.event.MouseEvent e)
Called when the mouse pressed.
|
void |
mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.
|
protected void |
preProcess(Link link) |
cleanup, init, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseMoved
protected java.lang.Class elementType
protected TNetwork network
protected Node fromNode
protected Node toNode
public CreateLinkInputHandler(TNetwork network)
network
- the network component.public CreateLinkInputHandler(TNetwork network, java.lang.Class elementType)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class InputAdapter
e
- the mouse event.protected boolean isLegalFromNode(Node fromNode)
protected boolean isLegalToNode(Node toNode)
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
mouseDragged
in class InputAdapter
e
- the mouse event.protected Link createLink()
protected void preProcess(Link link)
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class InputAdapter
e
- the mouse event.protected java.lang.Class getLinkClass()
public void mark(java.awt.Graphics2D g)
mark
in interface CanvasMarker
g
- the graphics object.Copyright © 2002 - 2010 Serva Software. All Rights Reserved.