att.grappa
Class GrappaPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by att.grappa.GrappaPanel
All Implemented Interfaces:
GrappaConstants, java.awt.event.ComponentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, java.lang.Runnable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.AncestorListener, javax.swing.event.PopupMenuListener, javax.swing.Scrollable

public class GrappaPanel
extends javax.swing.JPanel
implements GrappaConstants, java.awt.event.ComponentListener, javax.swing.event.AncestorListener, javax.swing.event.PopupMenuListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.print.Printable, java.lang.Runnable, javax.swing.Scrollable

A class used for drawing the graph.

Version:
1.2, 21 Aug 2005; Copyright 1996 - 2005 by AT&T Corp.
Author:
John Mocenigo, Research @ AT&T Labs
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  GrappaBacker backer
           
private  GrappaStyle deletionStyle
           
(package private)  boolean edgeLabels
           
(package private)  java.util.Vector elementVector
           
(package private)  Graph graph
           
(package private)  GrappaListener grappaListener
           
private  boolean inMenu
           
(package private)  java.awt.geom.AffineTransform inverseTransform
           
(package private)  int nextElement
           
(package private)  boolean nodeLabels
           
(package private)  java.awt.geom.AffineTransform oldTransform
           
private  GrappaBox outline
           
private  boolean paintActive
           
private  java.awt.geom.Point2D panelcpt
           
private  Element pressedElement
           
private  int pressedModifiers
           
private  GrappaPoint pressedPoint
           
private  GrappaBox savedOutline
           
private  boolean scaleChanged
           
private  double scaleFactor
           
private  double scaleInfo
           
(package private)  boolean scaleToFit
           
(package private)  GrappaSize scaleToSize
           
private  GrappaStyle selectionStyle
           
private static long serialVersionUID
           
(package private)  boolean subgLabels
           
(package private)  Subgraph subgraph
           
(package private)  java.awt.geom.AffineTransform transform
           
private  GrappaBox zoomBox
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
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, FILLCOLOR_ATTR, FILLCOLOR_HASH, 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, HEADLABEL_ATTR, HEADLABEL_HASH, HEADLP_ATTR, HEADLP_HASH, 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_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, TAILLABEL_ATTR, TAILLABEL_HASH, TAILLP_ATTR, TAILLP_HASH, TIP_ATTR, TIP_HASH, TRAPEZIUM_SHAPE, TRIANGLE_SHAPE, TRIPLEOCTAGON_SHAPE, TYPES_SHIFT, WEIGHT_ATTR, WEIGHT_HASH, WIDTH_ATTR, WIDTH_HASH
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
GrappaPanel(Subgraph subgraph)
          Constructs a new canvas associated with a particular subgraph.
GrappaPanel(Subgraph subgraph, GrappaBacker backer)
          Constructs a new canvas associated with a particular subgraph.
 
Method Summary
 GrappaListener addGrappaListener(GrappaListener listener)
          Adds the specified listener to receive mouse events from this graph.
 void ancestorAdded(javax.swing.event.AncestorEvent aev)
           
 void ancestorMoved(javax.swing.event.AncestorEvent aev)
           
 void ancestorRemoved(javax.swing.event.AncestorEvent aev)
           
 void centerPanelAtPoint(java.awt.geom.Point2D cpt)
          Centers the panel at the supplied point.
 void clearOutline()
          Clear swept outline, if any.
 void componentHidden(java.awt.event.ComponentEvent cev)
           
 void componentMoved(java.awt.event.ComponentEvent cev)
           
private  java.awt.geom.Point2D componentPaint(java.awt.Graphics g)
           
 void componentResized(java.awt.event.ComponentEvent cev)
           
 void componentShown(java.awt.event.ComponentEvent cev)
           
private  Element findContainingElement(Subgraph subg, java.awt.geom.Point2D pt)
           
private  Element findContainingElement(Subgraph subg, java.awt.geom.Point2D pt, Element crnt)
           
(package private)  java.awt.geom.Point2D getCPT()
           
 java.awt.geom.AffineTransform getInverseTransform()
          Get the inverse AffineTransform that applies to this drawing.
 java.awt.Dimension getPreferredScrollableViewportSize()
          Returns the size of the bounding box of the graph augmented by the margin attribute and any scaling.
 int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
          Returns 90% of the view area dimension that is in the orientation of the requested scroll.
 boolean getScrollableTracksViewportHeight()
          Always returns false as the viewport should not force the height of this GrappaPanel to match the width of the viewport.
 boolean getScrollableTracksViewportWidth()
          Always returns false as the viewport should not force the width of this GrappaPanel to match the width of the viewport.
 int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
          Always returns 1 since a GrappaPanel has not logical rows or columns.
 Subgraph getSubgraph()
          Get the subgraph being drawn on this panel.
 java.lang.String getToolTipText(java.awt.event.MouseEvent mev)
          Generate an appropriate tooltip based on the mouse location provided by the given event.
 java.awt.geom.AffineTransform getTransform()
          Get the AffineTransform that applies to this drawing.
 boolean hasOutline()
          Check if a swept outline is still available.
 void mouseClicked(java.awt.event.MouseEvent mev)
           
 void mouseDragged(java.awt.event.MouseEvent mev)
           
 void mouseEntered(java.awt.event.MouseEvent mev)
           
 void mouseExited(java.awt.event.MouseEvent mev)
           
 void mouseMoved(java.awt.event.MouseEvent mev)
           
 void mousePressed(java.awt.event.MouseEvent mev)
           
 void mouseReleased(java.awt.event.MouseEvent mev)
           
 double multiplyScaleFactor(double multiplier)
          Adjust the scale factor by the supplied multiplier.
 void paintComponent(java.awt.Graphics g)
           
private  void paintSubgraph(java.awt.Graphics2D g2d, Subgraph subg, java.awt.Shape clipper, java.awt.Color bkgdColor)
           
 void popupMenuCanceled(javax.swing.event.PopupMenuEvent pmev)
           
 void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent pmev)
           
 void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent pmev)
           
 int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pi)
           
private  Element reallyFindContainingElement(Subgraph subg, java.awt.geom.Point2D pt, Element[] stash)
           
 GrappaListener removeGrappaListener()
          Removes the current listener from this graph.
 void resetZoom()
          Reset the scale factor to one.
 void run()
           
(package private)  void setCPT(java.awt.geom.Point2D cpt)
           
 void setScaleToFit(boolean setting)
          Enable/disable scale-to-fit mode.
 void setScaleToSize(java.awt.geom.Dimension2D scaleSize)
          Scale the graph drawing to a specific size.
 void setToolTipText(java.lang.String tip)
          Registers the default text to display in a tool tip.
 GrappaBox zoomToOutline()
          Zoom the drawing to the outline just swept with the mouse, if any.
 GrappaBox zoomToOutline(GrappaBox outline)
          Zoom the drawing to the outline just swept with the mouse, if any.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

graph

Graph graph

subgraph

Subgraph subgraph

backer

GrappaBacker backer

nodeLabels

boolean nodeLabels

edgeLabels

boolean edgeLabels

subgLabels

boolean subgLabels

transform

java.awt.geom.AffineTransform transform

oldTransform

java.awt.geom.AffineTransform oldTransform

inverseTransform

java.awt.geom.AffineTransform inverseTransform

elementVector

java.util.Vector elementVector

nextElement

int nextElement

scaleToFit

boolean scaleToFit

scaleToSize

GrappaSize scaleToSize

grappaListener

GrappaListener grappaListener

pressedElement

private Element pressedElement

pressedPoint

private GrappaPoint pressedPoint

pressedModifiers

private int pressedModifiers

selectionStyle

private GrappaStyle selectionStyle

deletionStyle

private GrappaStyle deletionStyle

scaleFactor

private double scaleFactor

scaleInfo

private double scaleInfo

outline

private GrappaBox outline

savedOutline

private GrappaBox savedOutline

zoomBox

private GrappaBox zoomBox

inMenu

private boolean inMenu

scaleChanged

private boolean scaleChanged

paintActive

private boolean paintActive

panelcpt

private java.awt.geom.Point2D panelcpt
Constructor Detail

GrappaPanel

public GrappaPanel(Subgraph subgraph)
Constructs a new canvas associated with a particular subgraph. Keep in mind that Graph is a sub-class of Subgraph so that usually a Graph object is passed to the constructor.

Parameters:
subgraph - the subgraph to be rendered on the canvas

GrappaPanel

public GrappaPanel(Subgraph subgraph,
                   GrappaBacker backer)
Constructs a new canvas associated with a particular subgraph.

Parameters:
subgraph - the subgraph to be rendered on the canvas.
backer - used to draw a background for the graph.
Method Detail

addGrappaListener

public GrappaListener addGrappaListener(GrappaListener listener)
Adds the specified listener to receive mouse events from this graph.

Parameters:
listener - the event listener.
Returns:
the previous event listener.
See Also:
GrappaAdapter

removeGrappaListener

public GrappaListener removeGrappaListener()
Removes the current listener from this graph. Equivalent to addGrappaListener(null).

Returns:
the event listener just removed.

print

public int print(java.awt.Graphics g,
                 java.awt.print.PageFormat pf,
                 int pi)
          throws java.awt.print.PrinterException
Specified by:
print in interface java.awt.print.Printable
Throws:
java.awt.print.PrinterException

paintComponent

public void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

setCPT

void setCPT(java.awt.geom.Point2D cpt)

getCPT

java.awt.geom.Point2D getCPT()

componentPaint

private java.awt.geom.Point2D componentPaint(java.awt.Graphics g)

centerPanelAtPoint

public void centerPanelAtPoint(java.awt.geom.Point2D cpt)
Centers the panel at the supplied point.

Parameters:
cpt - requested center point

getTransform

public java.awt.geom.AffineTransform getTransform()
Get the AffineTransform that applies to this drawing.

Returns:
the AffineTransform that applies to this drawing.

getInverseTransform

public java.awt.geom.AffineTransform getInverseTransform()
Get the inverse AffineTransform that applies to this drawing.

Returns:
the inverse AffineTransform that applies to this drawing.

setToolTipText

public void setToolTipText(java.lang.String tip)
Registers the default text to display in a tool tip. Setting the default text to null turns off tool tips. The default text is displayed when the mouse is outside the graph boundaries, but within the panel.

Overrides:
setToolTipText in class javax.swing.JComponent
See Also:
Graph.setToolTipText(String)

getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent mev)
Generate an appropriate tooltip based on the mouse location provided by the given event.

Overrides:
getToolTipText in class javax.swing.JComponent
Returns:
if a GrappaListener is available, the result of its grappaTip() method is returned, otherwise null.
See Also:
setToolTipText(String)

setScaleToFit

public void setScaleToFit(boolean setting)
Enable/disable scale-to-fit mode.

Parameters:
setting - if true, the graph drawing is scaled to fit the panel, otherwise the graph is drawn full-size.

setScaleToSize

public void setScaleToSize(java.awt.geom.Dimension2D scaleSize)
Scale the graph drawing to a specific size.


getSubgraph

public Subgraph getSubgraph()
Get the subgraph being drawn on this panel.

Returns:
the subgraph being drawn on this panel.

resetZoom

public void resetZoom()
Reset the scale factor to one.


hasOutline

public boolean hasOutline()
Check if a swept outline is still available.

Returns:
true if there is an outline available.

clearOutline

public void clearOutline()
Clear swept outline, if any.


zoomToOutline

public GrappaBox zoomToOutline()
Zoom the drawing to the outline just swept with the mouse, if any.

Returns:
the box corresponding to the swept outline, or null.

zoomToOutline

public GrappaBox zoomToOutline(GrappaBox outline)
Zoom the drawing to the outline just swept with the mouse, if any.

Parameters:
outline - the zoom bounds
Returns:
the box corresponding to the swept outline, or null.

multiplyScaleFactor

public double multiplyScaleFactor(double multiplier)
Adjust the scale factor by the supplied multiplier.

Parameters:
multiplier - multiply the scale factor by this amount.
Returns:
the value of the previous scale factor.

paintSubgraph

private void paintSubgraph(java.awt.Graphics2D g2d,
                           Subgraph subg,
                           java.awt.Shape clipper,
                           java.awt.Color bkgdColor)

findContainingElement

private Element findContainingElement(Subgraph subg,
                                      java.awt.geom.Point2D pt)

findContainingElement

private Element findContainingElement(Subgraph subg,
                                      java.awt.geom.Point2D pt,
                                      Element crnt)

reallyFindContainingElement

private Element reallyFindContainingElement(Subgraph subg,
                                            java.awt.geom.Point2D pt,
                                            Element[] stash)

ancestorMoved

public void ancestorMoved(javax.swing.event.AncestorEvent aev)
Specified by:
ancestorMoved in interface javax.swing.event.AncestorListener

ancestorAdded

public void ancestorAdded(javax.swing.event.AncestorEvent aev)
Specified by:
ancestorAdded in interface javax.swing.event.AncestorListener

ancestorRemoved

public void ancestorRemoved(javax.swing.event.AncestorEvent aev)
Specified by:
ancestorRemoved in interface javax.swing.event.AncestorListener

componentHidden

public void componentHidden(java.awt.event.ComponentEvent cev)
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent cev)
Specified by:
componentMoved in interface java.awt.event.ComponentListener

componentResized

public void componentResized(java.awt.event.ComponentEvent cev)
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent cev)
Specified by:
componentShown in interface java.awt.event.ComponentListener

popupMenuCanceled

public void popupMenuCanceled(javax.swing.event.PopupMenuEvent pmev)
Specified by:
popupMenuCanceled in interface javax.swing.event.PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent pmev)
Specified by:
popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent pmev)
Specified by:
popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent mev)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent mev)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent mev)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent mev)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent mev)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent mev)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent mev)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

getPreferredScrollableViewportSize

public java.awt.Dimension getPreferredScrollableViewportSize()
Returns the size of the bounding box of the graph augmented by the margin attribute and any scaling.

Specified by:
getPreferredScrollableViewportSize in interface javax.swing.Scrollable
Returns:
The preferredSize of a JViewport whose view is this Scrollable.
See Also:
JViewport#getPreferredSize

getScrollableUnitIncrement

public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Always returns 1 since a GrappaPanel has not logical rows or columns.

Specified by:
getScrollableUnitIncrement in interface javax.swing.Scrollable
Parameters:
visibleRect - The view area visible within the viewport
orientation - Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
direction - Less than zero to scroll up/left, greater than zero for down/right.
Returns:
The "unit" increment for scrolling in the specified direction, which in the case of a GrappaPanel is always 1.
See Also:
JScrollBar#setUnitIncrement

getScrollableBlockIncrement

public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Returns 90% of the view area dimension that is in the orientation of the requested scroll.

Specified by:
getScrollableBlockIncrement in interface javax.swing.Scrollable
Parameters:
visibleRect - The view area visible within the viewport
orientation - Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.
direction - Less than zero to scroll up/left, greater than zero for down/right.
Returns:
The "unit" increment for scrolling in the specified direction, which in the case of a GrappaPanel is 90% of the visible width for a horizontal increment or 90% of the visible height for a vertical increment.
See Also:
JScrollBar#setBlockIncrement

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Always returns false as the viewport should not force the width of this GrappaPanel to match the width of the viewport.

Specified by:
getScrollableTracksViewportWidth in interface javax.swing.Scrollable
Returns:
false

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Always returns false as the viewport should not force the height of this GrappaPanel to match the width of the viewport.

Specified by:
getScrollableTracksViewportHeight in interface javax.swing.Scrollable
Returns:
false

run

public void run()
Specified by:
run in interface java.lang.Runnable