Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/monitoring on MAIN
MonitoringApplication.java+24-251.54 -> 1.55
ConnectionStatusPanel.java+14-101.7 -> 1.8
FieldsPanel.java+35-11.1 -> 1.2
+73-36
3 modified files
tweak the layout so it displays okay on my laptop; desktop monitor at lower resolution should be checked also

hps-java/src/main/java/org/lcsim/hps/monitoring
MonitoringApplication.java 1.54 -> 1.55
diff -u -r1.54 -r1.55
--- MonitoringApplication.java	4 Jun 2013 22:20:01 -0000	1.54
+++ MonitoringApplication.java	5 Jun 2013 15:59:57 -0000	1.55
@@ -92,7 +92,7 @@
  * calling its main() method.
  *
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringApplication.java,v 1.54 2013/06/04 22:20:01 jeremy Exp $
+ * @version $Id: MonitoringApplication.java,v 1.55 2013/06/05 15:59:57 jeremy Exp $
  */
 public class MonitoringApplication {
 
@@ -115,7 +115,6 @@
     private JMenuItem disconnectItem;
     private JMenuItem resetConnectionItem;
     private JMenuItem connectionLoadItem;
-    //private JMenuItem connectionSaveItem;
     private JMenuItem savePlotsItem;
     private JMenuItem resetDriversItem;
     private JMenuItem logItem;
@@ -157,7 +156,7 @@
     
     // Some default GUI size parameters.
     private final int logTableWidth = 700;
-    private final int logTableHeight = 320;
+    private final int logTableHeight = 270;
     
     // Format for screenshots. Hard-coded to PNG.
     private static final String screenshotFormat = "png";
@@ -183,6 +182,7 @@
     private static final int rightPanelWidth = (int)(screenWidth * 0.40);
     
     private static final int connectionStatusPanelHeight = 50;
+    private static final int connectionStatusPanelWidth = 400;
     
     /**
      * Constructor for monitoring application. Users should not need to use
@@ -209,7 +209,7 @@
         setupAida();
         
         // Log that the application started successfully.
-        log("Application initialized successfully.");       
+        log("Application initialized successfully.");     
     }
     
     private void setupAida() {
@@ -228,35 +228,36 @@
     }
     
     private void createLeftPanel() {
-        
+    	
         // Lefthand panel containing the three application tabs.
         leftPanel = new JPanel();
-        //leftPanel.setPreferredSize(new Dimension(leftPanelWidth, screenHeight-30));
+    	// set border ex. 
         //leftPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
         leftPanel.setMinimumSize(new Dimension(leftPanelWidth, screenHeight-30));
         leftPanel.setLayout(new GridBagLayout());
 
-        // Connection status panel.
         GridBagConstraints c = new GridBagConstraints();
-        c.gridx = 0;
-        c.gridy = 0;
-        c.anchor = GridBagConstraints.NORTH;
-        c.weightx = c.weighty = 1.0;
-        c.insets = new Insets(15, 0, 0, 15);
-        c.fill = GridBagConstraints.BOTH;
-        connectionStatusPanel = new ConnectionStatusPanel();
-        connectionStatusPanel.setPreferredSize(new Dimension(leftPanelWidth-10, connectionStatusPanelHeight));
-        leftPanel.add(connectionStatusPanel, c);
-
+        
         // Event processing buttons.
         c = new GridBagConstraints();
         c.gridx = 0;
-        c.gridy = 1;
+        c.gridy = 0;
         c.anchor = GridBagConstraints.CENTER;
-        c.insets = new Insets(0, 0, 0, 20);
+        c.insets = new Insets(10, 0, 0, 10);
         buttonsPanel = new EventButtonsPanel();
         buttonsPanel.addActionListener(actionListener);
         leftPanel.add(buttonsPanel, c);
+        
+        // Connection status panel.
+        c.gridx = 0;
+        c.gridy = 1;
+        c.anchor = GridBagConstraints.NORTH;
+        c.fill = GridBagConstraints.HORIZONTAL;
+        c.weightx = c.weighty = 1.0;
+        c.insets = new Insets(10, 0, 10, 0);
+        connectionStatusPanel = new ConnectionStatusPanel();
+        connectionStatusPanel.setMinimumSize(new Dimension(connectionStatusPanelWidth, connectionStatusPanelHeight));
+        leftPanel.add(connectionStatusPanel, c);
 
         // Contents of the tabs panel.
         connectionPanel = new ConnectionPanel();
@@ -267,7 +268,7 @@
         // Tab panels.
         c = new GridBagConstraints();
         c.fill = GridBagConstraints.BOTH;
-        c.weightx = c.weighty = 0.8;
+        c.weightx = c.weighty = 1.0;
         JPanel tabsPanel = new JPanel();
         tabs = new JTabbedPane();
         tabs.addTab("Connection Settings", connectionPanel);
@@ -290,7 +291,7 @@
         c.gridy = 0;
         c.weightx = 1.0;
         c.weighty = 1.0;
-        c.fill = GridBagConstraints.VERTICAL;
+        c.fill = GridBagConstraints.BOTH;
         c.anchor = GridBagConstraints.WEST;
         c.insets = new Insets(10, 10, 10, 10);
         mainPanel.add(leftPanel, c);
@@ -301,13 +302,11 @@
         // Create right-hand panel.
         rightPanel = new JPanel();
         rightPanel.setPreferredSize(new Dimension(rightPanelWidth, screenHeight-30));
-        //rightPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
         rightPanel.setMinimumSize(new Dimension(rightPanelWidth, screenHeight-30));
         rightPanel.setLayout(new BorderLayout());        
         
         // Create plot pane with empty tabs.
         plotPane = new JTabbedPane();
-        //plotPane.removeAll();
         rightPanel.add(plotPane, BorderLayout.CENTER);
 
         // Set layout of right panel.
@@ -315,7 +314,6 @@
         c.gridx = 1;
         c.gridy = 0;
         c.fill = GridBagConstraints.BOTH;
-        //c.anchor = GridBagConstraints.NORTHEAST;
         c.anchor = GridBagConstraints.CENTER;
         c.weightx = 1.0;
         c.weighty = 1.0;
@@ -506,7 +504,7 @@
         c.insets = new Insets(0, 3, 0, 10);
         JScrollPane logPane = new JScrollPane(logTable);
         logPane.setPreferredSize(new Dimension(logTableWidth, logTableHeight));
-        logPane.setMinimumSize(new Dimension(0, 300));
+        logPane.setMinimumSize(new Dimension(logTableWidth, logTableHeight));
         leftPanel.add(logPane, c);
     }
 
@@ -923,6 +921,7 @@
      * @param status The connection status.
      */
     private void setConnectionStatus(int status) {
+    	//System.out.println("setConnectionStatus = " + ConnectionStatus.toString(status));
         connectionStatus = status;
         connectionStatusPanel.setStatus(status);
         log("Connection status changed to <" + ConnectionStatus.toString(status) + ">.");

hps-java/src/main/java/org/lcsim/hps/monitoring
ConnectionStatusPanel.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- ConnectionStatusPanel.java	10 May 2012 21:14:53 -0000	1.7
+++ ConnectionStatusPanel.java	5 Jun 2013 15:59:57 -0000	1.8
@@ -21,60 +21,64 @@
     JTextField statusField;
     JTextField dateField;
     
+    // Format for date field.
     private final SimpleDateFormat dateFormat = new SimpleDateFormat("MMMM-dd-yyyy HH:mm:ss");
 
     ConnectionStatusPanel() {
         
         setLayout(new GridBagLayout());
-        Insets insets = new Insets(10, 5, 5, 10);
         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.
         c.gridx = 0;
         c.gridy = 0;
-        c.insets = insets;
         c.anchor = GridBagConstraints.WEST;
-        c.weightx = c.weighty = 1.0;
         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.insets = insets;
-        c.anchor = GridBagConstraints.EAST;
-        c.weightx = c.weighty = 1.0;
+        c.anchor = GridBagConstraints.WEST;
+        c.fill = GridBagConstraints.HORIZONTAL;
         statusField = new JTextField("", 15);
-        statusField.setHorizontalAlignment(JTextField.CENTER);
+        statusField.setHorizontalAlignment(JTextField.LEFT);
         statusField.setEditable(false);
         statusField.setBackground(Color.WHITE);
         statusField.setFont(font);
+        statusField.setMinimumSize(new Dimension(300, 50));
         add(statusField, c);
         
+        // The "@" label.
         c = new GridBagConstraints();
         c.gridx = 2;
         c.gridy = 0;
-        c.insets = insets;
         c.anchor = GridBagConstraints.CENTER;
         c.weightx = c.weighty = 1.0;
         JLabel atLabel = new JLabel("@");
         add(atLabel, c);
         
+        // The date field.
         c = new GridBagConstraints();
         c.gridx = 3;
         c.gridy = 0;
-        c.insets = insets;
         c.anchor = GridBagConstraints.WEST;
         c.weightx = c.weighty = 1.0;
         dateField = new JTextField("", 15);
         dateField.setEditable(false);
         dateField.setBackground(Color.WHITE);
-        dateField.setHorizontalAlignment(JTextField.RIGHT);
+        dateField.setHorizontalAlignment(JTextField.LEFT);
         dateField.setFont(font);
+        dateField.setMinimumSize(new Dimension(200, 50));
         add(dateField, c);
         
+        // Set default status.
         setStatus(ConnectionStatus.DISCONNECTED);
     }
 

hps-java/src/main/java/org/lcsim/hps/monitoring
FieldsPanel.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- FieldsPanel.java	3 May 2012 16:59:28 -0000	1.1
+++ FieldsPanel.java	5 Jun 2013 15:59:57 -0000	1.2
@@ -14,7 +14,7 @@
 /**
  * This class is used to provide utility methods for the data panels in the application tabs.
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: FieldsPanel.java,v 1.1 2012/05/03 16:59:28 jeremy Exp $
+ * @version $Id: FieldsPanel.java,v 1.2 2013/06/05 15:59:57 jeremy Exp $
  *
  */
 public class FieldsPanel extends JPanel {
@@ -73,6 +73,8 @@
     
     protected final JComboBox addComboBox(String name, String[] values) {
         
+    	//System.out.println("addComboBox = " + name);
+    	
         GridBagConstraints c = new GridBagConstraints();
         c.gridx = 0;
         c.gridy = currY;
@@ -88,6 +90,38 @@
         c.insets = insets;
         c.anchor = GridBagConstraints.EAST;
         JComboBox combo = new JComboBox(values);
+        //System.out.println("combo width = " + combo.getWidth());
+        //System.out.println("combo width = " + combo.getSize().getWidth());
+        combo.setEditable(editable);
+        add(combo, c);
+        
+        ++currY;
+        
+        return combo;
+    }
+    
+    protected final JComboBox addComboBoxMultiline(String name, String[] values) {
+        
+        GridBagConstraints c = new GridBagConstraints();
+        c.gridx = 0;
+        c.gridwidth = GridBagConstraints.REMAINDER;
+        c.gridy = currY;
+        c.insets = insets;
+        c.anchor = GridBagConstraints.WEST;
+        JLabel waitModeLabel = new JLabel(name + ":");
+        waitModeLabel.setHorizontalAlignment(JLabel.LEFT);
+        add(waitModeLabel, c);
+        ++currY;
+        
+        c = new GridBagConstraints();
+        c.gridx = 0;
+        c.gridwidth = GridBagConstraints.REMAINDER;
+        c.gridy = currY;
+        c.insets = insets;
+        c.anchor = GridBagConstraints.WEST;
+        JComboBox combo = new JComboBox(values);
+        //System.out.println("combo width = " + combo.getWidth());
+        //System.out.println("combo width = " + combo.getSize().getWidth());
         combo.setEditable(editable);
         add(combo, c);
         
CVSspam 0.2.12


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