use of javax.swing.BoxLayout in project JMRI by JMRI.
the class WarrantFrame method makeFindRouteTabPanel.
private JPanel makeFindRouteTabPanel() {
JPanel tab1 = new JPanel();
tab1.setLayout(new BoxLayout(tab1, BoxLayout.LINE_AXIS));
tab1.add(Box.createHorizontalStrut(STRUT_SIZE));
JPanel topLeft = new JPanel();
topLeft.setLayout(new BoxLayout(topLeft, BoxLayout.PAGE_AXIS));
topLeft.add(makeBlockPanels());
topLeft.add(Box.createVerticalStrut(2 * STRUT_SIZE));
tab1.add(topLeft);
tab1.add(Box.createHorizontalStrut(STRUT_SIZE));
JPanel topRight = new JPanel();
topRight.setLayout(new BoxLayout(topRight, BoxLayout.LINE_AXIS));
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
panel.add(Box.createVerticalStrut(2 * STRUT_SIZE));
_calculateButton = new JButton(Bundle.getMessage("Calculate"));
_calculateButton.setMaximumSize(_calculateButton.getPreferredSize());
_calculateButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
calculate();
}
});
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
JPanel pp = new JPanel();
pp.setLayout(new FlowLayout(FlowLayout.CENTER));
pp.add(new JLabel(Bundle.getMessage("CalculateRoute")));
p.add(pp);
pp = new JPanel();
pp.setLayout(new FlowLayout(FlowLayout.CENTER));
pp.add(_calculateButton);
p.add(pp);
panel.add(p);
panel.add(Box.createVerticalStrut(2 * STRUT_SIZE));
_stopButton = new JButton(Bundle.getMessage("Stop"));
_stopButton.setMaximumSize(_stopButton.getPreferredSize());
_stopButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
stopRouteFinder();
}
});
int numBlocks = InstanceManager.getDefault(OBlockManager.class).getSystemNameList().size();
if (numBlocks / 6 > getDepth()) {
setDepth(numBlocks / 6);
}
panel.add(searchDepthPanel(true));
p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));
p.add(makeTextBoxPanel(true, _searchStatus, "SearchRoute", null));
_searchStatus.setEditable(false);
p.add(Box.createVerticalGlue());
panel.add(p);
_searchStatus.setBackground(Color.white);
_searchStatus.setEditable(false);
p = new JPanel();
pp = new JPanel();
pp.setLayout(new FlowLayout(FlowLayout.CENTER));
pp.add(_stopButton);
p.add(pp, BorderLayout.SOUTH);
panel.add(p);
panel.add(Box.createRigidArea(new Dimension(10, topLeft.getPreferredSize().height - panel.getPreferredSize().height)));
panel.add(Box.createVerticalStrut(STRUT_SIZE));
panel.add(Box.createVerticalGlue());
topRight.add(panel);
topRight.add(Box.createHorizontalStrut(STRUT_SIZE));
PickListModel pickListModel = PickListModel.oBlockPickModelInstance();
topRight.add(new JScrollPane(pickListModel.makePickTable()));
Dimension dim = topRight.getPreferredSize();
topRight.setMinimumSize(dim);
tab1.add(topRight);
tab1.add(Box.createHorizontalStrut(STRUT_SIZE));
return tab1;
}
use of javax.swing.BoxLayout in project JMRI by JMRI.
the class WarrantFrame method makeTopPanel.
private JPanel makeTopPanel() {
JPanel topPanel = new JPanel();
topPanel.setLayout(new BoxLayout(topPanel, BoxLayout.PAGE_AXIS));
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
panel.add(Box.createHorizontalStrut(2 * STRUT_SIZE));
panel.add(new JLabel(Bundle.getMessage("LabelSystemName")));
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
_sysNameBox = new JTextField(_warrant.getSystemName());
_sysNameBox.setBackground(Color.white);
_sysNameBox.setEditable(false);
panel.add(_sysNameBox);
panel.add(Box.createHorizontalStrut(2 * STRUT_SIZE));
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(new JLabel(Bundle.getMessage("LabelUserName")));
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
_userNameBox = new JTextField(_warrant.getUserName());
panel.add(_userNameBox);
panel.add(Box.createHorizontalStrut(2 * STRUT_SIZE));
topPanel.add(panel);
topPanel.add(Box.createVerticalStrut(STRUT_SIZE));
return topPanel;
}
use of javax.swing.BoxLayout in project JMRI by JMRI.
the class WarrantPreferencesPanel method interpretationPanel.
private JPanel interpretationPanel() {
_interpretation = WarrantPreferences.getDefault().getInterpretation();
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS));
ButtonGroup group = new ButtonGroup();
makeButton(buttonPanel, group, "percentNormal", "ToolTipPercentNormal", SignalSpeedMap.PERCENT_NORMAL);
makeButton(buttonPanel, group, "percentThrottle", "ToolTipPercentThrottle", SignalSpeedMap.PERCENT_THROTTLE);
makeButton(buttonPanel, group, "speedMph", "ToolTipSpeedMph", SignalSpeedMap.SPEED_MPH);
makeButton(buttonPanel, group, "speedKmph", "ToolTipSpeedKmph", SignalSpeedMap.SPEED_KMPH);
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
JPanel p = new JPanel();
JLabel label = new JLabel(Bundle.getMessage("LabelInterpretation"));
label.setToolTipText(Bundle.getMessage("ToolTipInterpretation"));
p.setToolTipText(Bundle.getMessage("ToolTipInterpretation"));
p.add(label);
panel.add(p);
panel.add(buttonPanel, Box.CENTER_ALIGNMENT);
return panel;
}
use of javax.swing.BoxLayout in project JMRI by JMRI.
the class WarrantFrame method makeSetPowerTabPanel.
private JPanel makeSetPowerTabPanel() {
JPanel tab2 = new JPanel();
tab2.setLayout(new BoxLayout(tab2, BoxLayout.PAGE_AXIS));
tab2.add(makeTabMidPanel());
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makeBorderedTrainPanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makeTypePanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makeSCParamPanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makeRecordPanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makeRunParmsPanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
panel.add(makePlaybackPanel());
panel.add(Box.createHorizontalStrut(STRUT_SIZE));
tab2.add(panel);
panel = new JPanel();
String status = getIdleMessage();
panel.add(makeTextBoxPanel(false, _statusBox, "Status", null));
_statusBox.setEditable(false);
_statusBox.setMinimumSize(new Dimension(300, _statusBox.getPreferredSize().height));
_statusBox.setMaximumSize(new Dimension(900, _statusBox.getPreferredSize().height));
panel.add(_statusBox);
setStatusText(status, Color.black);
tab2.add(panel);
return tab2;
}
use of javax.swing.BoxLayout in project JMRI by JMRI.
the class WarrantPreferencesPanel method initGUI.
private void initGUI() {
this.setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
// add(new JTitledSeparator(Bundle.getMessage("TitleWarrantPreferences")));
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.PAGE_AXIS));
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.PAGE_AXIS));
leftPanel.add(layoutScalePanel());
leftPanel.add(searchDepthPanel(true));
leftPanel.add(timeIncrementPanel(true));
leftPanel.add(throttleIncrementPanel(true));
leftPanel.add(throttleScalePanel(true));
rightPanel.add(speedNamesPanel());
rightPanel.add(Box.createGlue());
rightPanel.add(interpretationPanel());
rightPanel.add(Box.createGlue());
rightPanel.add(appearancePanel());
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.LINE_AXIS));
panel.add(leftPanel);
panel.add(rightPanel);
add(panel);
}
Aggregations