@Override
public void doSkins() {
}
private Bounds calcFinalBounds() {
Bounds maxExtent = getMaxExtent();
Bounds docbounds = new Bounds(0,0,document.getWidth(),document.getHeight());
Bounds finalBounds = maxExtent.union(docbounds);
double extra = 500;
finalBounds = new Bounds(
finalBounds.getX()-extra,
finalBounds.getY()-extra,
finalBounds.getWidth()+extra*2,
finalBounds.getHeight()+extra*2
);
offsetX = finalBounds.getX()*getScale();
offsetY = finalBounds.getY()*getScale();
double nvx = -(offsetX+panX);
double nvy = -(offsetY+panY);
scrollPane.getHorizontalScrollBar().setValue(nvx);
scrollPane.getVerticalScrollBar().setValue(nvy);
return finalBounds;