Add more info in status bar.

This commit is contained in:
Holt59 2018-02-25 22:37:34 +01:00
parent b3aaaf8d10
commit 791ea13d5e

View File

@ -113,7 +113,7 @@ public class MainWindow extends JFrame {
private ArrayList<JMenuItem> graphLockItems = new ArrayList<JMenuItem>(); private ArrayList<JMenuItem> graphLockItems = new ArrayList<JMenuItem>();
// Label containing the map ID of the current graph. // Label containing the map ID of the current graph.
private JLabel mapIdPanel; private JLabel graphInfoPanel;
// Thread information // Thread information
private Timer threadTimer; private Timer threadTimer;
@ -489,12 +489,13 @@ public class MainWindow extends JFrame {
// Save file path. // Save file path.
graphFilePath = path; graphFilePath = path;
graphInfoPanel.setText(
String.format("Map ID: %#x, %d nodes", graph.getMapId(), graph.getNodes().size()));
drawGraph(); drawGraph();
for (JMenuItem item: graphLockItems) { for (JMenuItem item: graphLockItems) {
item.setEnabled(true); item.setEnabled(true);
} }
mapIdPanel.setText("Map ID: 0x" + Integer.toHexString(graph.getMapId()));
} }
}, false); }, false);
} }
@ -662,13 +663,14 @@ public class MainWindow extends JFrame {
private JPanel createStatusBar() { private JPanel createStatusBar() {
// create the status bar panel and shove it down the bottom of the frame // create the status bar panel and shove it down the bottom of the frame
JPanel statusPanel = new JPanel(); JPanel statusPanel = new JPanel();
statusPanel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY)); statusPanel.setBorder(new CompoundBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY),
new EmptyBorder(0, 15, 0, 15)));
statusPanel.setPreferredSize(new Dimension(getWidth(), 38)); statusPanel.setPreferredSize(new Dimension(getWidth(), 38));
statusPanel.setLayout(new BorderLayout()); statusPanel.setLayout(new BorderLayout());
mapIdPanel = new JLabel(); graphInfoPanel = new JLabel();
mapIdPanel.setHorizontalAlignment(SwingConstants.LEFT); graphInfoPanel.setHorizontalAlignment(SwingConstants.LEFT);
statusPanel.add(mapIdPanel, BorderLayout.WEST); statusPanel.add(graphInfoPanel, BorderLayout.WEST);
JLabel threadInfo = new JLabel("Thread running... "); JLabel threadInfo = new JLabel("Thread running... ");
JLabel threadTimerLabel = new JLabel("00:00:00"); JLabel threadTimerLabel = new JLabel("00:00:00");