use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class DancingFractalsController method stopRender.
public void stopRender() throws Exception {
if (renderThread != null) {
if (doRecordCBx.isSelected()) {
actionRecorder.recordStop();
}
renderThread.setForceAbort(true);
if (doRecordCBx.isSelected()) {
JFileChooser chooser = new FlameFileChooser(prefs);
if (prefs.getOutputFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getOutputFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
if (chooser.showSaveDialog(flameRootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
prefs.setLastOutputFlameFile(file);
PostRecordFlameGenerator generator = new PostRecordFlameGenerator(Prefs.getPrefs(), project, actionRecorder, renderThread, project.getFFT());
generator.createRecordedFlameFiles(file.getAbsolutePath());
}
}
renderThread = null;
actionRecorder = null;
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class IFlamesController method loadIFlameButton_clicked.
public void loadIFlameButton_clicked() {
try {
JFileChooser chooser = new FlameFileChooser(prefs);
if (prefs.getInputFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getInputFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
if (chooser.showOpenDialog(centerPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
List<Flame> flames = new FlameReader(prefs).readFlames(file.getAbsolutePath());
Flame flame = flames.get(0);
prefs.setLastInputFlameFile(file);
importFlame(flame);
getFlame().setLastFilename(file.getName());
messageHelper.showStatusMessage(getFlame(), "opened from disc");
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class IFlamesController method loadFlamesButton_clicked.
public void loadFlamesButton_clicked() {
JFileChooser chooser = new FlameFileChooser(prefs);
if (prefs.getInputFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getInputFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
chooser.setMultiSelectionEnabled(true);
if (chooser.showOpenDialog(centerPanel) == JFileChooser.APPROVE_OPTION) {
Throwable lastError = null;
for (File file : chooser.getSelectedFiles()) {
try {
List<Flame> flames = new FlameReader(prefs).readFlames(file.getAbsolutePath());
prefs.setLastInputFlameFile(file);
for (int i = flames.size() - 1; i >= 0; i--) {
addFlameToFlameLibrary(flames.get(i), new ThumbnailCacheKey(file.getAbsolutePath(), String.valueOf(i)));
}
} catch (Throwable ex) {
lastError = ex;
}
}
refreshFlameLibrary();
if (lastError != null) {
errorHandler.handleError(lastError);
}
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class MutaGenController method saveFlameBtn_clicked.
public void saveFlameBtn_clicked() {
if (selectedGenerationIdx >= 0 && selectedGenerationIdx < mutationList.size() && selRow >= 0 && selCol >= 0) {
MutationSet selectedSet = mutationList.get(selectedGenerationIdx);
Flame currFlame = selectedSet.getFlame(selRow, selCol);
try {
if (currFlame != null) {
JFileChooser chooser = new FlameFileChooser(prefs);
if (prefs.getOutputFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getOutputFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
if (chooser.showSaveDialog(rootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
new FlameWriter().writeFlame(currFlame, file.getAbsolutePath());
currFlame.setLastFilename(file.getName());
prefs.setLastOutputFlameFile(file);
}
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
}
Aggregations