use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class HydrostatModel method createExcitersPanel.
public void createExcitersPanel(String[] names) {
exciterPanel = new ControlPanel("Exciters", "LiveUpdate");
for (int i = 0; i < names.length; i++) {
LabeledComponentBase c = exciterPanel.addWidget(names[i], this, "exciters/" + names[i] + ":excitation", 0.0, 1.0);
if (c != null)
c.setLabelFontColor(Color.getHSBColor((float) i / names.length, 1f, 1f));
}
exciterPanel.pack();
exciterPanel.setVisible(true);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class SinglePyramid 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);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class SingleQuadwedge 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);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class RootModel method loadControlPanel.
public ControlPanel loadControlPanel(String filename) {
ControlPanel panel = null;
try {
panel = (ControlPanel) ComponentUtils.loadComponent(new File(filename), this, ControlPanel.class);
} catch (Exception e) {
System.out.println("Error reading control panel file " + filename + ", error=" + e.getMessage());
}
if (panel != null && panel.numWidgets() > 0) {
// panel.pack();
// panel.setVisible (true);
myControlPanels.add(panel);
locateControlPanel(panel);
}
return panel;
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class SimpleCollide method createAndAddControlPanel.
ControlPanel createAndAddControlPanel(String name, ModelComponent comp) {
ControlPanel panel = new ControlPanel(name);
if (comp instanceof FemModel3d) {
panel.addWidget(comp, "material");
panel.addWidget(comp, "density");
panel.addWidget(comp, "incompressible");
panel.addWidget(comp, "volume");
} else if (comp instanceof RigidBody) {
panel.addWidget(comp, "position");
panel.addWidget(comp, "orientation");
} else {
throw new InternalErrorException("No control panel code for components of type " + comp.getClass());
}
ControlPanel existingPanel = getControlPanels().get(name);
if (existingPanel != null) {
int idx = getControlPanels().indexOf(existingPanel);
removeControlPanel(existingPanel);
existingPanel.dispose();
addControlPanel(panel, idx);
Main.getMain().arrangeControlPanels(this);
} else {
addControlPanel(panel);
}
return panel;
}
Aggregations