Search in sources :

Example 1 with Rectangle2d

use of maspack.geometry.Rectangle2d in project artisynth_core by artisynth.

the class RectangleField method textToValue.

public Object textToValue(String text, BooleanHolder corrected, StringHolder errMsg) {
    corrected.value = false;
    Object value = super.textToValue(text, corrected, errMsg);
    if (value == Property.IllegalValue) {
        return Property.IllegalValue;
    }
    if (value instanceof VectorNd) {
        VectorNd tmp = (VectorNd) value;
        value = new Rectangle2d(tmp.get(0), tmp.get(1), tmp.get(2), tmp.get(3));
    }
    return validValue(value, errMsg);
}
Also used : VectorNd(maspack.matrix.VectorNd) Rectangle2d(maspack.geometry.Rectangle2d)

Example 2 with Rectangle2d

use of maspack.geometry.Rectangle2d in project artisynth_core by artisynth.

the class ColorBar method setDefaults.

@Override
protected void setDefaults() {
    setFont(new Font(defaultFontName, 0, defaultFontSize));
    myRenderProps = createDefaultRenderProps();
    hAlignment = defaultHAlignment;
    vAlignment = defaultVAlignment;
    myTextSize = defaultTextSize;
    myFontSize = defaultFontSize;
    myLoc = new Rectangle2d(defaultLoc);
    myColorMap = defaultColorMap;
    myValueRange = new DoubleInterval(defaultInterval);
    nBarDivisions = defaultBarDivisions;
    myTickFractions = new Vector2d(defaultTickFraction);
    myLabelPos = new VectorNd(0);
    myLabelText = new ArrayList<String>();
    myTextOffset = new Vector2d(defaultTextOffset);
    myNumberFormat = new NumberFormat(defaultNumberFormat);
    myRenderObject = null;
    myRenderObjectRebuildRequest = true;
}
Also used : Vector2d(maspack.matrix.Vector2d) Rectangle2d(maspack.geometry.Rectangle2d) VectorNd(maspack.matrix.VectorNd) DoubleInterval(maspack.util.DoubleInterval) Font(java.awt.Font) NumberFormat(maspack.util.NumberFormat)

Aggregations

Rectangle2d (maspack.geometry.Rectangle2d)2 VectorNd (maspack.matrix.VectorNd)2 Font (java.awt.Font)1 Vector2d (maspack.matrix.Vector2d)1 DoubleInterval (maspack.util.DoubleInterval)1 NumberFormat (maspack.util.NumberFormat)1