y.view.hierarchy
Class HierarchyCreateEdgeMode

java.lang.Object
  extended by y.view.ViewMode
      extended by y.view.CreateEdgeMode
          extended by y.view.hierarchy.HierarchyCreateEdgeMode
All Implemented Interfaces:
MouseListener, MouseMotionListener, EventListener, MouseInputListener

public class HierarchyCreateEdgeMode
extends CreateEdgeMode

A specialized CreateEdgeMode suitable for graphs that contain groups nodes.

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from class y.view.ViewMode
ACTIVE_PROPERTY, ACTIVE_VIEW_PROPERTY, CHILD_MODE_PROPERTY, EDITING_PROPERTY, GRAB_FOCUS_ENABLED_PROPERTY, lastClickEvent, lastDragEvent, lastMoveEvent, lastPressEvent, lastReleaseEvent, MODIFIER_MASK_PROPERTY, NAME_PROPERTY, originalX, originalY, PARENT_MODE_PROPERTY, view
 
Constructor Summary
HierarchyCreateEdgeMode()
           
 
Method Summary
protected  boolean acceptBend(Node start, Node hitNode, double x, double y)
          Apart from the default behavior, also accept a bend if its coordinate lies within the inner region of a group node.
protected  HitInfo createLabelHitInfo(double x, double y)
          Performs a hit test for a group node label at the specified location.
 int getGroupBorderWidth()
          returns the width the active group node border.
 boolean isConnectOnGroupNodeLabelEnabled()
          Returns whether or not a bend will be created when the mouse is released on the first label of a group node.
 void setConnectOnGroupNodeLabelEnabled(boolean enabled)
          Whether or not to connect an edge to a group node when the mouse is released on its first label.
 void setGroupBorderWidth(int groupBorderWidth)
          Sets the width of the active group node border.
 
Methods inherited from class y.view.CreateEdgeMode
acceptSourceNode, acceptTargetNode, addBend, allowBendCreation, allowSelfloopCreation, cancelEdgeCreation, cancelEditing, createDummyEdgeRealizer, createDummySourceNodeRealizer, createDummyTargetNodeRealizer, createEdge, createTargetNodeHitInfo, determineHitNode, doAllowBendCreation, doAllowSelfloopCreation, edgeCreated, edgeMoved, getCancelKeyCode, getDummyEdgeRealizer, getDummySourceNodeRealizer, getDummyTargetNodeRealizer, getSourcePortOffset, getTargetPortOffset, init, isEarlyEdgeCancelingEnabled, isOrthogonalEdgeCreation, mouseDraggedLeft, mouseMoved, mousePressedLeft, mouseReleasedLeft, mouseReleasedRight, mouseShiftPressedLeft, mouseShiftReleasedLeft, reactivateParent, removeBend, setCancelKeyCode, setEarlyEdgeCancelingEnabled, setOrthogonalEdgeCreation, sourceNodeDeclined, targetNodeDeclined
 
Methods inherited from class y.view.ViewMode
activate, addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getChild, getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getModifierMask, getName, getParent, isActive, isEditing, isGrabFocusEnabled, isGridMode, isModifierPressed, mouseClicked, mouseClicked, mouseDragged, mouseDraggedMiddle, mouseDraggedRight, mouseEntered, mouseExited, mouseMoved, mousePressed, mousePressedMiddle, mousePressedRight, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseShiftPressedMiddle, mouseShiftPressedRight, mouseShiftReleasedMiddle, mouseShiftReleasedRight, removePropertyChangeListener, removePropertyChangeListener, setActiveView, setChild, setChild, setEditing, setGrabFocusEnabled, setGridMode, setLastHitInfo, setModifierMask, setName, setParent, translateX, translateY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchyCreateEdgeMode

public HierarchyCreateEdgeMode()
Method Detail

acceptBend

protected boolean acceptBend(Node start,
                             Node hitNode,
                             double x,
                             double y)
Apart from the default behavior, also accept a bend if its coordinate lies within the inner region of a group node. A coordinate that lies on the border of the group node will not be accepted. Optionally, a coordinate inside the label of a group node will also not be accepted.

Overrides:
acceptBend in class CreateEdgeMode
Parameters:
start - the node from where edge creation started
hitNode - the node that was hit at the given location
x - the x-coordinate of the current location
y - the y-coordinate of the current location
See Also:
getGroupBorderWidth(), isConnectOnGroupNodeLabelEnabled()

setGroupBorderWidth

public void setGroupBorderWidth(int groupBorderWidth)
Sets the width of the active group node border. By default the border width is set to 10.

See Also:
acceptBend(Node, Node, double, double)

getGroupBorderWidth

public int getGroupBorderWidth()
returns the width the active group node border.

See Also:
setGroupBorderWidth(int)

isConnectOnGroupNodeLabelEnabled

public boolean isConnectOnGroupNodeLabelEnabled()
Returns whether or not a bend will be created when the mouse is released on the first label of a group node.


setConnectOnGroupNodeLabelEnabled

public void setConnectOnGroupNodeLabelEnabled(boolean enabled)
Whether or not to connect an edge to a group node when the mouse is released on its first label. By default this feature is enabled.

See Also:
acceptBend(Node, Node, double, double)

createLabelHitInfo

protected HitInfo createLabelHitInfo(double x,
                                     double y)
Performs a hit test for a group node label at the specified location.


© Copyright 2000-2008,
yWorks GmbH.
All rights reserved.