Search in sources :

Example 1 with SelectableComponentPanel

use of artisynth.core.gui.SelectableComponentPanel 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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) SelectableComponentPanel(artisynth.core.gui.SelectableComponentPanel) DoubleField(maspack.widgets.DoubleField)

Example 2 with SelectableComponentPanel

use of artisynth.core.gui.SelectableComponentPanel 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);
}
Also used : JScrollPane(javax.swing.JScrollPane) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) SelectableComponentPanel(artisynth.core.gui.SelectableComponentPanel) DoubleField(maspack.widgets.DoubleField)

Aggregations

SelectableComponentPanel (artisynth.core.gui.SelectableComponentPanel)2 Dimension (java.awt.Dimension)2 JLabel (javax.swing.JLabel)2 JScrollPane (javax.swing.JScrollPane)2 DoubleField (maspack.widgets.DoubleField)2