|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.piccolox.swing.PDefaultScrollDirector
public class PDefaultScrollDirector
The default scroll director implementation. This default implementation follows the widely accepted model of scrolling - namely the scrollbars control the movement of the window over the document rather than the movement of the document under the window.
Field Summary | |
---|---|
protected PCamera |
camera
The canvas' camera. |
protected PRoot |
root
The canvas' root. |
protected boolean |
scrollInProgress
Flag to indicate when scrolling is currently in progress. |
protected PScrollPane |
scrollPane
The scrollpane that contains the viewport. |
protected PCanvas |
view
The canvas that this class directs. |
protected PViewport |
viewPort
The viewport that signals this scroll director. |
Constructor Summary | |
---|---|
PDefaultScrollDirector()
The default constructor. |
Method Summary | |
---|---|
Point |
getViewPosition(Rectangle2D viewBounds)
Get the View position given the specified camera bounds. |
Dimension |
getViewSize(Rectangle2D viewBounds)
Get the size of the view based on the specified camera bounds. |
void |
install(PViewport targetViewPort,
PCanvas targetView)
Installs the scroll director and adds the appropriate listeners. |
void |
propertyChange(PropertyChangeEvent pce)
Invoked when the camera's view changes, or the bounds of the root or camera changes. |
void |
setViewPosition(double x,
double y)
Set the view position in a manner consistent with standardized scrolling. |
boolean |
shouldRevalidateScrollPane()
Should the ScrollPane be revalidated. |
void |
unInstall()
Uninstall the scroll director from the viewport. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PViewport viewPort
protected PScrollPane scrollPane
protected PCanvas view
protected PCamera camera
protected PRoot root
protected boolean scrollInProgress
Constructor Detail |
---|
public PDefaultScrollDirector()
Method Detail |
---|
public void install(PViewport targetViewPort, PCanvas targetView)
install
in interface PScrollDirector
targetViewPort
- viewport on which this director directstargetView
- PCanvas that the viewport looks atpublic void unInstall()
unInstall
in interface PScrollDirector
public Point getViewPosition(Rectangle2D viewBounds)
getViewPosition
in interface PScrollDirector
viewBounds
- The bounds for which the view position will be computed
public Dimension getViewSize(Rectangle2D viewBounds)
getViewSize
in interface PScrollDirector
viewBounds
- The view bounds for which the view size will be
computed
public void setViewPosition(double x, double y)
setViewPosition
in interface PScrollDirector
x
- The new x positiony
- The new y positionpublic void propertyChange(PropertyChangeEvent pce)
propertyChange
in interface PropertyChangeListener
pce
- property change event to examinepublic boolean shouldRevalidateScrollPane()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |