edu.uci.ics.jung.visualization.swt
Class GraphZoomScrollPane<V,E>

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by edu.uci.ics.jung.visualization.swt.GraphZoomScrollPane<V,E>
All Implemented Interfaces:
org.eclipse.swt.graphics.Drawable

public class GraphZoomScrollPane<V,E>
extends org.eclipse.swt.widgets.Composite

GraphZoomScrollPane is a Container for the Graph's VisualizationViewer and includes custom horizontal and vertical scrollbars. GraphZoomScrollPane listens for changes in the scale and translation of the VisualizationViewer, and will update the scrollbar positions and sizes accordingly. Changes in the scrollbar positions will cause the corresponding change in the translation component (offset) of the VisualizationViewer. The scrollbars are modified so that they will allow panning of the graph when the scale has been changed (e.g. zoomed-in or zoomed-out). The lower-right corner of this component is available to use as a small button or menu. samples.graph.GraphZoomScrollPaneDemo shows the use of this component.

Author:
Tom Nelson

Nested Class Summary
protected  class GraphZoomScrollPane.ResizeListener
          Listener to adjust the scroll bar parameters when the window is resized
 
Field Summary
protected  org.eclipse.swt.widgets.Composite corner
           
protected  org.eclipse.swt.widgets.Slider horizontalScrollBar
           
protected  boolean scrollBarsMayControlAdjusting
           
protected  org.eclipse.swt.widgets.Composite south
           
protected  org.eclipse.swt.widgets.Slider verticalScrollBar
           
 VisualizationComposite<V,E> vv
           
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
GraphZoomScrollPane(org.eclipse.swt.widgets.Composite parent, int style, Layout<V,E> layout, Dimension preferredSize)
          Create an instance of the GraphZoomScrollPane to contain the VisualizationViewer
 
Method Summary
 org.eclipse.swt.widgets.Composite getCorner()
           
protected  void setScrollBarValues(Rectangle rectangle, Point2D h0, Point2D h1, Point2D v0, Point2D v1)
           
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vv

public VisualizationComposite<V,E> vv

horizontalScrollBar

protected org.eclipse.swt.widgets.Slider horizontalScrollBar

verticalScrollBar

protected org.eclipse.swt.widgets.Slider verticalScrollBar

corner

protected org.eclipse.swt.widgets.Composite corner

scrollBarsMayControlAdjusting

protected boolean scrollBarsMayControlAdjusting

south

protected org.eclipse.swt.widgets.Composite south
Constructor Detail

GraphZoomScrollPane

public GraphZoomScrollPane(org.eclipse.swt.widgets.Composite parent,
                           int style,
                           Layout<V,E> layout,
                           Dimension preferredSize)
Create an instance of the GraphZoomScrollPane to contain the VisualizationViewer

Parameters:
vv -
Method Detail

setScrollBarValues

protected void setScrollBarValues(Rectangle rectangle,
                                  Point2D h0,
                                  Point2D h1,
                                  Point2D v0,
                                  Point2D v1)

getCorner

public org.eclipse.swt.widgets.Composite getCorner()
Returns:
Returns the corner component.


Copyright © 2007. All Rights Reserved.