Search in sources :

Example 1 with ClassField

use of artisynth.core.gui.widgets.ClassField in project artisynth_core by artisynth.

the class SelectComponentPanelHandler method createPanel.

public void createPanel() {
    myPanel = new JPanel();
    myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.X_AXIS));
    ImageIcon comboSelectIcon = GuiUtils.loadIcon(SelectableComponentPanel.class, "icon/downArrow.png");
    mySelectFilterButton = ButtonCreator.createIconicButton(comboSelectIcon, "Set Filter", "Set selection filter", true, false, null);
    componentFilter = new ClassField("", ClassField.All, 15);
    componentFilter.getTextField().setHorizontalAlignment(JTextField.RIGHT);
    componentFilter.setSpacing(0);
    componentFilter.getTextField().addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent e) {
            if (e.getModifiersEx() == ButtonMasks.getContextMenuMask()) {
                showFilterPopup();
            }
        }
    });
    componentFilter.addValueChangeListener(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent e) {
            doSetComponentFilter((Class) e.getValue());
        }
    });
    GuiUtils.setFixedSize(mySelectFilterButton, 18, 18);
    mySelectFilterButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent e) {
            if (e.getButton() == MouseEvent.BUTTON1) {
                showFilterPopup();
            }
        }
    });
    myComponentField = new ComponentField("", 30, myMain);
    // GuiUtils.setFixedSize (parentBtn, 24, 24);
    myPanel.add(Box.createRigidArea(new Dimension(36, 20)));
    myPanel.add(mySelectFilterButton);
    myPanel.add(componentFilter);
    myPanel.add(myComponentField);
    // myPanel.add(componentName);
    // //myPanel.add(selectParent);
    // myPanel.add(parentBtn);
    myFrame.add(myPanel, BorderLayout.SOUTH);
}
Also used : JPanel(javax.swing.JPanel) ImageIcon(javax.swing.ImageIcon) ValueChangeEvent(maspack.widgets.ValueChangeEvent) MouseEvent(java.awt.event.MouseEvent) ValueChangeListener(maspack.widgets.ValueChangeListener) ComponentField(artisynth.core.gui.widgets.ComponentField) BoxLayout(javax.swing.BoxLayout) MouseAdapter(java.awt.event.MouseAdapter) Dimension(java.awt.Dimension) ClassField(artisynth.core.gui.widgets.ClassField)

Aggregations

ClassField (artisynth.core.gui.widgets.ClassField)1 ComponentField (artisynth.core.gui.widgets.ComponentField)1 Dimension (java.awt.Dimension)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 BoxLayout (javax.swing.BoxLayout)1 ImageIcon (javax.swing.ImageIcon)1 JPanel (javax.swing.JPanel)1 ValueChangeEvent (maspack.widgets.ValueChangeEvent)1 ValueChangeListener (maspack.widgets.ValueChangeListener)1