|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.umd.cs.jazz.event.ZLinkEventHandler
ZLinkEventHandler is a simple event handler for interactively creating hyperlinks. This supports clicking on an object to define a link from that object, and then click on another object to define a link to that second object as a destination. This inserts a ZAnchorGroup which can then be used to follow the link. Links are also created by pressing on one object, dragging, then releasing on another object.
Warning: Serialized and ZSerialized objects of this class will not be compatible with future Jazz releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Jazz. A future release of Jazz will provide support for long term persistence.
Constructor Summary | |
ZLinkEventHandler(ZNode node,
ZCanvas canvas)
This method creates a new link event handler. |
Method Summary | |
protected void |
finishLink(ZMouseEvent e)
This method finishes the process of link creating a link. |
protected ZNode |
getNodeUnderMouse(ZMouseEvent e)
This method returns the current pickable node that is under the mouse cursor even in the case when the mouse is being dragged. |
protected void |
hideLink(ZAnchorGroup aLink)
This method finishes the process of link creating a link. |
void |
hideVisibleLinksAndHighlight()
Hides all links that have been made visible by this event handler. |
protected void |
hilite(ZNode aNode,
ZCamera aCamera)
This method will hilite the passed in node selecting it. |
boolean |
isActive()
Determines if this event handler is active. |
boolean |
isDefiningLink()
Determines if this event handler is currently defining a new link. |
void |
keyPressed(java.awt.event.KeyEvent e)
Key press event handler |
void |
keyReleased(java.awt.event.KeyEvent e)
Key release event handler |
void |
keyTyped(java.awt.event.KeyEvent e)
Key typed event handler |
void |
mouseClicked(ZMouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseDragged(ZMouseEvent e)
When the mouse is dragged the current node under the mouse cursor is updated and the curent link if one is being created is updated. |
void |
mouseEntered(ZMouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(ZMouseEvent e)
Invoked when the mouse exits a component. |
void |
mouseMoved(ZMouseEvent e)
When the mouse is moved the current node under the mouse cursor is updated and the curent link if one is being created is updated. |
void |
mousePressed(ZMouseEvent e)
When the mouse is pressed the event handler tries to start creating a new link. |
void |
mouseReleased(ZMouseEvent e)
When the mouse is released the event handler checks to see if a link is being created and if so it finishes that link. |
void |
setActive(boolean active)
Specifies whether this event handler is active or not. |
protected void |
startLink(ZMouseEvent e)
This will start a link, anchored at the current node under the cursor. |
protected void |
unhilite(ZNode aNode,
ZCamera aCamera)
This method will unhilite the passed in node by deselecting it. |
protected void |
updateCurrentLink(ZMouseEvent e)
This method updates the link that is currently being defined so that it follows the mouse cursor. |
protected void |
updateCurrentNode(ZMouseEvent e)
This method updates the current node so that it is always the node under the cursor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ZLinkEventHandler(ZNode node, ZCanvas canvas)
node
- The node this event handler attaches to.canvas
- The canvas this event handler attaches toMethod Detail |
public void setActive(boolean active)
setActive
in interface ZEventHandler
active
- True to make this event handler activepublic boolean isActive()
isActive
in interface ZEventHandler
public void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
e
- The event.public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
e
- The event.public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
e
- The event.public void mouseMoved(ZMouseEvent e)
mouseMoved
in interface ZMouseMotionListener
public void mousePressed(ZMouseEvent e)
mousePressed
in interface ZMouseListener
public void mouseDragged(ZMouseEvent e)
mouseDragged
in interface ZMouseMotionListener
public void mouseReleased(ZMouseEvent e)
mouseReleased
in interface ZMouseListener
public void mouseEntered(ZMouseEvent e)
mouseEntered
in interface ZMouseListener
public void mouseExited(ZMouseEvent e)
mouseExited
in interface ZMouseListener
public void mouseClicked(ZMouseEvent e)
mouseClicked
in interface ZMouseListener
protected void finishLink(ZMouseEvent e)
e
- The event that finished the linkprotected ZNode getNodeUnderMouse(ZMouseEvent e)
e
- The current event.protected void hilite(ZNode aNode, ZCamera aCamera)
aNode
- The node to hilite.aCamera
- The camera used to primarily view the anchor group.public boolean isDefiningLink()
protected void startLink(ZMouseEvent e)
protected void unhilite(ZNode aNode, ZCamera aCamera)
aNode
- The node to unhilite.aCamera
- The camera used to primarily view the anchor group.protected void updateCurrentLink(ZMouseEvent e)
protected void updateCurrentNode(ZMouseEvent e)
protected void hideLink(ZAnchorGroup aLink)
e
- The event that finished the linkpublic void hideVisibleLinksAndHighlight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |