Skip to content

Commit 31734cb

Browse files
committed
add banner to logging manager - beta status
indicate to the user that logging feature is in beta so that they can use it with caution
1 parent 8d6ddaa commit 31734cb

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

src/main/java/scriptmanager/main/LogManagerWindow.java

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848
@SuppressWarnings("serial")
4949
public class LogManagerWindow extends JFrame {
5050

51-
// private JPanel contentPane;
51+
private JPanel contentPane;
52+
private JTabbedPane tabbedPane;
53+
5254
/**
5355
* FileChooser which opens to user's directory
5456
*/
5557
protected JFileChooser fc = new JFileChooser(new File(System.getProperty("user.dir")));
5658
private File OUT_DIR = new File(System.getProperty("user.dir"));
5759

58-
private JTabbedPane tabbedPane;
59-
6060
private String[] column = {"Status","Command","Start Time", "Stop Time"};;
6161

6262
private JPanel pnl_Settings;
@@ -103,14 +103,33 @@ public void initialize() {
103103
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
104104
setBounds(125, 125, 650, 350);
105105

106+
contentPane = new JPanel();
107+
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
108+
setContentPane(contentPane);
109+
SpringLayout sl_contentPane = new SpringLayout();
110+
contentPane.setLayout(sl_contentPane);
111+
112+
// Add banner notifying user of beta-feature
113+
JPanel bannerPane = new JPanel();
114+
sl_contentPane.putConstraint(SpringLayout.NORTH, bannerPane, 5, SpringLayout.NORTH, contentPane);
115+
sl_contentPane.putConstraint(SpringLayout.WEST, bannerPane, 10, SpringLayout.WEST, contentPane);
116+
sl_contentPane.putConstraint(SpringLayout.EAST, bannerPane, 10, SpringLayout.EAST, contentPane);
117+
sl_contentPane.putConstraint(SpringLayout.SOUTH, bannerPane, 30, SpringLayout.NORTH, contentPane);
118+
bannerPane.setBackground(new Color(102, 102, 153)); // Color from MetalTheme docs (https://docs.oracle.com/javase/8/docs/api/javax/swing/plaf/metal/DefaultMetalTheme.html#getPrimary1--)
119+
contentPane.add(bannerPane);
120+
121+
// Text of banner pane
122+
JLabel bannerText = new JLabel("Logging is currently a beta feature, please report any bugs to Github.");
123+
bannerText.setForeground(Color.WHITE);
124+
bannerPane.add(bannerText);
125+
126+
// Set-up tabbed panel
106127
tabbedPane = new JTabbedPane(JTabbedPane.TOP);
107-
setContentPane(tabbedPane);
108-
SpringLayout sl_tabbedPane = new SpringLayout();
109-
110-
sl_tabbedPane.putConstraint(SpringLayout.NORTH, tabbedPane, 10, SpringLayout.NORTH, getContentPane());
111-
sl_tabbedPane.putConstraint(SpringLayout.WEST, tabbedPane, 10, SpringLayout.WEST, getContentPane());
112-
sl_tabbedPane.putConstraint(SpringLayout.SOUTH, tabbedPane, -10, SpringLayout.SOUTH, getContentPane());
113-
sl_tabbedPane.putConstraint(SpringLayout.EAST, tabbedPane, -10, SpringLayout.EAST, getContentPane());
128+
sl_contentPane.putConstraint(SpringLayout.NORTH, tabbedPane, 5, SpringLayout.SOUTH, bannerPane);
129+
sl_contentPane.putConstraint(SpringLayout.WEST, tabbedPane, 10, SpringLayout.WEST, contentPane);
130+
sl_contentPane.putConstraint(SpringLayout.SOUTH, tabbedPane, -10, SpringLayout.SOUTH, contentPane);
131+
sl_contentPane.putConstraint(SpringLayout.EAST, tabbedPane, -10, SpringLayout.EAST, contentPane);
132+
contentPane.add(tabbedPane);
114133

115134
// >>>>>>>> Settings <<<<<<<<
116135
pnl_Settings = new JPanel();

0 commit comments

Comments
 (0)