use of org.jwildfire.swing.PropertyPanel in project JWildfire by thargor6.
the class DancingFractalsController method motionTableClicked.
public void motionTableClicked() {
if (!refreshing) {
if (motionPropertyPnl != null) {
motionPropertyRootPnl.remove(motionPropertyPnl);
motionPropertyPnl = null;
}
if (project.getMotions().size() > 0 && motionTable.getSelectedRow() >= 0 && motionTable.getSelectedRow() < project.getMotions().size()) {
Motion motion = project.getMotions().get(motionTable.getSelectedRow());
@SuppressWarnings("rawtypes") Map<Class, PropertyEditor> editors = new HashMap<Class, PropertyEditor>();
editors.put(Motion.class, new MotionTypeEditor(project.getMotions()));
motionPropertyPnl = new PropertyPanel(motion, editors);
motionPropertyPnl.setDescriptionVisible(false);
PropertyChangeListener listener = new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
refreshing = true;
try {
int oldSel = motionTable.getSelectedRow();
refreshMotionTable();
motionTable.getSelectionModel().setSelectionInterval(oldSel, oldSel);
enableControls();
} finally {
refreshing = false;
}
}
};
motionPropertyPnl.addPropertySheetChangeListener(listener);
motionPropertyRootPnl.add(motionPropertyPnl, BorderLayout.CENTER);
enableControls();
}
}
refreshMotionLinksTable();
motionPropertyRootPnl.invalidate();
motionPropertyRootPnl.validate();
}
Aggregations