*/
public void moveView(float dx, float dy) {
if (getParent() instanceof JViewport) {
JViewport viewport = (JViewport)getParent();
Rectangle viewRectangle = viewport.getViewRect();
viewRectangle.translate(Math.round(dx * getScale()), Math.round(dy * getScale()));
viewRectangle.x = Math.min(Math.max(0, viewRectangle.x), getWidth() - viewRectangle.width);
viewRectangle.y = Math.min(Math.max(0, viewRectangle.y), getHeight() - viewRectangle.height);
viewport.setViewPosition(viewRectangle.getLocation());
}
}