protected class CurrentViewChangeListener implements PropertyChangeListener {
public void propertyChange(PropertyChangeEvent e) {
String propertyName = e.getPropertyName();
if (propertyName.equals(DrawingEditor.CURRENT_VIEW_CHANGED)) {
DrawingView oView = (DrawingView) e.getOldValue();
DrawingView cView = (DrawingView) e.getNewValue();
if ((oView == null) && (cView != null)) {
scaler.setEnabled(true);
scaler.validate();
}
if ((oView != null) && (cView == null)) {
scaler.setEnabled(false);
scaler.validate();
}
if (cView != null) {
int scale = (int) (cView.getScale() * 100);
scaler.setValue(new Integer(scale));
}
if (oView != null)
oView.removeFigureSelectionListener(currentViewFigureSelectionChangedListener);
if (cView != null)
cView.addFigureSelectionListener(currentViewFigureSelectionChangedListener);
if (dropTarget != null)
dropTarget.setComponent((JComponent) cView);
//dropTarget.setComponent(editorArea);
changeViewNameAction.putValue(ConstantDefinition.CURRENT_VIEW_NAME, cView.getDrawing().getTitle());
}
}