y.view.hierarchy
Class HierarchyEditMode

java.lang.Object
  |
  +--y.view.ViewMode
        |
        +--y.view.EditMode
              |
              +--y.view.hierarchy.HierarchyEditMode
All Implemented Interfaces:
EventListener, MouseInputListener, MouseListener, MouseMotionListener

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.


Field Summary
 
Fields inherited from class y.view.EditMode
createEdgeMode, hotSpotMode, moveLabelMode, movePortMode, moveSelectionMode, popupMode, pressedNode, selectionBoxMode
 
Fields inherited from class y.view.ViewMode
lastClickEvent, lastDragEvent, lastPressEvent, lastReleaseEvent, originalX, originalY, 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  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.
 void setGroupBorderWidth(int groupBorderWidth)
          Sets the width of the active group node border.
 
Methods inherited from class y.view.EditMode
activate, allowBendCreation, allowEdgeCreation, allowMoveSelection, allowMoving, allowNodeCreation, allowResizeNodes, createMoveLabelMode, createMovePortMode, createPopupMode, doAllowBendCreation, doAllowEdgeCreation, doAllowMoveSelection, doAllowMoving, doAllowNodeCreation, doAllowResizeNodes, doShowEdgeTips, doShowNodeTips, getCreateEdgeMode, getEdgeTip, getHotSpotMode, getMoveLabelMode, getMovePortMode, getMoveSelectionMode, getNodeTip, getPopupMode, getSelectionBoxMode, mouseDraggedLeft, mouseMoved, mousePressedLeft, mousePressedRight, mouseReleasedLeft, mouseShiftPressedLeft, mouseShiftReleasedLeft, nodeClicked, nodeCreated, setCreateEdgeMode, setHotSpotMode, setMoveLabelMode, setMovePortMode, setMoveSelectionMode, setPopupMode, setSelectionBoxMode, showEdgeTips, showNodeTips
 
Methods inherited from class y.view.ViewMode
getGraph2D, getGridX, getGridY, getHitInfo, getHitInfo, getLastHitInfo, getName, init, isGrabFocusEnabled, isGridMode, mouseClicked, mouseClicked, mouseDragged, mouseDraggedMiddle, mouseDraggedRight, mouseEntered, mouseExited, mouseMoved, mousePressed, mousePressedMiddle, mouseReleased, mouseReleased, mouseReleasedMiddle, mouseReleasedRight, mouseShiftPressedMiddle, mouseShiftPressedRight, mouseShiftReleasedMiddle, mouseShiftReleasedRight, reactivateParent, setActiveView, setChild, setChild, setGrabFocusEnabled, setGridMode, setLastHitInfo, 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. The width of the border region is the value returned by HierarchyEditMode.getGroupBorderWidth().

Overrides:
isCreateEdgeGesture in class EditMode

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

getGroupBorderWidth

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

See Also:
HierarchyEditMode.setGroupBorderWidth(int)

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

2003