Integer viewportX = (Integer)home.getVisualProperty(PLAN_VIEWPORT_X_VISUAL_PROPERTY);
Integer viewportY = (Integer)home.getVisualProperty(PLAN_VIEWPORT_Y_VISUAL_PROPERTY);
if (viewportX != null && viewportY != null) {
viewport.setViewPosition(new Point(viewportX, viewportY));
}
viewport.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent ev) {
Point viewportPosition = viewport.getViewPosition();
controller.setVisualProperty(PLAN_VIEWPORT_X_VISUAL_PROPERTY, viewportPosition.x);
controller.setVisualProperty(PLAN_VIEWPORT_Y_VISUAL_PROPERTY, viewportPosition.y);
}