use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class MutaGenController method loadFlameFromFileBtn_clicked.
public void loadFlameFromFileBtn_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(rootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
List<Flame> flames = new FlameReader(prefs).readFlames(file.getAbsolutePath());
Flame flame = flames.get(0);
prefs.setLastInputFlameFile(file);
if (flame != null) {
importFlame(flame);
}
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class IFlamesController method saveIFlameButton_clicked.
public void saveIFlameButton_clicked() {
try {
if (getFlame() != 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(centerPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
new FlameWriter().writeFlame(getFlame(), file.getAbsolutePath());
getFlame().setLastFilename(file.getName());
messageHelper.showStatusMessage(getFlame(), "flame saved to disc");
prefs.setLastOutputFlameFile(file);
}
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class DancingFractalsController method loadFlameButton_clicked.
public void loadFlameButton_clicked() {
try {
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(poolFlamePreviewPnl) == JFileChooser.APPROVE_OPTION) {
for (File file : chooser.getSelectedFiles()) {
List<Flame> newFlames = new FlameReader(prefs).readFlames(file.getAbsolutePath());
prefs.setLastInputFlameFile(file);
if (newFlames != null && newFlames.size() > 0) {
for (Flame newFlame : newFlames) {
project.getFlames().add(validateDancingFlame(newFlame));
}
}
}
refreshProjectFlames();
enableControls();
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class BatchRendererController method batchRenderAddFilesButton_clicked.
public void batchRenderAddFilesButton_clicked() {
if (jobRenderThread != null) {
return;
}
try {
JFileChooser chooser = new FlameFileChooser(prefs);
if (prefs.getInputFlamePath() != null) {
try {
chooser.setCurrentDirectory(new File(prefs.getInputFlamePath()));
} catch (Exception ex) {
ex.printStackTrace();
}
}
int jobCount = batchRenderList.size();
chooser.setMultiSelectionEnabled(true);
if (chooser.showOpenDialog(rootPanel) == JFileChooser.APPROVE_OPTION) {
for (File file : chooser.getSelectedFiles()) {
addFlameToBatchRenderer(file.getPath(), false);
}
}
if (jobCount != batchRenderList.size()) {
refreshRenderBatchJobsTable();
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.swing.FlameFileChooser in project JWildfire by thargor6.
the class MeshGenController method loadFlameButton_clicked.
public void loadFlameButton_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(rootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
List<Flame> flames = new FlameReader(prefs).readFlames(file.getAbsolutePath());
Flame newFlame = flames.get(0);
prefs.setLastInputFlameFile(file);
importFlame(newFlame);
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
Aggregations