Search in sources :

Example 1 with PickPanel

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"));
}
Also used : JPanel(javax.swing.JPanel) PickPanel(jmri.jmrit.picker.PickPanel) PickListModel(jmri.jmrit.picker.PickListModel) JFrame(javax.swing.JFrame) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel)

Example 2 with PickPanel

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"));
}
Also used : JPanel(javax.swing.JPanel) PickPanel(jmri.jmrit.picker.PickPanel) PickListModel(jmri.jmrit.picker.PickListModel) JFrame(javax.swing.JFrame) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel)

Aggregations

BoxLayout (javax.swing.BoxLayout)2 JFrame (javax.swing.JFrame)2 JLabel (javax.swing.JLabel)2 JPanel (javax.swing.JPanel)2 PickListModel (jmri.jmrit.picker.PickListModel)2 PickPanel (jmri.jmrit.picker.PickPanel)2