Commit in hps-java/src/main/java/org/lcsim/hps/monitoring on MAIN | |||
ConnectionStatusPanel.java | +28 | -11 | 1.8 -> 1.9 |
EventButtonsPanel.java | +3 | -6 | 1.1 -> 1.2 |
MonitoringApplication.java | +15 | -13 | 1.57 -> 1.58 |
+46 | -30 |
a few more layout tweaks
diff -u -r1.8 -r1.9 --- ConnectionStatusPanel.java 5 Jun 2013 15:59:57 -0000 1.8 +++ ConnectionStatusPanel.java 5 Jun 2013 20:49:38 -0000 1.9 @@ -9,12 +9,12 @@
import java.text.SimpleDateFormat; import java.util.Date;
-import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JPanel;
+import javax.swing.JSeparator;
import javax.swing.JTextField;
+import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
-import javax.swing.border.EtchedBorder;
class ConnectionStatusPanel extends JPanel {
@@ -27,26 +27,35 @@
ConnectionStatusPanel() { setLayout(new GridBagLayout());
- setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+ //setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
Font font = new Font("Arial", Font.PLAIN, 14); GridBagConstraints c = new GridBagConstraints(); c.weightx = c.weighty = 1.0;
- // Connection status label.
+ // Bottom separator.
c.gridx = 0; c.gridy = 0;
+ c.fill = GridBagConstraints.HORIZONTAL; + c.gridwidth = GridBagConstraints.REMAINDER; + add(new JSeparator(SwingConstants.HORIZONTAL), c); + + // Connection status label. + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 1;
c.anchor = GridBagConstraints.WEST;
+ c.insets = new Insets(0, 10, 0, 10);
JLabel statusLabel = new JLabel("Connection Status:"); statusLabel.setHorizontalAlignment(JLabel.LEFT); add(statusLabel, c); // Connection status field.
- c = new GridBagConstraints();
c.gridx = 1;
- c.gridy = 0;
+ c.gridy = 1;
c.anchor = GridBagConstraints.WEST; c.fill = GridBagConstraints.HORIZONTAL;
+ c.insets = new Insets(0, 0, 0, 10);
statusField = new JTextField("", 15); statusField.setHorizontalAlignment(JTextField.LEFT); statusField.setEditable(false);
@@ -56,20 +65,19 @@
add(statusField, c); // The "@" label.
- c = new GridBagConstraints();
c.gridx = 2;
- c.gridy = 0;
+ c.gridy = 1;
c.anchor = GridBagConstraints.CENTER;
- c.weightx = c.weighty = 1.0;
+ c.fill = GridBagConstraints.NONE; + c.insets = new Insets(0, 0, 0, 10);
JLabel atLabel = new JLabel("@"); add(atLabel, c); // The date field. c = new GridBagConstraints(); c.gridx = 3;
- c.gridy = 0;
+ c.gridy = 1;
c.anchor = GridBagConstraints.WEST;
- c.weightx = c.weighty = 1.0;
dateField = new JTextField("", 15); dateField.setEditable(false); dateField.setBackground(Color.WHITE);
@@ -78,6 +86,15 @@
dateField.setMinimumSize(new Dimension(200, 50)); add(dateField, c);
+ // Bottom separator. + c = new GridBagConstraints(); + c.gridx = 0; + c.gridy = 2; + c.fill = GridBagConstraints.HORIZONTAL; + c.gridwidth = GridBagConstraints.REMAINDER; + c.insets = new Insets(10, 0, 0, 0); + add(new JSeparator(SwingConstants.HORIZONTAL), c); +
// Set default status. setStatus(ConnectionStatus.DISCONNECTED); }
diff -u -r1.1 -r1.2 --- EventButtonsPanel.java 3 May 2012 16:59:28 -0000 1.1 +++ EventButtonsPanel.java 5 Jun 2013 20:49:38 -0000 1.2 @@ -15,16 +15,14 @@
JButton connectButton; EventButtonsPanel() {
- - Insets insets = new Insets(1, 1, 1, 1); -
+
GridBagLayout layout = new GridBagLayout(); setLayout(layout); GridBagConstraints c = new GridBagConstraints(); c.gridx = 0; c.gridy = 0;
- c.insets = insets;
+ c.insets = new Insets(0, 0, 0, 10);
connectButton = new JButton("Connect"); connectButton.setEnabled(true); connectButton.setActionCommand(MonitoringCommands.connectCmd);
@@ -33,7 +31,7 @@
c = new GridBagConstraints(); c.gridx = 1; c.gridy = 0;
- c.insets = insets;
+ c.insets = new Insets(0, 0, 0, 10);
pauseButton = new JButton("Pause"); pauseButton.setActionCommand(MonitoringCommands.pauseCmd); pauseButton.setEnabled(false);
@@ -42,7 +40,6 @@
c = new GridBagConstraints(); c.gridx = 2; c.gridy = 0;
- c.insets = insets;
nextEventsButton = new JButton("Next Event"); nextEventsButton.setEnabled(false); nextEventsButton.setActionCommand(MonitoringCommands.nextCmd);
diff -u -r1.57 -r1.58 --- MonitoringApplication.java 5 Jun 2013 19:07:41 -0000 1.57 +++ MonitoringApplication.java 5 Jun 2013 20:49:38 -0000 1.58 @@ -61,6 +61,7 @@
import java.util.logging.Logger; import javax.imageio.ImageIO;
+import javax.swing.BorderFactory;
import javax.swing.JFileChooser; import javax.swing.JFrame; import javax.swing.JMenu;
@@ -93,7 +94,7 @@
* calling its main() method. * * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringApplication.java,v 1.57 2013/06/05 19:07:41 jeremy Exp $
+ * @version $Id: MonitoringApplication.java,v 1.58 2013/06/05 20:49:38 jeremy Exp $
*/ public class MonitoringApplication {
@@ -235,6 +236,7 @@
leftPanel = new JPanel(); // set border ex. //leftPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+ //leftPanel.setBorder(BorderFactory.createEmptyBorder());
leftPanel.setMinimumSize(new Dimension(leftPanelWidth, screenHeight-30)); leftPanel.setLayout(new GridBagLayout());
@@ -256,7 +258,7 @@
c.anchor = GridBagConstraints.NORTH; c.fill = GridBagConstraints.HORIZONTAL; c.weightx = c.weighty = 1.0;
- c.insets = new Insets(10, 0, 10, 0);
+ c.insets = new Insets(10, 0, 5, 0);
connectionStatusPanel = new ConnectionStatusPanel(); connectionStatusPanel.setMinimumSize(new Dimension(connectionStatusPanelWidth, connectionStatusPanelHeight)); leftPanel.add(connectionStatusPanel, c);
@@ -295,7 +297,7 @@
c.weighty = 1.0; c.fill = GridBagConstraints.BOTH; c.anchor = GridBagConstraints.WEST;
- c.insets = new Insets(10, 10, 10, 10);
+ c.insets = new Insets(0, 5, 0, 0);
mainPanel.add(leftPanel, c); }
@@ -503,7 +505,7 @@
c.gridy = 3; c.fill = GridBagConstraints.BOTH; c.weightx = c.weighty = 1.0;
- c.insets = new Insets(0, 3, 0, 10);
+ c.insets = new Insets(0, 0, 5, 3);
JScrollPane logPane = new JScrollPane(logTable); logPane.setPreferredSize(new Dimension(logTableWidth, logTableHeight)); logPane.setMinimumSize(new Dimension(logTableWidth, logTableHeight));
@@ -963,15 +965,15 @@
frame.pack(); // Maximize frame size.
- final GraphicsConfiguration config = frame.getGraphicsConfiguration(); - final int left = Toolkit.getDefaultToolkit().getScreenInsets(config).left; - final int right = Toolkit.getDefaultToolkit().getScreenInsets(config).right; - final int top = Toolkit.getDefaultToolkit().getScreenInsets(config).top; - final int bottom = Toolkit.getDefaultToolkit().getScreenInsets(config).bottom; - final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); - final int width = screenSize.width - left - right; - final int height = screenSize.height - top - bottom; - frame.setSize(width,height);
+ //final GraphicsConfiguration config = frame.getGraphicsConfiguration(); + //final int left = Toolkit.getDefaultToolkit().getScreenInsets(config).left; + //final int right = Toolkit.getDefaultToolkit().getScreenInsets(config).right; + //final int top = Toolkit.getDefaultToolkit().getScreenInsets(config).top; + //final int bottom = Toolkit.getDefaultToolkit().getScreenInsets(config).bottom; + //final Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + //final int width = screenSize.width - left - right; + //final int height = screenSize.height - top - bottom; + //frame.setSize(width,height);
frame.setVisible(true); }
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1