Search in sources :

Example 1 with NumericProbePanel

use of artisynth.core.gui.NumericProbePanel in project artisynth_core by artisynth.

the class ProbeInfo method expandProbe.

public void expandProbe() {
    int width = myDisplayArea.getWidth();
    int height = GuiStorage.PROBE_DETAIL_HEIGHT;
    if (getProbe() instanceof Displayable) {
        Displayable dispProbe = (Displayable) getProbe();
        JPanel display = dispProbe.getDisplay(width, height, false);
        if (display instanceof NumericProbePanel && getProbe() instanceof NumericProbeBase) {
            smallDisplay = (NumericProbePanel) display;
        }
        myDisplayArea.add(display);
    }
    myLabel.setBorder(BorderFactory.createMatteBorder(0, 1, 1, 1, Color.BLACK));
    myController.updateComponentSizes();
    updateProbeDisplays();
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel) Displayable(artisynth.core.gui.Displayable) NumericProbeBase(artisynth.core.probes.NumericProbeBase) Point(java.awt.Point) WayPoint(artisynth.core.probes.WayPoint)

Example 2 with NumericProbePanel

use of artisynth.core.gui.NumericProbePanel in project artisynth_core by artisynth.

the class NumericProbeBase method getDisplay.

public JPanel getDisplay(int w, int h, boolean isLargeDisplay) {
    // track is only needed for large display
    NumericProbePanel display;
    if (isLargeDisplay) {
        display = new NumericProbePanel(this);
        display.setLargeDisplay(true);
        // reset for large display
        display.setDefaultDomain();
        myDisplays.add(display);
    } else {
        if (mySmallDisplay == null) {
            mySmallDisplay = new NumericProbePanel(this);
            myDisplays.add(mySmallDisplay);
        }
        display = mySmallDisplay;
    }
    display.setDisplaySize(w, h);
    return display;
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel)

Example 3 with NumericProbePanel

use of artisynth.core.gui.NumericProbePanel in project artisynth_core by artisynth.

the class NumericProbeBase method applyDefaultDisplayRanges.

public void applyDefaultDisplayRanges() {
    for (NumericProbePanel display : myDisplays) {
        display.setAutoRange();
        display.resetDisplay();
    }
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel)

Example 4 with NumericProbePanel

use of artisynth.core.gui.NumericProbePanel in project artisynth_core by artisynth.

the class NumericProbeBase method clone.

public Object clone() throws CloneNotSupportedException {
    NumericProbeBase probe = (NumericProbeBase) super.clone();
    probe.myNumericList = (NumericList) myNumericList.clone();
    probe.myInterpolation = new Interpolation(myInterpolation);
    if (myVariables != null) {
        // make a deep copy of the variable list
        probe.myVariables = new LinkedHashMap<String, NumericProbeVariable>();
        for (Map.Entry<String, NumericProbeVariable> entry : myVariables.entrySet()) {
            probe.myVariables.put(entry.getKey(), new NumericProbeVariable(entry.getValue()));
        }
    }
    if (myDrivers != null) {
        probe.myDrivers = new ArrayList<NumericProbeDriver>();
        for (NumericProbeDriver oldDriver : myDrivers) {
            NumericProbeDriver driver = new NumericProbeDriver();
            try {
                driver.setExpression(oldDriver.getExpression(), probe.myVariables);
            } catch (Exception e) {
                throw new InternalErrorException("Illegal driver expression '" + oldDriver.getExpression() + "': " + e.getMessage());
            }
            probe.myDrivers.add(driver);
        }
    }
    if (myPropList != null) {
        probe.myPropList = (ArrayList<Property>) myPropList.clone();
    }
    if (myConverters != null) {
        probe.myConverters = new NumericConverter[myConverters.length];
        for (int i = 0; i < myConverters.length; i++) {
            probe.myConverters[i] = new NumericConverter(myConverters[i]);
        }
    }
    // clear the displays because these are lazily allocated and
    // we don't want them reused
    probe.mySmallDisplay = null;
    probe.myDisplays = new ArrayList<NumericProbePanel>();
    // attached file should also not be brought into clone
    probe.myAttachedFileName = null;
    return probe;
}
Also used : NumericProbePanel(artisynth.core.gui.NumericProbePanel) PyString(org.python.core.PyString) IOException(java.io.IOException) Interpolation(maspack.interpolation.Interpolation) NumericConverter(maspack.properties.NumericConverter) PyStringMap(org.python.core.PyStringMap) Property(maspack.properties.Property)

Aggregations

NumericProbePanel (artisynth.core.gui.NumericProbePanel)4 Displayable (artisynth.core.gui.Displayable)1 NumericProbeBase (artisynth.core.probes.NumericProbeBase)1 WayPoint (artisynth.core.probes.WayPoint)1 Point (java.awt.Point)1 IOException (java.io.IOException)1 Interpolation (maspack.interpolation.Interpolation)1 NumericConverter (maspack.properties.NumericConverter)1 Property (maspack.properties.Property)1 PyString (org.python.core.PyString)1 PyStringMap (org.python.core.PyStringMap)1