Search in sources :

Example 6 with OptionPanel

use of maspack.widgets.OptionPanel 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 7 with OptionPanel

use of maspack.widgets.OptionPanel 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 8 with OptionPanel

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

the class NumericProbeRangeSelectorDialog method commonProbeRangeSelectorInit.

private void commonProbeRangeSelectorInit(NumericProbePanel DisplayProbe) {
    display = DisplayProbe;
    super.setModal(true);
    double[] range = display.getDisplayRange();
    minYRange = range[0];
    maxYRange = range[1];
    autoRanging = display.isAutoRanging();
    getContentPane().setLayout(new BoxLayout(getContentPane(), BoxLayout.Y_AXIS));
    myPanel = new LabeledComponentPanel();
    myPanel.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(myPanel);
    generateWidgets(myPanel);
    JSeparator sep = new JSeparator();
    sep.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(sep);
    OptionPanel options = new OptionPanel("OK Cancel", this);
    options.setAlignmentX(Component.CENTER_ALIGNMENT);
    getContentPane().add(options);
    pack();
    Point offset = display.getLocationOnScreen();
    this.setLocation(offset.x, offset.y);
    // this.setSize(new Dimension(350, 125));
    // this.setMinimumSize(new Dimension(350, 125));
    setVisible(true);
}
Also used : BoxLayout(javax.swing.BoxLayout) Point(java.awt.Point) LabeledComponentPanel(maspack.widgets.LabeledComponentPanel) JSeparator(javax.swing.JSeparator) OptionPanel(maspack.widgets.OptionPanel)

Aggregations

OptionPanel (maspack.widgets.OptionPanel)8 BooleanSelector (maspack.widgets.BooleanSelector)3 LabeledComponentPanel (maspack.widgets.LabeledComponentPanel)3 BoxLayout (javax.swing.BoxLayout)2 JSeparator (javax.swing.JSeparator)2 DoubleField (maspack.widgets.DoubleField)2 StringField (maspack.widgets.StringField)2 Main (artisynth.core.driver.Main)1 PropertyField (artisynth.core.gui.widgets.PropertyField)1 CompositeComponent (artisynth.core.modelbase.CompositeComponent)1 ModelComponent (artisynth.core.modelbase.ModelComponent)1 MutableCompositeComponent (artisynth.core.modelbase.MutableCompositeComponent)1 Component (java.awt.Component)1 Container (java.awt.Container)1 Dimension (java.awt.Dimension)1 Insets (java.awt.Insets)1 Point (java.awt.Point)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 JComponent (javax.swing.JComponent)1