JGraphpad Pro
v6.0.5.0


com.jgraph.pad.graph
Class JGraphpadMarqueeHandler

java.lang.Object
  extended byorg.jgraph.graph.BasicMarqueeHandler
      extended bycom.jgraph.pad.graph.JGraphpadMarqueeHandler

public class JGraphpadMarqueeHandler
extends org.jgraph.graph.BasicMarqueeHandler

Marquee handler that implements popup menus and folding (by icon). This implements the event processing order for all graphs in the following way:


Field Summary
protected  JGraphEditor editor
          References the enclosing editor.
protected  org.jgraph.graph.CellView groupView
          Holds the group view if the interaction started on a folding icon.
static String NODENAME_CELLPOPUPMENU
          Defines the nodename used to configure the cellpopupmenu.
static String NODENAME_GRAPHPOPUPMENU
          Defines the nodename used to configure the graphpopupmenu.
 
Fields inherited from class org.jgraph.graph.BasicMarqueeHandler
currentPoint, marqueeBounds, previousCursor, startPoint
 
Constructor Summary
JGraphpadMarqueeHandler(JGraphEditor editor)
          Constructs a new editor using the specified editor to configure and create popup menus.
 
Method Summary
protected  org.jgraph.graph.CellView getGroupByFoldingHandle(org.jgraph.JGraph graph, Point2D pt)
          Returns the cell view at the specified location if the location is over the cell view's folding icon.
protected  Node getPopupMenuConfiguration(MouseEvent event)
          Returns the popup menu configuration for the specified event.
 boolean isForceMarqueeEvent(MouseEvent event)
          Extends the parent's implementation to implement the event processing order.
 void mousePressed(MouseEvent event)
          Overrides the parent's implementation to either block processing if a group view is scheduled to be collapsed/expanded or immediately select the cell under the mouse pointer if it is not selected.
 void mouseReleased(MouseEvent e)
          Overrides the parent's implementation to display a popup menu using getPopupMenuConfiguration(MouseEvent) to obtain the configuration or toggle the collapsed state of groupView and select the respective cell.
 
Methods inherited from class org.jgraph.graph.BasicMarqueeHandler
getCurrentPoint, getGraphForEvent, getMarqueeBounds, getPreviousCursor, getStartPoint, handleMarqueeEvent, isMarqueeTriggerEvent, mouseDragged, mouseMoved, overlay, paint, processMouseDraggedEvent, setCurrentPoint, setMarqueeBounds, setPreviousCursor, setStartPoint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODENAME_GRAPHPOPUPMENU

public static String NODENAME_GRAPHPOPUPMENU
Defines the nodename used to configure the graphpopupmenu.


NODENAME_CELLPOPUPMENU

public static String NODENAME_CELLPOPUPMENU
Defines the nodename used to configure the cellpopupmenu.


editor

protected JGraphEditor editor
References the enclosing editor. The editor is used to configure and create the popup menus.


groupView

protected org.jgraph.graph.CellView groupView
Holds the group view if the interaction started on a folding icon.

Constructor Detail

JGraphpadMarqueeHandler

public JGraphpadMarqueeHandler(JGraphEditor editor)
Constructs a new editor using the specified editor to configure and create popup menus.

Parameters:
editor - The enclosing editor.
Method Detail

isForceMarqueeEvent

public boolean isForceMarqueeEvent(MouseEvent event)
Extends the parent's implementation to implement the event processing order.

Parameters:
event - The object that describes the event.

mousePressed

public void mousePressed(MouseEvent event)
Overrides the parent's implementation to either block processing if a group view is scheduled to be collapsed/expanded or immediately select the cell under the mouse pointer if it is not selected.

Parameters:
event - The object that describes the event.

mouseReleased

public void mouseReleased(MouseEvent e)
Overrides the parent's implementation to display a popup menu using getPopupMenuConfiguration(MouseEvent) to obtain the configuration or toggle the collapsed state of groupView and select the respective cell. The state of the handler is reset after event processing.

Parameters:
e - The object that describes the event.

getPopupMenuConfiguration

protected Node getPopupMenuConfiguration(MouseEvent event)
Returns the popup menu configuration for the specified event. This implementation looks at the event source and returns a NODENAME_CELLPOPUPMENU or NODENAME_GRAPHPOPUPMENU configuration based on the selection state of the graph.

Parameters:
event - The event that triggered the display of the popup menu.
Returns:
Returns the popup menu configuration for event.

getGroupByFoldingHandle

protected org.jgraph.graph.CellView getGroupByFoldingHandle(org.jgraph.JGraph graph,
                                                            Point2D pt)
Returns the cell view at the specified location if the location is over the cell view's folding icon.

Parameters:
graph - The graph to get the cell views from.
pt - The location to check for a folding icon.
Returns:
Returns the topmost cell view who's folding icon is under the mouse pointer.

JGraphpad Pro
v6.0.5.0


Copyright (C) 2005 JGraph.com. All rights reserved.