Skip to Content.
Sympa Menu

perfsonar-dev - perfsonar: r2776 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . ui/panels

Subject: perfsonar development work

List archive

perfsonar: r2776 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . ui/panels


Chronological Thread 
  • From:
  • To:
  • Subject: perfsonar: r2776 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . ui/panels
  • Date: Wed, 5 Sep 2007 10:50:34 -0400

Author: nina
Date: 2007-09-05 10:50:34 -0400 (Wed, 05 Sep 2007)
New Revision: 2776

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/StatusBar.java
Log:
error visualization (clickable red rectangle on the right of the status bar)

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2007-09-05 13:32:52 UTC (rev 2775)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/SmartMARequest.java
2007-09-05 14:50:34 UTC (rev 2776)
@@ -62,13 +62,13 @@
protected AbstractPerfsonarResponse propertyChangeListener;
Hashtable<IPerfsonarSchema, PerfsonarRequestsPool> requestsPool;
protected int MaxRequests = 16;
+
//PerfsonarRequestsPool[] requestsPool = null;

protected transient IUserData data = null;

public SmartMARequest() {
super();
-
propertyChangeListener = new AbstractPerfsonarResponse() {
/**
* return
{@link
IPerfsonarRequest} object if processing is already completed
@@ -96,9 +96,11 @@
*/
public synchronized void
callException(PerfsonarResponseEvent e) {
super.callException(e);
+
setRequestsRunning(countInitiated
-(countCompleted + countErrors));
returnRequest(e.getRequest());
Exception x = e.getException();
+
/*
firePropertyChange(new
BusyIdleEvent(this,BusyIdleEvent.PROPERTY_BUSY,null,
new Boolean((countCompleted +
countErrors) < countInitiated)));

Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/StatusBar.java
===================================================================
---
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/StatusBar.java
2007-09-05 13:32:52 UTC (rev 2775)
+++
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/panels/StatusBar.java
2007-09-05 14:50:34 UTC (rev 2776)
@@ -25,8 +25,12 @@
package org.perfsonar.perfsonarui.ui.panels;

import java.awt.BorderLayout;
+import java.awt.Color;
import java.awt.Dimension;
+import java.awt.GridLayout;
import java.awt.LayoutManager;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.PrintWriter;
@@ -34,6 +38,7 @@

import javax.swing.BorderFactory;
import javax.swing.JLabel;
+import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
@@ -41,6 +46,8 @@
import javax.swing.border.BevelBorder;

import org.apache.axis.AxisFault;
+import org.jdesktop.layout.GroupLayout;
+import org.jdesktop.layout.GroupLayout.SequentialGroup;
import org.perfsonar.perfsonarui.plugins.IPerfsonarTab;
import org.perfsonar.perfsonarui.plugins.MetaDataList;

@@ -53,8 +60,8 @@
protected JProgressBar progressBar;
protected JLabel label;
protected MetaDataList dataList;
- protected StringBuffer errorsLog = new StringBuffer();
-
+ protected Exception theError;
+ protected JLabel errorsLabel;
/**
* Comment for <code>serialVersionUID</code>
*/
@@ -100,15 +107,14 @@
*/
@Override
public void addWidgets(IPerfsonarTab psModel) {
- setLayout(new BorderLayout());
+ theError = null;
+ setLayout(new GridLayout(1,2));
+
label = new JLabel();
-
//label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED ));
- add(label,BorderLayout.CENTER);
-
- //this.dataList = psModel.getDataList();
- //dataList.addObserver(this);

progressBar = new JProgressBar(0,100);
+ progressBar.setPreferredSize(new Dimension(100,24));
+ progressBar.setMaximumSize(new Dimension(200,24));
//progressBar.setIndeterminate(false);
progressBar.setIndeterminate(true);
progressBar.setVisible(false);
@@ -117,11 +123,36 @@
progressBar.setStringPainted(false);


progressBar.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED ));
- add(progressBar,BorderLayout.EAST);
+
+ errorsLabel = new JLabel();
+ Dimension box = new Dimension(24,24);
+ errorsLabel.setPreferredSize(box);
+ errorsLabel.setMaximumSize(box);
+ errorsLabel.setMinimumSize(box);
+ errorsLabel.setOpaque(true);
+
errorsLabel.setBorder(BorderFactory.createLineBorder(getBackground(),4));
+ errorsLabel.addMouseListener(new MouseAdapter() {
+ @Override
+ public void mousePressed(MouseEvent e) {
+ showErrorlog(theError);
+ }
+ });
+
//errorsLabel.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
+
//label.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED ));
+ //add(errorsLabel,BorderLayout.CENTER);
+
+
+ add(label);
+
+ JPanel p = new JPanel(new BorderLayout());
+ p.add(errorsLabel,BorderLayout.EAST);
+ p.add(progressBar,BorderLayout.CENTER);
+ add(p);
setPreferredSize(new Dimension(200,24));


}
+
/*
public void update(Observable arg0, Object arg1) {
int p = dataList.getProgress();
@@ -147,9 +178,16 @@
//progressBar.setString(percent.toString() +
"%");
progressBar.setString("");
} else if
(arg0.getPropertyName().equals(BusyIdleEvent.PROPERTY_ERROR)) {
-
- showException((Exception ) arg0.getNewValue());
-
+ theError = (Exception ) arg0.getNewValue();
+ if (theError != null) {
+ errorsLabel.setText(theError.getMessage());
+ errorsLabel.setBackground(Color.red);
+ errorsLabel.setToolTipText("Click here for
error details");
+ } else {
+ errorsLabel.setText("");
+ errorsLabel.setBackground(Color.black);
+ errorsLabel.setToolTipText("");
+ }
} else
label.setText(arg0.getNewValue().toString());
}
@@ -165,8 +203,9 @@


}
-
- public void showException(Exception x) {
+
+ public void showErrorlog(Exception x) {
+ if (x == null) return;
JPanel p = new JPanel(new BorderLayout());
p.add(new JLabel(x.toString()),BorderLayout.NORTH);

@@ -189,7 +228,7 @@
sp.setPreferredSize(new Dimension(350,200));
p.add(sp,BorderLayout.CENTER);

-
+ JOptionPane.showMessageDialog(this,p,"Last
error",JOptionPane.ERROR_MESSAGE,null);


}



  • perfsonar: r2776 - in branches/perfsonarui/src/org/perfsonar/perfsonarui: . ui/panels, svnlog, 09/05/2007

Archive powered by MHonArc 2.6.16.

Top of Page