|
||||||||||
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 | |
---|---|
java.awt.Point |
getViewPosition(java.awt.geom.Rectangle2D viewBounds)
Get the View position given the specified camera bounds |
java.awt.Dimension |
getViewSize(java.awt.geom.Rectangle2D viewBounds)
Get the size of the view based on the specified camera bounds |
void |
install(PViewport viewPort,
PCanvas view)
Installs the scroll director and adds the appropriate listeners |
void |
propertyChange(java.beans.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 viewPort, PCanvas view)
install
in interface PScrollDirector
viewPort
- The viewport on which this director directsview
- The ZCanvas that the viewport looks atpublic void unInstall()
unInstall
in interface PScrollDirector
public java.awt.Point getViewPosition(java.awt.geom.Rectangle2D viewBounds)
getViewPosition
in interface PScrollDirector
viewBounds
- The bounds for which the view position will be computed
public java.awt.Dimension getViewSize(java.awt.geom.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(java.beans.PropertyChangeEvent pce)
propertyChange
in interface java.beans.PropertyChangeListener
public boolean shouldRevalidateScrollPane()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |