use of jmri.jmrit.picker.PickPanel in project JMRI by JMRI.
the class DetectionPanel method openPickList.
void openPickList() {
_pickFrame = new JFrame();
JPanel content = new JPanel();
content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
JPanel blurb = new JPanel();
blurb.setLayout(new BoxLayout(blurb, BoxLayout.Y_AXIS));
blurb.add(Box.createVerticalStrut(ItemPalette.STRUT_SIZE));
blurb.add(new JLabel(Bundle.getMessage("DragOccupancyName", Bundle.getMessage("DetectionSensor"))));
blurb.add(new JLabel(Bundle.getMessage("DragErrorName", Bundle.getMessage("ErrorSensor"))));
blurb.add(Box.createVerticalStrut(ItemPalette.STRUT_SIZE));
JPanel panel = new JPanel();
panel.add(blurb);
content.add(panel);
PickListModel[] models = { PickListModel.oBlockPickModelInstance(), PickListModel.sensorPickModelInstance() };
content.add(new PickPanel(models));
_pickFrame.setContentPane(content);
_pickFrame.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
closePickList();
}
});
_pickFrame.setLocationRelativeTo(this);
_pickFrame.toFront();
_pickFrame.setVisible(true);
_pickFrame.pack();
_openPicklistButton.setText(Bundle.getMessage("ClosePicklist"));
}
use of jmri.jmrit.picker.PickPanel in project JMRI by JMRI.
the class EditCircuitFrame method openPickList.
void openPickList() {
_pickFrame = new JFrame();
JPanel content = new JPanel();
content.setLayout(new BoxLayout(content, BoxLayout.Y_AXIS));
JPanel blurb = new JPanel();
blurb.setLayout(new BoxLayout(blurb, BoxLayout.Y_AXIS));
blurb.add(Box.createVerticalStrut(ItemPalette.STRUT_SIZE));
blurb.add(new JLabel(Bundle.getMessage("DragOccupancyName", Bundle.getMessage("DetectionSensor"))));
blurb.add(new JLabel(Bundle.getMessage("DragErrorName", Bundle.getMessage("ErrorSensor"))));
blurb.add(Box.createVerticalStrut(ItemPalette.STRUT_SIZE));
JPanel panel = new JPanel();
panel.add(blurb);
content.add(panel);
PickListModel[] models = { PickListModel.sensorPickModelInstance() };
content.add(new PickPanel(models));
_pickFrame.setContentPane(content);
_pickFrame.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent e) {
closePickList();
}
});
_pickFrame.setLocationRelativeTo(this);
_pickFrame.toFront();
_pickFrame.setVisible(true);
_pickFrame.pack();
_openPicklistButton.setText(Bundle.getMessage("ClosePicklist"));
}