y.view.hierarchy
Class HierarchyEditMode

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

public class HierarchyEditMode
extends EditMode

A specialized EditMode suitable for editing hierarchically organized graphs. This mode uses specialized child modes to provide adequate editing capabilities for grouped graphs.

 
Your browser does not support SVG content.

Field Summary
 
Fields inherited from class y.view.EditMode
createEdgeMode, editNodeMode, hotSpotMode, mouseInputMode, moveLabelMode, movePortMode, moveSelectionMode, moveViewPortMode, ORTHOGONAL_ROUTING_DPKEY, popupMode, pressedNode, selectionBoxMode
 
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
HierarchyEditMode()
          Creates a new instance of HierarchyEditMode
 
Method Summary
protected  ViewMode createCreateEdgeMode()
          Returns an instance of HierarchyCreateEdgeMode.
protected  ViewMode createHotSpotMode()
          Returns an instance of HierarchyHotSpotMode.
protected  HitInfo createLabelHitInfo(double x, double y)
          Performs a hit test for a group node label at the specified location.
protected  ViewMode createMoveSelectionMode()
          Returns an instance of HierarchyMoveSelectionMode.
protected  ViewMode createSelectionBoxMode()
          Returns an instance of HierarchySelectionBoxMode.
 int getGroupBorderWidth()
          returns the width the active group node border.
protected  boolean isCreateEdgeGesture(MouseEvent lastPress, MouseEvent lastDrag)
          Special handling for group nodes.
 boolean isCreateEdgeOnGroupNodeLabelEnabled()
          Returns whether or not a bend will be created when the mouse is released on the first label of a group node.
 void setCreateEdgeOnGroupNodeLabelEnabled(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.EditMode
activate, allowBendCreation, allowEdgeCreation, allowLabelSelection, allowMouseInput, allowMoveLabels, allowMovePorts, allowMoveSelection, allowMoving, allowNodeCreation, allowNodeEditing, allowResizeNodes, assignNodeLabel, bendClicked, bendCreated, createBend, createEditNodeMode, createMouseInputMode, createMoveLabelMode, createMovePortMode, createMoveViewPortMode, createNode, createOrthogonalMoveBendsMode, createPopupMode, doAllowBendCreation, doAllowEdgeCreation, doAllowLabelSelection, doAllowMouseInput, doAllowMoveLabels, doAllowMovePorts, doAllowMoveSelection, doAllowMoving, doAllowNodeCreation, doAllowNodeEditing, doAllowResizeNodes, doShowEdgeTips, doShowNodeTips, edgeClicked, editNode, getCreateEdgeMode, getDefaultCursor, getEdgeTip, getEditNodeMode, getHotSpotMode, getMouseInputMode, getMoveLabelMode, getMovePortMode, getMoveSelectionMode, getMoveViewPortMode, getNodeTip, getOrthogonalMoveBendsMode, getPopupMode, getSelectionBoxMode, isAdjustScrollBarPolicy, isEditNodeGesture, isMixedSelectionEnabled, isOrthogonalEdgeRouting, isOrthogonalRouting, labelClicked, labelClicked, mouseClicked, mouseDraggedLeft, mouseMoved, mousePressed, mousePressedLeft, mousePressedRight, mouseReleasedLeft, mouseShiftPressedLeft, mouseShiftReleasedLeft, nodeClicked, nodeClicked, nodeCreated, paperClicked, prepareView, setAdjustScrollBarPolicy, setCreateEdgeMode, setDefaultCursor, setEditNodeMode, setHotSpotMode, setMixedSelectionEnabled, setMouseInputMode, setMoveLabelMode, setMovePortMode, setMoveSelectionMode, setMoveViewPortMode, setOrthogonalEdgeRouting, setOrthogonalMoveBendsMode, setPopupMode, setSelectionBoxMode, showEdgeTips, showNodeTips, startEditor
 
Methods inherited from class y.view.ViewMode
addPropertyChangeListener, addPropertyChangeListener, cancelEditing, firePropertyChange, firePropertyChange, firePropertyChange, getChild, getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getModifierMask, getName, getParent, init, isActive, isEditing, isGrabFocusEnabled, isGridMode, isModifierPressed, mouseClicked, mouseDragged, mouseDraggedMiddle, mouseDraggedRight, mouseEntered, mouseExited, mouseMoved, mousePressedMiddle, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseReleasedRight, mouseShiftPressedMiddle, mouseShiftPressedRight, mouseShiftReleasedMiddle, mouseShiftReleasedRight, reactivateParent, 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

HierarchyEditMode

public HierarchyEditMode()
Creates a new instance of HierarchyEditMode

Method Detail

createHotSpotMode

protected ViewMode createHotSpotMode()
Returns an instance of HierarchyHotSpotMode.

Overrides:
createHotSpotMode in class EditMode
Returns:
a specialized HotSpotMode

createCreateEdgeMode

protected ViewMode createCreateEdgeMode()
Returns an instance of HierarchyCreateEdgeMode.

Overrides:
createCreateEdgeMode in class EditMode
Returns:
a specialized HotSpotMode

createSelectionBoxMode

protected ViewMode createSelectionBoxMode()
Returns an instance of HierarchySelectionBoxMode.

Overrides:
createSelectionBoxMode in class EditMode
Returns:
a specialized HotSpotMode

createMoveSelectionMode

protected ViewMode createMoveSelectionMode()
Returns an instance of HierarchyMoveSelectionMode.

Overrides:
createMoveSelectionMode in class EditMode
Returns:
a specialized HotSpotMode

isCreateEdgeGesture

protected boolean isCreateEdgeGesture(MouseEvent lastPress,
                                      MouseEvent lastDrag)
Special handling for group nodes. As an additional constraint for creating an edge that starts from a group node it is required that the mouse hits the group nodes at its border region or, optionally, that it hits the first label of the group node. The width of the border region is the value returned by getGroupBorderWidth(). Activation of the label hit acceptance is controlled by isCreateEdgeOnGroupNodeLabelEnabled().

Overrides:
isCreateEdgeGesture in class EditMode
Parameters:
lastPress - the last press event
lastDrag - the last drag event
Returns:
whether to start the CreateEdgeMode

createLabelHitInfo

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


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:
isCreateEdgeGesture(MouseEvent, MouseEvent)

getGroupBorderWidth

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

See Also:
setGroupBorderWidth(int)

isCreateEdgeOnGroupNodeLabelEnabled

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


setCreateEdgeOnGroupNodeLabelEnabled

public void setCreateEdgeOnGroupNodeLabelEnabled(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:
isCreateEdgeGesture(MouseEvent, MouseEvent)

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