Search in sources :

Example 6 with TextTransformer

use of org.jwildfire.transform.TextTransformer in project JWildfire by thargor6.

the class FlameBrowserController method deleteBtn_clicked.

public void deleteBtn_clicked() {
    FlameFlatNode node = getSelectedFlame();
    if (node != null) {
        try {
            if (StandardDialogs.confirm(rootPanel, "Do you really want to permanently delete this flame?")) {
                File file = new File(node.getFilename());
                if (!file.delete()) {
                    throw new Exception("Could not delete file");
                }
                node.setRemoved(false);
                ImagePanel pnl = pnlList.get(selectedPnl);
                SimpleImage img = pnl.getImage();
                TextTransformer txt = new TextTransformer();
                txt.setText1("(deleted)");
                txt.setAntialiasing(true);
                txt.setColor(Color.RED);
                txt.setMode(Mode.NORMAL);
                txt.setFontStyle(FontStyle.BOLD);
                txt.setFontName("Arial");
                txt.setFontSize(24);
                txt.setHAlign(HAlignment.CENTRE);
                txt.setVAlign(VAlignment.CENTRE);
                txt.transformImage(img);
                pnl.invalidate();
                pnl.repaint();
            }
        } catch (Exception ex) {
            errorHandler.handleError(ex);
        }
    }
}
Also used : SimpleImage(org.jwildfire.image.SimpleImage) TextTransformer(org.jwildfire.transform.TextTransformer) File(java.io.File) ImagePanel(org.jwildfire.swing.ImagePanel)

Example 7 with TextTransformer

use of org.jwildfire.transform.TextTransformer in project JWildfire by thargor6.

the class FlamePreviewHelper method showLayerAppendModeIndicator.

private void showLayerAppendModeIndicator(SimpleImage img) {
    TextTransformer txt = new TextTransformer();
    txt.setText1("layer-append-mode active");
    txt.setAntialiasing(true);
    txt.setColor(Color.RED);
    txt.setMode(Mode.NORMAL);
    txt.setFontStyle(FontStyle.BOLD);
    txt.setFontName("Arial");
    txt.setFontSize(16);
    txt.setHAlign(HAlignment.RIGHT);
    txt.setVAlign(VAlignment.BOTTOM);
    txt.transformImage(img);
}
Also used : TextTransformer(org.jwildfire.transform.TextTransformer)

Aggregations

TextTransformer (org.jwildfire.transform.TextTransformer)7 SimpleImage (org.jwildfire.image.SimpleImage)6 Rectangle (java.awt.Rectangle)2 File (java.io.File)2 Flame (org.jwildfire.create.tina.base.Flame)2 FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)2 RenderInfo (org.jwildfire.create.tina.render.RenderInfo)2 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)2 ImagePanel (org.jwildfire.swing.ImagePanel)2 Color (java.awt.Color)1 Dimension (java.awt.Dimension)1 JFileChooser (javax.swing.JFileChooser)1 Layer (org.jwildfire.create.tina.base.Layer)1 XYZPoint (org.jwildfire.create.tina.base.XYZPoint)1 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)1 DrawFocusPointFlameRenderer (org.jwildfire.create.tina.render.DrawFocusPointFlameRenderer)1 FlamePanel (org.jwildfire.create.tina.swing.flamepanel.FlamePanel)1 FlamePanelConfig (org.jwildfire.create.tina.swing.flamepanel.FlamePanelConfig)1 RectangleTransformer (org.jwildfire.transform.RectangleTransformer)1