ch.elca.dependency.view
Class MyGrappaAdapter

java.lang.Object
  |
  +--ch.elca.dependency.view.MyGrappaAdapter
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, GrappaConstants, GrappaListener

public class MyGrappaAdapter
extends java.lang.Object
implements GrappaConstants, GrappaListener, java.awt.event.ActionListener

A GrappaAdapter for the att.grappa.GrappaPanel class.

Version:
1.0-beta
Author:
Christoph Trutmann

Field Summary
 
Fields inherited from interface att.grappa.GrappaConstants
_NO_TYPE, ANONYMOUS_PREFIX, BBOX_ATTR, BBOX_HASH, BOX_SHAPE, BOX_TYPE, CLUSTERRANK_ATTR, COLOR_ATTR, COLOR_HASH, COLOR_TYPE, CUSTOM_ATTR, CUSTOM_HASH, CUSTOM_SHAPE, DELETION_MASK, DIAMOND_SHAPE, DIR_ATTR, DIR_HASH, DIR_TYPE, DISTORTION_ATTR, DISTORTION_HASH, DOUBLE_TYPE, DOUBLECIRCLE_SHAPE, DOUBLEOCTAGON_SHAPE, EDGE, EGG_SHAPE, FONTCOLOR_ATTR, FONTCOLOR_HASH, FONTNAME_ATTR, FONTNAME_HASH, FONTSIZE_ATTR, FONTSIZE_HASH, FONTSTYLE_ATTR, FONTSTYLE_HASH, FONTSTYLE_TYPE, GRAPPA_BACKGROUND_COLOR_ATTR, GRAPPA_BACKGROUND_COLOR_HASH, GRAPPA_DELETION_STYLE_ATTR, GRAPPA_DELETION_STYLE_HASH, GRAPPA_FONTSIZE_ADJUSTMENT_ATTR, GRAPPA_FONTSIZE_ADJUSTMENT_HASH, GRAPPA_SELECTION_STYLE_ATTR, GRAPPA_SELECTION_STYLE_HASH, GRAPPA_SHAPE, HASHLIST_TYPE, HEIGHT_ATTR, HEIGHT_HASH, HEXAGON_SHAPE, HIGHLIGHT_MASK, HIGHLIGHT_OFF, HIGHLIGHT_ON, HIGHLIGHT_TOGGLE, HOUSE_SHAPE, IDENTXFRM, IMAGE_ATTR, IMAGE_HASH, INTEGER_TYPE, INVERTEDHOUSE_SHAPE, INVERTEDTRAPEZIUM_SHAPE, INVERTEDTRIANGLE_SHAPE, LABEL_ATTR, LABEL_HASH, LINE_SHAPE, LINE_TYPE, LOG10, LP_ATTR, LP_HASH, MARGIN_ATTR, MARGIN_HASH, MCIRCLE_SHAPE, MCLIMIT_ATTR, MCLIMIT_HASH, MDIAMOND_SHAPE, MINBOX_ATTR, MINBOX_HASH, MINLEN_ATTR, MINLEN_HASH, MINSIZE_ATTR, MINSIZE_HASH, MRECORD_SHAPE, MSQUARE_SHAPE, NBSP, NEW_LINE, NO_SHAPE, NODE, NODESEP_ATTR, NODESEP_HASH, OCTAGON_SHAPE, ORIENTATION_ATTR, ORIENTATION_HASH, OVAL_SHAPE, PACKAGE_PREFIX, PARALLELOGRAM_SHAPE, PATCH_ATTR, PATCH_HASH, PENTAGON_SHAPE, PERIPHERIES_ATTR, PERIPHERIES_HASH, PERIPHERY_GAP, PKG_LOWER, PKG_UPLOW, PKG_UPPER, PLAINTEXT_SHAPE, POINT_TYPE, PointsPerInch, POLYGON_SHAPE, POS_ATTR, POS_HASH, PRINTLIST_ATTR, PRINTLIST_HASH, RANKDIR_ATTR, RANKDIR_HASH, RANKSEP_ATTR, RANKSEP_HASH, RECORD_SHAPE, RECTS_ATTR, RECTS_HASH, ROTATION_ATTR, ROTATION_HASH, ROUNDEDBOX_SHAPE, SELECTION_MASK, SHAPE_ATTR, SHAPE_HASH, SHAPE_MASK, SHAPE_TYPE, SIDES_ATTR, SIDES_HASH, SIZE_ATTR, SIZE_HASH, SIZE_TYPE, SKEW_ATTR, SKEW_HASH, STRING_TYPE, STYLE_ATTR, STYLE_HASH, STYLE_TYPE, SUBGRAPH, SYSTEM, TAG_ATTR, TAG_HASH, TIP_ATTR, TIP_HASH, TRAPEZIUM_SHAPE, TRIANGLE_SHAPE, TRIPLEOCTAGON_SHAPE, TYPES_SHIFT, WEIGHT_ATTR, WEIGHT_HASH, WIDTH_ATTR, WIDTH_HASH
 
Constructor Summary
MyGrappaAdapter()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent aev)
          Invoked when an action occurs.
 void clearSelection(GrappaPanel panel, Subgraph subg)
          Clears all the selections in all the views.
 void grappaClicked(Subgraph subg, Element elem, GrappaPoint pt, int modifiers, int clickCount, GrappaPanel panel)
          The method called when a mouse click occurs on a displayed subgraph.
 void grappaDragged(Subgraph subg, GrappaPoint currentPt, int currentModifiers, Element pressedElem, GrappaPoint pressedPt, int pressedModifiers, GrappaBox outline, GrappaPanel panel)
          The method called when a mouse drag occurs on a displayed subgraph.
 void grappaPressed(Subgraph subg, Element elem, GrappaPoint pt, int modifiers, GrappaPanel panel)
          The method called when a mouse press occurs on a displayed subgraph.
 void grappaReleased(Subgraph subg, Element elem, GrappaPoint pt, int modifiers, Element pressedElem, GrappaPoint pressedPt, int pressedModifiers, GrappaBox outline, GrappaPanel panel)
          The method called when a mouse release occurs on a displayed subgraph.
 java.lang.String grappaTip(Subgraph subg, Element elem, GrappaPoint pt, int modifiers, GrappaPanel panel)
          The method called when a element tooltip is needed.
 void reference(Selection select, DependencyDetails detail)
          References the Selection interface for notify the other views about changing selections.
 void setZoomFactor(double positive, double negative)
          Sets the zoom factor for the zoom out / in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyGrappaAdapter

public MyGrappaAdapter()
Method Detail

reference

public void reference(Selection select,
                      DependencyDetails detail)
References the Selection interface for notify the other views about changing selections. And also the DependencyDetails interface for showing additional dependency information for an arbitrary edge.

Parameters:
select - Selection interface.

setZoomFactor

public void setZoomFactor(double positive,
                          double negative)
Sets the zoom factor for the zoom out / in.


grappaClicked

public void grappaClicked(Subgraph subg,
                          Element elem,
                          GrappaPoint pt,
                          int modifiers,
                          int clickCount,
                          GrappaPanel panel)
The method called when a mouse click occurs on a displayed subgraph.

Specified by:
grappaClicked in interface GrappaListener
Parameters:
subg - displayed subgraph where action occurred
elem - subgraph element in which action occurred
pt - the point where the action occurred (graph coordinates)
modifiers - mouse modifiers in effect
clickCount - count of mouse clicks that triggered this action
panel - specific panel where the action occurred

grappaPressed

public void grappaPressed(Subgraph subg,
                          Element elem,
                          GrappaPoint pt,
                          int modifiers,
                          GrappaPanel panel)
The method called when a mouse press occurs on a displayed subgraph.

Specified by:
grappaPressed in interface GrappaListener
Parameters:
subg - displayed subgraph where action occurred
elem - subgraph element in which action occurred
pt - the point where the action occurred (graph coordinates)
modifiers - mouse modifiers in effect
panel - specific panel where the action occurred

grappaReleased

public void grappaReleased(Subgraph subg,
                           Element elem,
                           GrappaPoint pt,
                           int modifiers,
                           Element pressedElem,
                           GrappaPoint pressedPt,
                           int pressedModifiers,
                           GrappaBox outline,
                           GrappaPanel panel)
The method called when a mouse release occurs on a displayed subgraph.

Specified by:
grappaReleased in interface GrappaListener
Parameters:
subg - displayed subgraph where action occurred
elem - subgraph element in which action occurred
pt - the point where the action occurred (graph coordinates)
modifiers - mouse modifiers in effect
pressedElem - subgraph element in which the most recent mouse press occurred
pressedPt - the point where the most recent mouse press occurred (graph coordinates)
pressedModifiers - mouse modifiers in effect when the most recent mouse press occurred
outline - enclosing box specification from the previous drag position (for XOR reset purposes)
panel - specific panel where the action occurred

grappaDragged

public void grappaDragged(Subgraph subg,
                          GrappaPoint currentPt,
                          int currentModifiers,
                          Element pressedElem,
                          GrappaPoint pressedPt,
                          int pressedModifiers,
                          GrappaBox outline,
                          GrappaPanel panel)
The method called when a mouse drag occurs on a displayed subgraph.

Specified by:
grappaDragged in interface GrappaListener
Parameters:
subg - displayed subgraph where action occurred
currentPt - the current drag point
currentModifiers - the current drag mouse modifiers
pressedElem - subgraph element in which the most recent mouse press occurred
pressedPt - the point where the most recent mouse press occurred (graph coordinates)
pressedModifiers - mouse modifiers in effect when the most recent mouse press occurred
outline - enclosing box specification from the previous drag position (for XOR reset purposes)
panel - specific panel where the action occurred

grappaTip

public java.lang.String grappaTip(Subgraph subg,
                                  Element elem,
                                  GrappaPoint pt,
                                  int modifiers,
                                  GrappaPanel panel)
The method called when a element tooltip is needed.

Specified by:
grappaTip in interface GrappaListener
Parameters:
subg - displayed subgraph where action occurred
elem - subgraph element in which action occurred
pt - the point where the action occurred (graph coordinates)
modifiers - mouse modifiers in effect
panel - specific panel where the action occurred
Returns:
the tip to be displayed or null; in this implementation, if the mouse is in a graph element that has its tip attribute defined, then that text is returned. If that attribute is not set, the element name is returned. If the mouse is outside the graph bounds, then the text supplied to the graph setToolTipText method is supplied.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent aev)
Invoked when an action occurs.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
aev - the action event trigger.

clearSelection

public void clearSelection(GrappaPanel panel,
                           Subgraph subg)
Clears all the selections in all the views.



Copyright © 2003 ELCA Informatique SA. All Rights Reserved.