use of org.jwildfire.create.tina.swing.TxtFileChooser in project JWildfire by thargor6.
the class LeapMotionControllerHolder method stopLeapMotionListener.
public void stopLeapMotionListener() {
try {
try {
if (leapMotionController != null && listener != null) {
leapMotionController.removeListener(listener);
}
} finally {
listener = null;
}
if (leapMotionEditorListenerThread != null) {
leapMotionEditorListenerThread.signalCancel();
leapMotionEditorListenerThread = null;
}
if (recorder != null && !recorder.isEmpty()) {
tinaController.undoAction();
applyMotionToFlame(recorder, tinaController.getCurrFlame());
tinaController.refreshUI();
if (doSave && StandardDialogs.confirm(rootPanel, "Do you want to save the recorded motion-data?")) {
Prefs prefs = Prefs.getPrefs();
JFileChooser chooser = new TxtFileChooser(prefs);
if (prefs.getTinaRawMotionDataPath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getTinaRawMotionDataPath()));
} catch (Exception ex) {
ex.printStackTrace();
}
} else if (prefs.getTinaFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getTinaFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
if (chooser.showOpenDialog(rootPanel) == JFileChooser.APPROVE_OPTION) {
try {
exportMotionToFile(chooser.getSelectedFile());
} catch (Exception ex) {
errorHandler.handleError(ex);
}
}
}
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
Aggregations