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);
}
Aggregations