Search in sources :

Example 1 with MotionType

use of org.jwildfire.create.tina.dance.motion.MotionType in project JWildfire by thargor6.

the class DancingFractalsController method addMotionBtn_clicked.

public void addMotionBtn_clicked() {
    try {
        MotionType motionType = (MotionType) addMotionCmb.getSelectedItem();
        if (motionType != null) {
            Motion newMotion = motionType.getMotionClass().newInstance();
            project.getMotions().add(newMotion);
            boolean oldRefreshing = refreshing;
            refreshing = true;
            try {
                refreshMotionTable();
            } finally {
                refreshing = oldRefreshing;
            }
            int selectRow = project.getMotions().size() - 1;
            motionTable.getSelectionModel().setSelectionInterval(selectRow, selectRow);
        }
    } catch (Throwable ex) {
        errorHandler.handleError(ex);
    }
}
Also used : Motion(org.jwildfire.create.tina.dance.motion.Motion) MotionType(org.jwildfire.create.tina.dance.motion.MotionType)

Aggregations

Motion (org.jwildfire.create.tina.dance.motion.Motion)1 MotionType (org.jwildfire.create.tina.dance.motion.MotionType)1