You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/11/13 16:08:26 UTC
svn commit: r1769510 [2/8] - in /uima/uimaj/branches/experiment-v3-jcas:
uimaj-adapter-soap/src/main/java/org/apache/uima/adapter/soap/
uimaj-adapter-soap/src/main/java/org/apache/uima/adapter/soap/axis11/
uimaj-component-test-util/src/main/java/org/ap...
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-component-test-util/src/main/java/org/apache/uima/test/junit_extension/PerformanceTestResultImpl.java Sun Nov 13 16:08:24 2016
@@ -26,6 +26,7 @@ import java.util.GregorianCalendar;
import org.apache.uima.internal.util.TimeSpan;
+// TODO: Auto-generated Javadoc
/**
* PerformanceTestResultImpl implements the PerformanceTestResult interface and provides the results of a performance
* test run.
@@ -33,52 +34,72 @@ import org.apache.uima.internal.util.Tim
*/
public class PerformanceTestResultImpl implements PerformanceTestResult {
+ /** The newline. */
private static String NEWLINE = System.getProperty("line.separator");
+ /** The repeat single mode. */
private boolean repeatSingleMode = false;
+ /** The do warmup. */
private boolean doWarmup = false;
+ /** The nums to run. */
private int numsToRun = 1;
+ /** The ae desc file. */
private File aeDescFile = null;
+ /** The test file dir. */
private File testFileDir = null;
+ /** The number of files. */
private int numberOfFiles = 0;
+ /** The collection file size. */
private long collectionFileSize = 0;
+ /** The number of characters. */
private int numberOfCharacters = 0;
+ /** The datapath. */
private String datapath = null;
+ /** The number of created annotations. */
private int numberOfCreatedAnnotations = 0;
+ /** The init time. */
private TimeSpan initTime = null;
+ /** The warmup time. */
private TimeSpan warmupTime = null;
+ /** The overall time. */
private TimeSpan overallTime = null;
+ /** The io time. */
private TimeSpan ioTime = null;
+ /** The processing time. */
private TimeSpan processingTime = null;
+ /** The cleanup time. */
private TimeSpan cleanupTime = null;
+ /** The document preparation time. */
private TimeSpan documentPreparationTime = null;
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getNumberOfProcessedCharacters()
*/
+ @Override
public int getNumberOfProcessedCharacters() {
return this.numberOfCharacters * this.numsToRun;
}
/**
- * @param numberOfCharacters
- * The number of characters.
+ * Sets the number of characters.
+ *
+ * @param numberOfCharacters The number of characters.
*/
public void setNumberOfCharacters(int numberOfCharacters) {
this.numberOfCharacters = numberOfCharacters;
@@ -87,13 +108,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getNumberOfProcessedFiles()
*/
+ @Override
public int getNumberOfProcessedFiles() {
return this.numberOfFiles * this.numsToRun;
}
/**
- * @param numberOfFiles
- * The number of files.
+ * Sets the number of files.
+ *
+ * @param numberOfFiles The number of files.
*/
public void setNumberOfFiles(int numberOfFiles) {
this.numberOfFiles = numberOfFiles;
@@ -102,13 +125,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getUIMADatapath()
*/
+ @Override
public String getUIMADatapath() {
return this.datapath;
}
/**
- * @param datapath
- * The UIMA datapath.
+ * Sets the datapath.
+ *
+ * @param datapath The UIMA datapath.
*/
public void setDatapath(String datapath) {
this.datapath = datapath;
@@ -117,13 +142,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getAeInitTime()
*/
+ @Override
public TimeSpan getAeInitTime() {
return this.initTime;
}
/**
- * @param initTime
- * The analysis engine init time.
+ * Sets the inits the time.
+ *
+ * @param initTime The analysis engine init time.
*/
public void setInitTime(TimeSpan initTime) {
this.initTime = initTime;
@@ -132,13 +159,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getFileIoTime()
*/
+ @Override
public TimeSpan getFileIoTime() {
return this.ioTime;
}
/**
- * @param ioTime
- * The file io time to set.
+ * Sets the io time.
+ *
+ * @param ioTime The file io time to set.
*/
public void setIoTime(TimeSpan ioTime) {
this.ioTime = ioTime;
@@ -147,13 +176,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getNumberOfCreatedAnnotations()
*/
+ @Override
public int getNumberOfCreatedAnnotations() {
return this.numberOfCreatedAnnotations;
}
/**
- * @param numberOfCreatedAnnotations
- * The number of created annotations to set.
+ * Sets the number of created annotations.
+ *
+ * @param numberOfCreatedAnnotations The number of created annotations to set.
*/
public void setNumberOfCreatedAnnotations(int numberOfCreatedAnnotations) {
this.numberOfCreatedAnnotations = numberOfCreatedAnnotations;
@@ -162,13 +193,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getNumberOfRepeatedRuns()
*/
+ @Override
public int getNumberOfRepeatedRuns() {
return this.numsToRun;
}
/**
- * @param numsToRun
- * The number of repeated runs.
+ * Sets the nums to run.
+ *
+ * @param numsToRun The number of repeated runs.
*/
public void setNumsToRun(int numsToRun) {
this.numsToRun = numsToRun;
@@ -177,13 +210,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getOverallTime()
*/
+ @Override
public TimeSpan getOverallTime() {
return this.overallTime;
}
/**
- * @param overallTime
- * The overall processing time.
+ * Sets the overall time.
+ *
+ * @param overallTime The overall processing time.
*/
public void setOverallTime(TimeSpan overallTime) {
this.overallTime = overallTime;
@@ -192,13 +227,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getAeProcessingTime()
*/
+ @Override
public TimeSpan getAeProcessingTime() {
return this.processingTime;
}
/**
- * @param processingTime
- * The analysis engine processing time.
+ * Sets the processing time.
+ *
+ * @param processingTime The analysis engine processing time.
*/
public void setProcessingTime(TimeSpan processingTime) {
this.processingTime = processingTime;
@@ -207,13 +244,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#isRepeatSingleMode()
*/
+ @Override
public boolean isRepeatSingleMode() {
return this.repeatSingleMode;
}
/**
- * @param repeatSingleMode
- * The repeat single mode setting
+ * Sets the repeat single mode.
+ *
+ * @param repeatSingleMode The repeat single mode setting
*/
public void setRepeatSingleMode(boolean repeatSingleMode) {
this.repeatSingleMode = repeatSingleMode;
@@ -222,13 +261,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getAeDescFilePath()
*/
+ @Override
public String getAeDescFilePath() {
return this.aeDescFile.getAbsolutePath();
}
/**
- * @param aeDescFile
- * The analysis engine descriptor file.
+ * Sets the ae desc file path.
+ *
+ * @param aeDescFile The analysis engine descriptor file.
*/
public void setAeDescFilePath(File aeDescFile) {
this.aeDescFile = aeDescFile;
@@ -237,13 +278,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getTestFileDirectoryPath()
*/
+ @Override
public String getTestFileDirectoryPath() {
return this.testFileDir.getAbsolutePath();
}
/**
- * @param testFileDir
- * The test file directory.
+ * Sets the test file dir.
+ *
+ * @param testFileDir The test file directory.
*/
public void setTestFileDir(File testFileDir) {
this.testFileDir = testFileDir;
@@ -252,13 +295,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getAeWarmupTime()
*/
+ @Override
public TimeSpan getAeWarmupTime() {
return this.warmupTime;
}
/**
- * @param warmupTime
- * The analysis engine warmup time.
+ * Sets the warmup time.
+ *
+ * @param warmupTime The analysis engine warmup time.
*/
public void setWarmupTime(TimeSpan warmupTime) {
this.warmupTime = warmupTime;
@@ -267,13 +312,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#isDoAeWarmup()
*/
+ @Override
public boolean isDoAeWarmup() {
return this.doWarmup;
}
/**
- * @param doWarmup
- * the doWarmup setting
+ * Sets the do warmup.
+ *
+ * @param doWarmup the doWarmup setting
*/
public void setDoWarmup(boolean doWarmup) {
this.doWarmup = doWarmup;
@@ -281,9 +328,11 @@ public class PerformanceTestResultImpl i
/**
* returns a performance report with the current performance results.
- *
+ *
+ * @return the string
* @see java.lang.Object#toString()
*/
+ @Override
public String toString() {
StringBuffer resultString = new StringBuffer();
resultString.append(NEWLINE + "Performance Test run results " + NEWLINE);
@@ -338,6 +387,7 @@ public class PerformanceTestResultImpl i
*
* @throws Exception passthru
*/
+ @Override
public void writePerfResultsAsColumn(String level, File file) throws Exception {
// set level name to "none" if it is not available
@@ -407,13 +457,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getAeCleanupTime()
*/
+ @Override
public TimeSpan getAeCleanupTime() {
return this.cleanupTime;
}
/**
- * @param cleanupTime
- * the analysis engine cleanup time
+ * Sets the cleanup time.
+ *
+ * @param cleanupTime the analysis engine cleanup time
*/
public void setCleanupTime(TimeSpan cleanupTime) {
this.cleanupTime = cleanupTime;
@@ -422,13 +474,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getDocumentPreparationTime()
*/
+ @Override
public TimeSpan getDocumentPreparationTime() {
return this.documentPreparationTime;
}
/**
- * @param documentPreparationTime
- * the document preparation time
+ * Sets the document preparation time.
+ *
+ * @param documentPreparationTime the document preparation time
*/
public void setDocumentPreparationTime(TimeSpan documentPreparationTime) {
this.documentPreparationTime = documentPreparationTime;
@@ -437,13 +491,15 @@ public class PerformanceTestResultImpl i
/* (non-Javadoc)
* @see org.apache.uima.test.junit_extension.PerformanceTestResult#getProcessedFileSize()
*/
+ @Override
public long getProcessedFileSize() {
return this.collectionFileSize * this.numsToRun;
}
/**
- * @param collectionFileSize
- * the collection file size
+ * Sets the total file size.
+ *
+ * @param collectionFileSize the collection file size
*/
public void setTotalFileSize(long collectionFileSize) {
this.collectionFileSize = collectionFileSize;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java Sun Nov 13 16:08:24 2016
@@ -39,24 +39,34 @@ import org.apache.uima.analysis_engine.T
import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
import org.apache.uima.resource.metadata.Capability;
+// TODO: Auto-generated Javadoc
/**
* A tree view of Annotations and associated features.
*
*/
public class AnnotationFeaturesViewer extends JPanel implements ActionListener {
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -8028169177689821008L;
+ /** The Constant ROOT. */
public static final String ROOT = "Root";
+ /** The scroll pane. */
private JScrollPane scrollPane;
+ /** The tree. */
private JTree tree;
+ /** The expand all button. */
private JButton expandAllButton;
+ /** The collapse all button. */
private JButton collapseAllButton;
+ /**
+ * Instantiates a new annotation features viewer.
+ */
public AnnotationFeaturesViewer() {
super();
@@ -83,6 +93,12 @@ public class AnnotationFeaturesViewer ex
add(buttonsPanel, BorderLayout.NORTH);
}
+ /**
+ * Populate.
+ *
+ * @param analysisEngine the analysis engine
+ * @param aeMetaData the ae meta data
+ */
public void populate(AnalysisEngine analysisEngine, AnalysisEngineMetaData aeMetaData) {
tree = generateTreeView(analysisEngine, aeMetaData);
@@ -102,6 +118,13 @@ public class AnnotationFeaturesViewer ex
scrollPane.getViewport().add(tree, null);
}
+ /**
+ * Generate tree view.
+ *
+ * @param analysisEngine the analysis engine
+ * @param aeMetaData the ae meta data
+ * @return the j tree
+ */
private JTree generateTreeView(AnalysisEngine analysisEngine, AnalysisEngineMetaData aeMetaData) {
DefaultMutableTreeNode root = new DefaultMutableTreeNode(ROOT);
@@ -137,6 +160,11 @@ public class AnnotationFeaturesViewer ex
return new JTree(root);
}
+ /**
+ * Gets the selection.
+ *
+ * @return the selection
+ */
public String getSelection() {
TreePath treePath = tree.getSelectionPath();
if (treePath != null) {
@@ -150,6 +178,10 @@ public class AnnotationFeaturesViewer ex
return null;
}
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (source == expandAllButton) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java Sun Nov 13 16:08:24 2016
@@ -69,6 +69,7 @@ import org.apache.uima.util.CasCreationU
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
/**
* Main Annotation Viewer GUI. Allows user to choose directory of XCAS or XMI files, then
* launches the AnnotationViewerDialog.
@@ -76,8 +77,11 @@ import org.apache.uima.util.XMLInputSour
*
*/
public class AnnotationViewerMain extends JFrame {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -3201723535833938833L;
+ /** The Constant HELP_MESSAGE. */
private static final String HELP_MESSAGE = "Instructions for using Annotation Viewer:\n\n"
+ "1) In the \"Input Directory\" field, either type or use the browse\n"
+ "button to select a directory containing the analyzed documents\n "
@@ -92,17 +96,22 @@ public class AnnotationViewerMain extend
+ "or XML. The Java annotation viewer is recommended.\n\n"
+ "5) Double-click on a document to view it.\n";
+ /** The uima home dir. */
private File uimaHomeDir;
+ /** The input file selector. */
private FileSelector inputFileSelector;
+ /** The tae descriptor file selector. */
private FileSelector taeDescriptorFileSelector;
+ /** The view button. */
private JButton viewButton;
+ /** The about dialog. */
private JDialog aboutDialog;
- /** Stores user preferences */
+ /** Stores user preferences. */
private Preferences prefs = Preferences.userRoot().node("org/apache/uima/tools/AnnotationViewer");
/**
@@ -192,6 +201,7 @@ public class AnnotationViewerMain extend
// Event Handlling of "Exit" Menu Item
exitMenuItem.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent ae) {
savePreferences();
System.exit(0);
@@ -200,6 +210,7 @@ public class AnnotationViewerMain extend
// Event Handlling of "About" Menu Item
aboutMenuItem.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent ae) {
aboutDialog.setVisible(true);
}
@@ -207,6 +218,7 @@ public class AnnotationViewerMain extend
// Event Handlling of "Help" Menu Item
helpMenuItem.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent ae) {
JOptionPane.showMessageDialog(AnnotationViewerMain.this, HELP_MESSAGE,
"Annotation Viewer Help", JOptionPane.PLAIN_MESSAGE);
@@ -233,6 +245,7 @@ public class AnnotationViewerMain extend
// Event Handling of view Button
viewButton.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent ee) {
try {
viewDocuments();
@@ -248,6 +261,13 @@ public class AnnotationViewerMain extend
}
}
+ /**
+ * View documents.
+ *
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceInitializationException the resource initialization exception
+ */
public void viewDocuments() throws InvalidXMLException, IOException,
ResourceInitializationException {
File descriptorFile = new File(taeDescriptorFileSelector.getSelected());
@@ -296,8 +316,10 @@ public class AnnotationViewerMain extend
}
/**
- * @param tad
- * @param descFileName
+ * Gets the style map file.
+ *
+ * @param tad the tad
+ * @param descFileName the desc file name
* @return the style map file
* @throws IOException -
*/
@@ -317,8 +339,10 @@ public class AnnotationViewerMain extend
}
/**
- * @param tsd
- * @param descFileName
+ * Gets the style map file.
+ *
+ * @param tsd the tsd
+ * @param descFileName the desc file name
* @return the style map file
* @throws IOException -
*/
@@ -338,6 +362,9 @@ public class AnnotationViewerMain extend
/**
* Gets the name of the style map file for the given AE or TypeSystem descriptor filename.
+ *
+ * @param aDescriptorFileName the a descriptor file name
+ * @return the style map file name
*/
public File getStyleMapFileName(String aDescriptorFileName) {
String baseName;
@@ -350,10 +377,16 @@ public class AnnotationViewerMain extend
return new File(baseName + "StyleMap.xml");
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
public static void main(String[] args) {
final AnnotationViewerMain frame = new AnnotationViewerMain();
frame.addWindowListener(new WindowAdapter() {
+ @Override
public void windowClosing(WindowEvent e) {
frame.savePreferences();
System.exit(0);
@@ -453,6 +486,7 @@ public class AnnotationViewerMain extend
*
* @see java.awt.Component#getPreferredSize()
*/
+ @Override
public Dimension getPreferredSize() {
return new Dimension(640, 200);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java Sun Nov 13 16:08:24 2016
@@ -46,6 +46,7 @@ import org.apache.uima.tools.components.
import org.apache.uima.tools.components.XmlDetagger;
import org.apache.uima.util.AnalysisEnginePerformanceReports;
+// TODO: Auto-generated Javadoc
/**
* An example application that reads documents from the file system, sends them though an Analysis
* Engine(AE), and produces XML files with inline annotations. This application uses a
@@ -76,35 +77,50 @@ import org.apache.uima.util.AnalysisEngi
*/
public class RunAE implements StatusCallbackListener {
+ /** The ae specifier file. */
// Values read from cmd line args
private File aeSpecifierFile = null;
+ /** The input dir. */
private File inputDir = null;
+ /** The output dir. */
private File outputDir = null;
+ /** The xml tag name. */
private String xmlTagName = null;
+ /** The language. */
private String language;
+ /** The encoding. */
private String encoding;
+ /** The gen progress messages. */
private boolean genProgressMessages = true;
+ /** The stats level. */
private int statsLevel = 1;
+ /** The xcas input. */
private boolean xcasInput = false;
+ /** The xmi input. */
private boolean xmiInput = false;
+ /** The x lenient. */
private boolean xLenient = false;
+ /** The docs processed. */
int docsProcessed;
+ /** The m CPE. */
private CollectionProcessingEngine mCPE;
/**
* Constructor. Sets up and runs an Analysis Engine.
+ *
+ * @param args the args
*/
public RunAE(String[] args) {
try {
@@ -234,15 +250,23 @@ public class RunAE implements StatusCall
}
/**
+ * Initialization complete.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#initializationComplete()
*/
+ @Override
public void initializationComplete() {
}
/**
+ * Entity process complete.
+ *
+ * @param aCas the a cas
+ * @param aStatus the a status
* @see org.apache.uima.collection.StatusCallbackListener#entityProcessComplete(org.apache.uima.cas.CAS,
* org.apache.uima.collection.EntityProcessStatus)
*/
+ @Override
public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
if (aStatus.isException()) {
Iterator iter = aStatus.getExceptions().iterator();
@@ -267,22 +291,31 @@ public class RunAE implements StatusCall
}
/**
+ * Aborted.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#aborted()
*/
+ @Override
public void aborted() {
System.out.println("Processing Aborted");
}
/**
+ * Batch process complete.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#batchProcessComplete()
*/
+ @Override
public void batchProcessComplete() {
}
/**
+ * Collection process complete.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#collectionProcessComplete()
*/
+ @Override
public void collectionProcessComplete() {
// output performance stats
if (statsLevel > 0) {
@@ -298,14 +331,20 @@ public class RunAE implements StatusCall
}
/**
+ * Paused.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#paused()
*/
+ @Override
public void paused() {
}
/**
+ * Resumed.
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#resumed()
*/
+ @Override
public void resumed() {
}
@@ -337,7 +376,8 @@ public class RunAE implements StatusCall
/**
* Reads command line arguments and sets static class variables appropriately.
- *
+ *
+ * @param args the args
* @return true if command line args were valid, false if not
*/
private boolean processCmdLineArgs(String[] args) {
@@ -415,6 +455,11 @@ public class RunAE implements StatusCall
return (aeSpecifierFile != null) && (inputDir != null);
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
public static void main(String[] args) {
new RunAE(args);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java Sun Nov 13 16:08:24 2016
@@ -24,6 +24,7 @@ import org.apache.uima.UIMA_IllegalState
import org.apache.uima.resource.ResourceCreationSpecifier;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
/**
* Command-line utility for validating a descriptor. Supports CollectionReader, CasInitializer,
* AnalysisEngine, and CasConsumer descriptors.
@@ -32,9 +33,9 @@ public class ValidateDescriptor {
/**
* Runs the ValidateDescriptor tool.
- *
- * @param args
- * takes one argument, the path to a descriptor file.
+ *
+ * @param args takes one argument, the path to a descriptor file.
+ * @throws Exception the exception
*/
public static void main(String[] args) throws Exception {
if (args.length != 1) {
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java Sun Nov 13 16:08:24 2016
@@ -22,6 +22,7 @@ package org.apache.uima.tools.annot_view
import org.apache.uima.tools.cvd.CVD;
+// TODO: Auto-generated Javadoc
/**
* Compatibility class, delegates to the new {@link org.apache.uima.tools.cvd.CVD org.apache.uima.tools.cvd.CVD}.
*
@@ -31,7 +32,9 @@ import org.apache.uima.tools.cvd.CVD;
public class Gladis {
/**
- * @param args
+ * The main method.
+ *
+ * @param args the arguments
*/
public static void main(String[] args) {
CVD.main(args);
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java Sun Nov 13 16:08:24 2016
@@ -30,17 +30,34 @@ import org.apache.uima.resource.Resource
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class AnalysisEnginePanel.
+ */
public class AnalysisEnginePanel extends MetaDataPanel {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -5927337001602381195L;
+ /** The should run check box. */
JCheckBox shouldRunCheckBox = new JCheckBox((String) null, true);
+ /** The ae specifier. */
ResourceSpecifier aeSpecifier;
+ /** The specifier file. */
File specifierFile;
+ /** The last file sync timestamp. */
long lastFileSyncTimestamp;
+ /**
+ * Instantiates a new analysis engine panel.
+ *
+ * @param aeSpecifier the ae specifier
+ * @param specifierFile the specifier file
+ * @param fileModStamp the file mod stamp
+ */
public AnalysisEnginePanel(ResourceSpecifier aeSpecifier, File specifierFile, long fileModStamp) {
super(4); // 4 columns
this.aeSpecifier = aeSpecifier;
@@ -48,23 +65,50 @@ public class AnalysisEnginePanel extends
this.lastFileSyncTimestamp = fileModStamp;
}
+ /**
+ * Gets the analysis engine specifier.
+ *
+ * @return the analysis engine specifier
+ */
public ResourceSpecifier getAnalysisEngineSpecifier() {
return this.aeSpecifier;
}
+ /**
+ * Gets the last file sync timestamp.
+ *
+ * @return the last file sync timestamp
+ */
public long getLastFileSyncTimestamp() {
return this.lastFileSyncTimestamp;
}
+ /**
+ * Sets the last file sync timestamp.
+ *
+ * @param timestamp the new last file sync timestamp
+ */
public void setLastFileSyncTimestamp(long timestamp) {
this.lastFileSyncTimestamp = timestamp;
}
+ /**
+ * Checks for file changed.
+ *
+ * @param lastCheck the last check
+ * @return true, if successful
+ */
public boolean hasFileChanged(long lastCheck) {
return specifierFile.lastModified() > this.lastFileSyncTimestamp
&& specifierFile.lastModified() > lastCheck;
}
+ /**
+ * Refresh from file.
+ *
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public void refreshFromFile() throws InvalidXMLException, IOException {
clearAll();
this.aeSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java Sun Nov 13 16:08:24 2016
@@ -28,6 +28,7 @@ import javax.swing.JTextField;
import org.apache.uima.tools.util.gui.FileSelector;
import org.apache.uima.tools.util.gui.ListSelector;
+// TODO: Auto-generated Javadoc
/**
* Configuration Field class used for representation of resource parameters in dynamically created
* MetaDataPanels.
@@ -35,27 +36,32 @@ import org.apache.uima.tools.util.gui.Li
* @see org.apache.uima.tools.cpm.MetaDataPanel
*/
public class ConfigField {
+
+ /** The parameter name. */
private String parameterName;
+ /** The class string. */
private String classString;
+ /** The is multi valued. */
private boolean isMultiValued;
+ /** The field component. */
private JComponent fieldComponent;
+ /** The original value. */
private Object originalValue;
+ /** The last saved value. */
private Object lastSavedValue;
/**
- * @param pn
- * Resource parameter name e.g. outputDir
- * @param cs
- * String value of Java type used for value e.g. Integer
- * @param mv
- * true if the value is a multi-value array
- * @param c
- * Component used to represent field - Could be JTextField, JCheckBox, FileSelector or
+ * Instantiates a new config field.
+ *
+ * @param pn Resource parameter name e.g. outputDir
+ * @param cs String value of Java type used for value e.g. Integer
+ * @param mv true if the value is a multi-value array
+ * @param c Component used to represent field - Could be JTextField, JCheckBox, FileSelector or
* ListSelector
*/
public ConfigField(String pn, String cs, boolean mv, JComponent c) {
@@ -67,22 +73,47 @@ public class ConfigField {
lastSavedValue = originalValue;
}
+ /**
+ * Gets the parameter name.
+ *
+ * @return the parameter name
+ */
public String getParameterName() {
return parameterName;
}
+ /**
+ * Gets the class string.
+ *
+ * @return the class string
+ */
public String getClassString() {
return classString;
}
+ /**
+ * Gets the field component.
+ *
+ * @return the field component
+ */
public JComponent getFieldComponent() {
return fieldComponent;
}
+ /**
+ * Checks if is multi valued.
+ *
+ * @return true, if is multi valued
+ */
public boolean isMultiValued() {
return isMultiValued;
}
+ /**
+ * Gets the field value.
+ *
+ * @return the field value
+ */
public Object getFieldValue() {
if (fieldComponent instanceof JTextField) {
String fieldString = ((JTextField) fieldComponent).getText();
@@ -132,6 +163,11 @@ public class ConfigField {
return null;
}
+ /**
+ * Sets the field value.
+ *
+ * @param fieldValue the new field value
+ */
public void setFieldValue(Object fieldValue) {
if (fieldComponent instanceof JTextField) {
((JTextField) fieldComponent).setText(fieldValue.toString());
@@ -156,6 +192,8 @@ public class ConfigField {
/**
* Returns whether this field has been modified from its original value. This is not affected by
* whether the user has saved the new value; for that use isDirty().
+ *
+ * @return true, if is modified
*/
public boolean isModified() {
Object currentValue = getFieldValue();
@@ -171,6 +209,8 @@ public class ConfigField {
/**
* Returns whether this field has been modified since the last time the CPE descriptor was saved.
+ *
+ * @return true, if is dirty
*/
public boolean isDirty() {
Object currentValue = getFieldValue();
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java Sun Nov 13 16:08:24 2016
@@ -28,15 +28,31 @@ import org.apache.uima.resource.Resource
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ConsumerPanel.
+ */
public class ConsumerPanel extends MetaDataPanel {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -6822046781435538398L;
+ /** The cas consumer specifier. */
ResourceSpecifier casConsumerSpecifier;
+ /** The specifier file. */
File specifierFile;
+ /** The last file sync timestamp. */
long lastFileSyncTimestamp;
+ /**
+ * Instantiates a new consumer panel.
+ *
+ * @param casConsumerSpecifier the cas consumer specifier
+ * @param specifierFile the specifier file
+ * @param fileModStamp the file mod stamp
+ */
public ConsumerPanel(ResourceSpecifier casConsumerSpecifier, File specifierFile, long fileModStamp) {
super(4); // 4 columns
this.casConsumerSpecifier = casConsumerSpecifier;
@@ -45,23 +61,50 @@ public class ConsumerPanel extends MetaD
this.lastFileSyncTimestamp = fileModStamp;
}
+ /**
+ * Gets the cas consumer specifier.
+ *
+ * @return the cas consumer specifier
+ */
public ResourceSpecifier getCasConsumerSpecifier() {
return this.casConsumerSpecifier;
}
+ /**
+ * Gets the last file sync timestamp.
+ *
+ * @return the last file sync timestamp
+ */
public long getLastFileSyncTimestamp() {
return this.lastFileSyncTimestamp;
}
+ /**
+ * Sets the last file sync timestamp.
+ *
+ * @param timestamp the new last file sync timestamp
+ */
public void setLastFileSyncTimestamp(long timestamp) {
this.lastFileSyncTimestamp = timestamp;
}
+ /**
+ * Checks for file changed.
+ *
+ * @param lastCheck the last check
+ * @return true, if successful
+ */
public boolean hasFileChanged(long lastCheck) {
return specifierFile.lastModified() > this.lastFileSyncTimestamp
&& specifierFile.lastModified() > lastCheck;
}
+ /**
+ * Refresh from file.
+ *
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public void refreshFromFile() throws InvalidXMLException, IOException {
clearAll();
this.casConsumerSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java Sun Nov 13 16:08:24 2016
@@ -46,21 +46,36 @@ import org.apache.uima.tools.images.Imag
import org.apache.uima.tools.util.gui.FileChooserBugWorkarounds;
import org.apache.uima.tools.util.gui.AboutDialog;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CpmFrame.
+ */
public class CpmFrame extends JFrame implements ActionListener {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 756368351780483658L;
+ /** The cpm panel. */
private CpmPanel cpmPanel;
+ /** The menu bar. */
private JMenuBar menuBar;
+ /** The exit menu item. */
private JMenuItem exitMenuItem;
+ /** The about menu item. */
private JMenuItem aboutMenuItem;
+ /** The help menu item. */
private JMenuItem helpMenuItem;
+ /** The about dialog. */
private JDialog aboutDialog;
+ /**
+ * Instantiates a new cpm frame.
+ */
public CpmFrame() {
super("Collection Processing Engine Configurator");
@@ -102,6 +117,11 @@ public class CpmFrame extends JFrame imp
this.pack();
}
+ /**
+ * Creates the menu bar.
+ *
+ * @return the j menu bar
+ */
private JMenuBar createMenuBar() {
menuBar = new JMenuBar();
@@ -137,6 +157,10 @@ public class CpmFrame extends JFrame imp
return menuBar;
}
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
public void actionPerformed(ActionEvent ev) {
Object source = ev.getSource();
@@ -150,6 +174,10 @@ public class CpmFrame extends JFrame imp
}
}
+ /* (non-Javadoc)
+ * @see java.awt.Container#getPreferredSize()
+ */
+ @Override
public Dimension getPreferredSize() {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
return new Dimension(screenSize.width, (screenSize.height - 65));
@@ -157,6 +185,8 @@ public class CpmFrame extends JFrame imp
/**
* Runs the application.
+ *
+ * @param args the arguments
*/
public static void main(String[] args) {
//GUI creation must be done in the event handler thread, because Swing is
@@ -164,6 +194,7 @@ public class CpmFrame extends JFrame imp
//because it's initialization can be quite complex (it loads the last known
//CPE descriptor).
SwingUtilities.invokeLater(new Runnable() {
+ @Override
public void run() {
initGUI();
}
@@ -179,11 +210,13 @@ public class CpmFrame extends JFrame imp
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter() {
+ @Override
public void windowClosing(WindowEvent e) {
if (frame.cpmPanel.confirmExit())
System.exit(0);
}
+ @Override
public void windowActivated(WindowEvent e) {
frame.cpmPanel.checkForOutOfSyncFiles();
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java Sun Nov 13 16:08:24 2016
@@ -33,7 +33,6 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
-import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
@@ -102,10 +101,17 @@ import org.apache.uima.util.Progress;
import org.apache.uima.util.UriUtils;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class CpmPanel.
+ */
public class CpmPanel extends JPanel implements ActionListener, FileSelectorListener,
TabClosedListener, TransportControlListener {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -5096300176103368922L;
+ /** The Constant HELP_MESSAGE. */
public static final String HELP_MESSAGE = "Instructions for using UIMA Collection Processing Engine Configurator:\n\n"
+ "Select a Collection Reader descriptor using the Browse button in the topmost panel.\n\n"
+ "On the Analyis Engines panel and the CAS Consumers panel, use the Add button to select Analysis Engine (AE) \n"
@@ -117,120 +123,178 @@ public class CpmPanel extends JPanel imp
+ "The View menu contains an option to display the CAS Initializer panel. CAS Initializers are deprecated \n"
+ "since UIMA version 2.0, but are still supported by this tool.";
+ /** The Constant PREFS_CPE_DESCRIPTOR_FILE. */
private static final String PREFS_CPE_DESCRIPTOR_FILE = "cpeDescriptorFile";
+ /** The Constant PREFS_SAVE_USING_IMPORTS. */
private static final String PREFS_SAVE_USING_IMPORTS ="saveUsingImports";
+ /** The open cpe desc menu item. */
private JMenuItem openCpeDescMenuItem;
+ /** The save cpe desc menu item. */
private JMenuItem saveCpeDescMenuItem;
+ /** The refresh menu item. */
private JMenuItem refreshMenuItem;
+ /** The clear all menu item. */
private JMenuItem clearAllMenuItem;
+ /** The main split pane. */
private JSplitPane mainSplitPane;
+ /** The reader initializer split pane. */
private JSplitPane readerInitializerSplitPane;
+ /** The collection reader panel. */
private ResetableMetaDataPanel collectionReaderPanel;
+ /** The collection reader titled border. */
private TitledBorder collectionReaderTitledBorder;
+ /** The cas initializer panel. */
private ResetableMetaDataPanel casInitializerPanel;
+ /** The cas initializer titled border. */
private TitledBorder casInitializerTitledBorder;
+ /** The reader file selector. */
private FileSelector readerFileSelector;
+ /** The cas initializer file selector. */
private FileSelector casInitializerFileSelector;
+ /** The ae main panel. */
private JPanel aeMainPanel;
+ /** The ae tabbed pane. */
private JTabbedPaneWithCloseIcons aeTabbedPane;
+ /** The move ae right button. */
private JButton moveAeRightButton;
+ /** The move ae left button. */
private JButton moveAeLeftButton;
+ /** The add ae button. */
private JButton addAeButton;
+ /** The ae titled border. */
private TitledBorder aeTitledBorder;
+ /** The consumers panel. */
private JPanel consumersPanel;
+ /** The consumer titled border. */
private TitledBorder consumerTitledBorder;
+ /** The add consumer button. */
private JButton addConsumerButton;
+ /** The move consumer right button. */
private JButton moveConsumerRightButton;
+ /** The move consumer left button. */
private JButton moveConsumerLeftButton;
+ /** The consumer tabbed pane. */
private JTabbedPaneWithCloseIcons consumerTabbedPane;
+ /** The ae specifiers. */
private Vector aeSpecifiers = new Vector();
+ /** The consumer specifiers. */
private Vector consumerSpecifiers = new Vector();
+ /** The progress bar. */
// private static LogDialog logDialog;
private JProgressBar progressBar;
+ /** The transport control panel. */
private TransportControlPanel transportControlPanel;
+ /** The start button. */
private AbstractButton startButton;
+ /** The stop button. */
private AbstractButton stopButton;
+ /** The status label. */
private JLabel statusLabel;
+ /** The progress timer. */
private Timer progressTimer;
+ /** The elapsed time. */
private int elapsedTime;
+ /** The performance query timer. */
private Timer performanceQueryTimer;
+ /** The collection reader desc. */
private CollectionReaderDescription collectionReaderDesc;
+ /** The cas initializer desc. */
private CasInitializerDescription casInitializerDesc;
+ /** The m CPE. */
private CollectionProcessingEngine mCPE;
+ /** The indeterminate progress pause. */
private boolean indeterminateProgressPause;
+ /** The ae file chooser. */
private JFileChooser aeFileChooser;
+ /** The consumer file chooser. */
private JFileChooser consumerFileChooser;
+ /** The open save file chooser. */
private JFileChooser openSaveFileChooser;
+ /** The file chooser root dir. */
private File fileChooserRootDir;
+ /** The collection reader last file sync timestamp. */
private long collectionReaderLastFileSyncTimestamp;
+ /** The cas initializer last file sync timestamp. */
private long casInitializerLastFileSyncTimestamp;
+ /** The last file sync user prompt time. */
private long lastFileSyncUserPromptTime;
- /** Stores user preferences */
+ /** Stores user preferences. */
private Preferences prefs = Preferences.userRoot().node("org/apache/uima/tools/CPE_GUI");
+ /** The m shutting down. */
private boolean mShuttingDown;
+ /** The m paused. */
private boolean mPaused;
+ /** The selected components changed. */
private boolean selectedComponentsChanged = false;
+ /** The view cas initializer panel menu item. */
private JMenuItem viewCasInitializerPanelMenuItem;
+ /** The current cpe desc. */
private CpeDescription currentCpeDesc = createEmptyCpeDescription();
+ /** The default resource manager. */
private final ResourceManager defaultResourceManager = UIMAFramework.newDefaultResourceManager();
+ /** The save using imports. */
private boolean saveUsingImports = true;
+ /** The save using import menu item. */
private JCheckBoxMenuItem saveUsingImportMenuItem;
+ /**
+ * Instantiates a new cpm panel.
+ */
public CpmPanel() {
super();
@@ -460,6 +524,11 @@ public class CpmPanel extends JPanel imp
openSaveFileChooser.setFileFilter(new XMLFileFilter());
}
+ /**
+ * Gets the parent frame.
+ *
+ * @return the parent frame
+ */
private Frame getParentFrame() {
Component parent = this.getParent();
while (parent != null && !(parent instanceof Frame)) {
@@ -469,8 +538,8 @@ public class CpmPanel extends JPanel imp
}
/**
- * Creates JMenuItems that should be added to the File menu
- *
+ * Creates JMenuItems that should be added to the File menu.
+ *
* @return a List of JMenuItems
*/
public List createFileMenuItems() {
@@ -503,8 +572,8 @@ public class CpmPanel extends JPanel imp
}
/**
- * Creates JMenuItems that should be added to the View menu
- *
+ * Creates JMenuItems that should be added to the View menu.
+ *
* @return a List of JMenuItems
*/
public List createViewMenuItems() {
@@ -518,6 +587,11 @@ public class CpmPanel extends JPanel imp
return menuItemList;
}
+ /**
+ * Sets the cas initializer panel visible.
+ *
+ * @param visible the new cas initializer panel visible
+ */
private void setCasInitializerPanelVisible(boolean visible) {
casInitializerPanel.setVisible(visible);
if (viewCasInitializerPanelMenuItem != null) {
@@ -528,6 +602,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Read preferences.
+ */
private void readPreferences() {
String cpeDescFileString = prefs.get(PREFS_CPE_DESCRIPTOR_FILE, null);
if (cpeDescFileString != null) {
@@ -546,6 +623,11 @@ public class CpmPanel extends JPanel imp
setSaveUsingImports("true".equalsIgnoreCase(saveUsingImportsString));
}
+ /**
+ * Sets the save using imports.
+ *
+ * @param b the new save using imports
+ */
private void setSaveUsingImports(boolean b) {
saveUsingImports = b;
if (saveUsingImportMenuItem != null)
@@ -553,6 +635,9 @@ public class CpmPanel extends JPanel imp
prefs.put(PREFS_SAVE_USING_IMPORTS, Boolean.toString(b));
}
+ /**
+ * Start processing.
+ */
private void startProcessing() {
// Check that Collection Reader is selected
if (collectionReaderDesc == null) {
@@ -588,6 +673,8 @@ public class CpmPanel extends JPanel imp
/**
* Updates the configuration parameter settings in this.currentCpeDesc to match the current state
* of the GUI.
+ *
+ * @throws Exception the exception
*/
private void updateCpeDescriptionParameterOverrides() throws Exception {
// first check for descriptors out of sync with filesystem
@@ -652,14 +739,10 @@ public class CpmPanel extends JPanel imp
/**
* Called by createCpeDescription to add configuration parameter overrides to the CpeDescription
* being constructed, based on the user's changes in the GUI.
- *
- * @param aSettings
- * the CasProcessorConfigurationParameterSettings element that will be modified
- * @param aPanel
- * the GUI panel representing settings for the CAS Processor
- * @param aClearDirty
- * whether to clear the dirty bit of each field. This should be set to true when this
- * method is called during the act of saving the CPE descriptor.
+ *
+ * @param aSettings the CasProcessorConfigurationParameterSettings element that will be modified
+ * @param aPanel the GUI panel representing settings for the CAS Processor
+ * @throws CpeDescriptorException the cpe descriptor exception
*/
private void createParameterOverrides(CasProcessorConfigurationParameterSettings aSettings,
MetaDataPanel aPanel) throws CpeDescriptorException {
@@ -693,6 +776,10 @@ public class CpmPanel extends JPanel imp
selectedComponentsChanged = false;
}
+ /* (non-Javadoc)
+ * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+ */
+ @Override
public void actionPerformed(ActionEvent ev) {
Object source = ev.getSource();
@@ -709,6 +796,7 @@ public class CpmPanel extends JPanel imp
progressBar.setValue(0);
final Thread worker = new Thread() {
+ @Override
public void run() {
startProcessing();
}
@@ -878,6 +966,11 @@ public class CpmPanel extends JPanel imp
consumersPanel.validate();
}
+ /**
+ * Creates the empty cpe description.
+ *
+ * @return the cpe description
+ */
private CpeDescription createEmptyCpeDescription() {
CpeDescription cpeDesc = CpeDescriptorFactory.produceDescriptor();
// We use CAS pool size default of 3
@@ -915,6 +1008,12 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Do save cpe descriptor.
+ *
+ * @param aFile the a file
+ * @throws Exception the exception
+ */
private void doSaveCpeDescriptor(File aFile) throws Exception {
// update the parameter overrides according to GUI settings
updateCpeDescriptionParameterOverrides();
@@ -946,7 +1045,10 @@ public class CpmPanel extends JPanel imp
}
/**
- * @param file
+ * Update imports.
+ *
+ * @param cpeDescSaveFile the cpe desc save file
+ * @throws Exception the exception
*/
private void updateImports(File cpeDescSaveFile) throws Exception {
CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
@@ -966,8 +1068,11 @@ public class CpmPanel extends JPanel imp
}
/**
- * @param descriptor
- * @param cpeDescSaveFile
+ * Update import.
+ *
+ * @param descriptor the descriptor
+ * @param cpeDescSaveFile the cpe desc save file
+ * @throws Exception the exception
*/
private void updateImport(CpeComponentDescriptor descriptor, File cpeDescSaveFile) throws Exception {
//don't touch import by name
@@ -995,13 +1100,18 @@ public class CpmPanel extends JPanel imp
/**
* Utility method for convertion a URL to a File name, taking care of
* proper escaping.
+ *
* @param url a URL
* @return File corresponding to that URL
+ * @throws URISyntaxException the URI syntax exception
*/
private File urlToFile(URL url) throws URISyntaxException {
return new File(UriUtils.quote(url));
}
+ /**
+ * Display progress.
+ */
private void displayProgress() {
if (mCPE != null) {
try {
@@ -1034,7 +1144,11 @@ public class CpmPanel extends JPanel imp
}
}
- /** Ask user to confirm exist. Return true if they confirm, false if not. */
+ /**
+ * Ask user to confirm exist. Return true if they confirm, false if not.
+ *
+ * @return true, if successful
+ */
public boolean confirmExit() {
mShuttingDown = true;
// ask for confirm if CPM is processing
@@ -1075,6 +1189,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Check for out of sync files.
+ */
public void checkForOutOfSyncFiles() {
StringBuffer componentNames = new StringBuffer();
@@ -1123,6 +1240,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Refresh out of sync files.
+ */
public void refreshOutOfSyncFiles() {
if (collectionReaderDesc != null) {
File readerSpecifierFile = new File(readerFileSelector.getSelected());
@@ -1234,6 +1354,15 @@ public class CpmPanel extends JPanel imp
displayError(message);
}
+ /**
+ * Populate collection reader panel.
+ *
+ * @param cpeColRdr the cpe col rdr
+ * @return true, if successful
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private boolean populateCollectionReaderPanel(CpeCollectionReaderIterator cpeColRdr)
throws InvalidXMLException, IOException, ResourceConfigurationException {
try {
@@ -1294,6 +1423,15 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Populate cas initializer panel.
+ *
+ * @param cpeCasIni the cpe cas ini
+ * @return true, if successful
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private boolean populateCasInitializerPanel(CpeCollectionReaderCasInitializer cpeCasIni)
throws InvalidXMLException, IOException, ResourceConfigurationException {
try {
@@ -1356,6 +1494,15 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Adds the AE.
+ *
+ * @param aeSpecifierFile the ae specifier file
+ * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private void addAE(String aeSpecifierFile) throws CpeDescriptorException, InvalidXMLException,
IOException, ResourceConfigurationException {
String tempAeName = new File(aeSpecifierFile).getName(); // overriden later
@@ -1371,6 +1518,16 @@ public class CpmPanel extends JPanel imp
addAE(casProc);
}
+ /**
+ * Adds the AE.
+ *
+ * @param cpeCasProc the cpe cas proc
+ * @return true, if successful
+ * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private boolean addAE(CpeCasProcessor cpeCasProc) throws CpeDescriptorException,
InvalidXMLException, IOException, ResourceConfigurationException {
URL aeSpecifierUrl = cpeCasProc.getCpeComponentDescriptor().findAbsoluteUrl(defaultResourceManager);
@@ -1412,6 +1569,15 @@ public class CpmPanel extends JPanel imp
return true;
}
+ /**
+ * Adds the consumer.
+ *
+ * @param consumerSpecifierFile the consumer specifier file
+ * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private void addConsumer(String consumerSpecifierFile) throws CpeDescriptorException,
InvalidXMLException, IOException, ResourceConfigurationException {
String tempName = new File(consumerSpecifierFile).getName(); // overriden later
@@ -1426,6 +1592,16 @@ public class CpmPanel extends JPanel imp
addConsumer(casProc);
}
+ /**
+ * Adds the consumer.
+ *
+ * @param cpeCasProc the cpe cas proc
+ * @return true, if successful
+ * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private boolean addConsumer(CpeCasProcessor cpeCasProc) throws CpeDescriptorException,
InvalidXMLException, IOException, ResourceConfigurationException {
URL consumerSpecifierUrl = cpeCasProc.getCpeComponentDescriptor().findAbsoluteUrl(
@@ -1468,6 +1644,12 @@ public class CpmPanel extends JPanel imp
return true;
}
+ /**
+ * Make unique cas processor name.
+ *
+ * @param baseName the base name
+ * @return the string
+ */
private String makeUniqueCasProcessorName(String baseName) {
if (aeTabbedPane.indexOfTab(baseName) == -1 && consumerTabbedPane.indexOfTab(baseName) == -1)
return baseName;
@@ -1481,6 +1663,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Removes the all A es and consumers.
+ */
private void removeAllAEsAndConsumers() {
aeTabbedPane.removeAll();
aeSpecifiers.clear();
@@ -1489,7 +1674,11 @@ public class CpmPanel extends JPanel imp
consumerSpecifiers.clear();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.util.gui.FileSelectorListener#fileSelected(javax.swing.JComponent, java.lang.String)
+ */
// FileSelectorListener:
+ @Override
public boolean fileSelected(JComponent source, String fileString) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@@ -1555,7 +1744,11 @@ public class CpmPanel extends JPanel imp
return rv;
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.cpm.TabClosedListener#tabClosed(org.apache.uima.tools.cpm.JTabbedPaneWithCloseIcons, int)
+ */
// TabClosedListener:
+ @Override
public void tabClosed(JTabbedPaneWithCloseIcons source, int tabPos) {
try {
if (source == consumerTabbedPane) {
@@ -1571,12 +1764,20 @@ public class CpmPanel extends JPanel imp
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.util.gui.TransportControlListener#controlStarted()
+ */
+ @Override
public void controlStarted() {
statusLabel.setText("Initializing");
progressBar.setIndeterminate(true);
setFrameEnabled(false);
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.util.gui.TransportControlListener#controlPaused()
+ */
+ @Override
public void controlPaused() {
mPaused = true;
statusLabel.setText("Paused");
@@ -1597,6 +1798,10 @@ public class CpmPanel extends JPanel imp
"Processing is paused.");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.util.gui.TransportControlListener#controlResumed()
+ */
+ @Override
public void controlResumed() {
mPaused = false;
statusLabel.setText("Resumed");
@@ -1609,6 +1814,10 @@ public class CpmPanel extends JPanel imp
performanceQueryTimer.restart();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.tools.util.gui.TransportControlListener#controlStopped()
+ */
+ @Override
public void controlStopped() {
try {
mCPE.stop();
@@ -1617,6 +1826,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Reset screen.
+ */
private void resetScreen() {
progressTimer.stop();
performanceQueryTimer.stop();
@@ -1693,6 +1905,9 @@ public class CpmPanel extends JPanel imp
clearAllMenuItem.setEnabled(onOff);
}
+ /**
+ * On completion.
+ */
public void onCompletion() {
try {
// statusLabel.setText("Completed (" + statusLabel.getText() + ")");
@@ -1715,6 +1930,9 @@ public class CpmPanel extends JPanel imp
}
}
+ /**
+ * Prints the stats.
+ */
public void printStats() {
// logDialog.write( mCPM.getPerformanceReport().toString());
}
@@ -1748,6 +1966,15 @@ public class CpmPanel extends JPanel imp
return false;
}
+ /**
+ * Open cpe descriptor.
+ *
+ * @param aFile the a file
+ * @throws InvalidXMLException the invalid XML exception
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws CpeDescriptorException the cpe descriptor exception
+ * @throws ResourceConfigurationException the resource configuration exception
+ */
private void openCpeDescriptor(File aFile) throws InvalidXMLException, IOException,
CpeDescriptorException, ResourceConfigurationException {
// parse
@@ -1812,7 +2039,10 @@ public class CpmPanel extends JPanel imp
}
/**
- * @param specifier
+ * Checks if is cas consumer specifier.
+ *
+ * @param specifier the specifier
+ * @return true, if is cas consumer specifier
*/
private boolean isCasConsumerSpecifier(ResourceSpecifier specifier) {
if (specifier instanceof CasConsumerDescription) {
@@ -1824,7 +2054,15 @@ public class CpmPanel extends JPanel imp
return false;
}
+ /**
+ * The Class StatusCallbackListenerImpl.
+ */
class StatusCallbackListenerImpl implements StatusCallbackListener {
+
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#initializationComplete()
+ */
+ @Override
public void initializationComplete() {
// init progress bar
int nrFiles = -1;
@@ -1849,6 +2087,10 @@ public class CpmPanel extends JPanel imp
progressTimer.start();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.StatusCallbackListener#entityProcessComplete(org.apache.uima.cas.CAS, org.apache.uima.collection.EntityProcessStatus)
+ */
+ @Override
public void entityProcessComplete(CAS aCas, EntityProcessStatus aStatus) {
// report an error if it occurred
if (aStatus.isException()) {
@@ -1857,21 +2099,41 @@ public class CpmPanel extends JPanel imp
}
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#batchProcessComplete()
+ */
+ @Override
public void batchProcessComplete() {
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#collectionProcessComplete()
+ */
+ @Override
public void collectionProcessComplete() {
onCompletion();
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#paused()
+ */
+ @Override
public void paused() {
System.out.println("StatusCallbackListenerImpl::paused()");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#resumed()
+ */
+ @Override
public void resumed() {
System.out.println("StatusCallbackListenerImpl::resumed");
}
+ /* (non-Javadoc)
+ * @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#aborted()
+ */
+ @Override
public void aborted() {
if (!mShuttingDown && !mPaused) {
PerformanceReportDialog perfReportDlg = new PerformanceReportDialog(CpmPanel.this
@@ -1889,12 +2151,22 @@ public class CpmPanel extends JPanel imp
* to clear out related components when specifier file selection changes.
*/
static class ResetableMetaDataPanel extends MetaDataPanel {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -4573780175511175666L;
+ /**
+ * Instantiates a new resetable meta data panel.
+ */
public ResetableMetaDataPanel() {
super();
}
+ /**
+ * Instantiates a new resetable meta data panel.
+ *
+ * @param nrColumns the nr columns
+ */
public ResetableMetaDataPanel(int nrColumns) {
super(nrColumns);
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java Sun Nov 13 16:08:24 2016
@@ -19,7 +19,18 @@
package org.apache.uima.tools.cpm;
+// TODO: Auto-generated Javadoc
+/**
+ * The Class ElapsedTimeFormatter.
+ */
final public class ElapsedTimeFormatter {
+
+ /**
+ * Format.
+ *
+ * @param totalSecs the total secs
+ * @return the string
+ */
public static String format(int totalSecs) {
int hours = 0;
int mins = totalSecs / 60;
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java Sun Nov 13 16:08:24 2016
@@ -29,6 +29,7 @@ import java.awt.event.MouseListener;
import javax.swing.Icon;
import javax.swing.JTabbedPane;
+// TODO: Auto-generated Javadoc
/**
* A JTabbedPane which has a close ('X') icon on each tab. To add a tab, use the method
* addTab(String, Component) To have an extra icon on each tab (e.g. showing the file type) use the
@@ -38,27 +39,55 @@ import javax.swing.JTabbedPane;
*/
public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListener {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 7680554379341154297L;
+ /** The tab closed listener. */
private TabClosedListener tabClosedListener;
+ /**
+ * Instantiates a new j tabbed pane with close icons.
+ */
public JTabbedPaneWithCloseIcons() {
super();
addMouseListener(this);
}
+ /**
+ * Adds the tab closed listener.
+ *
+ * @param aTabClosedListener the a tab closed listener
+ */
public void addTabClosedListener(TabClosedListener aTabClosedListener) {
this.tabClosedListener = aTabClosedListener;
}
+ /* (non-Javadoc)
+ * @see javax.swing.JTabbedPane#addTab(java.lang.String, java.awt.Component)
+ */
+ @Override
public void addTab(String title, Component component) {
this.addTab(title, component, null);
}
+ /**
+ * Adds the tab.
+ *
+ * @param title the title
+ * @param component the component
+ * @param extraIcon the extra icon
+ */
public void addTab(String title, Component component, Icon extraIcon) {
super.addTab(title, new CloseTabIcon(extraIcon), component);
}
+ /**
+ * Move tab.
+ *
+ * @param fromIndex the from index
+ * @param toIndex the to index
+ */
public void moveTab(int fromIndex, int toIndex) {
Component componentToMove = this.getComponentAt(fromIndex);
String title = this.getTitleAt(fromIndex);
@@ -68,6 +97,10 @@ public class JTabbedPaneWithCloseIcons e
this.setTitleAt(toIndex, title);
}
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+ */
+ @Override
public void mouseClicked(MouseEvent e) {
int tabIndex = getUI().tabForCoordinate(this, e.getX(), e.getY());
if (tabIndex < 0)
@@ -80,15 +113,31 @@ public class JTabbedPaneWithCloseIcons e
}
}
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+ */
+ @Override
public void mouseEntered(MouseEvent e) {
}
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+ */
+ @Override
public void mouseExited(MouseEvent e) {
}
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+ */
+ @Override
public void mousePressed(MouseEvent e) {
}
+ /* (non-Javadoc)
+ * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+ */
+ @Override
public void mouseReleased(MouseEvent e) {
}
}
@@ -115,6 +164,7 @@ class CloseTabIcon implements Icon {
height = 16;
}
+ @Override
public void paintIcon(Component c, Graphics g, int x, int y) {
this.x_pos = x;
this.y_pos = y;
@@ -136,10 +186,12 @@ class CloseTabIcon implements Icon {
fileIcon.paintIcon(c, g, x + width, y_p);
}
+ @Override
public int getIconWidth() {
return width + (fileIcon != null ? fileIcon.getIconWidth() : 0);
}
+ @Override
public int getIconHeight() {
return height;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java Sun Nov 13 16:08:24 2016
@@ -41,6 +41,7 @@ import org.apache.uima.tools.util.gui.Fi
import org.apache.uima.tools.util.gui.FormPanel;
import org.apache.uima.tools.util.gui.ListSelector;
+// TODO: Auto-generated Javadoc
/**
*
* A dynamically generated form panel with components generated from configuration parameters
@@ -51,21 +52,39 @@ import org.apache.uima.tools.util.gui.Li
*/
public class MetaDataPanel extends FormPanel {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 2002216386886772644L;
+ /** The meta data. */
ResourceMetaData metaData;
+ /** The fields list. */
ArrayList fieldsList = new ArrayList();
// Contains ConfigFields
+ /**
+ * Instantiates a new meta data panel.
+ */
public MetaDataPanel() {
}
+ /**
+ * Instantiates a new meta data panel.
+ *
+ * @param nrColumns the nr columns
+ */
public MetaDataPanel(int nrColumns) {
super(nrColumns);
}
+ /**
+ * Populate.
+ *
+ * @param md the md
+ * @param overrides the overrides
+ */
public void populate(ResourceMetaData md, CasProcessorConfigurationParameterSettings overrides) {
metaData = md;
@@ -146,19 +165,29 @@ public class MetaDataPanel extends FormP
}
}
+ /**
+ * Gets the meta data.
+ *
+ * @return the meta data
+ */
public ResourceMetaData getMetaData() {
return metaData;
}
+ /**
+ * Gets the values.
+ *
+ * @return the values
+ */
public List getValues() {
return fieldsList;
}
/**
- * @param fieldName
- * Configuration parameter field name
- * @param fieldValue
- * Field value
+ * Sets the value.
+ *
+ * @param fieldName Configuration parameter field name
+ * @param fieldValue Field value
*/
public void setValue(String fieldName, Object fieldValue) {
// Find fieldName in fieldList:
@@ -171,7 +200,9 @@ public class MetaDataPanel extends FormP
}
}
- /** Removes all fields */
+ /**
+ * Removes all fields.
+ */
public void clearAll() {
Component components[] = gridBagPanel.getComponents();
for (int i = (components.length - 1); i >= 0; i--) {
@@ -184,6 +215,8 @@ public class MetaDataPanel extends FormP
/**
* Returns whether this panel has been modified from its original configuration. Note that this is
* not affected by saves. For that, use isDirty().
+ *
+ * @return true, if is modified
*/
public boolean isModified() {
List fields = getValues();
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java Sun Nov 13 16:08:24 2016
@@ -38,25 +38,37 @@ import javax.swing.tree.DefaultTreeModel
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.ProcessTraceEvent;
+// TODO: Auto-generated Javadoc
/**
* Mock-up of dialog for reporting performance stats.
*
*/
public class PerformanceReportDialog extends JDialog {
+
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 7747258424181047062L;
+ /** The status label. */
private JLabel statusLabel = new JLabel("Processing completed successfully.");
+ /** The docs processed label. */
private JLabel docsProcessedLabel = new JLabel("Documents Processed: 0");
+ /** The total time label. */
private JLabel totalTimeLabel = new JLabel("Total Time: 0.0 seconds");
+ /** The tree. */
private JTree tree = new JTree();
+ /** The m event type map. */
private Map mEventTypeMap;
/**
- * @throws java.awt.HeadlessException
+ * Instantiates a new performance report dialog.
+ *
+ * @param aFrame the a frame
+ * @throws HeadlessException the headless exception
+ * @throws java.awt.HeadlessException the java.awt. headless exception
*/
public PerformanceReportDialog(Frame aFrame) throws HeadlessException {
super(aFrame, true);
@@ -83,6 +95,13 @@ public class PerformanceReportDialog ext
}
+ /**
+ * Display stats.
+ *
+ * @param aProcessTrace the a process trace
+ * @param aNumDocsProcessed the a num docs processed
+ * @param aStatusMessage the a status message
+ */
public void displayStats(ProcessTrace aProcessTrace, int aNumDocsProcessed, String aStatusMessage) {
statusLabel.setText(aStatusMessage);
docsProcessedLabel.setText("Documents Processed: " + aNumDocsProcessed);
@@ -111,6 +130,13 @@ public class PerformanceReportDialog ext
this.setVisible(true);
}
+ /**
+ * Builds the event tree.
+ *
+ * @param aEvent the a event
+ * @param aParentNode the a parent node
+ * @param aTotalTime the a total time
+ */
public void buildEventTree(ProcessTraceEvent aEvent, DefaultMutableTreeNode aParentNode,
long aTotalTime) {
final DecimalFormat pctFmt = new DecimalFormat("##.##%");
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java Sun Nov 13 16:08:24 2016
@@ -19,18 +19,19 @@
package org.apache.uima.tools.cpm;
+// TODO: Auto-generated Javadoc
/**
- *
- * Callback interface used in conjunction with JTabbedPaneWithCloseIcons
- *
+ * Callback interface used in conjunction with JTabbedPaneWithCloseIcons.
+ *
* @see org.apache.uima.tools.cpm.JTabbedPaneWithCloseIcons
*/
public interface TabClosedListener {
+
/**
- * @param source
- * the JTabbedPaneWithCloseIcons control sending this event
- * @param tabPos
- * position of the tab that was closed
+ * Tab closed.
+ *
+ * @param source the JTabbedPaneWithCloseIcons control sending this event
+ * @param tabPos position of the tab that was closed
*/
public void tabClosed(JTabbedPaneWithCloseIcons source, int tabPos);
}