public class ScrollingExample.DocumentScrollDirector extends PDefaultScrollDirector
camera, root, scrollInProgress, scrollPane, view, viewPort| Constructor and Description |
|---|
ScrollingExample.DocumentScrollDirector() |
| Modifier and Type | Method and Description |
|---|---|
Point |
getViewPosition(Rectangle2D viewBounds)
Get the View position given the specified camera bounds - modified
such that:
Rather than finding the distance from the upper left corner of the
window to the upper left corner of the document - we instead find the
distance from the lower right corner of the window to the upper left
corner of the document THEN we subtract that value from total
document width so that the position is inverted
|
void |
setViewPosition(double x,
double y)
We do the same thing we did in getViewPosition above to flip the
document-window position relationship
|
getViewSize, install, propertyChange, shouldRevalidateScrollPane, unInstallpublic ScrollingExample.DocumentScrollDirector()
public Point getViewPosition(Rectangle2D viewBounds)
getViewPosition in interface PScrollDirectorgetViewPosition in class PDefaultScrollDirectorviewBounds - The bounds for which the view position will be
computedpublic void setViewPosition(double x,
double y)
setViewPosition in interface PScrollDirectorsetViewPosition in class PDefaultScrollDirectorx - The new x positiony - The new y positionCopyright © 1995-2012 Piccolo2D. All Rights Reserved.