public class PrintExample.DocumentScrollDirector extends PDefaultScrollDirector
camera, root, scrollInProgress, scrollPane, view, viewPort
Constructor and Description |
---|
PrintExample.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, unInstall
public Point getViewPosition(Rectangle2D viewBounds)
getViewPosition
in interface PScrollDirector
getViewPosition
in class PDefaultScrollDirector
viewBounds
- The bounds for which the view position will be
computedpublic void setViewPosition(double x, double y)
setViewPosition
in interface PScrollDirector
setViewPosition
in class PDefaultScrollDirector
x
- The new x positiony
- The new y positionCopyright © 1995-2013 Piccolo2D. All Rights Reserved.