Search in sources :

Example 6 with ControlPanel

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

the class DicomLoader method createControlPanel.

void createControlPanel() {
    panel = new ControlPanel("DICOM controls");
    fnf = new FileNameField("File or folder:", 30);
    fnf.getFileChooser().setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    fnf.getFileChooser().setCurrentDirectory(ArtisynthPath.getSrcRelativeFile(this, "data/"));
    fnf.setName("dicom_path");
    panel.addWidget(fnf);
    fnp = new StringField("File regex:", 30);
    fnp.setValue(".*");
    panel.addWidget(fnp);
    fns = new BooleanSelector("Subdirectories", true);
    panel.addWidget(fns);
    // panel for full-width button
    JPanel jpanel = new JPanel();
    jpanel.setLayout(new GridLayout());
    panel.addWidget(jpanel);
    JButton button = new JButton("Load");
    button.setActionCommand("load");
    button.addActionListener(this);
    jpanel.add(button);
    button = new JButton("Add Plane");
    button.setActionCommand("plane");
    button.addActionListener(this);
    jpanel.add(button);
    addControlPanel(panel);
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BooleanSelector(maspack.widgets.BooleanSelector) ControlPanel(artisynth.core.gui.ControlPanel) StringField(maspack.widgets.StringField) JButton(javax.swing.JButton) FileNameField(maspack.widgets.FileNameField)

Example 7 with ControlPanel

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

the class ArticulatedFem method addControlPanel.

protected void addControlPanel(MechModel mech) {
    myControlPanel = new ControlPanel("options", "");
    myControlPanel.addWidget(mech, "integrator");
    myControlPanel.addWidget(mech, "matrixSolver");
    myControlPanel.addWidget(mech, "maxStepSize");
    addControlPanel(myControlPanel);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 8 with ControlPanel

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

the class RootModel method postscan.

/**
 * {@inheritDoc}
 */
public void postscan(Deque<ScanToken> tokens, CompositeComponent ancestor) throws IOException {
    super.postscan(tokens, ancestor);
    for (ControlPanel cp : myControlPanels) {
        cp.pack();
        cp.setVisible(true);
    }
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 9 with ControlPanel

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

the class FemBeamTest method attach.

@Override
public void attach(DriverInterface driver) {
    super.attach(driver);
    ControlPanel panel = new ControlPanel("material controls");
    panel.addWidget(this, "material");
    panel.pack();
    addControlPanel(panel);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel)

Example 10 with ControlPanel

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

the class SingleQuadhex method createControlPanel.

private void createControlPanel(FemModel3d mod) {
    ControlPanel panel = new ControlPanel("options");
    FemControlPanel.addFem3dControls(panel, mod, mod);
    panel.pack();
    addControlPanel(panel);
    panel.setVisible(true);
    Main.getMain().arrangeControlPanels(this);
}
Also used : ControlPanel(artisynth.core.gui.ControlPanel) FemControlPanel(artisynth.core.gui.FemControlPanel)

Aggregations

ControlPanel (artisynth.core.gui.ControlPanel)35 FemControlPanel (artisynth.core.gui.FemControlPanel)10 Point (artisynth.core.mechmodels.Point)3 File (java.io.File)3 IOException (java.io.IOException)3 InternalErrorException (maspack.util.InternalErrorException)3 LabeledComponentBase (maspack.widgets.LabeledComponentBase)3 CollisionManager (artisynth.core.mechmodels.CollisionManager)2 MechModel (artisynth.core.mechmodels.MechModel)2 RigidBody (artisynth.core.mechmodels.RigidBody)2 WayPoint (artisynth.core.probes.WayPoint)2 RootModel (artisynth.core.workspace.RootModel)2 BooleanSelector (maspack.widgets.BooleanSelector)2 Main (artisynth.core.driver.Main)1 FemModel3d (artisynth.core.femmodels.FemModel3d)1 FemMuscleModel (artisynth.core.femmodels.FemMuscleModel)1 MuscleBundle (artisynth.core.femmodels.MuscleBundle)1 LinearAxialMuscle (artisynth.core.materials.LinearAxialMuscle)1 AxialSpring (artisynth.core.mechmodels.AxialSpring)1 Muscle (artisynth.core.mechmodels.Muscle)1