Commit in hps-java/src/main/java/org/lcsim/hps/monitoring on MAIN | |||
MonitoringApplication.java | +24 | -2 | 1.56 -> 1.57 |
make sure to print stack traces if exceptions occur; try to set frame to maximized size (probably not the best way to do this)
diff -u -r1.56 -r1.57 --- MonitoringApplication.java 5 Jun 2013 17:55:28 -0000 1.56 +++ MonitoringApplication.java 5 Jun 2013 19:07:41 -0000 1.57 @@ -32,6 +32,7 @@
import java.awt.AWTException; import java.awt.BorderLayout; import java.awt.Dimension;
+import java.awt.GraphicsConfiguration;
import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets;
@@ -92,7 +93,7 @@
* calling its main() method. * * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringApplication.java,v 1.56 2013/06/05 17:55:28 jeremy Exp $
+ * @version $Id: MonitoringApplication.java,v 1.57 2013/06/05 19:07:41 jeremy Exp $
*/ public class MonitoringApplication {
@@ -608,6 +609,7 @@
try { log(Level.FINEST, "Action performed <" + cmd + ">."); } catch (Exception xx) {
+ xx.printStackTrace();
} } if (connectCmd.equals(cmd)) {
@@ -956,9 +958,21 @@
frame.setContentPane(mainPanel); frame.setJMenuBar(menuBar); frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- frame.setMinimumSize(new Dimension(600, 850));
+ //frame.setMinimumSize(new Dimension(600, 850));
frame.setResizable(true); 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); +
frame.setVisible(true); }
@@ -1088,6 +1102,7 @@
log("Redirected System output to file <" + logFile.getPath() + ">."); } catch (IOException e) {
+ e.printStackTrace();
log(Level.SEVERE, "Error redirecting System output to file <" + logFile.getPath() + ">."); showDialog("Error redirecting System output to log file."); }
@@ -1133,6 +1148,7 @@
eventPanel.setEventRefresh(newEventRefresh); log("Event refresh set to <" + newEventRefresh + ">."); } catch (Exception e) {
+ e.printStackTrace();
log(Level.WARNING, "Ignored invalid event refresh setting."); showDialog("The value " + inputValue + " is not valid for Event Refresh Rate."); }
@@ -1158,6 +1174,7 @@
} log("Max events set to <" + newMaxEvents + ">."); } catch (Exception e) {
+ e.printStackTrace();
log(Level.WARNING, "Ignored invalid max events setting <" + inputValue + ">."); showDialog("The value " + inputValue + " is not valid for Max Events."); }
@@ -1266,8 +1283,10 @@
BufferedImage image = robot.createScreenCapture(screenRectangle); ImageIO.write(image, screenshotFormat, new File(fileName)); } catch (AWTException e) {
+ e.printStackTrace();
showDialog(e.getMessage()); } catch (IOException e) {
+ e.printStackTrace();
showDialog(e.getMessage()); } }
@@ -1329,6 +1348,7 @@
try { eventProcessingThread.join(); } catch (InterruptedException e) {
+ e.printStackTrace();
} log("Event processor finished with status <" + ConnectionStatus.toString(eventProcessor.getStatus()) + ">."); endStatus = eventProcessor.getStatus();
@@ -1553,6 +1573,7 @@
// Wait for cleanup thread to finish. cleanupThread.join(this.maxCleanupTime); } catch (InterruptedException e) {
+ e.printStackTrace();
} if (cleanupThread.succeeded()) {
@@ -1746,6 +1767,7 @@
out.close(); log("Saved log to file <" + logFile.getPath() + ">."); } catch (IOException e) {
+ e.printStackTrace();
log(Level.SEVERE, "Failed to save log to file <" + logFile.getPath() + ">."); showDialog("Failed to save log file."); }
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