use of maspack.widgets.DoubleField in project artisynth_core by artisynth.
the class MenuBarHandler method createTimeDisplay.
private DoubleField createTimeDisplay() {
DoubleField display = new DoubleField("", 0, "%9.5f");
display.setToolTipText("current time");
display.getTextField().setToolTipText("current time");
display.setEnabledAll(false);
display.setColumns(7);
return display;
}
use of maspack.widgets.DoubleField in project artisynth_core by artisynth.
the class ExcitationTargetAgent method createTargetList.
protected void createTargetList() {
myTargetPanel = new SelectableComponentPanel();
myTargetPanel.setSelectionManager(mySelectionManager);
myTargetPanel.setSpacing(0);
for (int i = 0; i < myExciter.numTargets(); i++) {
DoubleField widget = createTargetWidget(myExciter.getTarget(i), myExciter.getGain(i));
myTargetPanel.addWidget(widget);
myTargetPanel.mapWidgetToComponent(widget, myExciter.getTarget(i));
}
myTargetPanel.addMouseListener(new ListMouseHandler());
JLabel label = new JLabel("Existing targets and gains:");
GuiUtils.setItalicFont(label);
addToContentPane(label);
myListScroller = new JScrollPane(myTargetPanel);
myListScroller.setPreferredSize(new Dimension(280, 150));
myListScroller.setMinimumSize(new Dimension(280, 150));
addToContentPane(myListScroller);
}
use of maspack.widgets.DoubleField in project artisynth_core by artisynth.
the class MotionTargetComponentAgent method createTargetList.
protected void createTargetList() {
myTargetPanel = new SelectableComponentPanel();
myTargetPanel.setSelectionManager(mySelectionManager);
myTargetPanel.setSpacing(0);
for (int i = 0; i < myController.getMotionSources().size(); i++) {
DoubleField widget = createTargetWidget(myController.getMotionSources().get(i), myController.getMotionTargetWeights().get(i));
myTargetPanel.addWidget(widget);
myTargetPanel.mapWidgetToComponent(widget, myController.getMotionSources().get(i));
}
myTargetPanel.addMouseListener(new ListMouseHandler());
JLabel label = new JLabel("Existing targets and weights:");
GuiUtils.setItalicFont(label);
addToContentPane(label);
myListScroller = new JScrollPane(myTargetPanel);
myListScroller.setPreferredSize(new Dimension(480, 150));
myListScroller.setMinimumSize(new Dimension(480, 150));
addToContentPane(myListScroller);
}
use of maspack.widgets.DoubleField in project artisynth_core by artisynth.
the class MotionTargetComponentAgent method selectionChanged.
public void selectionChanged(SelectionEvent e) {
ModelComponent c = e.getLastAddedComponent();
if (isValidTarget(c)) {
MotionTargetComponent comp = (MotionTargetComponent) c;
if (myState == State.SelectingTargets && !myController.getMotionSources().contains(comp) && !myController.getMotionTargets().contains(comp)) {
myController.addMotionTarget(comp, 1.0);
DoubleField widget = createTargetWidget(comp, 1.0);
myTargetPanel.addWidget(widget);
myTargetPanel.mapWidgetToComponent(widget, comp);
myTargetPanel.revalidate();
myTargetPanel.repaint();
}
// else if (myExciter.findTarget(ex) != -1)
// { mySelectedTargets.add (ex);
// }
}
}
use of maspack.widgets.DoubleField in project artisynth_core by artisynth.
the class MotionTargetComponentAgent method createTargetWidget.
DoubleField createTargetWidget(MotionTargetComponent target, double gain) {
String name = ComponentUtils.getPathName(myAncestor, target);
DoubleField field = new DoubleField(name, gain);
field.addValueChangeListener(new WeightHandler(target));
field.setLabelStretchable(true);
field.setStretchable(true);
return field;
}
Aggregations