use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class FemMuscleBeams method createControlPanel.
protected ControlPanel createControlPanel() {
MechModel mech = (MechModel) models().get("mech");
FemMuscleModel beamFibres = (FemMuscleModel) (mech.models().get("Fibre beam"));
FemMuscleModel beamMaterial = (FemMuscleModel) (mech.models().get("Material beam"));
ControlPanel panel = new ControlPanel("Muscle controls");
panel.addLabel("Fibre beam:");
for (MuscleBundle mb : beamFibres.getMuscleBundles()) {
LabeledComponentBase comp = panel.addWidget(mb.getName(), mb, "excitation");
comp.setLabelFontColor(mb.getRenderProps().getLineColor());
}
for (MuscleExciter mc : beamFibres.getMuscleExciters()) {
panel.addWidget(mc.getName(), mc, "excitation");
}
panel.addWidget(new JSeparator());
panel.addLabel("Material beam:");
for (MuscleBundle mb : beamMaterial.getMuscleBundles()) {
LabeledComponentBase comp = panel.addWidget(mb.getName(), mb, "excitation");
comp.setLabelFontColor(mb.getRenderProps().getLineColor());
}
for (MuscleExciter mc : beamMaterial.getMuscleExciters()) {
panel.addWidget(mc.getName(), mc, "excitation");
}
return panel;
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class MenuBarHandler method doAddControlPanel.
/**
* add a control panel to the model
*/
private void doAddControlPanel() {
RootModel root = myMain.getRootModel();
int number = root.getControlPanels().nextComponentNumber();
ControlPanel panel = new ControlPanel("panel " + number, "LiveUpdate Close");
GuiUtils.locateVertically(panel.getFrame(), myMain.getFrame(), GuiUtils.CENTER);
GuiUtils.locateHorizontally(panel.getFrame(), myMain.getFrame(), GuiUtils.RIGHT);
root.addControlPanel(panel);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class InverseManager method isInversePanelVisible.
public static boolean isInversePanelVisible() {
Main main = Main.getMain();
ControlPanel inversePanel = main.getInverseManager().inverseControlPanel;
return (inversePanel != null);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class FemBeamMech method addControlPanel.
public void addControlPanel(MechModel mechMod, FemModel3d femMod) {
myControlPanel = new ControlPanel("options", "");
FemControlPanel.addFemControls(myControlPanel, femMod, mechMod);
addControlPanel(myControlPanel);
}
use of artisynth.core.gui.ControlPanel in project artisynth_core by artisynth.
the class FemMuscleDemo method createMusclePanel.
public void createMusclePanel() {
ControlPanel myControlPanel = new ControlPanel("options", "LiveUpdate");
FemControlPanel.addMuscleControls(myControlPanel, tissue, myModel);
myControlPanel.addWidget(tissue, "profile");
ComponentList<MuscleBundle> muscles = ((FemMuscleModel) tissue).getMuscleBundles();
for (int i = 0; i < muscles.size(); ++i) {
DoubleFieldSlider slider = (DoubleFieldSlider) myControlPanel.addWidget("activation [N per Muscle]", this, "models/FemBeam/models/fem/bundles/" + i + ":excitation", 0, 1);
slider.setRoundingTolerance(0.00001);
slider.getLabel().setForeground(getMuscleColor(i));
BooleanSelector checkBox = (BooleanSelector) PropertyWidget.create("", muscles.get(i), "renderProps.visible");
checkBox.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent e) {
rerender();
}
});
slider.add(checkBox);
}
for (int i = 0; i < muscles.size(); ++i) {
BooleanSelector selector = (BooleanSelector) myControlPanel.addWidget("fibres active", this, "models/FemBeam/models/fem/bundles/" + i + ":fibresActive");
selector.getLabel().setForeground(getMuscleColor(i));
BooleanSelector checkBox = (BooleanSelector) PropertyWidget.create("", muscles.get(i).getFibres(), "renderProps.visible");
checkBox.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent e) {
rerender();
}
});
selector.add(checkBox);
}
addControlPanel(myControlPanel);
}
Aggregations