use of org.jwildfire.create.tina.io.FlameWriter in project JWildfire by thargor6.
the class TinaController method allsaveButton_clicked.
public void allsaveButton_clicked() {
try {
List<Flame> flames = new ArrayList<>();
for (FlameThumbnail thumbnail : randomBatch) {
if (thumbnail.getSelectCheckbox() != null && thumbnail.getSelectCheckbox().isSelected()) {
flames.add(generateExportFlame(thumbnail.getFlame()));
}
}
if (!flames.isEmpty()) {
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();
String filename = file.getAbsolutePath();
if (!filename.endsWith("." + Tools.FILEEXT_FLAME)) {
filename += "." + Tools.FILEEXT_FLAME;
}
new FlameWriter().writeFlames(flames, filename);
messageHelper.showStatusMessage(getCurrFlame(), flames.size() + " " + (flames.size() > 1 ? "flames" : "flame") + " saved to disc");
prefs.setLastOutputFlameFile(file);
}
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.io.FlameWriter in project JWildfire by thargor6.
the class TinaController method sendCurrentFlameToBatchRenderer.
public void sendCurrentFlameToBatchRenderer() {
try {
Flame flame = getCurrFlame();
if (flame != null) {
String filename = qsaveFilenameGen.generateNextFilename();
new FlameWriter().writeFlame(generateExportFlame(flame), filename);
batchRendererController.importFlame(filename, getResolutionProfile(), getQualityProfile());
messageHelper.showStatusMessage(getCurrFlame(), "sent as file <" + new File(filename).getName() + "> to batch-renderer");
}
} catch (Exception ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.io.FlameWriter in project JWildfire by thargor6.
the class TinaController method saveFlameToClipboard.
public void saveFlameToClipboard() {
try {
if (getCurrFlame() != null) {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
String xml = new FlameWriter().getFlameXML(generateExportFlame(getCurrFlame()));
StringSelection data = new StringSelection(xml);
clipboard.setContents(data, data);
messageHelper.showStatusMessage(getCurrFlame(), "flame saved to clipboard");
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.io.FlameWriter in project JWildfire by thargor6.
the class TinaInteractiveRendererController method toClipboardButton_clicked.
public void toClipboardButton_clicked() {
try {
Flame currFlame = getCurrFlame();
if (currFlame != null) {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
String xml = new FlameWriter().getFlameXML(currFlame);
StringSelection data = new StringSelection(xml);
clipboard.setContents(data, data);
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
use of org.jwildfire.create.tina.io.FlameWriter in project JWildfire by thargor6.
the class TinaInteractiveRendererController method saveFlameButton_clicked.
public void saveFlameButton_clicked() {
try {
Flame currFlame = getCurrFlame();
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(imageRootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
new FlameWriter().writeFlame(currFlame, file.getAbsolutePath());
prefs.setLastOutputFlameFile(file);
}
}
} catch (Throwable ex) {
errorHandler.handleError(ex);
}
}
Aggregations