You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2008/02/25 16:21:51 UTC
svn commit: r630875 -
/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
Author: twgoetz
Date: Mon Feb 25 07:21:43 2008
New Revision: 630875
URL: http://svn.apache.org/viewvc?rev=630875&view=rev
Log:
Jira UIMA-749: add process trace/performance report to CVD.
https://issues.apache.org/jira/browse/UIMA-749
Modified:
incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
Modified: incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java?rev=630875&r1=630874&r2=630875&view=diff
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java Mon Feb 25 07:21:43 2008
@@ -98,6 +98,7 @@
import org.apache.uima.internal.util.Timer;
import org.apache.uima.resource.ResourceManager;
import org.apache.uima.resource.ResourceSpecifier;
+import org.apache.uima.tools.cpm.PerformanceReportDialog;
import org.apache.uima.tools.cvd.control.AboutHandler;
import org.apache.uima.tools.cvd.control.AboutUimaHandler;
import org.apache.uima.tools.cvd.control.AddCPHandler;
@@ -153,6 +154,7 @@
import org.apache.uima.util.FileUtils;
import org.apache.uima.util.Level;
import org.apache.uima.util.Logger;
+import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.XMLInputSource;
/**
@@ -277,6 +279,8 @@
private JMenuItem reRunMenu;
private JMenuItem runOnCasMenuItem;
+
+ private JMenuItem showPerfReportItem;
private JPopupMenu textPopup;
@@ -361,6 +365,8 @@
private static final Color selectionColor = Color.orange;
private Properties preferences;
+
+ private ProcessTrace lastRunProcessTrace = null;
public static final String textDirPref = "dir.open.text";
@@ -1149,6 +1155,19 @@
runMenu.add(this.runOnCasMenuItem);
this.runOnCasMenuItem.addActionListener(new AnnotatorRunOnCasEventHandler(this));
this.runOnCasMenuItem.setEnabled(false);
+ this.showPerfReportItem = new JMenuItem("Perf. report");
+ this.showPerfReportItem.setEnabled(false);
+ this.showPerfReportItem.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ if (MainFrame.this.lastRunProcessTrace == null) {
+ MainFrame.this.showError("No performance report to show.");
+ } else {
+ PerformanceReportDialog prd = new PerformanceReportDialog(MainFrame.this);
+ prd.displayStats(MainFrame.this.lastRunProcessTrace, 1, "Process trace");
+ }
+ }
+ });
+ runMenu.add(this.showPerfReportItem);
runMenu.addSeparator();
this.recentDescFileMenu = new JMenu("Recently used ...");
this.recentDescFileMenu.setMnemonic(KeyEvent.VK_U);
@@ -1546,7 +1565,9 @@
// this.disableSofaListener = true;
this.sofaSelectionComboBox.setSelectedIndex(0);
}
- this.ae.process(this.cas);
+ this.lastRunProcessTrace = this.ae.process(this.cas);
+ this.showPerfReportItem.setEnabled(true);
+ this.log.log(Level.INFO, "Process trace of AE run:\n" + this.lastRunProcessTrace.toString());
// Update sofacombobox here
// this.disableSofaListener = true;
int currentViewID = this.sofaSelectionComboBox.getSelectedIndex();