y.view
Class Scroller

java.lang.Object
  extended by y.view.Scroller
All Implemented Interfaces:
ActionListener, EventListener

public class Scroller
extends Object
implements ActionListener

This is a class which scrolls a view in direction with a certain speed. The speed can be changed via a synchronized method. This class is especially useful when run in a separate thread. A Vector is drawn in the direction of the scrolling.

 
Your browser does not support SVG content.

Constructor Summary
Scroller(Graph2DView view, double xpress, double ypress)
          Constructs a new Scroller for a given view.
 
Method Summary
 void actionPerformed(ActionEvent actionEvent)
          Loop, in which the scrolling performs
 void dispose()
           
 void init()
           
 void setDirection(double x, double y)
          Sets the direction of the scrolling by a direction vector (x,y).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scroller

public Scroller(Graph2DView view,
                double xpress,
                double ypress)
Constructs a new Scroller for a given view. The given world coordinates represent an initial reference point for the Scroller.

Method Detail

init

public void init()

dispose

public void dispose()

setDirection

public void setDirection(double x,
                         double y)
Sets the direction of the scrolling by a direction vector (x,y). The speed is proportional to the length of this vector.


actionPerformed

public void actionPerformed(ActionEvent actionEvent)
Loop, in which the scrolling performs

Specified by:
actionPerformed in interface ActionListener

© Copyright 2000-2008,
yWorks GmbH.
All rights reserved.