Search in sources :

Example 1 with FlamePanel

use of org.jwildfire.create.tina.swing.flamepanel.FlamePanel in project JWildfire by thargor6.

the class IFlamesController method getBaseFlamePreviewPanel.

private FlamePanel getBaseFlamePreviewPanel() {
    if (baseFlamePreviewPanel == null) {
        int width = baseFlamePreviewRootPnl.getWidth();
        int height = baseFlamePreviewRootPnl.getHeight();
        SimpleImage img = new SimpleImage(width, height);
        img.fillBackground(0, 0, 0);
        baseFlamePreviewPanel = new FlamePanel(prefs, img, 0, 0, baseFlamePreviewRootPnl.getWidth(), this, null);
        ResolutionProfile resProfile = getResolutionProfile();
        baseFlamePreviewPanel.setRenderWidth(resProfile.getWidth());
        baseFlamePreviewPanel.setRenderHeight(resProfile.getHeight());
        baseFlamePreviewPanel.setFocusable(true);
        baseFlamePreviewRootPnl.add(baseFlamePreviewPanel, BorderLayout.CENTER);
        baseFlamePreviewRootPnl.getParent().validate();
        baseFlamePreviewRootPnl.repaint();
        baseFlamePreviewPanel.requestFocusInWindow();
    }
    return baseFlamePreviewPanel;
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Example 2 with FlamePanel

use of org.jwildfire.create.tina.swing.flamepanel.FlamePanel in project JWildfire by thargor6.

the class DancingFractalsController method getFlamePanel.

private FlamePanel getFlamePanel() {
    if (flamePanel == null) {
        // flameRootPanel can't be null !?
        int borderWidth = flameRootPanel.getBorder().getBorderInsets(flameRootPanel).left;
        int width = flameRootPanel.getWidth() - borderWidth;
        int height = flameRootPanel.getHeight() - borderWidth;
        if (width < 16 || height < 16)
            return null;
        SimpleImage img = new SimpleImage(width, height);
        img.fillBackground(0, 0, 0);
        flamePanel = new FlamePanel(prefs, img, 0, 0, flameRootPanel.getWidth() - borderWidth, null, null);
        flamePanel.setRenderWidth(640);
        flamePanel.setRenderHeight(480);
        flameRootPanel.add(flamePanel, BorderLayout.CENTER);
        flameRootPanel.getParent().validate();
        flameRootPanel.repaint();
    }
    flamePanel.setFlameHolder(renderThread);
    return flamePanel;
}
Also used : SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Example 3 with FlamePanel

use of org.jwildfire.create.tina.swing.flamepanel.FlamePanel in project JWildfire by thargor6.

the class DancingFractalsController method borderSizeSlider_changed.

public void borderSizeSlider_changed() {
    int value = borderSizeSlider.getValue();
    int currValue = flameRootPanel.getBorder().getBorderInsets(flameRootPanel).left;
    if (currValue != value) {
        flameRootPanel.setBorder(new EmptyBorder(0, 0, value, value));
        if (flamePanel != null) {
            FlamePanel oldFlamePanel = flamePanel;
            flamePanel = null;
            flameRootPanel.remove(oldFlamePanel);
            flameRootPanel.getParent().validate();
            flameRootPanel.repaint();
        }
    }
}
Also used : FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel) EmptyBorder(javax.swing.border.EmptyBorder)

Example 4 with FlamePanel

use of org.jwildfire.create.tina.swing.flamepanel.FlamePanel in project JWildfire by thargor6.

the class DancingFractalsController method getPoolPreviewFlamePanel.

private FlamePanel getPoolPreviewFlamePanel() {
    if (poolFlamePreviewFlamePanel == null && poolFlamePreviewPnl != null) {
        int width = poolFlamePreviewPnl.getWidth();
        int height = poolFlamePreviewPnl.getHeight();
        SimpleImage img = new SimpleImage(width, height);
        img.fillBackground(0, 0, 0);
        poolFlamePreviewFlamePanel = new FlamePanel(prefs, img, 0, 0, poolFlamePreviewPnl.getWidth(), poolFlameHolder, null);
        poolFlamePreviewFlamePanel.setRenderWidth(640);
        poolFlamePreviewFlamePanel.setRenderHeight(480);
        poolFlamePreviewFlamePanel.setDrawTriangles(false);
        poolFlamePreviewPnl.add(poolFlamePreviewFlamePanel, BorderLayout.CENTER);
        poolFlamePreviewPnl.getParent().validate();
        poolFlamePreviewPnl.repaint();
    }
    return poolFlamePreviewFlamePanel;
}
Also used : SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Example 5 with FlamePanel

use of org.jwildfire.create.tina.swing.flamepanel.FlamePanel in project JWildfire by thargor6.

the class BatchRendererController method getBatchPreviewFlamePanel.

private FlamePanel getBatchPreviewFlamePanel() {
    if (batchPreviewFlamePanel == null) {
        int width = data.batchPreviewRootPanel.getWidth();
        int height = data.batchPreviewRootPanel.getHeight();
        SimpleImage img = new SimpleImage(width, height);
        img.fillBackground(0, 0, 0);
        batchPreviewFlamePanel = new FlamePanel(prefs, img, 0, 0, data.batchPreviewRootPanel.getWidth(), getBatchRenderPreviewFlameHolder(), null);
        ResolutionProfile resProfile = getBatchRenderResolutionProfile();
        batchPreviewFlamePanel.setRenderWidth(resProfile.getWidth());
        batchPreviewFlamePanel.setRenderHeight(resProfile.getHeight());
        batchPreviewFlamePanel.setDrawTriangles(false);
        data.batchPreviewRootPanel.add(batchPreviewFlamePanel, BorderLayout.CENTER);
        data.batchPreviewRootPanel.getParent().validate();
        data.batchPreviewRootPanel.repaint();
    }
    return batchPreviewFlamePanel;
}
Also used : ResolutionProfile(org.jwildfire.base.ResolutionProfile) SimpleImage(org.jwildfire.image.SimpleImage) FlamePanel(org.jwildfire.create.tina.swing.flamepanel.FlamePanel)

Aggregations

FlamePanel (org.jwildfire.create.tina.swing.flamepanel.FlamePanel)23 SimpleImage (org.jwildfire.image.SimpleImage)20 Rectangle (java.awt.Rectangle)9 Flame (org.jwildfire.create.tina.base.Flame)9 FlameRenderer (org.jwildfire.create.tina.render.FlameRenderer)9 RenderInfo (org.jwildfire.create.tina.render.RenderInfo)9 RenderedFlame (org.jwildfire.create.tina.render.RenderedFlame)9 ResolutionProfile (org.jwildfire.base.ResolutionProfile)5 FlamePanelConfig (org.jwildfire.create.tina.swing.flamepanel.FlamePanelConfig)3 Point (java.awt.Point)2 XYZProjectedPoint (org.jwildfire.create.tina.base.XYZProjectedPoint)2 DrawFocusPointFlameRenderer (org.jwildfire.create.tina.render.DrawFocusPointFlameRenderer)2 KeyAdapter (java.awt.event.KeyAdapter)1 KeyEvent (java.awt.event.KeyEvent)1 MouseEvent (java.awt.event.MouseEvent)1 MouseWheelEvent (java.awt.event.MouseWheelEvent)1 MouseWheelListener (java.awt.event.MouseWheelListener)1 EmptyBorder (javax.swing.border.EmptyBorder)1 Prefs (org.jwildfire.base.Prefs)1 ComposeTransformer (org.jwildfire.transform.ComposeTransformer)1