use of org.jwildfire.create.tina.base.Flame in project JWildfire by thargor6.
the class AbstractControlsDelegate method editMotionCurve.
protected void editMotionCurve(MotionCurve pCurve, double pInitialValue, String pPropName, String pLabel) {
Envelope envelope = pCurve.toEnvelope();
if (envelope.getX().length == 0) {
int[] x = new int[] { 0 };
if (pInitialValue <= envelope.getViewYMin() + 1) {
envelope.setViewYMin(pInitialValue - 1.0);
}
if (pInitialValue >= envelope.getViewYMax() - 1) {
envelope.setViewYMax(pInitialValue + 1.0);
}
double[] y = new double[] { pInitialValue };
envelope.setValues(x, y);
}
EnvelopeDialog dlg = new EnvelopeDialog(SwingUtilities.getWindowAncestor(rootPanel), owner.getErrorHandler(), envelope, true);
dlg.setFlameToPreview(EnvelopeDialogFlamePreviewType.MOTION_CURVE, owner.getCurrFlame(), pCurve);
dlg.setTitle("Editing " + pLabel);
dlg.setModal(true);
dlg.setVisible(true);
if (dlg.isConfirmed()) {
Flame flame = owner.getCurrFlame();
if (useUndoManager) {
owner.undoManager.saveUndoPoint(flame);
}
if (dlg.isRemoved()) {
pCurve.setEnabled(false);
} else {
pCurve.assignFromEnvelope(envelope);
pCurve.setEnabled(true);
}
owner.refreshFlameImage(true, false, 1, true, false);
}
}
use of org.jwildfire.create.tina.base.Flame in project JWildfire by thargor6.
the class TinaController method xFormModGammaRandomizeBtn_Clicked.
public void xFormModGammaRandomizeBtn_Clicked(boolean pWholeFractal) {
if (pWholeFractal) {
Flame flame = getCurrFlame();
if (flame != null) {
saveUndoPoint();
for (Layer layer : flame.getLayers()) {
for (XForm xForm : layer.getXForms()) {
xForm.randomizeModGamma();
}
}
refreshXFormUI(getCurrXForm(XFormType.BOTH));
refreshFlameImage(true, false, 1, true, false);
}
} else {
XForm xForm = getCurrXForm(XFormType.NORMAL);
if (xForm != null) {
saveUndoPoint();
xForm.randomizeModGamma();
refreshXFormUI(xForm);
refreshFlameImage(true, false, 1, true, false);
}
}
}
use of org.jwildfire.create.tina.base.Flame in project JWildfire by thargor6.
the class TinaController method xFormModLocalGammaResetAllBtn_Clicked.
public void xFormModLocalGammaResetAllBtn_Clicked(boolean pWholeFractal) {
if (pWholeFractal) {
Flame flame = getCurrFlame();
if (flame != null) {
saveUndoPoint();
for (Layer layer : flame.getLayers()) {
for (XForm xForm : layer.getXForms()) {
xForm.resetModColorEffects();
}
}
refreshXFormUI(getCurrXForm(XFormType.BOTH));
refreshFlameImage(true, false, 1, true, false);
}
} else {
XForm xForm = getCurrXForm(XFormType.NORMAL);
if (xForm != null) {
saveUndoPoint();
xForm.resetModColorEffects();
refreshXFormUI(xForm);
refreshFlameImage(true, false, 1, true, false);
}
}
}
use of org.jwildfire.create.tina.base.Flame in project JWildfire by thargor6.
the class TinaController method getCurrFlame.
@Override
public Flame getCurrFlame(boolean autoGenerateIfEmpty) {
if (_currFlame == null) {
final int IMG_WIDTH = 80;
final int IMG_HEIGHT = 60;
RandomFlameGenerator randGen = new AllRandomFlameGenerator();
int palettePoints = 3 + Tools.randomInt(21);
boolean fadePaletteColors = Math.random() > 0.09;
boolean uniformWidth = Math.random() > 0.75;
RandomFlameGeneratorSampler sampler = new RandomFlameGeneratorSampler(IMG_WIDTH, IMG_HEIGHT, prefs, randGen, RandomSymmetryGeneratorList.SPARSE, RandomGradientGeneratorList.DEFAULT, palettePoints, fadePaletteColors, uniformWidth, RandomBatchQuality.LOW);
Flame flame = sampler.createSample().getFlame();
setCurrFlame(flame);
}
return _currFlame;
}
use of org.jwildfire.create.tina.base.Flame in project JWildfire by thargor6.
the class TinaController method randomizeColorSpeedBtn_clicked.
public void randomizeColorSpeedBtn_clicked() {
Flame flame = getCurrFlame();
if (flame != null) {
saveUndoPoint();
getCurrLayer().randomizeColorSpeed();
transformationChanged(true);
}
}
Aggregations