* value and extent which can be used by a panner or scrollbars
*/
private void updateRangeModel() {
if (_canvas.getCanvasPane() == this) { //make sure this pane is the top one.
DefaultBoundedRangeModel _horizontalRangeModel = (DefaultBoundedRangeModel) _canvas
.getHorizontalRangeModel();
DefaultBoundedRangeModel _verticalRangeModel = (DefaultBoundedRangeModel) _canvas
.getVerticalRangeModel();
Rectangle2D viewsize = _canvas.getViewSize();
Rectangle2D vissize = _canvas.getVisibleSize();
int visWidth = (int) vissize.getWidth();
int visHeight = (int) vissize.getHeight();
int visX = (int) vissize.getX();
int visY = (int) vissize.getY();
int viewWidth = (int) viewsize.getWidth();
int viewHeight = (int) viewsize.getHeight();
int viewX = (int) viewsize.getX();
int viewY = (int) viewsize.getY();
_verticalRangeModel.setMinimum(-viewHeight);
_horizontalRangeModel.setMinimum(-viewWidth);
_verticalRangeModel.setMaximum(viewY + (2 * viewHeight));
_horizontalRangeModel.setMaximum(viewX + (2 * viewWidth));
_verticalRangeModel.setExtent(visHeight);
_horizontalRangeModel.setExtent(visWidth);
_verticalRangeModel.setValue(visY);
_horizontalRangeModel.setValue(visX);
}
}