use of org.jwildfire.envelope.Envelope in project JWildfire by thargor6.
the class MotionCurve method toEnvelope.
public Envelope toEnvelope() {
Envelope res = new Envelope();
res.setViewXMin(viewXMin);
res.setViewXMax(viewXMax);
res.setViewYMin(viewYMin);
res.setViewYMax(viewYMax);
res.setInterpolation(interpolation);
res.setSelectedIdx(selectedIdx);
res.setLocked(locked);
int[] newX = new int[x.length];
System.arraycopy(x, 0, newX, 0, x.length);
double[] newY = new double[y.length];
System.arraycopy(y, 0, newY, 0, y.length);
res.setValues(newX, newY);
return res;
}
use of org.jwildfire.envelope.Envelope in project JWildfire by thargor6.
the class ChannelMixerPanelDelegate method editCurve.
protected void editCurve(ActionEvent e) {
Flame flame = owner.getOwner().getCurrFlame();
MotionCurve curve = getCurve(flame);
Envelope envelope = curve.toEnvelope();
EnvelopeDialog dlg = new EnvelopeDialog(SwingUtilities.getWindowAncestor(rootPanel), owner.getErrorHandler(), envelope, false);
dlg.setFlameToPreview(EnvelopeDialogFlamePreviewType.COLOR_CURVE, flame, curve);
dlg.setTitle("Editing motion curve");
dlg.setModal(true);
dlg.setVisible(true);
if (dlg.isConfirmed()) {
if (owner.isUseUndoManager()) {
owner.getOwner().undoManager.saveUndoPoint(flame);
}
curve.assignFromEnvelope(envelope);
owner.getOwner().refreshFlameImage(true, false, 1, true, true);
refreshCurve(flame);
}
}
Aggregations