Package org.jwildfire.envelope

Examples of org.jwildfire.envelope.Envelope


      pBuffer.append(" ");
      pBuffer.append(param.getName());
      pBuffer.append(" ");
      pBuffer.append(param.getValue());
      pBuffer.append(pLineSeparator);
      Envelope envelope = param.getEnvelope();
      if (envelope != null) {
        // envelope <paramname>
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_ENVELOPE);
        pBuffer.append(" ");
        pBuffer.append(param.getName());
        pBuffer.append(pLineSeparator);
        // view <xmin> <xmax> <ymin> <ymax>
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_VIEW);
        pBuffer.append(" ");
        pBuffer.append(Tools.doubleToString(envelope.getViewXMin()));
        pBuffer.append(" ");
        pBuffer.append(Tools.doubleToString(envelope.getViewXMax()));
        pBuffer.append(" ");
        pBuffer.append(Tools.doubleToString(envelope.getViewYMin()));
        pBuffer.append(" ");
        pBuffer.append(Tools.doubleToString(envelope.getViewYMax()));
        pBuffer.append(pLineSeparator);
        // points <x0> <y0> ... <xN> <yN>
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_POINTS);
        for (int p = 0; p < envelope.size(); p++) {
          pBuffer.append(" ");
          pBuffer.append(Tools.intToString(envelope.getX()[p]));
          pBuffer.append(" ");
          pBuffer.append(Tools.doubleToString(envelope.getY()[p]));
        }
        pBuffer.append(pLineSeparator);
        // selected <selected>       
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_SELECTED);
        pBuffer.append(" ");
        pBuffer.append(Tools.intToString(envelope.getSelectedIdx()));
        pBuffer.append(pLineSeparator);
        // interpolation <interpolation>
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INTERPOLATION);
        pBuffer.append(" ");
        pBuffer.append(envelope.getInterpolation().toString());
        pBuffer.append(pLineSeparator);
        // locked <locked>
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_INDENT);
        pBuffer.append(TOKEN_LOCKED);
        pBuffer.append(" ");
        pBuffer.append(envelope.isLocked());
        pBuffer.append(pLineSeparator);
      }
    }
    //
    pBuffer.append(pLineSeparator);
View Full Code Here


    editMotionCurve(propName, getEditingTitle(sender));
    enableControl(sender, false);
  }

  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(rootTabbedPane), owner.getErrorHandler(), envelope, true);
    dlg.setFlameToPreview(EnvelopeDialogFlamePreviewType.MOTION_CURVE, owner.getCurrFlame(), pCurve);
View Full Code Here

    y = new double[pEnvelope.getY().length];
    System.arraycopy(pEnvelope.getY(), 0, y, 0, y.length);
  }

  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;
  }
View Full Code Here

TOP

Related Classes of org.jwildfire.envelope.Envelope

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.