com.touchgraph.graphlayout.interaction
Class HVScroll

java.lang.Object
  extended by com.touchgraph.graphlayout.interaction.HVScroll
All Implemented Interfaces:
GraphListener, EventListener

public class HVScroll
extends Object
implements GraphListener

HVScroll: Allows for scrolling horizontally+vertically. This can be done in all sorts of ways, for instance by using the scrollbars, or by dragging.

This code is more complex then it would seem it should be, because scrolling has to be independent of the screen being warped by lenses. HVScroll needs to use the tgLensSet object because the offset is recorded in real coordinates, while the user interacts with the drawn coordinates.

Version:
1.21 $Id: HVScroll.java,v 3.1 2004/11/22 01:30:47 altheim Exp $
Author:
Alexander Shapiro, Murray Altheim (2002-09-17 thread groups, 2002-12-12 v1.22 features)

Field Summary
 boolean scrolling
           
 
Constructor Summary
HVScroll(TGPanel tgp, TGLensSet tgls)
          Constructor with a TGPanel tgp and TGLensSet tgls.
 
Method Summary
 void cancelScrolling()
          Immediately halts the center-scrolling thread loop.
 Point2D.Double getBottomRightDraw()
           
 Point2D.Double getDrawCenter()
           
 JScrollBar getHorizontalSB()
           
 com.touchgraph.graphlayout.interaction.HVScroll.HVDragUI getHVDragUI()
           
 TGAbstractClickUI getHVScrollToCenterUI()
           
 com.touchgraph.graphlayout.interaction.HVScroll.HVLens getLens()
           
 Point getOffset()
           
 int getOffsetX()
           
 int getOffsetY()
           
 Point2D.Double getTopLeftDraw()
           
 JScrollBar getVerticalSB()
           
 void graphMoved()
          Updates the graph following a move.
 void graphReset()
           
 boolean isScrolling()
          Returns true if the center-scrolling thread is active.
 void scrollAtoB(Point2D.Double drawFrom, Point2D.Double drawTo)
           
 void setOffset(Point p)
           
 void slowScrollToCenter(Node n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scrolling

public boolean scrolling
Constructor Detail

HVScroll

public HVScroll(TGPanel tgp,
                TGLensSet tgls)
Constructor with a TGPanel tgp and TGLensSet tgls.

Method Detail

getHorizontalSB

public JScrollBar getHorizontalSB()

getVerticalSB

public JScrollBar getVerticalSB()

getHVDragUI

public com.touchgraph.graphlayout.interaction.HVScroll.HVDragUI getHVDragUI()

getLens

public com.touchgraph.graphlayout.interaction.HVScroll.HVLens getLens()

getHVScrollToCenterUI

public TGAbstractClickUI getHVScrollToCenterUI()

getTopLeftDraw

public Point2D.Double getTopLeftDraw()

getBottomRightDraw

public Point2D.Double getBottomRightDraw()

getDrawCenter

public Point2D.Double getDrawCenter()

graphMoved

public void graphMoved()
Updates the graph following a move. From the GraphListener interface.

Specified by:
graphMoved in interface GraphListener

graphReset

public void graphReset()
Specified by:
graphReset in interface GraphListener

setOffset

public void setOffset(Point p)

getOffset

public Point getOffset()

getOffsetX

public int getOffsetX()

getOffsetY

public int getOffsetY()

scrollAtoB

public void scrollAtoB(Point2D.Double drawFrom,
                       Point2D.Double drawTo)

isScrolling

public boolean isScrolling()
Returns true if the center-scrolling thread is active.


cancelScrolling

public void cancelScrolling()
Immediately halts the center-scrolling thread loop.


slowScrollToCenter

public void slowScrollToCenter(Node n)


The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.