Search in sources :

Example 16 with DoubleField

use of maspack.widgets.DoubleField in project artisynth_core by artisynth.

the class SetCollisionsDialog method createDisplay.

protected void createDisplay() {
    myEnabledField = new BooleanSelector("enabled", false);
    myEnabledField.setVoidValueEnabled(true);
    myEnabledField.addValueChangeListener(this);
    addWidget(myEnabledField);
    myFrictionField = new DoubleField("friction", 0);
    myFrictionField.setVoidValueEnabled(true);
    myFrictionField.setRange(0, Double.POSITIVE_INFINITY);
    myFrictionField.addValueChangeListener(this);
    addWidget(myFrictionField);
    addWidget(new JSeparator());
    OptionPanel panel = new OptionPanel("Set Cancel", this);
    addWidget(panel);
    mySetButton = panel.getButton("Set");
    pack();
}
Also used : BooleanSelector(maspack.widgets.BooleanSelector) DoubleField(maspack.widgets.DoubleField) OptionPanel(maspack.widgets.OptionPanel)

Example 17 with DoubleField

use of maspack.widgets.DoubleField in project artisynth_core by artisynth.

the class DefaultCollisionsDialog method createDisplay.

protected void createDisplay() {
    myRREnabled = new BooleanSelector("rigid-rigid", false);
    myRDEnabled = new BooleanSelector("rigid-deformable", false);
    myDDEnabled = new BooleanSelector("deformable-deformable", false);
    myDSEnabled = new BooleanSelector("deformable-self", false);
    myRRFriction = new DoubleField("", 0);
    myRDFriction = new DoubleField("", 0);
    myDDFriction = new DoubleField("", 0);
    myDSFriction = new DoubleField("", 0);
    myRREnabled.addMajorComponent(myRRFriction);
    myRDEnabled.addMajorComponent(myRDFriction);
    myDDEnabled.addMajorComponent(myDDFriction);
    myDSEnabled.addMajorComponent(myDSFriction);
    addWidget(myRREnabled);
    addWidget(myRDEnabled);
    addWidget(myDDEnabled);
    addWidget(myDSEnabled);
    addWidget(new JSeparator());
    addWidgetHeader(myRREnabled);
    OptionPanel panel = new OptionPanel("Set Cancel", this);
    addWidget(panel);
    mySetButton = panel.getButton("Set");
    pack();
}
Also used : BooleanSelector(maspack.widgets.BooleanSelector) DoubleField(maspack.widgets.DoubleField) OptionPanel(maspack.widgets.OptionPanel)

Example 18 with DoubleField

use of maspack.widgets.DoubleField in project artisynth_core by artisynth.

the class DefaultCollisionsDialog method updateSettings.

private void updateSettings(LinkedHashMap<CollidablePair, CollisionBehavior> settings, BooleanSelector enabledField, Collidable col0, Collidable col1) {
    DoubleField frictionField = (DoubleField) enabledField.getMajorComponent(2);
    boolean enabled = enabledField.getBooleanValue();
    double friction = frictionField.getDoubleValue();
    CollisionBehavior behavior = new CollisionBehavior(enabled, friction);
    settings.put(new CollidablePair(col0, col1), behavior);
}
Also used : DoubleField(maspack.widgets.DoubleField)

Example 19 with DoubleField

use of maspack.widgets.DoubleField in project artisynth_core by artisynth.

the class NumericProbeRangeSelectorDialog method generateWidgets.

public void generateWidgets(LabeledComponentPanel panel) {
    maxYField = new DoubleField("Display Maximum (y) :", maxYRange, "%8.3f");
    maxYField.addValueChangeListener(this);
    panel.addWidget(maxYField);
    minYField = new DoubleField("Display Minimum (y) :", minYRange, "%8.3f");
    minYField.addValueChangeListener(this);
    panel.addWidget(minYField);
    autoRangeField = new BooleanSelector("Auto range: ", autoRanging);
    autoRangeField.addValueChangeListener(this);
    panel.addWidget(autoRangeField);
}
Also used : BooleanSelector(maspack.widgets.BooleanSelector) DoubleField(maspack.widgets.DoubleField)

Aggregations

DoubleField (maspack.widgets.DoubleField)19 BooleanSelector (maspack.widgets.BooleanSelector)4 Dimension (java.awt.Dimension)3 JLabel (javax.swing.JLabel)3 IntegerField (maspack.widgets.IntegerField)3 VectorField (maspack.widgets.VectorField)3 SelectableComponentPanel (artisynth.core.gui.SelectableComponentPanel)2 ModelComponent (artisynth.core.modelbase.ModelComponent)2 JButton (javax.swing.JButton)2 JScrollPane (javax.swing.JScrollPane)2 StringHolder (maspack.util.StringHolder)2 OptionPanel (maspack.widgets.OptionPanel)2 ValueChangeEvent (maspack.widgets.ValueChangeEvent)2 ValueCheckListener (maspack.widgets.ValueCheckListener)2 MuscleElementDesc (artisynth.core.femmodels.MuscleElementDesc)1 ExcitationComponent (artisynth.core.mechmodels.ExcitationComponent)1 MotionTargetComponent (artisynth.core.mechmodels.MotionTargetComponent)1 WayPoint (artisynth.core.probes.WayPoint)1 File (java.io.File)1 BoxLayout (javax.swing.BoxLayout)1