You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by re...@apache.org on 2022/02/10 14:37:13 UTC
[uima-uimaj] 06/15: [UIMA-6373] Format UIMA Core Java SDK codebase
This is an automated email from the ASF dual-hosted git repository.
rec pushed a commit to branch refactoring/UIMA-6373-Format-UIMA-Core-Java-SDK-codebase
in repository https://gitbox.apache.org/repos/asf/uima-uimaj.git
commit e3c64769669937180940a95946a1ef85ca5c2cef
Author: Richard Eckart de Castilho <re...@apache.org>
AuthorDate: Thu Feb 10 15:08:09 2022 +0100
[UIMA-6373] Format UIMA Core Java SDK codebase
- Auto-format
---
.../uima/tools/AnnotationFeaturesViewer.java | 17 +-
.../apache/uima/tools/AnnotationViewerMain.java | 67 +-
.../src/main/java/org/apache/uima/tools/RunAE.java | 65 +-
.../org/apache/uima/tools/ValidateDescriptor.java | 7 +-
.../org/apache/uima/tools/annot_view/Gladis.java | 8 +-
.../components/FileSystemCollectionReader.java | 25 +-
.../tools/components/InlineXmlCasConsumer.java | 15 +-
.../tools/components/XCasWriterCasConsumer.java | 7 +-
.../tools/components/XmiWriterCasConsumer.java | 23 +-
.../apache/uima/tools/components/XmlDetagger.java | 29 +-
.../apache/uima/tools/cpm/AnalysisEnginePanel.java | 28 +-
.../org/apache/uima/tools/cpm/ConfigField.java | 18 +-
.../org/apache/uima/tools/cpm/ConsumerPanel.java | 31 +-
.../java/org/apache/uima/tools/cpm/CpmFrame.java | 28 +-
.../java/org/apache/uima/tools/cpm/CpmPanel.java | 468 ++++++-----
.../uima/tools/cpm/ElapsedTimeFormatter.java | 6 +-
.../uima/tools/cpm/JTabbedPaneWithCloseIcons.java | 45 +-
.../org/apache/uima/tools/cpm/MetaDataPanel.java | 29 +-
.../uima/tools/cpm/PerformanceReportDialog.java | 41 +-
.../apache/uima/tools/cpm/TabClosedListener.java | 9 +-
.../cvd/AnnotationDisplayCustomizationFrame.java | 124 +--
.../apache/uima/tools/cvd/AnnotationExtent.java | 11 +-
.../java/org/apache/uima/tools/cvd/ArrayNode.java | 22 +-
.../org/apache/uima/tools/cvd/AutoFoldingMenu.java | 14 +-
.../main/java/org/apache/uima/tools/cvd/CVD.java | 24 +-
.../java/org/apache/uima/tools/cvd/ColorIcon.java | 8 +-
.../java/org/apache/uima/tools/cvd/FSNode.java | 329 ++++----
.../org/apache/uima/tools/cvd/FSTreeModel.java | 163 ++--
.../java/org/apache/uima/tools/cvd/FSTreeNode.java | 5 +-
.../org/apache/uima/tools/cvd/IndexTreeNode.java | 22 +-
.../org/apache/uima/tools/cvd/LogFileViewer.java | 284 +++----
.../java/org/apache/uima/tools/cvd/MainFrame.java | 378 +++++----
.../org/apache/uima/tools/cvd/MarkupExtent.java | 11 +-
.../uima/tools/cvd/MultiAnnotViewerFrame.java | 40 +-
.../org/apache/uima/tools/cvd/MultiMarkup.java | 37 +-
.../org/apache/uima/tools/cvd/RecentFilesList.java | 27 +-
.../uima/tools/cvd/StringFsPopupEventAdapter.java | 57 +-
.../org/apache/uima/tools/cvd/TypeTreeNode.java | 14 +-
.../uima/tools/cvd/control/AboutHandler.java | 20 +-
.../uima/tools/cvd/control/AboutUimaHandler.java | 9 +-
.../uima/tools/cvd/control/AddLanguageHandler.java | 9 +-
.../cvd/control/AnnotatorOpenEventHandler.java | 8 +-
.../cvd/control/AnnotatorRerunEventHandler.java | 8 +-
.../cvd/control/AnnotatorRunCPCEventHandler.java | 8 +-
.../cvd/control/AnnotatorRunOnCasEventHandler.java | 8 +-
.../uima/tools/cvd/control/CaretChangeHandler.java | 8 +-
.../cvd/control/CloseAnnotationViewHandler.java | 14 +-
.../tools/cvd/control/CloseLogViewHandler.java | 15 +-
.../tools/cvd/control/CloseTypeSystemHandler.java | 12 +-
.../tools/cvd/control/ColorPrefsOpenHandler.java | 8 +-
.../tools/cvd/control/ColorPrefsSaveHandler.java | 8 +-
.../tools/cvd/control/FSTreeSelectionListener.java | 9 +-
.../tools/cvd/control/FileOpenEventHandler.java | 10 +-
.../tools/cvd/control/FileSaveAsEventHandler.java | 9 +-
.../tools/cvd/control/FileSaveEventHandler.java | 9 +-
.../uima/tools/cvd/control/FocusFSAction.java | 9 +-
.../uima/tools/cvd/control/FocusIRAction.java | 9 +-
.../uima/tools/cvd/control/FocusTextAction.java | 9 +-
.../apache/uima/tools/cvd/control/HelpHandler.java | 13 +-
.../uima/tools/cvd/control/IndexPopupListener.java | 32 +-
.../cvd/control/IndexTreeSelectionListener.java | 15 +-
.../control/LoadRecentDescFileEventHandler.java | 14 +-
.../control/LoadRecentTextFileEventHandler.java | 14 +-
.../uima/tools/cvd/control/MainFrameClosing.java | 12 +-
.../uima/tools/cvd/control/ManualHandler.java | 27 +-
.../tools/cvd/control/NewTextEventHandler.java | 9 +-
.../uima/tools/cvd/control/PopupHandler.java | 13 +-
.../uima/tools/cvd/control/PopupListener.java | 17 +-
.../tools/cvd/control/RemoveLanguageHandler.java | 9 +-
.../cvd/control/RestoreLangDefaultsHandler.java | 9 +-
.../uima/tools/cvd/control/SetCodePageHandler.java | 9 +-
.../uima/tools/cvd/control/SetDataPathHandler.java | 11 +-
.../uima/tools/cvd/control/SetLanguageHandler.java | 9 +-
.../tools/cvd/control/SetLogConfigHandler.java | 5 +-
.../cvd/control/ShowAnnotatedTextHandler.java | 12 +-
.../control/ShowAnnotationCustomizerHandler.java | 11 +-
.../tools/cvd/control/ShowTypesystemHandler.java | 9 +-
.../tools/cvd/control/SofaSelectionListener.java | 21 +-
.../uima/tools/cvd/control/SystemExitHandler.java | 9 +-
.../tools/cvd/control/TextChangedListener.java | 14 +-
.../tools/cvd/control/TextContextMenuAction.java | 8 +-
.../uima/tools/cvd/control/TextFocusHandler.java | 4 +-
.../uima/tools/cvd/control/TreeFocusHandler.java | 13 +-
.../control/TypeSystemFileOpenEventHandler.java | 16 +-
.../org/apache/uima/tools/cvd/control/UndoMgr.java | 17 +-
.../cvd/control/XCASFileOpenEventHandler.java | 12 +-
.../uima/tools/cvd/control/XCASSaveHandler.java | 8 +-
.../uima/tools/cvd/control/XCASSaveTSHandler.java | 8 +-
.../tools/cvd/control/XmiCasFileOpenHandler.java | 12 +-
.../uima/tools/cvd/control/XmiCasSaveHandler.java | 15 +-
.../uima/tools/cvd/tsview/FeatureTableModel.java | 16 +-
.../apache/uima/tools/cvd/tsview/MainFrame.java | 48 +-
.../tools/docanalyzer/AnnotationViewerDialog.java | 200 +++--
.../uima/tools/docanalyzer/DocumentAnalyzer.java | 315 ++++----
.../uima/tools/docanalyzer/FileSelector.java | 59 +-
.../tools/docanalyzer/FileSelectorListener.java | 22 +-
.../uima/tools/docanalyzer/PrefsMediator.java | 71 +-
.../uima/tools/docanalyzer/TfDocumentListener.java | 8 +-
.../tools/docanalyzer/TfFileSelectorListener.java | 8 +-
.../uima/tools/docanalyzer/TfFocusListener.java | 8 +-
.../java/org/apache/uima/tools/jcasgen/GUI.java | 31 +-
.../apache/uima/tools/jcasgen/GuiErrorImpl.java | 7 +-
.../uima/tools/jcasgen/GuiProgressMonitor.java | 26 +-
.../java/org/apache/uima/tools/jcasgen/IError.java | 12 +-
.../java/org/apache/uima/tools/jcasgen/IMerge.java | 27 +-
.../uima/tools/jcasgen/IProgressMonitor.java | 15 +-
.../uima/tools/jcasgen/JCasTypeTemplate.java | 329 ++++----
.../java/org/apache/uima/tools/jcasgen/Jg.java | 810 +++++++++++--------
.../uima/tools/jcasgen/LogThrowErrorImpl.java | 3 +-
.../java/org/apache/uima/tools/jcasgen/Prefs.java | 17 +-
.../org/apache/uima/tools/jcasgen/TypeInfo.java | 16 +-
.../tools/jcasgen/UimaLoggerProgressMonitor.java | 26 +-
.../java/org/apache/uima/tools/jcasgen/Waiter.java | 3 +-
.../uima/tools/pear/install/InstallPear.java | 33 +-
.../uima/tools/pear/install/InstallPearCli.java | 79 +-
.../uima/tools/pear/merger/PMController.java | 27 +-
.../uima/tools/pear/merger/PMControllerHelper.java | 8 +-
.../apache/uima/tools/pear/merger/PMUimaAgent.java | 38 +-
.../uima/tools/pear/packager/PearPackager.java | 41 +-
.../apache/uima/tools/stylemap/AnTreeListener.java | 12 +-
.../tools/stylemap/AnnotationFeaturesViewer.java | 42 +-
.../apache/uima/tools/stylemap/ColorEditor.java | 21 +-
.../apache/uima/tools/stylemap/ColorParser.java | 27 +-
.../apache/uima/tools/stylemap/ColorRenderer.java | 11 +-
.../uima/tools/stylemap/LabelCellEditor.java | 10 +-
.../apache/uima/tools/stylemap/MyCellRenderer.java | 24 +-
.../apache/uima/tools/stylemap/StyleConstants.java | 3 +-
.../apache/uima/tools/stylemap/StyleMapEditor.java | 93 ++-
.../apache/uima/tools/stylemap/StyleMapEntry.java | 26 +-
.../apache/uima/tools/stylemap/StyleMapTable.java | 19 +-
.../uima/tools/stylemap/StyleMapTableModel.java | 49 +-
.../uima/tools/stylemap/StyleMapXmlParser.java | 24 +-
.../uima/tools/stylemap/TableDropAdapter.java | 13 +-
.../uima/tools/stylemap/TableGUIMediator.java | 21 +-
.../tools/stylemap/TableSelectionListener.java | 21 +-
.../apache/uima/tools/util/gui/AboutDialog.java | 27 +-
.../org/apache/uima/tools/util/gui/Caption.java | 6 +-
.../tools/util/gui/FileChooserBugWorkarounds.java | 5 +-
.../apache/uima/tools/util/gui/FileSelector.java | 118 +--
.../uima/tools/util/gui/FileSelectorListener.java | 22 +-
.../org/apache/uima/tools/util/gui/FormPanel.java | 17 +-
.../apache/uima/tools/util/gui/ImageButton.java | 10 +-
.../apache/uima/tools/util/gui/IntegerField.java | 12 +-
.../apache/uima/tools/util/gui/ListSelector.java | 28 +-
.../apache/uima/tools/util/gui/SliderField.java | 27 +-
.../uima/tools/util/gui/SpringUtilities.java | 82 +-
.../tools/util/gui/TransportControlListener.java | 15 +-
.../uima/tools/util/gui/TransportControlPanel.java | 32 +-
.../apache/uima/tools/util/gui/XMLFileFilter.java | 14 +-
.../util/htmlview/AnnotationViewGenerator.java | 68 +-
.../uima/tools/viewer/CasAnnotationViewer.java | 853 +++++++++++----------
.../tools/viewer/CasAnnotationViewerApplet.java | 11 +-
.../apache/uima/tools/viewer/CasTreeViewer.java | 52 +-
.../uima/tools/viewer/CasTreeViewerApplet.java | 9 +-
.../apache/uima/tools/viewer/EntityResolver.java | 48 +-
.../uima/tools/pear/merger/PearMergerTest.java | 29 +-
.../uima/tools/viewer/CasAnnotationViewerTest.java | 127 +--
157 files changed, 4247 insertions(+), 3226 deletions(-)
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java
index 4a422e7..08b2837 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationFeaturesViewer.java
@@ -39,7 +39,6 @@ import org.apache.uima.analysis_engine.TypeOrFeature;
import org.apache.uima.analysis_engine.metadata.AnalysisEngineMetaData;
import org.apache.uima.resource.metadata.Capability;
-
/**
* A tree view of Annotations and associated features.
*
@@ -94,8 +93,10 @@ public class AnnotationFeaturesViewer extends JPanel implements ActionListener {
/**
* Populate.
*
- * @param analysisEngine the analysis engine
- * @param aeMetaData the ae meta data
+ * @param analysisEngine
+ * the analysis engine
+ * @param aeMetaData
+ * the ae meta data
*/
public void populate(AnalysisEngine analysisEngine, AnalysisEngineMetaData aeMetaData) {
tree = generateTreeView(analysisEngine, aeMetaData);
@@ -119,8 +120,10 @@ public class AnnotationFeaturesViewer extends JPanel implements ActionListener {
/**
* Generate tree view.
*
- * @param analysisEngine the analysis engine
- * @param aeMetaData the ae meta data
+ * @param analysisEngine
+ * the analysis engine
+ * @param aeMetaData
+ * the ae meta data
* @return the j tree
*/
private JTree generateTreeView(AnalysisEngine analysisEngine, AnalysisEngineMetaData aeMetaData) {
@@ -176,7 +179,9 @@ public class AnnotationFeaturesViewer extends JPanel implements ActionListener {
return null;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java b/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java
index 8c0a55e..9ffa982 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/AnnotationViewerMain.java
@@ -69,15 +69,14 @@ import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
/**
- * Main Annotation Viewer GUI. Allows user to choose directory of XCAS or XMI files, then
- * launches the AnnotationViewerDialog.
+ * Main Annotation Viewer GUI. Allows user to choose directory of XCAS or XMI files, then launches
+ * the AnnotationViewerDialog.
*
*
*/
public class AnnotationViewerMain extends JFrame {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -3201723535833938833L;
@@ -111,7 +110,7 @@ public class AnnotationViewerMain extends JFrame {
/** The about dialog. */
private JDialog aboutDialog;
- /** Stores user preferences. */
+ /** Stores user preferences. */
private Preferences prefs = Preferences.userRoot().node("org/apache/uima/tools/AnnotationViewer");
/**
@@ -183,8 +182,8 @@ public class AnnotationViewerMain extends JFrame {
inputDir);
inputFileSelector.setSelected(inputDir.getAbsolutePath());
- taeDescriptorFileSelector = new FileSelector("", "TAE Descriptor File",
- JFileChooser.FILES_ONLY, uimaHomeDir);
+ taeDescriptorFileSelector = new FileSelector("", "TAE Descriptor File", JFileChooser.FILES_ONLY,
+ uimaHomeDir);
File descriptorFile = new File(uimaHomeDir,
"examples/descriptors/analysis_engine/PersonTitleAnnotator.xml");
@@ -264,12 +263,15 @@ public class AnnotationViewerMain extends JFrame {
/**
* View documents.
*
- * @throws InvalidXMLException the invalid XML exception
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws ResourceInitializationException the resource initialization exception
+ * @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 {
+ public void viewDocuments()
+ throws InvalidXMLException, IOException, ResourceInitializationException {
File descriptorFile = new File(taeDescriptorFileSelector.getSelected());
if (!descriptorFile.exists() || descriptorFile.isDirectory()) {
displayError("Descriptor File \"" + descriptorFile.getPath() + "\" does not exist.");
@@ -288,8 +290,8 @@ public class AnnotationViewerMain extends JFrame {
File styleMapFile;
if (descriptor instanceof AnalysisEngineDescription) {
cas = CasCreationUtils.createCas((AnalysisEngineDescription) descriptor);
- styleMapFile = getStyleMapFile((AnalysisEngineDescription) descriptor, descriptorFile
- .getPath());
+ styleMapFile = getStyleMapFile((AnalysisEngineDescription) descriptor,
+ descriptorFile.getPath());
} else if (descriptor instanceof TypeSystemDescription) {
TypeSystemDescription tsDesc = (TypeSystemDescription) descriptor;
tsDesc.resolveImports();
@@ -307,9 +309,8 @@ public class AnnotationViewerMain extends JFrame {
// PrefsMediator is also used in DocumentAnalyzer, where the
// output dir is the directory containing XCAS files.
prefsMed.setOutputDir(inputDir.toString());
- AnnotationViewerDialog viewerDialog = new AnnotationViewerDialog(this,
- "Analyzed Documents", prefsMed, styleMapFile, null, cas.getTypeSystem(), null, false,
- cas);
+ AnnotationViewerDialog viewerDialog = new AnnotationViewerDialog(this, "Analyzed Documents",
+ prefsMed, styleMapFile, null, cas.getTypeSystem(), null, false, cas);
viewerDialog.pack();
viewerDialog.setModal(true);
viewerDialog.setVisible(true);
@@ -318,10 +319,13 @@ public class AnnotationViewerMain extends JFrame {
/**
* Gets the style map file.
*
- * @param tad the tad
- * @param descFileName the desc file name
+ * @param tad
+ * the tad
+ * @param descFileName
+ * the desc file name
* @return the style map file
- * @throws IOException -
+ * @throws IOException
+ * -
*/
private File getStyleMapFile(AnalysisEngineDescription tad, String descFileName)
throws IOException {
@@ -341,10 +345,13 @@ public class AnnotationViewerMain extends JFrame {
/**
* Gets the style map file.
*
- * @param tsd the tsd
- * @param descFileName the desc file name
+ * @param tsd
+ * the tsd
+ * @param descFileName
+ * the desc file name
* @return the style map file
- * @throws IOException -
+ * @throws IOException
+ * -
*/
private File getStyleMapFile(TypeSystemDescription tsd, String descFileName) throws IOException {
File styleMapFile = getStyleMapFileName(descFileName);
@@ -363,7 +370,8 @@ public class AnnotationViewerMain extends JFrame {
/**
* Gets the name of the style map file for the given AE or TypeSystem descriptor filename.
*
- * @param aDescriptorFileName the a descriptor file name
+ * @param aDescriptorFileName
+ * the a descriptor file name
* @return the style map file name
*/
public File getStyleMapFileName(String aDescriptorFileName) {
@@ -380,7 +388,8 @@ public class AnnotationViewerMain extends JFrame {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
final AnnotationViewerMain frame = new AnnotationViewerMain();
@@ -415,8 +424,8 @@ public class AnnotationViewerMain extends JFrame {
// restore preferences
inputFileSelector.setSelected(prefs.get("inDir", defaultInputDir.toString()));
- taeDescriptorFileSelector.setSelected(prefs.get("taeDescriptorFile", defaultTaeDescriptorFile
- .toString()));
+ taeDescriptorFileSelector
+ .setSelected(prefs.get("taeDescriptorFile", defaultTaeDescriptorFile.toString()));
}
/**
@@ -480,7 +489,7 @@ public class AnnotationViewerMain extends JFrame {
displayError(message);
}
-
+
/*
* (non-Javadoc)
*
@@ -489,5 +498,5 @@ public class AnnotationViewerMain extends JFrame {
@Override
public Dimension getPreferredSize() {
return new Dimension(640, 200);
- }
+ }
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java b/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java
index 47aef16..21788c9 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/RunAE.java
@@ -46,7 +46,6 @@ import org.apache.uima.tools.components.InlineXmlCasConsumer;
import org.apache.uima.tools.components.XmlDetagger;
import org.apache.uima.util.AnalysisEnginePerformanceReports;
-
/**
* 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
@@ -57,8 +56,8 @@ import org.apache.uima.util.AnalysisEnginePerformanceReports;
* <AE descriptor or JAR file name> <input dir>
* [<output dir>]</code>
* <p>
- * If <code>output dir</code> is not specified, the analysis results will not be output. This can
- * be useful when only interested in performance statistics.
+ * If <code>output dir</code> is not specified, the analysis results will not be output. This can be
+ * useful when only interested in performance statistics.
* <p>
* <u>OPTIONS</u>
* <p>
@@ -107,7 +106,7 @@ public class RunAE implements StatusCallbackListener {
/** The xmi input. */
private boolean xmiInput = false;
-
+
/** The x lenient. */
private boolean xLenient = false;
@@ -120,7 +119,8 @@ public class RunAE implements StatusCallbackListener {
/**
* Constructor. Sets up and runs an Analysis Engine.
*
- * @param args the args
+ * @param args
+ * the args
*/
public RunAE(String[] args) {
try {
@@ -143,8 +143,8 @@ public class RunAE implements StatusCallbackListener {
.produceCasProcessorConfigurationParameterSettings();
CpeCollectionReader cpeCollRdr = cpeDesc.getAllCollectionCollectionReaders()[0];
cpeCollRdr.setConfigurationParameterSettings(crSettings);
- crSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR, inputDir
- .getAbsolutePath());
+ crSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR,
+ inputDir.getAbsolutePath());
crSettings.setParameterValue(FileSystemCollectionReader.PARAM_ENCODING, encoding);
crSettings.setParameterValue(FileSystemCollectionReader.PARAM_LANGUAGE, language);
if (xcasInput) {
@@ -160,8 +160,8 @@ public class RunAE implements StatusCallbackListener {
CpeCasProcessor xmlDetaggerCasProc = null;
if (xmlTagName != null && xmlTagName.length() > 0) {
xmlDetaggerCasProc = CpeDescriptorFactory.produceCasProcessor("XmlDetagger");
- CpeComponentDescriptor cpeComponentDescriptor =
- CpeDescriptorFactory.produceComponentDescriptor(XmlDetagger.getDescriptorURL().toString());
+ CpeComponentDescriptor cpeComponentDescriptor = CpeDescriptorFactory
+ .produceComponentDescriptor(XmlDetagger.getDescriptorURL().toString());
xmlDetaggerCasProc.setCpeComponentDescriptor(cpeComponentDescriptor);
CasProcessorConfigurationParameterSettings detaggerSettings = CpeDescriptorFactory
.produceCasProcessorConfigurationParameterSettings();
@@ -173,8 +173,8 @@ public class RunAE implements StatusCallbackListener {
// add user's AE to CPE
CpeCasProcessor casProc = CpeDescriptorFactory.produceCasProcessor("UserAE");
- CpeComponentDescriptor cpeComponentDescriptor =
- CpeDescriptorFactory.produceComponentDescriptor(aeSpecifierFile.getAbsolutePath());
+ CpeComponentDescriptor cpeComponentDescriptor = CpeDescriptorFactory
+ .produceComponentDescriptor(aeSpecifierFile.getAbsolutePath());
casProc.setCpeComponentDescriptor(cpeComponentDescriptor);
casProc.setMaxErrorCount(0);
cpeDesc.addCasProcessor(casProc);
@@ -184,14 +184,14 @@ public class RunAE implements StatusCallbackListener {
CpeCasProcessor casCon = null;
if (outputDir != null) {
casCon = CpeDescriptorFactory.produceCasProcessor("CasConsumer");
- cpeComponentDescriptor =
- CpeDescriptorFactory.produceComponentDescriptor(InlineXmlCasConsumer.getDescriptorURL().toString());
+ cpeComponentDescriptor = CpeDescriptorFactory
+ .produceComponentDescriptor(InlineXmlCasConsumer.getDescriptorURL().toString());
casCon.setCpeComponentDescriptor(cpeComponentDescriptor);
CasProcessorConfigurationParameterSettings consumerSettings = CpeDescriptorFactory
.produceCasProcessorConfigurationParameterSettings();
casCon.setConfigurationParameterSettings(consumerSettings);
- consumerSettings.setParameterValue(InlineXmlCasConsumer.PARAM_OUTPUTDIR, outputDir
- .getAbsolutePath());
+ consumerSettings.setParameterValue(InlineXmlCasConsumer.PARAM_OUTPUTDIR,
+ outputDir.getAbsolutePath());
if (xcasInput) {
consumerSettings.setParameterValue(InlineXmlCasConsumer.PARAM_XCAS, "XCAS");
} else if (xmiInput) {
@@ -237,17 +237,18 @@ public class RunAE implements StatusCallbackListener {
docsProcessed = 0;
mCPE.process();
} catch (Exception e) {
- //special check for using XML detagger with remotes, which will generate an error
- //since sofa mappings aren't supported for remotes
- if (xmlTagName != null && xmlTagName.length() > 0 && e instanceof UIMAException &&
- ((UIMAException)e).hasMessageKey(ResourceInitializationException.SOFA_MAPPING_NOT_SUPPORTED_FOR_REMOTE)) {
- System.err.println("The XML detagging feature (-t) is not supported for remote Analysis Engines or for Aggregates containing remotes.");
- }
- else {
+ // special check for using XML detagger with remotes, which will generate an error
+ // since sofa mappings aren't supported for remotes
+ if (xmlTagName != null && xmlTagName.length() > 0 && e instanceof UIMAException
+ && ((UIMAException) e).hasMessageKey(
+ ResourceInitializationException.SOFA_MAPPING_NOT_SUPPORTED_FOR_REMOTE)) {
+ System.err.println(
+ "The XML detagging feature (-t) is not supported for remote Analysis Engines or for Aggregates containing remotes.");
+ } else {
e.printStackTrace();
}
}
- }
+ }
/**
* Initialization complete.
@@ -261,8 +262,10 @@ public class RunAE implements StatusCallbackListener {
/**
* Entity process complete.
*
- * @param aCas the a cas
- * @param aStatus the a status
+ * @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)
*/
@@ -277,8 +280,8 @@ public class RunAE implements StatusCallbackListener {
// retrieve the filename of the input file from the CAS
// (it was put there by the FileSystemCollectionReader)
if (!(xcasInput || xmiInput)) {
- Type fileLocType = aCas.getTypeSystem().getType(
- "org.apache.uima.examples.SourceDocumentInformation");
+ Type fileLocType = aCas.getTypeSystem()
+ .getType("org.apache.uima.examples.SourceDocumentInformation");
Feature fileNameFeat = fileLocType.getFeatureByBaseName("uri");
FSIterator it = aCas.getAnnotationIndex(fileLocType).iterator();
FeatureStructure fileLoc = it.get();
@@ -370,13 +373,14 @@ public class RunAE implements StatusCallbackListener {
System.err.println("-lenient - ignore out-of-typesystem content when deserializing XML files.");
System.err.println("-l <ISO language> - specify the ISO Language code to set.");
System.err.println("-e <encoding> - specify the character encoding to use.");
-
+
}
/**
* Reads command line arguments and sets static class variables appropriately.
*
- * @param args the args
+ * @param args
+ * the args
* @return true if command line args were valid, false if not
*/
private boolean processCmdLineArgs(String[] args) {
@@ -457,7 +461,8 @@ public class RunAE implements StatusCallbackListener {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
new RunAE(args);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java b/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java
index fe6c66b..fb23364 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/ValidateDescriptor.java
@@ -24,7 +24,6 @@ import org.apache.uima.UIMA_IllegalStateException;
import org.apache.uima.resource.ResourceCreationSpecifier;
import org.apache.uima.util.XMLInputSource;
-
/**
* Command-line utility for validating a descriptor. Supports CollectionReader, CasInitializer,
* AnalysisEngine, and CasConsumer descriptors.
@@ -34,8 +33,10 @@ public class ValidateDescriptor {
/**
* Runs the ValidateDescriptor tool.
*
- * @param args takes one argument, the path to a descriptor file.
- * @throws Exception the exception
+ * @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) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java b/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java
index 3e93909..83fb6d1 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/annot_view/Gladis.java
@@ -17,14 +17,13 @@
* under the License.
*/
-
package org.apache.uima.tools.annot_view;
import org.apache.uima.tools.cvd.CVD;
-
/**
- * Compatibility class, delegates to the new {@link org.apache.uima.tools.cvd.CVD org.apache.uima.tools.cvd.CVD}.
+ * Compatibility class, delegates to the new {@link org.apache.uima.tools.cvd.CVD
+ * org.apache.uima.tools.cvd.CVD}.
*
* @deprecated Use org.apache.uima.tools.cvd.CVD instead.
*/
@@ -34,7 +33,8 @@ public class Gladis {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
CVD.main(args);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/components/FileSystemCollectionReader.java b/uimaj-tools/src/main/java/org/apache/uima/tools/components/FileSystemCollectionReader.java
index eddfa09..c50946e 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/components/FileSystemCollectionReader.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/components/FileSystemCollectionReader.java
@@ -82,8 +82,8 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
public static final String PARAM_XCAS = "XCAS";
/**
- * Name of the configuration parameter that must be set to indicate if the
- * execution proceeds if an encountered type is unknown
+ * Name of the configuration parameter that must be set to indicate if the execution proceeds if
+ * an encountered type is unknown
*/
public static final String PARAM_LENIENT = "LENIENT";
@@ -98,7 +98,7 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
private boolean mTEXT;
private String mXCAS;
-
+
private boolean lenient;
/**
@@ -111,9 +111,11 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
mEncoding = (String) getConfigParameterValue(PARAM_ENCODING);
mLanguage = (String) getConfigParameterValue(PARAM_LANGUAGE);
mXCAS = (String) getConfigParameterValue(PARAM_XCAS);
- //XCAS parameter can be set to "xcas" or "xmi", as well as "true" (which for historical reasons
- //means the same as "xcas"). Any other value will cause the input file to be treated as a text document.
- mTEXT = !("xcas".equalsIgnoreCase(mXCAS) || "xmi".equalsIgnoreCase(mXCAS) || "true".equalsIgnoreCase(mXCAS));
+ // XCAS parameter can be set to "xcas" or "xmi", as well as "true" (which for historical reasons
+ // means the same as "xcas"). Any other value will cause the input file to be treated as a text
+ // document.
+ mTEXT = !("xcas".equalsIgnoreCase(mXCAS) || "xmi".equalsIgnoreCase(mXCAS)
+ || "true".equalsIgnoreCase(mXCAS));
String mLenient = (String) getConfigParameterValue(PARAM_LENIENT);
lenient = "true".equalsIgnoreCase(mLenient);
@@ -165,7 +167,7 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
getCasInitializer().initializeCas(fis, aCAS);
} else // No CAS Initiliazer, so read file and set document text ourselves
{
- String text = FileUtils.file2String(file, mEncoding);
+ String text = FileUtils.file2String(file, mEncoding);
// put document text in JCas
jcas.setDocumentText(text);
}
@@ -196,8 +198,7 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
try {
if (mXCAS.equalsIgnoreCase("xmi")) {
XmiCasDeserializer.deserialize(fis, aCAS, lenient);
- }
- else {
+ } else {
XCASDeserializer.deserialize(fis, aCAS, lenient);
}
} catch (SAXException e) {
@@ -247,10 +248,10 @@ public class FileSystemCollectionReader extends CollectionReader_ImplBase {
public static CollectionReaderDescription getDescription() throws InvalidXMLException {
InputStream descStream = FileSystemCollectionReader.class
.getResourceAsStream("FileSystemCollectionReader.xml");
- return UIMAFramework.getXMLParser().parseCollectionReaderDescription(
- new XMLInputSource(descStream, null));
+ return UIMAFramework.getXMLParser()
+ .parseCollectionReaderDescription(new XMLInputSource(descStream, null));
}
-
+
public static URL getDescriptorURL() {
return FileSystemCollectionReader.class.getResource("FileSystemCollectionReader.xml");
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/components/InlineXmlCasConsumer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/components/InlineXmlCasConsumer.java
index 02df771..acb20cc 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/components/InlineXmlCasConsumer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/components/InlineXmlCasConsumer.java
@@ -53,8 +53,8 @@ import org.xml.sax.SAXException;
* This CAS Consumer takes two parameters:
* <ul>
* <li><code>OutputDirectory</code> - path to directory into which output files will be written</li>
- * <li><code>OutputFilter</code> (optional) - an FSMatchConstraint which annotations must match
- * in order to be included in the output. If omitted, all annotations will be included in the
+ * <li><code>OutputFilter</code> (optional) - an FSMatchConstraint which annotations must match in
+ * order to be included in the output. If omitted, all annotations will be included in the
* output.</li>
* </ul>
* <p>
@@ -84,7 +84,7 @@ public class InlineXmlCasConsumer extends CasConsumer_ImplBase {
private int mDocNum;
private String mXCAS;
-
+
private boolean mTEXT;
@Override
@@ -164,8 +164,7 @@ public class InlineXmlCasConsumer extends CasConsumer_ImplBase {
if (mXCAS.equalsIgnoreCase("xcas")) {
XCASSerializer ser = new XCASSerializer(aCAS.getTypeSystem());
ser.serialize(aCAS, xmlSer.getContentHandler());
- }
- else {
+ } else {
XmiCasSerializer ser = new XmiCasSerializer(aCAS.getTypeSystem());
ser.serialize(aCAS, xmlSer.getContentHandler());
}
@@ -199,10 +198,10 @@ public class InlineXmlCasConsumer extends CasConsumer_ImplBase {
public static CasConsumerDescription getDescription() throws InvalidXMLException {
InputStream descStream = InlineXmlCasConsumer.class
.getResourceAsStream("InlineXmlCasConsumer.xml");
- return UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(descStream, null));
+ return UIMAFramework.getXMLParser()
+ .parseCasConsumerDescription(new XMLInputSource(descStream, null));
}
-
+
public static URL getDescriptorURL() {
return InlineXmlCasConsumer.class.getResource("InlineXmlCasConsumer.xml");
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XCasWriterCasConsumer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XCasWriterCasConsumer.java
index e0fdfa5..567a6ec 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XCasWriterCasConsumer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XCasWriterCasConsumer.java
@@ -111,7 +111,8 @@ public class XCasWriterCasConsumer extends CasConsumer_ImplBase {
try {
// handle blanks in path
// https://issues.apache.org/jira/browse/UIMA-1748
- // use 3 arg form of URI Constructor to properly quote any otherwise illegal chars such as blank
+ // use 3 arg form of URI Constructor to properly quote any otherwise illegal chars such as
+ // blank
// https://issues.apache.org/jira/browse/UIMA-2097
URI uri = UriUtils.quote(fileLoc.getUri());
inFile = new File(uri);
@@ -172,8 +173,8 @@ public class XCasWriterCasConsumer extends CasConsumer_ImplBase {
public static CasConsumerDescription getDescription() throws InvalidXMLException {
InputStream descStream = XCasWriterCasConsumer.class
.getResourceAsStream("XCasWriterCasConsumer.xml");
- return UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(descStream, null));
+ return UIMAFramework.getXMLParser()
+ .parseCasConsumerDescription(new XMLInputSource(descStream, null));
}
public static URL getDescriptorURL() {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmiWriterCasConsumer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmiWriterCasConsumer.java
index 0fbe590..fadf8ea 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmiWriterCasConsumer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmiWriterCasConsumer.java
@@ -104,7 +104,8 @@ public class XmiWriterCasConsumer extends CasConsumer_ImplBase {
try {
// handle blanks in path
// https://issues.apache.org/jira/browse/UIMA-1748
- // use 3 arg form of URI Constructor to properly quote any otherwise illegal chars such as blank
+ // use 3 arg form of URI Constructor to properly quote any otherwise illegal chars such as
+ // blank
// https://issues.apache.org/jira/browse/UIMA-2097
URI uri = UriUtils.quote(fileLoc.getUri());
inFile = new File(uri);
@@ -139,12 +140,16 @@ public class XmiWriterCasConsumer extends CasConsumer_ImplBase {
* CAS to serialize
* @param name
* output file
- * @throws SAXException -
- * @throws Exception -
+ * @throws SAXException
+ * -
+ * @throws Exception
+ * -
*
- * @throws ResourceProcessException -
+ * @throws ResourceProcessException
+ * -
*/
- private void writeXmi(CAS aCas, File name, String modelFileName) throws IOException, SAXException {
+ private void writeXmi(CAS aCas, File name, String modelFileName)
+ throws IOException, SAXException {
try (FileOutputStream out = new FileOutputStream(name)) {
// write XMI
@@ -166,11 +171,11 @@ public class XmiWriterCasConsumer extends CasConsumer_ImplBase {
public static CasConsumerDescription getDescription() throws InvalidXMLException {
InputStream descStream = XCasWriterCasConsumer.class
.getResourceAsStream("XmiWriterCasConsumer.xml");
- return UIMAFramework.getXMLParser().parseCasConsumerDescription(
- new XMLInputSource(descStream, null));
+ return UIMAFramework.getXMLParser()
+ .parseCasConsumerDescription(new XMLInputSource(descStream, null));
}
-
+
public static URL getDescriptorURL() {
return XmiWriterCasConsumer.class.getResource("XmiWriterCasConsumer.xml");
- }
+ }
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmlDetagger.java b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmlDetagger.java
index 51f38f0..d95f832 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmlDetagger.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/components/XmlDetagger.java
@@ -57,19 +57,18 @@ public class XmlDetagger extends CasAnnotator_ImplBase {
* file will be considered the document.
*/
public static final String PARAM_TEXT_TAG = "XmlTagContainingText";
-
+
private SAXParserFactory parserFactory = XMLUtils.createSAXParserFactory();
private Type sourceDocInfoType;
private String mXmlTagContainingText = null;
-
@Override
public void initialize(UimaContext aContext) throws ResourceInitializationException {
super.initialize(aContext);
// Get config param setting
- mXmlTagContainingText = (String) getContext().getConfigParameterValue(PARAM_TEXT_TAG);
+ mXmlTagContainingText = (String) getContext().getConfigParameterValue(PARAM_TEXT_TAG);
}
@Override
@@ -107,7 +106,7 @@ public class XmlDetagger extends CasAnnotator_ImplBase {
}
}
-
+
/**
* Parses and returns the descriptor for this Analysis Gnein. The descriptor is stored in the
* uima-core.jar file and located using the ClassLoader.
@@ -118,15 +117,14 @@ public class XmlDetagger extends CasAnnotator_ImplBase {
* if the descriptor is invalid or missing
*/
public static AnalysisEngineDescription getDescription() throws InvalidXMLException {
- InputStream descStream = XmlDetagger.class
- .getResourceAsStream("XmlDetagger.xml");
- return UIMAFramework.getXMLParser().parseAnalysisEngineDescription(
- new XMLInputSource(descStream, null));
- }
+ InputStream descStream = XmlDetagger.class.getResourceAsStream("XmlDetagger.xml");
+ return UIMAFramework.getXMLParser()
+ .parseAnalysisEngineDescription(new XMLInputSource(descStream, null));
+ }
public static URL getDescriptorURL() {
return XmlDetagger.class.getResource("XmlDetagger.xml");
- }
+ }
class DetagHandler extends DefaultHandler {
private StringBuffer detaggedText = new StringBuffer();
@@ -135,9 +133,10 @@ public class XmlDetagger extends CasAnnotator_ImplBase {
public DetagHandler() {
insideTextTag = (mXmlTagContainingText == null);
}
-
+
@Override
- public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+ public void startElement(String uri, String localName, String qName, Attributes attributes)
+ throws SAXException {
if (qName.equalsIgnoreCase(mXmlTagContainingText)) {
insideTextTag = true;
}
@@ -153,14 +152,14 @@ public class XmlDetagger extends CasAnnotator_ImplBase {
@Override
public void characters(char[] ch, int start, int length) throws SAXException {
if (insideTextTag) {
- detaggedText.append(ch, start, length);
+ detaggedText.append(ch, start, length);
}
}
-
+
@Override
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {
if (insideTextTag) {
- detaggedText.append(ch, start, length);
+ detaggedText.append(ch, start, length);
}
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java
index 7908c80..d6f0608 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/AnalysisEnginePanel.java
@@ -30,12 +30,11 @@ import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
/**
* The Class AnalysisEnginePanel.
*/
public class AnalysisEnginePanel extends MetaDataPanel {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5927337001602381195L;
@@ -54,9 +53,12 @@ public class AnalysisEnginePanel extends MetaDataPanel {
/**
* Instantiates a new analysis engine panel.
*
- * @param aeSpecifier the ae specifier
- * @param specifierFile the specifier file
- * @param fileModStamp the file mod stamp
+ * @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
@@ -86,7 +88,8 @@ public class AnalysisEnginePanel extends MetaDataPanel {
/**
* Sets the last file sync timestamp.
*
- * @param timestamp the new last file sync timestamp
+ * @param timestamp
+ * the new last file sync timestamp
*/
public void setLastFileSyncTimestamp(long timestamp) {
this.lastFileSyncTimestamp = timestamp;
@@ -95,7 +98,8 @@ public class AnalysisEnginePanel extends MetaDataPanel {
/**
* Checks for file changed.
*
- * @param lastCheck the last check
+ * @param lastCheck
+ * the last check
* @return true, if successful
*/
public boolean hasFileChanged(long lastCheck) {
@@ -106,13 +110,15 @@ public class AnalysisEnginePanel extends MetaDataPanel {
/**
* Refresh from file.
*
- * @throws InvalidXMLException the invalid XML exception
- * @throws IOException Signals that an I/O exception has occurred.
+ * @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(
- new XMLInputSource(this.specifierFile));
+ this.aeSpecifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(new XMLInputSource(this.specifierFile));
if (aeSpecifier instanceof AnalysisEngineDescription) {
AnalysisEngineDescription aeDescription = (AnalysisEngineDescription) aeSpecifier;
populate(aeDescription.getMetaData(), null);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java
index 3766aec..5dfa2d8 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConfigField.java
@@ -28,7 +28,6 @@ import javax.swing.JTextField;
import org.apache.uima.tools.util.gui.FileSelector;
import org.apache.uima.tools.util.gui.ListSelector;
-
/**
* Configuration Field class used for representation of resource parameters in dynamically created
* MetaDataPanels.
@@ -36,7 +35,7 @@ import org.apache.uima.tools.util.gui.ListSelector;
* @see org.apache.uima.tools.cpm.MetaDataPanel
*/
public class ConfigField {
-
+
/** The parameter name. */
private String parameterName;
@@ -58,10 +57,14 @@ public class ConfigField {
/**
* 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
+ * @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) {
@@ -166,7 +169,8 @@ public class ConfigField {
/**
* Sets the field value.
*
- * @param fieldValue the new field value
+ * @param fieldValue
+ * the new field value
*/
public void setFieldValue(Object fieldValue) {
if (fieldComponent instanceof JTextField) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java
index c3eb5b9..7bb7d56 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ConsumerPanel.java
@@ -28,12 +28,11 @@ import org.apache.uima.resource.ResourceSpecifier;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
/**
* The Class ConsumerPanel.
*/
public class ConsumerPanel extends MetaDataPanel {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -6822046781435538398L;
@@ -49,11 +48,15 @@ public class ConsumerPanel extends MetaDataPanel {
/**
* Instantiates a new consumer panel.
*
- * @param casConsumerSpecifier the cas consumer specifier
- * @param specifierFile the specifier file
- * @param fileModStamp the file mod stamp
+ * @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) {
+ public ConsumerPanel(ResourceSpecifier casConsumerSpecifier, File specifierFile,
+ long fileModStamp) {
super(4); // 4 columns
this.casConsumerSpecifier = casConsumerSpecifier;
@@ -82,7 +85,8 @@ public class ConsumerPanel extends MetaDataPanel {
/**
* Sets the last file sync timestamp.
*
- * @param timestamp the new last file sync timestamp
+ * @param timestamp
+ * the new last file sync timestamp
*/
public void setLastFileSyncTimestamp(long timestamp) {
this.lastFileSyncTimestamp = timestamp;
@@ -91,7 +95,8 @@ public class ConsumerPanel extends MetaDataPanel {
/**
* Checks for file changed.
*
- * @param lastCheck the last check
+ * @param lastCheck
+ * the last check
* @return true, if successful
*/
public boolean hasFileChanged(long lastCheck) {
@@ -102,13 +107,15 @@ public class ConsumerPanel extends MetaDataPanel {
/**
* Refresh from file.
*
- * @throws InvalidXMLException the invalid XML exception
- * @throws IOException Signals that an I/O exception has occurred.
+ * @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(
- new XMLInputSource(this.specifierFile));
+ this.casConsumerSpecifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(new XMLInputSource(this.specifierFile));
if (casConsumerSpecifier instanceof CasConsumerDescription) {
CasConsumerDescription consumerDescription = (CasConsumerDescription) casConsumerSpecifier;
populate(consumerDescription.getMetaData(), null);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java
index daac8da..ac832df 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmFrame.java
@@ -46,12 +46,11 @@ import org.apache.uima.tools.images.Images;
import org.apache.uima.tools.util.gui.AboutDialog;
import org.apache.uima.tools.util.gui.FileChooserBugWorkarounds;
-
/**
* The Class CpmFrame.
*/
public class CpmFrame extends JFrame implements ActionListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 756368351780483658L;
@@ -135,7 +134,7 @@ public class CpmFrame extends JFrame implements ActionListener {
exitMenuItem = new JMenuItem("Exit");
exitMenuItem.addActionListener(this);
fileMenu.add(exitMenuItem);
-
+
JMenu viewMenu = new JMenu("View");
List viewMenuItems = cpmPanel.createViewMenuItems();
iter = viewMenuItems.iterator();
@@ -157,7 +156,9 @@ public class CpmFrame extends JFrame implements ActionListener {
return menuBar;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -174,7 +175,9 @@ public class CpmFrame extends JFrame implements ActionListener {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.Container#getPreferredSize()
*/
@Override
@@ -186,19 +189,20 @@ public class CpmFrame extends JFrame implements ActionListener {
/**
* Runs the application.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
- //GUI creation must be done in the event handler thread, because Swing is
- //not thread-safe. This is particularly important for the CPE Configurator
- //because it's initialization can be quite complex (it loads the last known
- //CPE descriptor).
+ // GUI creation must be done in the event handler thread, because Swing is
+ // not thread-safe. This is particularly important for the CPE Configurator
+ // because it's initialization can be quite complex (it loads the last known
+ // CPE descriptor).
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
- initGUI();
+ initGUI();
}
- });
+ });
}
/**
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java
index 3fc8988..c61abf8 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/CpmPanel.java
@@ -101,13 +101,12 @@ import org.apache.uima.util.Progress;
import org.apache.uima.util.UriUtils;
import org.apache.uima.util.XMLInputSource;
-
/**
* The Class CpmPanel.
*/
public class CpmPanel extends JPanel implements ActionListener, FileSelectorListener,
TabClosedListener, TransportControlListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5096300176103368922L;
@@ -125,9 +124,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/** 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";
+ private static final String PREFS_SAVE_USING_IMPORTS = "saveUsingImports";
/** The open cpe desc menu item. */
private JMenuItem openCpeDescMenuItem;
@@ -265,7 +264,7 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/** 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. */
@@ -282,10 +281,10 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/** 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;
@@ -296,7 +295,6 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
* Instantiates a new cpm panel.
*/
public CpmPanel() {
-
// The following is VERY flaky:
// Don't 'try' this at home:
@@ -458,7 +456,7 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
initFileChoosers();
- //create file selectors (used to populate CR and CI panels later)
+ // create file selectors (used to populate CR and CI panels later)
readerFileSelector = new FileSelector(null, "Collection Reader Descriptor",
JFileChooser.FILES_ONLY, fileChooserRootDir, new XMLFileFilter());
readerFileSelector.addFileSelectorListener(this, collectionReaderPanel);
@@ -477,7 +475,7 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
// CAS initializer panel is initially hidden since it is deprecated
setCasInitializerPanelVisible(false);
-
+
// read preferences (loads last opened CPE descriptor)
if (System.getProperty("uima.noprefs") == null) {
readPreferences();
@@ -512,8 +510,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
consumerFileChooser.addChoosableFileFilter(new XMLFileFilter());
File consumerDescDir = fileChooserRootDir;
if (consumerSpecifiers.size() > 0) {
- File lastConsumerFile = new File((String) consumerSpecifiers
- .get(consumerSpecifiers.size() - 1));
+ File lastConsumerFile = new File(
+ (String) consumerSpecifiers.get(consumerSpecifiers.size() - 1));
consumerDescDir = lastConsumerFile.getParentFile();
}
if (consumerDescDir.exists()) {
@@ -557,13 +555,13 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
refreshMenuItem.addActionListener(this);
menuItemList.add(refreshMenuItem);
- JMenu saveOptionsSubmenu = new JMenu ("Save Options");
+ JMenu saveOptionsSubmenu = new JMenu("Save Options");
saveUsingImportMenuItem = new JCheckBoxMenuItem("Use <import>");
saveUsingImportMenuItem.addActionListener(this);
saveUsingImportMenuItem.setSelected(saveUsingImports);
saveOptionsSubmenu.add(saveUsingImportMenuItem);
menuItemList.add(saveOptionsSubmenu);
-
+
clearAllMenuItem = new JMenuItem("Clear All");
clearAllMenuItem.addActionListener(this);
menuItemList.add(clearAllMenuItem);
@@ -586,11 +584,12 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
return menuItemList;
}
-
+
/**
* Sets the cas initializer panel visible.
*
- * @param visible the new cas initializer panel visible
+ * @param visible
+ * the new cas initializer panel visible
*/
private void setCasInitializerPanelVisible(boolean visible) {
casInitializerPanel.setVisible(visible);
@@ -626,7 +625,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Sets the save using imports.
*
- * @param b the new save using imports
+ * @param b
+ * the new save using imports
*/
private void setSaveUsingImports(boolean b) {
saveUsingImports = b;
@@ -653,8 +653,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
updateCpeDescriptionParameterOverrides();
// intantiate CPE
- mCPE = null; // to allow GC of previous ae's that may
- // hold onto lots of memory e.g. OpenNLP
+ mCPE = null; // to allow GC of previous ae's that may
+ // hold onto lots of memory e.g. OpenNLP
mCPE = UIMAFramework.produceCollectionProcessingEngine(currentCpeDesc);
// attach callback listener
@@ -674,7 +674,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
* Updates the configuration parameter settings in this.currentCpeDesc to match the current state
* of the GUI.
*
- * @throws Exception the exception
+ * @throws Exception
+ * the exception
*/
private void updateCpeDescriptionParameterOverrides() throws Exception {
// first check for descriptors out of sync with filesystem
@@ -722,8 +723,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
// CAS Consumers
for (int i = 0; i < consumerSpecifiers.size(); i++) {
- CpeCasProcessor casProc = currentCpeDesc.getCpeCasProcessors().getCpeCasProcessor(
- aeSpecifiers.size() + i);
+ CpeCasProcessor casProc = currentCpeDesc.getCpeCasProcessors()
+ .getCpeCasProcessor(aeSpecifiers.size() + i);
ConsumerPanel consumerPanel = (ConsumerPanel) consumerTabbedPane.getComponentAt(i);
if (consumerPanel.isModified()) {
CasProcessorConfigurationParameterSettings settings = CpeDescriptorFactory
@@ -740,9 +741,12 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
* 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
- * @throws CpeDescriptorException the cpe descriptor exception
+ * @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 {
@@ -776,7 +780,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
selectedComponentsChanged = false;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -828,8 +834,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
if (index > 0) {
// update CPE descriptor
try {
- CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors().getCpeCasProcessor(
- index);
+ CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors()
+ .getCpeCasProcessor(index);
currentCpeDesc.getCpeCasProcessors().removeCpeCasProcessor(index);
currentCpeDesc.getCpeCasProcessors().addCpeCasProcessor(casProcToMove, index - 1);
} catch (CpeDescriptorException e) {
@@ -847,8 +853,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
if (index > -1 && index < aeTabbedPane.getTabCount() - 1) {
// update CPE descriptor
try {
- CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors().getCpeCasProcessor(
- index);
+ CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors()
+ .getCpeCasProcessor(index);
currentCpeDesc.getCpeCasProcessors().removeCpeCasProcessor(index);
currentCpeDesc.getCpeCasProcessors().addCpeCasProcessor(casProcToMove, index + 1);
} catch (CpeDescriptorException e) {
@@ -889,8 +895,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
// update CPE descriptor
try {
int absIndex = aeSpecifiers.size() + index;
- CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors().getCpeCasProcessor(
- absIndex);
+ CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors()
+ .getCpeCasProcessor(absIndex);
currentCpeDesc.getCpeCasProcessors().removeCpeCasProcessor(absIndex);
currentCpeDesc.getCpeCasProcessors().addCpeCasProcessor(casProcToMove, absIndex - 1);
} catch (CpeDescriptorException e) {
@@ -909,8 +915,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
// update CPE descriptor
try {
int absIndex = aeSpecifiers.size() + index;
- CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors().getCpeCasProcessor(
- absIndex);
+ CpeCasProcessor casProcToMove = currentCpeDesc.getCpeCasProcessors()
+ .getCpeCasProcessor(absIndex);
currentCpeDesc.getCpeCasProcessors().removeCpeCasProcessor(absIndex);
currentCpeDesc.getCpeCasProcessors().addCpeCasProcessor(casProcToMove, absIndex + 1);
} catch (CpeDescriptorException e) {
@@ -945,8 +951,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
} else if (source == viewCasInitializerPanelMenuItem) {
setCasInitializerPanelVisible(!casInitializerPanel.isVisible());
} else if (source == saveUsingImportMenuItem) {
- setSaveUsingImports(!saveUsingImports);
- }
+ setSaveUsingImports(!saveUsingImports);
+ }
}
/**
@@ -1011,15 +1017,17 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Do save cpe descriptor.
*
- * @param aFile the a file
- * @throws Exception the exception
+ * @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();
-
+
if (saveUsingImports) {
- //replace <include> with <import>, and update relative import paths
+ // replace <include> with <import>, and update relative import paths
updateImports(aFile);
}
@@ -1038,17 +1046,19 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
}
- //mark descriptor with new location, for later import resolution
+ // mark descriptor with new location, for later import resolution
currentCpeDesc.setSourceUrl(aFile.toURI().toURL());
-
+
clearDirty();
}
/**
* Update imports.
*
- * @param cpeDescSaveFile the cpe desc save file
- * @throws Exception the exception
+ * @param cpeDescSaveFile
+ * the cpe desc save file
+ * @throws Exception
+ * the exception
*/
private void updateImports(File cpeDescSaveFile) throws Exception {
CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
@@ -1064,46 +1074,51 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
for (int i = 0; i < casProcs.length; i++) {
updateImport(casProcs[i].getCpeComponentDescriptor(), cpeDescSaveFile);
}
-
+
}
/**
* Update import.
*
- * @param descriptor the descriptor
- * @param cpeDescSaveFile the cpe desc save file
- * @throws Exception the exception
+ * @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
+ private void updateImport(CpeComponentDescriptor descriptor, File cpeDescSaveFile)
+ throws Exception {
+ // don't touch import by name
if (descriptor.getImport() != null && descriptor.getImport().getName() != null)
return;
-
- //for include or import by location, get the absolute URL of the descriptor
+
+ // for include or import by location, get the absolute URL of the descriptor
URL descUrl = descriptor.findAbsoluteUrl(defaultResourceManager);
-
- //don't touch URLs with protocol other than file:
+
+ // don't touch URLs with protocol other than file:
if ("file".equals(descUrl.getProtocol())) {
File descFile = urlToFile(descUrl);
- //try to find relative path from cpeDescSaveFile to descFile
+ // try to find relative path from cpeDescSaveFile to descFile
String relPath = FileUtils.findRelativePath(descFile, cpeDescSaveFile.getParentFile());
if (relPath != null) {
- //update CPE descriptor
+ // update CPE descriptor
descriptor.setInclude(null);
Import newImport = UIMAFramework.getResourceSpecifierFactory().createImport();
newImport.setLocation(relPath);
descriptor.setImport(newImport);
}
- }
+ }
}
/**
- * Utility method for convertion a URL to a File name, taking care of
- * proper escaping.
+ * Utility method for convertion a URL to a File name, taking care of proper escaping.
*
- * @param url a URL
+ * @param url
+ * a URL
* @return File corresponding to that URL
- * @throws URISyntaxException the URI syntax exception
+ * @throws URISyntaxException
+ * the URI syntax exception
*/
private File urlToFile(URL url) throws URISyntaxException {
return new File(UriUtils.quote(url));
@@ -1128,7 +1143,7 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
}
- if (FILE_ENTITY_PROGRESS_INDEX >= 0) { // uima-1086
+ if (FILE_ENTITY_PROGRESS_INDEX >= 0) { // uima-1086
int value = (int) progress[FILE_ENTITY_PROGRESS_INDEX].getCompleted();
progressBar.setValue(value);
@@ -1145,7 +1160,7 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
/**
- * 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
*/
@@ -1168,9 +1183,10 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
// ask for confirm if configuration settings have been modified
try {
if (isDirty()) {
- int rv = JOptionPane.showConfirmDialog(this, "Configuration settings have been modified. "
- + "Would you like to save the CPE descriptor?", "Exit",
- JOptionPane.YES_NO_CANCEL_OPTION);
+ int rv = JOptionPane.showConfirmDialog(this,
+ "Configuration settings have been modified. "
+ + "Would you like to save the CPE descriptor?",
+ "Exit", JOptionPane.YES_NO_CANCEL_OPTION);
if (rv == JOptionPane.CANCEL_OPTION) {
mShuttingDown = false;
@@ -1248,8 +1264,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
File readerSpecifierFile = new File(readerFileSelector.getSelected());
if (readerSpecifierFile.lastModified() > this.collectionReaderLastFileSyncTimestamp) {
try {
- populateCollectionReaderPanel(currentCpeDesc.getAllCollectionCollectionReaders()[0]
- .getCollectionIterator());
+ populateCollectionReaderPanel(
+ currentCpeDesc.getAllCollectionCollectionReaders()[0].getCollectionIterator());
} catch (Exception e) {
displayError(e);
}
@@ -1260,8 +1276,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
File casInitializerSpecifierFile = new File(casInitializerFileSelector.getSelected());
if (casInitializerSpecifierFile.lastModified() > this.casInitializerLastFileSyncTimestamp) {
try {
- populateCasInitializerPanel(currentCpeDesc.getAllCollectionCollectionReaders()[0]
- .getCasInitializer());
+ populateCasInitializerPanel(
+ currentCpeDesc.getAllCollectionCollectionReaders()[0].getCasInitializer());
} catch (Exception e) {
displayError(e);
}
@@ -1357,11 +1373,15 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Populate collection reader panel.
*
- * @param cpeColRdr the cpe col rdr
+ * @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
+ * @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 {
@@ -1370,12 +1390,12 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
String specifierFile = null;
if (cpeColRdr != null) {
specifierUrl = cpeColRdr.getDescriptor().findAbsoluteUrl(defaultResourceManager);
- //CPE GUI only supports file URLs
+ // CPE GUI only supports file URLs
if (!"file".equals(specifierUrl.getProtocol())) {
- displayError("Could not load descriptor from URL " + specifierUrl.toString() +
- ". CPE Configurator only supports file: URLs");
+ displayError("Could not load descriptor from URL " + specifierUrl.toString()
+ + ". CPE Configurator only supports file: URLs");
return false;
- }
+ }
try {
specifierFile = urlToFile(specifierUrl).toString();
} catch (URISyntaxException e) {
@@ -1409,10 +1429,10 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
} else {
collectionReaderLastFileSyncTimestamp = f.lastModified();
XMLInputSource readerInputSource = new XMLInputSource(f);
- collectionReaderDesc = UIMAFramework.getXMLParser().parseCollectionReaderDescription(
- readerInputSource);
- collectionReaderPanel.populate(collectionReaderDesc.getMetaData(), cpeColRdr
- .getConfigurationParameterSettings());
+ collectionReaderDesc = UIMAFramework.getXMLParser()
+ .parseCollectionReaderDescription(readerInputSource);
+ collectionReaderPanel.populate(collectionReaderDesc.getMetaData(),
+ cpeColRdr.getConfigurationParameterSettings());
}
}
return true;
@@ -1426,11 +1446,15 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Populate cas initializer panel.
*
- * @param cpeCasIni the cpe cas ini
+ * @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
+ * @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 {
@@ -1439,12 +1463,12 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
String specifierFile = null;
if (cpeCasIni != null) {
specifierUrl = cpeCasIni.getDescriptor().findAbsoluteUrl(defaultResourceManager);
- //CPE GUI only supports file URLs
+ // CPE GUI only supports file URLs
if (!"file".equals(specifierUrl.getProtocol())) {
- displayError("Could not load descriptor from URL " + specifierUrl.toString() +
- ". CPE Configurator only supports file: URLs");
+ displayError("Could not load descriptor from URL " + specifierUrl.toString()
+ + ". CPE Configurator only supports file: URLs");
return false;
- }
+ }
try {
specifierFile = urlToFile(specifierUrl).toString();
} catch (URISyntaxException e) {
@@ -1481,11 +1505,11 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
} else {
casInitializerLastFileSyncTimestamp = f.lastModified();
XMLInputSource casIniInputSource = new XMLInputSource(f);
- casInitializerDesc = UIMAFramework.getXMLParser().parseCasInitializerDescription(
- casIniInputSource);
+ casInitializerDesc = UIMAFramework.getXMLParser()
+ .parseCasInitializerDescription(casIniInputSource);
- casInitializerPanel.populate(casInitializerDesc.getMetaData(), cpeCasIni
- .getConfigurationParameterSettings());
+ casInitializerPanel.populate(casInitializerDesc.getMetaData(),
+ cpeCasIni.getConfigurationParameterSettings());
return true;
}
} finally {
@@ -1497,11 +1521,16 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* 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
+ * @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 {
@@ -1521,22 +1550,28 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Adds the AE.
*
- * @param cpeCasProc the cpe cas proc
+ * @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
+ * @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);
- //CPE GUI only supports file URLs
+ URL aeSpecifierUrl = cpeCasProc.getCpeComponentDescriptor()
+ .findAbsoluteUrl(defaultResourceManager);
+ // CPE GUI only supports file URLs
if (!"file".equals(aeSpecifierUrl.getProtocol())) {
- displayError("Could not load descriptor from URL " + aeSpecifierUrl.toString() +
- ". CPE Configurator only supports file: URLs");
+ displayError("Could not load descriptor from URL " + aeSpecifierUrl.toString()
+ + ". CPE Configurator only supports file: URLs");
return false;
- }
+ }
File f;
try {
f = urlToFile(aeSpecifierUrl);
@@ -1546,8 +1581,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
long fileModStamp = f.lastModified(); // get mod stamp before parsing, to prevent race condition
XMLInputSource aeInputSource = new XMLInputSource(aeSpecifierUrl);
- ResourceSpecifier aeSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
- aeInputSource);
+ ResourceSpecifier aeSpecifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(aeInputSource);
AnalysisEnginePanel aePanel = new AnalysisEnginePanel(aeSpecifier, f, fileModStamp);
String tabName;
@@ -1572,11 +1607,16 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* 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
+ * @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 {
@@ -1595,23 +1635,28 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Adds the consumer.
*
- * @param cpeCasProc the cpe cas proc
+ * @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
+ * @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(
- defaultResourceManager);
- //CPE GUI only supports file URLs
+ URL consumerSpecifierUrl = cpeCasProc.getCpeComponentDescriptor()
+ .findAbsoluteUrl(defaultResourceManager);
+ // CPE GUI only supports file URLs
if (!"file".equals(consumerSpecifierUrl.getProtocol())) {
- displayError("Could not load descriptor from URL " + consumerSpecifierUrl.toString() +
- ". CPE Configurator only supports file: URLs");
+ displayError("Could not load descriptor from URL " + consumerSpecifierUrl.toString()
+ + ". CPE Configurator only supports file: URLs");
return false;
- }
+ }
File f;
try {
f = urlToFile(consumerSpecifierUrl);
@@ -1622,8 +1667,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
long fileModStamp = f.lastModified(); // get mod stamp before parsing, to prevent race condition
XMLInputSource consumerInputSource = new XMLInputSource(consumerSpecifierUrl);
- ResourceSpecifier casConsumerSpecifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
- consumerInputSource);
+ ResourceSpecifier casConsumerSpecifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(consumerInputSource);
ConsumerPanel consumerPanel = new ConsumerPanel(casConsumerSpecifier, f, fileModStamp);
String tabName;
@@ -1647,7 +1692,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Make unique cas processor name.
*
- * @param baseName the base name
+ * @param baseName
+ * the base name
* @return the string
*/
private String makeUniqueCasProcessorName(String baseName) {
@@ -1674,8 +1720,11 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
consumerSpecifiers.clear();
}
- /* (non-Javadoc)
- * @see org.apache.uima.tools.util.gui.FileSelectorListener#fileSelected(javax.swing.JComponent, java.lang.String)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.tools.util.gui.FileSelectorListener#fileSelected(javax.swing.JComponent,
+ * java.lang.String)
*/
// FileSelectorListener:
@Override
@@ -1691,15 +1740,15 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
currentCpeDesc.setAllCollectionCollectionReaders(null);
currentCpeDesc.addCollectionReader(fileString);
CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
-
-// CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
-// if (readers.length == 0) {
-// currentCpeDesc.addCollectionReader(fileString);
-// readers = currentCpeDesc.getAllCollectionCollectionReaders();
-// } else {
-// readers[0].getCollectionIterator().getDescriptor().getInclude().set(fileString);
-// readers[0].getCollectionIterator().setConfigurationParameterSettings(null);
-// }
+
+ // CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
+ // if (readers.length == 0) {
+ // currentCpeDesc.addCollectionReader(fileString);
+ // readers = currentCpeDesc.getAllCollectionCollectionReaders();
+ // } else {
+ // readers[0].getCollectionIterator().getDescriptor().getInclude().set(fileString);
+ // readers[0].getCollectionIterator().setConfigurationParameterSettings(null);
+ // }
rv = populateCollectionReaderPanel(readers[0].getCollectionIterator());
} else {
@@ -1713,16 +1762,16 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
currentCpeDesc.setAllCollectionCollectionReaders(null);
currentCpeDesc.addCasInitializer(fileString);
CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
-
-// CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
-// if (readers.length == 0 || readers[0].getCasInitializer() == null) {
-// currentCpeDesc.addCasInitializer(fileString);
-// readers = currentCpeDesc.getAllCollectionCollectionReaders();
-// } else {
-// readers[0].getCasInitializer().getDescriptor().getInclude().set(fileString);
-// // clear config settings
-// readers[0].getCasInitializer().setConfigurationParameterSettings(null);
-// }
+
+ // CpeCollectionReader[] readers = currentCpeDesc.getAllCollectionCollectionReaders();
+ // if (readers.length == 0 || readers[0].getCasInitializer() == null) {
+ // currentCpeDesc.addCasInitializer(fileString);
+ // readers = currentCpeDesc.getAllCollectionCollectionReaders();
+ // } else {
+ // readers[0].getCasInitializer().getDescriptor().getInclude().set(fileString);
+ // // clear config settings
+ // readers[0].getCasInitializer().setConfigurationParameterSettings(null);
+ // }
rv = populateCasInitializerPanel(readers[0].getCasInitializer());
} else {
// no CAS initializer selected - OK
@@ -1744,8 +1793,11 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
return rv;
}
- /* (non-Javadoc)
- * @see org.apache.uima.tools.cpm.TabClosedListener#tabClosed(org.apache.uima.tools.cpm.JTabbedPaneWithCloseIcons, int)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.apache.uima.tools.cpm.TabClosedListener#tabClosed(org.apache.uima.tools.cpm.
+ * JTabbedPaneWithCloseIcons, int)
*/
// TabClosedListener:
@Override
@@ -1764,7 +1816,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.util.gui.TransportControlListener#controlStarted()
*/
@Override
@@ -1774,7 +1828,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
setFrameEnabled(false);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.util.gui.TransportControlListener#controlPaused()
*/
@Override
@@ -1792,13 +1848,15 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
progressTimer.stop();
performanceQueryTimer.stop();
- PerformanceReportDialog perfReportDlg = new PerformanceReportDialog(CpmPanel.this
- .getParentFrame());
+ PerformanceReportDialog perfReportDlg = new PerformanceReportDialog(
+ CpmPanel.this.getParentFrame());
perfReportDlg.displayStats(mCPE.getPerformanceReport(), progressBar.getValue(),
"Processing is paused.");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.util.gui.TransportControlListener#controlResumed()
*/
@Override
@@ -1814,7 +1872,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
performanceQueryTimer.restart();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.util.gui.TransportControlListener#controlStopped()
*/
@Override
@@ -1969,11 +2029,16 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* 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
+ * @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 {
@@ -1983,8 +2048,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
// update GUI
// Collection Reader
CpeCollectionReader[] collRdrs = currentCpeDesc.getAllCollectionCollectionReaders(); // more
- // than
- // one??
+ // than
+ // one??
CpeCollectionReader collRdr = null;
if (collRdrs != null && collRdrs.length > 0) {
collRdr = collRdrs[0];
@@ -2012,26 +2077,26 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
for (int i = 0; i < casProcs.length; i++) {
boolean success = true;
try {
- URL specifierUrl = casProcs[i].getCpeComponentDescriptor().findAbsoluteUrl(defaultResourceManager);
- ResourceSpecifier specifier = UIMAFramework.getXMLParser().parseResourceSpecifier(
- new XMLInputSource(specifierUrl));
+ URL specifierUrl = casProcs[i].getCpeComponentDescriptor()
+ .findAbsoluteUrl(defaultResourceManager);
+ ResourceSpecifier specifier = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(new XMLInputSource(specifierUrl));
if (isCasConsumerSpecifier(specifier)) {
success = addConsumer(casProcs[i]);
} else {
success = addAE(casProcs[i]);
}
- }
- catch(Exception e) {
+ } catch (Exception e) {
System.err.println("Error loading CPE Descriptor " + aFile.getPath());
- e.printStackTrace();
- success= false;
+ e.printStackTrace();
+ success = false;
}
if (!success) {
currentCpeDesc.getCpeCasProcessors().removeCpeCasProcessor(i - numFailed);
numFailed++;
}
- }
-
+ }
+
prefs.put(PREFS_CPE_DESCRIPTOR_FILE, aFile.getAbsolutePath());
// nothing should be dirty when we first open
@@ -2041,7 +2106,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Checks if is cas consumer specifier.
*
- * @param specifier the specifier
+ * @param specifier
+ * the specifier
* @return true, if is cas consumer specifier
*/
private boolean isCasConsumerSpecifier(ResourceSpecifier specifier) {
@@ -2058,8 +2124,10 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
* The Class StatusCallbackListenerImpl.
*/
class StatusCallbackListenerImpl implements StatusCallbackListener {
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#initializationComplete()
*/
@Override
@@ -2087,8 +2155,12 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
progressTimer.start();
}
- /* (non-Javadoc)
- * @see org.apache.uima.collection.StatusCallbackListener#entityProcessComplete(org.apache.uima.cas.CAS, org.apache.uima.collection.EntityProcessStatus)
+ /*
+ * (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) {
@@ -2099,22 +2171,29 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
}
- /* (non-Javadoc)
+ /*
+ * (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()
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#collectionProcessComplete()
*/
@Override
public void collectionProcessComplete() {
onCompletion();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#paused()
*/
@Override
@@ -2122,7 +2201,9 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
System.out.println("StatusCallbackListenerImpl::paused()");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#resumed()
*/
@Override
@@ -2130,14 +2211,16 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
System.out.println("StatusCallbackListenerImpl::resumed");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.collection.base_cpm.BaseStatusCallbackListener#aborted()
*/
@Override
public void aborted() {
if (!mShuttingDown && !mPaused) {
- PerformanceReportDialog perfReportDlg = new PerformanceReportDialog(CpmPanel.this
- .getParentFrame());
+ PerformanceReportDialog perfReportDlg = new PerformanceReportDialog(
+ CpmPanel.this.getParentFrame());
perfReportDlg.displayStats(mCPE.getPerformanceReport(), progressBar.getValue(),
"Processing aborted.");
}
@@ -2147,11 +2230,11 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
}
/**
- * MetaDataPanel used for Collection Reader & AE selection and configuration. Adds a reset method
- * to clear out related components when specifier file selection changes.
+ * MetaDataPanel used for Collection Reader & AE selection and configuration. Adds a reset
+ * method to clear out related components when specifier file selection changes.
*/
static class ResetableMetaDataPanel extends MetaDataPanel {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -4573780175511175666L;
@@ -2164,7 +2247,8 @@ public class CpmPanel extends JPanel implements ActionListener, FileSelectorList
/**
* Instantiates a new resetable meta data panel.
*
- * @param nrColumns the nr columns
+ * @param nrColumns
+ * the nr columns
*/
public ResetableMetaDataPanel(int nrColumns) {
super(nrColumns);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java
index 57381a8..5404645 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/ElapsedTimeFormatter.java
@@ -19,16 +19,16 @@
package org.apache.uima.tools.cpm;
-
/**
* The Class ElapsedTimeFormatter.
*/
final public class ElapsedTimeFormatter {
-
+
/**
* Format.
*
- * @param totalSecs the total secs
+ * @param totalSecs
+ * the total secs
* @return the string
*/
public static String format(int totalSecs) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java
index 5dc465f..32af3ab 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/JTabbedPaneWithCloseIcons.java
@@ -29,7 +29,6 @@ import java.awt.event.MouseListener;
import javax.swing.Icon;
import javax.swing.JTabbedPane;
-
/**
* 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
@@ -39,7 +38,7 @@ import javax.swing.JTabbedPane;
*/
public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7680554379341154297L;
@@ -56,13 +55,16 @@ public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListe
/**
* Adds the tab closed listener.
*
- * @param aTabClosedListener the a tab closed listener
+ * @param aTabClosedListener
+ * the a tab closed listener
*/
public void addTabClosedListener(TabClosedListener aTabClosedListener) {
this.tabClosedListener = aTabClosedListener;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.JTabbedPane#addTab(java.lang.String, java.awt.Component)
*/
@Override
@@ -73,9 +75,12 @@ public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListe
/**
* Adds the tab.
*
- * @param title the title
- * @param component the component
- * @param extraIcon the extra icon
+ * @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);
@@ -84,8 +89,10 @@ public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListe
/**
* Move tab.
*
- * @param fromIndex the from index
- * @param toIndex the to index
+ * @param fromIndex
+ * the from index
+ * @param toIndex
+ * the to index
*/
public void moveTab(int fromIndex, int toIndex) {
Component componentToMove = this.getComponentAt(fromIndex);
@@ -96,7 +103,9 @@ public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListe
this.setTitleAt(toIndex, title);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
*/
@Override
@@ -112,28 +121,36 @@ public class JTabbedPaneWithCloseIcons extends JTabbedPane implements MouseListe
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
*/
@Override
public void mouseEntered(MouseEvent e) {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
*/
@Override
public void mouseExited(MouseEvent e) {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
*/
@Override
public void mousePressed(MouseEvent e) {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java
index 6f92cb5..3ee40b6 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/MetaDataPanel.java
@@ -41,7 +41,6 @@ import org.apache.uima.tools.util.gui.FileSelector;
import org.apache.uima.tools.util.gui.FormPanel;
import org.apache.uima.tools.util.gui.ListSelector;
-
/**
*
* A dynamically generated form panel with components generated from configuration parameters
@@ -52,7 +51,7 @@ import org.apache.uima.tools.util.gui.ListSelector;
*/
public class MetaDataPanel extends FormPanel {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 2002216386886772644L;
@@ -73,7 +72,8 @@ public class MetaDataPanel extends FormPanel {
/**
* Instantiates a new meta data panel.
*
- * @param nrColumns the nr columns
+ * @param nrColumns
+ * the nr columns
*/
public MetaDataPanel(int nrColumns) {
super(nrColumns);
@@ -82,8 +82,10 @@ public class MetaDataPanel extends FormPanel {
/**
* Populate.
*
- * @param md the md
- * @param overrides the overrides
+ * @param md
+ * the md
+ * @param overrides
+ * the overrides
*/
public void populate(ResourceMetaData md, CasProcessorConfigurationParameterSettings overrides) {
metaData = md;
@@ -105,9 +107,8 @@ public class MetaDataPanel extends FormPanel {
boolean multiValued = parameters[i].isMultiValued();
boolean requiresFileSelector = false;
- if ((name.endsWith("Dir") || name.endsWith("Directory") || name.endsWith("Descriptor") || name
- .indexOf("File") != -1)
- && type.equals("String"))
+ if ((name.endsWith("Dir") || name.endsWith("Directory") || name.endsWith("Descriptor")
+ || name.indexOf("File") != -1) && type.equals("String"))
requiresFileSelector = true;
boolean justDirectories = false;
@@ -123,8 +124,8 @@ public class MetaDataPanel extends FormPanel {
Object parameterValue = cps.getParameterValue(name);
if (type.equals("Boolean"))
- field = new JCheckBox((String) null, (parameterValue == null) ? false
- : (Boolean) parameterValue);
+ field = new JCheckBox((String) null,
+ (parameterValue == null) ? false : (Boolean) parameterValue);
else if (multiValued == false) {
if (requiresFileSelector == false) {
String stringValue = (parameterValue == null) ? "" : parameterValue.toString();
@@ -186,8 +187,10 @@ public class MetaDataPanel extends FormPanel {
/**
* Sets the value.
*
- * @param fieldName Configuration parameter field name
- * @param fieldValue Field value
+ * @param fieldName
+ * Configuration parameter field name
+ * @param fieldValue
+ * Field value
*/
public void setValue(String fieldName, Object fieldValue) {
// Find fieldName in fieldList:
@@ -201,7 +204,7 @@ public class MetaDataPanel extends FormPanel {
}
/**
- * Removes all fields.
+ * Removes all fields.
*/
public void clearAll() {
Component components[] = gridBagPanel.getComponents();
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java
index 916a578..35ffbc3 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/PerformanceReportDialog.java
@@ -38,13 +38,12 @@ import javax.swing.tree.DefaultTreeModel;
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.ProcessTraceEvent;
-
/**
* Mock-up of dialog for reporting performance stats.
*
*/
public class PerformanceReportDialog extends JDialog {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7747258424181047062L;
@@ -66,9 +65,12 @@ public class PerformanceReportDialog extends JDialog {
/**
* 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
+ * @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);
@@ -98,11 +100,15 @@ public class PerformanceReportDialog extends JDialog {
/**
* Display stats.
*
- * @param aProcessTrace the a process trace
- * @param aNumDocsProcessed the a num docs processed
- * @param aStatusMessage the a status message
+ * @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) {
+ public void displayStats(ProcessTrace aProcessTrace, int aNumDocsProcessed,
+ String aStatusMessage) {
statusLabel.setText(aStatusMessage);
docsProcessedLabel.setText("Documents Processed: " + aNumDocsProcessed);
@@ -117,8 +123,8 @@ public class PerformanceReportDialog extends JDialog {
totalTimeLabel.setText("Total Time: " + totalTimeSeconds + " seconds");
// create root tree node
- DefaultMutableTreeNode root = new DefaultMutableTreeNode("100% (" + totalTime
- + "ms) - Collection Processing Engine");
+ DefaultMutableTreeNode root = new DefaultMutableTreeNode(
+ "100% (" + totalTime + "ms) - Collection Processing Engine");
// build tree
it = aProcessTrace.getEvents().iterator();
while (it.hasNext()) {
@@ -133,9 +139,12 @@ public class PerformanceReportDialog extends JDialog {
/**
* Builds the event tree.
*
- * @param aEvent the a event
- * @param aParentNode the a parent node
- * @param aTotalTime the a total time
+ * @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) {
@@ -154,8 +163,8 @@ public class PerformanceReportDialog extends JDialog {
type = aEvent.getType();
}
- DefaultMutableTreeNode node = new DefaultMutableTreeNode(pctStr + " (" + duration + "ms) - "
- + aEvent.getComponentName() + " (" + type + ")");
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(
+ pctStr + " (" + duration + "ms) - " + aEvent.getComponentName() + " (" + type + ")");
aParentNode.add(node);
Iterator it = aEvent.getSubEvents().iterator();
while (it.hasNext()) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java
index 406aeee..b266cc0 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cpm/TabClosedListener.java
@@ -19,19 +19,20 @@
package org.apache.uima.tools.cpm;
-
/**
* Callback interface used in conjunction with JTabbedPaneWithCloseIcons.
*
* @see org.apache.uima.tools.cpm.JTabbedPaneWithCloseIcons
*/
public interface TabClosedListener {
-
+
/**
* Tab closed.
*
- * @param source the JTabbedPaneWithCloseIcons control sending this event
- * @param tabPos position of the tab that was closed
+ * @param source
+ * the JTabbedPaneWithCloseIcons control sending this event
+ * @param tabPos
+ * position of the tab that was closed
*/
void tabClosed(JTabbedPaneWithCloseIcons source, int tabPos);
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationDisplayCustomizationFrame.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationDisplayCustomizationFrame.java
index af84c51..f44b0ac 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationDisplayCustomizationFrame.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationDisplayCustomizationFrame.java
@@ -50,7 +50,6 @@ import javax.swing.tree.TreeModel;
import org.apache.uima.cas.CAS;
import org.apache.uima.cas.TypeSystem;
-
/**
* TODO: add type comment for <code>AnnotationDisplayCustomizationFrame</code>.
*
@@ -62,28 +61,27 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
private static final long serialVersionUID = -6695661439132793537L;
/**
- * The listener interface for receiving typeTreeSelection events.
- * The class that is interested in processing a typeTreeSelection
- * event implements this interface, and the object created
- * with that class is registered with a component using the
- * component's <code>addTypeTreeSelectionListener</code> method. When
- * the typeTreeSelection event occurs, that object's appropriate
- * method is invoked.
+ * The listener interface for receiving typeTreeSelection events. The class that is interested in
+ * processing a typeTreeSelection event implements this interface, and the object created with
+ * that class is registered with a component using the component's
+ * <code>addTypeTreeSelectionListener</code> method. When the typeTreeSelection event occurs, that
+ * object's appropriate method is invoked.
*
* @see TypeTreeSelectionEvent
*/
private class TypeTreeSelectionListener implements TreeSelectionListener {
-
+
/**
* Value changed.
*
- * @param event the event
+ * @param event
+ * the event
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
*/
@Override
public void valueChanged(TreeSelectionEvent event) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) AnnotationDisplayCustomizationFrame.this.tree
- .getLastSelectedPathComponent();
+ .getLastSelectedPathComponent();
String typeName = (String) node.getUserObject();
if (typeName.equals(AnnotationDisplayCustomizationFrame.this.currentTypeName)) {
return;
@@ -98,13 +96,15 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
*/
private class CustomizeBgButtonHandler implements ActionListener {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
Color color = JColorChooser.showDialog(AnnotationDisplayCustomizationFrame.this,
- "Choose color", AnnotationDisplayCustomizationFrame.this.bgColor);
+ "Choose color", AnnotationDisplayCustomizationFrame.this.bgColor);
if (color != null) {
AnnotationDisplayCustomizationFrame.this.bgColor = color;
AnnotationDisplayCustomizationFrame.this.bgIcon.setColor(color);
@@ -122,13 +122,15 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
*/
private class CustomizeFgButtonHandler implements ActionListener {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
Color color = JColorChooser.showDialog(AnnotationDisplayCustomizationFrame.this,
- "Choose color", AnnotationDisplayCustomizationFrame.this.fgColor);
+ "Choose color", AnnotationDisplayCustomizationFrame.this.fgColor);
if (color != null) {
AnnotationDisplayCustomizationFrame.this.fgColor = color;
AnnotationDisplayCustomizationFrame.this.fgIcon.setColor(color);
@@ -146,24 +148,26 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
*/
private class AcceptButtonHandler implements ActionListener {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
Style style = AnnotationDisplayCustomizationFrame.this.styleMap
- .get(AnnotationDisplayCustomizationFrame.this.currentTypeName);
+ .get(AnnotationDisplayCustomizationFrame.this.currentTypeName);
if (style == null) {
style = AnnotationDisplayCustomizationFrame.this.textPane.addStyle(
- AnnotationDisplayCustomizationFrame.this.currentTypeName,
- AnnotationDisplayCustomizationFrame.this.styleMap.get(CAS.TYPE_NAME_ANNOTATION));
+ AnnotationDisplayCustomizationFrame.this.currentTypeName,
+ AnnotationDisplayCustomizationFrame.this.styleMap.get(CAS.TYPE_NAME_ANNOTATION));
}
- StyleConstants.setForeground(style, StyleConstants
- .getForeground(AnnotationDisplayCustomizationFrame.this.currentStyle));
- StyleConstants.setBackground(style, StyleConstants
- .getBackground(AnnotationDisplayCustomizationFrame.this.currentStyle));
- AnnotationDisplayCustomizationFrame.this.styleMap.put(
- AnnotationDisplayCustomizationFrame.this.currentTypeName, style);
+ StyleConstants.setForeground(style,
+ StyleConstants.getForeground(AnnotationDisplayCustomizationFrame.this.currentStyle));
+ StyleConstants.setBackground(style,
+ StyleConstants.getBackground(AnnotationDisplayCustomizationFrame.this.currentStyle));
+ AnnotationDisplayCustomizationFrame.this.styleMap
+ .put(AnnotationDisplayCustomizationFrame.this.currentTypeName, style);
enableButtons(false);
AnnotationDisplayCustomizationFrame.this.repaint();
}
@@ -175,23 +179,25 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
*/
private class CancelButtonHandler implements ActionListener {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
Style style = AnnotationDisplayCustomizationFrame.this.styleMap
- .get(AnnotationDisplayCustomizationFrame.this.currentTypeName);
+ .get(AnnotationDisplayCustomizationFrame.this.currentTypeName);
if (style == null) {
style = AnnotationDisplayCustomizationFrame.this.styleMap.get(CAS.TYPE_NAME_ANNOTATION);
}
// assert(style != null);
AnnotationDisplayCustomizationFrame.this.fgColor = StyleConstants.getForeground(style);
AnnotationDisplayCustomizationFrame.this.fgIcon
- .setColor(AnnotationDisplayCustomizationFrame.this.fgColor);
+ .setColor(AnnotationDisplayCustomizationFrame.this.fgColor);
AnnotationDisplayCustomizationFrame.this.bgColor = StyleConstants.getBackground(style);
AnnotationDisplayCustomizationFrame.this.bgIcon
- .setColor(AnnotationDisplayCustomizationFrame.this.bgColor);
+ .setColor(AnnotationDisplayCustomizationFrame.this.bgColor);
setCurrentStyle(style);
setTextPane();
enableButtons(false);
@@ -251,7 +257,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Instantiates a new annotation display customization frame.
*
- * @throws java.awt.HeadlessException the java.awt. headless exception
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
*/
public AnnotationDisplayCustomizationFrame() {
}
@@ -259,7 +266,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Instantiates a new annotation display customization frame.
*
- * @param arg0 the arg 0
+ * @param arg0
+ * the arg 0
*/
public AnnotationDisplayCustomizationFrame(GraphicsConfiguration arg0) {
super(arg0);
@@ -268,8 +276,10 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Instantiates a new annotation display customization frame.
*
- * @param arg0 the arg 0
- * @throws java.awt.HeadlessException the java.awt. headless exception
+ * @param arg0
+ * the arg 0
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
*/
public AnnotationDisplayCustomizationFrame(String arg0) {
super(arg0);
@@ -278,8 +288,10 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Instantiates a new annotation display customization frame.
*
- * @param arg0 the arg 0
- * @param arg1 the arg 1
+ * @param arg0
+ * the arg 0
+ * @param arg1
+ * the arg 1
*/
public AnnotationDisplayCustomizationFrame(String arg0, GraphicsConfiguration arg1) {
super(arg0, arg1);
@@ -288,7 +300,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Sets the current style.
*
- * @param style the new current style
+ * @param style
+ * the new current style
*/
private void setCurrentStyle(Style style) {
// Copy style.
@@ -300,7 +313,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Enable buttons.
*
- * @param flag the flag
+ * @param flag
+ * the flag
*/
private void enableButtons(boolean flag) {
this.acceptButton.setEnabled(flag);
@@ -310,8 +324,10 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Inits the.
*
- * @param styleMap1 the style map 1
- * @param cas the cas
+ * @param styleMap1
+ * the style map 1
+ * @param cas
+ * the cas
*/
public void init(Map<String, Style> styleMap1, CAS cas) {
this.styleMap = styleMap1;
@@ -327,7 +343,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Creates the customization panel.
*
- * @param typeName the type name
+ * @param typeName
+ * the type name
* @return the j panel
*/
private JPanel createCustomizationPanel(String typeName) {
@@ -361,7 +378,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Sets the customization panel.
*
- * @param typeName the new customization panel
+ * @param typeName
+ * the new customization panel
*/
private void setCustomizationPanel(String typeName) {
this.currentTypeName = typeName;
@@ -385,7 +403,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Creates the button panel.
*
- * @param buttonPanel the button panel
+ * @param buttonPanel
+ * the button panel
*/
private void createButtonPanel(JPanel buttonPanel) {
this.acceptButton = new JButton("OK");
@@ -423,9 +442,12 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Creates the color panel.
*
- * @param text the text
- * @param icon the icon
- * @param buttonType the button type
+ * @param text
+ * the text
+ * @param icon
+ * the icon
+ * @param buttonType
+ * the button type
* @return the j panel
*/
private JPanel createColorPanel(String text, ColorIcon icon, int buttonType) {
@@ -447,7 +469,8 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Creates the tree model.
*
- * @param ts the ts
+ * @param ts
+ * the ts
* @return the tree model
*/
private TreeModel createTreeModel(TypeSystem ts) {
@@ -463,9 +486,12 @@ public class AnnotationDisplayCustomizationFrame extends JFrame {
/**
* Adds the children.
*
- * @param node the node
- * @param type the type
- * @param ts the ts
+ * @param node
+ * the node
+ * @param type
+ * the type
+ * @param ts
+ * the ts
*/
private static void addChildren(DefaultMutableTreeNode node, org.apache.uima.cas.Type type,
TypeSystem ts) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationExtent.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationExtent.java
index eb2d8d1..0bb7bbf 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationExtent.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AnnotationExtent.java
@@ -21,7 +21,6 @@ package org.apache.uima.tools.cvd;
import javax.swing.text.Style;
-
/**
* The Class AnnotationExtent.
*/
@@ -36,13 +35,15 @@ public class AnnotationExtent {
/** The style. */
private Style style;
-
/**
* Instantiates a new annotation extent.
*
- * @param start the start
- * @param end the end
- * @param style the style
+ * @param start
+ * the start
+ * @param end
+ * the end
+ * @param style
+ * the style
*/
public AnnotationExtent(int start, int end, Style style) {
this.start = start;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ArrayNode.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ArrayNode.java
index d6269e3..8b0c28c 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ArrayNode.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ArrayNode.java
@@ -19,7 +19,6 @@
package org.apache.uima.tools.cvd;
-
/**
* TODO: add type comment for <code>ArrayNode</code>.
*
@@ -39,19 +38,22 @@ public class ArrayNode extends FSTreeNode {
/** The end. */
private int end;
-
/**
* Instantiates a new array node.
*
- * @param start the start
- * @param end the end
+ * @param start
+ * the start
+ * @param end
+ * the end
*/
public ArrayNode(int start, int end) {
this.start = start;
this.end = end;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
@Override
@@ -59,7 +61,9 @@ public class ArrayNode extends FSTreeNode {
return "[" + this.start + ".." + this.end + "]";
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.cvd.FSTreeNode#initChildren()
*/
@Override
@@ -70,7 +74,8 @@ public class ArrayNode extends FSTreeNode {
/**
* Degree.
*
- * @param i the i
+ * @param i
+ * the i
* @return the int
*/
// Compute the degree of i: (number of decimals of (i-1)) - 1.
@@ -81,7 +86,7 @@ public class ArrayNode extends FSTreeNode {
}
return (int) Math.log10(i - 1);
}
-
+
/**
* Gets the end.
*
@@ -99,6 +104,5 @@ public class ArrayNode extends FSTreeNode {
public int getStart() {
return this.start;
}
-
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AutoFoldingMenu.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AutoFoldingMenu.java
index b002847..48e4b30 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AutoFoldingMenu.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/AutoFoldingMenu.java
@@ -22,7 +22,6 @@ package org.apache.uima.tools.cvd;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
-
/**
* Auto-folding menu. It overrides the add(JMenuItem) method only.
*
@@ -46,8 +45,10 @@ public class AutoFoldingMenu extends JMenu {
/**
* Instantiates a new auto folding menu.
*
- * @param title the title
- * @param max the max
+ * @param title
+ * the title
+ * @param max
+ * the max
*/
public AutoFoldingMenu(String title, int max) {
super(title);
@@ -57,13 +58,16 @@ public class AutoFoldingMenu extends JMenu {
/**
* Instantiates a new auto folding menu.
*
- * @param title the title
+ * @param title
+ * the title
*/
public AutoFoldingMenu(String title) {
this(title, DEFAULT_MENU_SIZE);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.JMenu#add(javax.swing.JMenuItem)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/CVD.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/CVD.java
index 4605679..2005d17 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/CVD.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/CVD.java
@@ -30,7 +30,6 @@ import org.apache.uima.internal.util.CommandLineParser;
import org.apache.uima.resource.RelativePathResolver;
import org.apache.uima.tools.images.Images;
-
/**
* The main class for the CAS Visual Debugger.
*
@@ -58,9 +57,9 @@ public class CVD {
/** The Constant LOOK_AND_FEEL_PARAM. */
private static final String LOOK_AND_FEEL_PARAM = "-lookandfeel";
-
+
/** The Constant XMI_FILE_PARAM. */
- private static final String XMI_FILE_PARAM = "-xmi";
+ private static final String XMI_FILE_PARAM = "-xmi";
/**
* Instantiates a new cvd.
@@ -80,7 +79,8 @@ public class CVD {
/**
* Creates the main frame.
*
- * @param iniFile the ini file
+ * @param iniFile
+ * the ini file
* @return the main frame
*/
public static MainFrame createMainFrame(File iniFile) {
@@ -120,7 +120,7 @@ public class CVD {
parser.addParameter(DATA_PATH_PARAM, true);
parser.addParameter(LOOK_AND_FEEL_PARAM, true);
parser.addParameter(EXECUTE_SWITCH);
- parser.addParameter(XMI_FILE_PARAM, true);
+ parser.addParameter(XMI_FILE_PARAM, true);
parser.addParameter(INI_FILE_PARAM, true);
return parser;
}
@@ -129,8 +129,8 @@ public class CVD {
* Prints the usage.
*/
private static final void printUsage() {
- System.out
- .println("Usage: java org.apache.uima.cvd.CVD [-text <TextFile>] [-desc <XmlDescriptor>] [-datapath <DataPath>] [-exec]");
+ System.out.println(
+ "Usage: java org.apache.uima.cvd.CVD [-text <TextFile>] [-desc <XmlDescriptor>] [-datapath <DataPath>] [-exec]");
System.out.println("Additional optional parameters:");
System.out.println(" -lookandfeel <LookAndFeelClassName>");
}
@@ -138,7 +138,8 @@ public class CVD {
/**
* Check cmd line syntax.
*
- * @param clp the clp
+ * @param clp
+ * the clp
* @return true, if successful
*/
private static final boolean checkCmdLineSyntax(CommandLineParser clp) {
@@ -166,7 +167,8 @@ public class CVD {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
try {
@@ -206,9 +208,9 @@ public class CVD {
frame.loadAEDescriptor(new File(clp.getParamArgument(DESC_FILE_PARAM)));
}
if (clp.isInArgsList(TEXT_FILE_PARAM)) {
- frame.loadTextFile(new File(clp.getParamArgument(TEXT_FILE_PARAM)));
+ frame.loadTextFile(new File(clp.getParamArgument(TEXT_FILE_PARAM)));
} else if (clp.isInArgsList(XMI_FILE_PARAM)) {
- frame.loadXmiFile(new File(clp.getParamArgument(XMI_FILE_PARAM)));
+ frame.loadXmiFile(new File(clp.getParamArgument(XMI_FILE_PARAM)));
}
if (clp.isInArgsList(EXECUTE_SWITCH)) {
frame.runAE(true);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ColorIcon.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ColorIcon.java
index 0e0786e..f1b3b39 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ColorIcon.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/ColorIcon.java
@@ -25,7 +25,6 @@ import java.awt.Graphics;
import javax.swing.Icon;
-
/**
* TODO: add type comment for <code>ColorIcon</code>.
*
@@ -39,7 +38,6 @@ public class ColorIcon implements Icon {
/** The color. */
private Color color = Color.black;
-
/**
* Instantiates a new color icon.
*/
@@ -49,7 +47,8 @@ public class ColorIcon implements Icon {
/**
* Instantiates a new color icon.
*
- * @param color the color
+ * @param color
+ * the color
*/
public ColorIcon(Color color) {
this();
@@ -59,7 +58,8 @@ public class ColorIcon implements Icon {
/**
* Sets the color.
*
- * @param color the new color
+ * @param color
+ * the new color
*/
public void setColor(Color color) {
this.color = color;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSNode.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSNode.java
index b4e0dc5..931fb9a 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSNode.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSNode.java
@@ -42,22 +42,18 @@ import org.apache.uima.jcas.cas.StringArray;
import org.apache.uima.jcas.cas.TOP;
import org.apache.uima.jcas.tcas.Annotation;
-
/**
* A node in the FS Tree Model
*
- * A node is
- * - an Feature Structure array
- * -- elements may be other nodes
- * - a primitive value, including Strings
- * - a Feature Structure.
+ * A node is - an Feature Structure array -- elements may be other nodes - a primitive value,
+ * including Strings - a Feature Structure.
*/
public class FSNode extends FSTreeNode {
/** The Constant maxStringLength. */
private static final int maxStringLength = 100;
-
+
/** The s tree model. */
private final FSTreeModel fSTreeModel;
@@ -99,10 +95,10 @@ public class FSNode extends FSTreeNode {
/** The int or long like value. */
private final long intOrLongLikeValue;
-
+
/** The fs. */
private final TOP fs;
-
+
/** The string. */
private final String string;
@@ -114,45 +110,63 @@ public class FSNode extends FSTreeNode {
/** The is array elem. */
private final boolean isArrayElem;
-
+
/** The is shortened string. */
// Remember if we're displaying a shortened string.
private boolean isShortenedString = false;
-
+
/**
* K 2 nc.
*
- * @param kind the kind
+ * @param kind
+ * the kind
* @return the int
*/
private int k2nc(SlotKind kind) {
- switch(kind) {
- case Slot_Boolean:
- case Slot_BooleanRef: return BOOL_FS;
- case Slot_Byte:
- case Slot_ByteRef: return BYTE_FS;
- case Slot_Short:
- case Slot_ShortRef: return SHORT_FS;
- case Slot_Int: return INT_FS;
- case Slot_Float: return FLOAT_FS;
- case Slot_LongRef: return LONG_FS;
- case Slot_DoubleRef: return DOUBLE_FS;
- case Slot_StrRef: return STRING_FS;
- case Slot_HeapRef: return STD_FS;
- default: Misc.internalError(); return -1;
+ switch (kind) {
+ case Slot_Boolean:
+ case Slot_BooleanRef:
+ return BOOL_FS;
+ case Slot_Byte:
+ case Slot_ByteRef:
+ return BYTE_FS;
+ case Slot_Short:
+ case Slot_ShortRef:
+ return SHORT_FS;
+ case Slot_Int:
+ return INT_FS;
+ case Slot_Float:
+ return FLOAT_FS;
+ case Slot_LongRef:
+ return LONG_FS;
+ case Slot_DoubleRef:
+ return DOUBLE_FS;
+ case Slot_StrRef:
+ return STRING_FS;
+ case Slot_HeapRef:
+ return STD_FS;
+ default:
+ Misc.internalError();
+ return -1;
}
}
/**
* Instantiates a new FS node.
*
- * @param fSTreeModel the f S tree model
- * @param nodeClass the node class
- * @param fsOrString the fs or string
- * @param intOrLongLikeValue the int or long like value
- * @param feat the feat
+ * @param fSTreeModel
+ * the f S tree model
+ * @param nodeClass
+ * the node class
+ * @param fsOrString
+ * the fs or string
+ * @param intOrLongLikeValue
+ * the int or long like value
+ * @param feat
+ * the feat
*/
- FSNode(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue, Feature feat) {
+ FSNode(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue,
+ Feature feat) {
this.fSTreeModel = fSTreeModel;
this.nodeClass = nodeClass;
this.intOrLongLikeValue = intOrLongLikeValue;
@@ -166,13 +180,19 @@ public class FSNode extends FSTreeNode {
/**
* Instantiates a new FS node.
*
- * @param fSTreeModel the f S tree model
- * @param nodeClass the node class
- * @param fsOrString the fs or string
- * @param intOrLongLikeValue the int or long like value
- * @param elementIndex the element index
+ * @param fSTreeModel
+ * the f S tree model
+ * @param nodeClass
+ * the node class
+ * @param fsOrString
+ * the fs or string
+ * @param intOrLongLikeValue
+ * the int or long like value
+ * @param elementIndex
+ * the element index
*/
- FSNode(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue, int elementIndex) {
+ FSNode(FSTreeModel fSTreeModel, int nodeClass, Object fsOrString, long intOrLongLikeValue,
+ int elementIndex) {
this.fSTreeModel = fSTreeModel;
this.nodeClass = nodeClass;
this.intOrLongLikeValue = intOrLongLikeValue;
@@ -192,7 +212,9 @@ public class FSNode extends FSTreeNode {
return this.nodeClass;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.apache.uima.tools.cvd.FSTreeNode#initChildren()
*/
@Override
@@ -207,89 +229,93 @@ public class FSNode extends FSTreeNode {
if (this.fs == null) {
return;
}
-
+
TypeImpl type = getType();
-// CASImpl cas = this.fSTreeModel.getCas();
+ // CASImpl cas = this.fSTreeModel.getCas();
if (type.isArray()) {
- int arrayLength = ((CommonArrayFS)fs).size();
-// if (arrayLength > 20) {
-// arrayLength = 20;
-// }
-
-// FSNode node = null;
-// int arrayPos = cas.getArrayStartAddress((int) this.addr);
-// int nodeClass1;
-// if (cas.isIntArrayType(type)) {
-// nodeClass1 = FSNode.INT_FS;
-// } else if (cas.isFloatArrayType(type)) {
-// nodeClass1 = FSNode.FLOAT_FS;
-// } else if (cas.isStringArrayType(type)) {
-// nodeClass1 = FSNode.STRING_FS;
-// } else if (cas.isByteArrayType(type)) {
-// nodeClass1 = FSNode.BYTE_FS;
-// } else if (cas.isBooleanArrayType(type)) {
-// nodeClass1 = FSNode.BOOL_FS;
-// } else if (cas.isShortArrayType(type)) {
-// nodeClass1 = FSNode.SHORT_FS;
-// } else if (cas.isLongArrayType(type)) {
-// nodeClass1 = FSNode.LONG_FS;
-// } else if (cas.isDoubleArrayType(type)) {
-// nodeClass1 = FSNode.DOUBLE_FS;
-// } else {
-// nodeClass1 = FSNode.STD_FS;
-// }
+ int arrayLength = ((CommonArrayFS) fs).size();
+ // if (arrayLength > 20) {
+ // arrayLength = 20;
+ // }
+
+ // FSNode node = null;
+ // int arrayPos = cas.getArrayStartAddress((int) this.addr);
+ // int nodeClass1;
+ // if (cas.isIntArrayType(type)) {
+ // nodeClass1 = FSNode.INT_FS;
+ // } else if (cas.isFloatArrayType(type)) {
+ // nodeClass1 = FSNode.FLOAT_FS;
+ // } else if (cas.isStringArrayType(type)) {
+ // nodeClass1 = FSNode.STRING_FS;
+ // } else if (cas.isByteArrayType(type)) {
+ // nodeClass1 = FSNode.BYTE_FS;
+ // } else if (cas.isBooleanArrayType(type)) {
+ // nodeClass1 = FSNode.BOOL_FS;
+ // } else if (cas.isShortArrayType(type)) {
+ // nodeClass1 = FSNode.SHORT_FS;
+ // } else if (cas.isLongArrayType(type)) {
+ // nodeClass1 = FSNode.LONG_FS;
+ // } else if (cas.isDoubleArrayType(type)) {
+ // nodeClass1 = FSNode.DOUBLE_FS;
+ // } else {
+ // nodeClass1 = FSNode.STD_FS;
+ // }
List<FSNode> arrayNodes = new ArrayList<>(arrayLength);
SlotKind kind = type.getComponentSlotKind();
int nc = k2nc(kind);
switch (kind) {
- case Slot_Int: {
- int[] a = ((IntegerArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
- break;
+ case Slot_Int: {
+ int[] a = ((IntegerArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
+ break;
}
- case Slot_Float: {
- float[] a = ((FloatArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, CASImpl.float2int(a[i]), i));
- break;
+ case Slot_Float: {
+ float[] a = ((FloatArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength,
+ i -> new FSNode(this.fSTreeModel, nc, null, CASImpl.float2int(a[i]), i));
+ break;
}
- case Slot_StrRef: {
- String[] a = ((StringArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, a[i], 0, i));
- break;
+ case Slot_StrRef: {
+ String[] a = ((StringArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, a[i], 0, i));
+ break;
}
- case Slot_HeapRef: {
- TOP[] a = ((FSArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, a[i], 0, i));
- break;
+ case Slot_HeapRef: {
+ TOP[] a = ((FSArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, a[i], 0, i));
+ break;
}
- case Slot_BooleanRef: {
- boolean[] a = ((BooleanArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i]? 1 : 0, i));
- break;
+ case Slot_BooleanRef: {
+ boolean[] a = ((BooleanArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength,
+ i -> new FSNode(this.fSTreeModel, nc, null, a[i] ? 1 : 0, i));
+ break;
}
- case Slot_ByteRef: {
- byte[] a = ((ByteArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
- break;
+ case Slot_ByteRef: {
+ byte[] a = ((ByteArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
+ break;
}
- case Slot_ShortRef: {
- short[] a = ((ShortArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
- break;
+ case Slot_ShortRef: {
+ short[] a = ((ShortArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
+ break;
}
- case Slot_LongRef: {
- long[] a = ((LongArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
- break;
+ case Slot_LongRef: {
+ long[] a = ((LongArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, a[i], i));
+ break;
}
- case Slot_DoubleRef: {
- double[] a = ((DoubleArray)fs)._getTheArray();
- makeNodes(arrayNodes, arrayLength, i -> new FSNode(this.fSTreeModel, nc, null, CASImpl.double2long(a[i]), i));
- break;
+ case Slot_DoubleRef: {
+ double[] a = ((DoubleArray) fs)._getTheArray();
+ makeNodes(arrayNodes, arrayLength,
+ i -> new FSNode(this.fSTreeModel, nc, null, CASImpl.double2long(a[i]), i));
+ break;
}
- default: Misc.internalError();
- } // end of switch
-
+ default:
+ Misc.internalError();
+ } // end of switch
+
this.children = FSTreeModel.createArrayChildren(0, arrayLength, arrayNodes, this.fSTreeModel);
} else {
this.children = new ArrayList<>(type.getNumberOfFeatures());
@@ -297,17 +323,38 @@ public class FSNode extends FSTreeNode {
for (FeatureImpl f : feats) {
SlotKind kind = f.getSlotKind();
int nc = k2nc(kind);
- switch(kind) {
- case Slot_Boolean: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getBooleanValue(f) ? 1 : 0, f)); break;
- case Slot_Byte: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getByteValue(f), f)); break;
- case Slot_Short: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getShortValue(f), f)); break;
- case Slot_Int: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getIntValue(f), f)); break;
- case Slot_Float: children.add(new FSNode(this.fSTreeModel, nc, null, CASImpl.float2int(fs.getFloatValue(f)), f)); break;
- case Slot_LongRef: children.add(new FSNode(this.fSTreeModel, nc, null, fs.getLongValue(f), f)); break;
- case Slot_DoubleRef:children.add(new FSNode(this.fSTreeModel, nc, null, CASImpl.double2long(fs.getDoubleValue(f)), f)); break;
- case Slot_StrRef: children.add(new FSNode(this.fSTreeModel, nc, fs.getStringValue(f), 0, f)); break;
- case Slot_HeapRef: children.add(new FSNode(this.fSTreeModel, nc, fs.getFeatureValue(f), 0, f)); break;
- default: Misc.internalError();
+ switch (kind) {
+ case Slot_Boolean:
+ children.add(new FSNode(this.fSTreeModel, nc, null, fs.getBooleanValue(f) ? 1 : 0, f));
+ break;
+ case Slot_Byte:
+ children.add(new FSNode(this.fSTreeModel, nc, null, fs.getByteValue(f), f));
+ break;
+ case Slot_Short:
+ children.add(new FSNode(this.fSTreeModel, nc, null, fs.getShortValue(f), f));
+ break;
+ case Slot_Int:
+ children.add(new FSNode(this.fSTreeModel, nc, null, fs.getIntValue(f), f));
+ break;
+ case Slot_Float:
+ children.add(new FSNode(this.fSTreeModel, nc, null,
+ CASImpl.float2int(fs.getFloatValue(f)), f));
+ break;
+ case Slot_LongRef:
+ children.add(new FSNode(this.fSTreeModel, nc, null, fs.getLongValue(f), f));
+ break;
+ case Slot_DoubleRef:
+ children.add(new FSNode(this.fSTreeModel, nc, null,
+ CASImpl.double2long(fs.getDoubleValue(f)), f));
+ break;
+ case Slot_StrRef:
+ children.add(new FSNode(this.fSTreeModel, nc, fs.getStringValue(f), 0, f));
+ break;
+ case Slot_HeapRef:
+ children.add(new FSNode(this.fSTreeModel, nc, fs.getFeatureValue(f), 0, f));
+ break;
+ default:
+ Misc.internalError();
} // end of switch
}
}
@@ -316,16 +363,20 @@ public class FSNode extends FSTreeNode {
/**
* Make nodes.
*
- * @param arrayNodes the array nodes
- * @param newFSNode the new FS node
+ * @param arrayNodes
+ * the array nodes
+ * @param newFSNode
+ * the new FS node
*/
private void makeNodes(List<FSNode> arrayNodes, int size, IntFunction<FSNode> newFSNode) {
for (int idx = 0; idx < size; idx++) {
arrayNodes.add(newFSNode.apply(idx));
}
- }
-
- /* (non-Javadoc)
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
@Override
@@ -356,7 +407,7 @@ public class FSNode extends FSTreeNode {
private String getFeatureString() {
return "<i>" + this.feat.getShortName() + "</i>";
}
-
+
/**
* Checks if is shortened string.
*
@@ -365,8 +416,8 @@ public class FSNode extends FSTreeNode {
boolean isShortenedString() {
return this.isShortenedString;
}
-
- /**
+
+ /**
* @return for string nodes, return the string value (so it can be displayed seperately
*/
String getFullString() {
@@ -382,7 +433,7 @@ public class FSNode extends FSTreeNode {
* @return the value string
*/
private String getValueString() {
-
+
switch (this.nodeClass) {
case INT_FS:
case BYTE_FS:
@@ -416,8 +467,8 @@ public class FSNode extends FSTreeNode {
if (this.fs == null) {
return getNullString();
}
- return "<font color=blue>" + getType().getName() + "</font>["
- + ((CommonArrayFS)fs).size() + "]";
+ return "<font color=blue>" + getType().getName() + "</font>[" + ((CommonArrayFS) fs).size()
+ + "]";
}
case STD_FS: {
if (fs == null) {
@@ -432,7 +483,8 @@ public class FSNode extends FSTreeNode {
/**
* Shorten string.
*
- * @param s the s
+ * @param s
+ * the s
* @return the string
*/
private static final String shortenString(String s) {
@@ -444,11 +496,12 @@ public class FSNode extends FSTreeNode {
buf.append("...");
return buf.toString();
}
-
+
/**
* Escape lt.
*
- * @param s the s
+ * @param s
+ * the s
* @return the string
*/
private static final String escapeLt(String s) {
@@ -456,7 +509,7 @@ public class FSNode extends FSTreeNode {
int i = 0;
while (i < max) {
if (s.charAt(i) == '<') {
- break;
+ break;
}
++i;
}
@@ -466,15 +519,15 @@ public class FSNode extends FSTreeNode {
StringBuffer buf = new StringBuffer(s.substring(0, i));
while (i < max) {
if (s.charAt(i) == '<') {
- buf.append("<");
+ buf.append("<");
} else {
- buf.append(s.charAt(i));
+ buf.append(s.charAt(i));
}
++i;
}
return buf.toString();
}
-
+
/**
* Gets the null string.
*
@@ -517,7 +570,7 @@ public class FSNode extends FSTreeNode {
* @return the start
*/
public int getStart() {
- return isAnnotation() ? ((Annotation)fs).getBegin() : -1;
+ return isAnnotation() ? ((Annotation) fs).getBegin() : -1;
}
/**
@@ -526,7 +579,7 @@ public class FSNode extends FSTreeNode {
* @return the end
*/
public int getEnd() {
- return isAnnotation() ? ((Annotation)fs).getEnd() : -1;
+ return isAnnotation() ? ((Annotation) fs).getEnd() : -1;
}
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeModel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeModel.java
index 3c3a7ee..d331e11 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeModel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeModel.java
@@ -37,7 +37,6 @@ import org.apache.uima.cas.impl.TypeImpl_string;
import org.apache.uima.cas.impl.TypeSystemConstants;
import org.apache.uima.jcas.cas.TOP;
-
/**
* Swing Tree Model for Feature Structures.
*/
@@ -74,9 +73,12 @@ public class FSTreeModel implements TreeModel {
/**
* Update.
*
- * @param indexName the index name
- * @param index the index
- * @param cas1 the cas 1
+ * @param indexName
+ * the index name
+ * @param index
+ * the index
+ * @param cas1
+ * the cas 1
*/
public void update(String indexName, FSIndex index, CAS cas1) {
// this.indexName = indexName;
@@ -141,8 +143,10 @@ public class FSTreeModel implements TreeModel {
/**
* Gets the child.
*
- * @param parent the parent
- * @param index the index
+ * @param parent
+ * the parent
+ * @param index
+ * the index
* @return the child
* @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
*/
@@ -153,54 +157,64 @@ public class FSTreeModel implements TreeModel {
return node.getChildren().get(index);
}
-// int getNodeType(int addr, Feature feat) {
-// Type domType = feat.getRange();
-// if (this.cas.isStringType(domType)) {
-// return FSNode.STRING_FS;
-// } else if (this.cas.isIntType(domType)) {
-// return FSNode.INT_FS;
-// } else if (this.cas.isFloatType(domType)) {
-// return FSNode.FLOAT_FS;
-// } else if (this.cas.isByteType(domType)) {
-// return FSNode.BYTE_FS;
-// } else if (this.cas.isBooleanType(domType)) {
-// return FSNode.BOOL_FS;
-// } else if (this.cas.isShortType(domType)) {
-// return FSNode.SHORT_FS;
-// } else if (this.cas.isLongType(domType)) {
-// return FSNode.LONG_FS;
-// } else if (this.cas.isDoubleType(domType)) {
-// return FSNode.DOUBLE_FS;
-// } else if (this.cas.isArrayOfFsType(domType)) {
-// final int featAddr = this.cas.getFeatureValue(addr, ((FeatureImpl) feat).getCode());
-// if (this.cas.isArrayType(this.cas.getTypeSystemImpl()
-// .ll_getTypeForCode(this.cas.getHeapValue(featAddr)))) {
-// return FSNode.ARRAY_FS;
-// }
-// }
-// return FSNode.STD_FS;
-// }
+ // int getNodeType(int addr, Feature feat) {
+ // Type domType = feat.getRange();
+ // if (this.cas.isStringType(domType)) {
+ // return FSNode.STRING_FS;
+ // } else if (this.cas.isIntType(domType)) {
+ // return FSNode.INT_FS;
+ // } else if (this.cas.isFloatType(domType)) {
+ // return FSNode.FLOAT_FS;
+ // } else if (this.cas.isByteType(domType)) {
+ // return FSNode.BYTE_FS;
+ // } else if (this.cas.isBooleanType(domType)) {
+ // return FSNode.BOOL_FS;
+ // } else if (this.cas.isShortType(domType)) {
+ // return FSNode.SHORT_FS;
+ // } else if (this.cas.isLongType(domType)) {
+ // return FSNode.LONG_FS;
+ // } else if (this.cas.isDoubleType(domType)) {
+ // return FSNode.DOUBLE_FS;
+ // } else if (this.cas.isArrayOfFsType(domType)) {
+ // final int featAddr = this.cas.getFeatureValue(addr, ((FeatureImpl) feat).getCode());
+ // if (this.cas.isArrayType(this.cas.getTypeSystemImpl()
+ // .ll_getTypeForCode(this.cas.getHeapValue(featAddr)))) {
+ // return FSNode.ARRAY_FS;
+ // }
+ // }
+ // return FSNode.STD_FS;
+ // }
/**
- * Gets the node type.
- *
- * @param type the type
- * @return the node type
- */
-int getNodeType(Type type) {
+ * Gets the node type.
+ *
+ * @param type
+ * the type
+ * @return the node type
+ */
+ int getNodeType(Type type) {
if (type instanceof TypeImpl_string) {
return FSNode.STRING_FS;
} else {
- switch(((TypeImpl)type).getCode()) {
- case TypeSystemConstants.intTypeCode: return FSNode.INT_FS;
- case TypeSystemConstants.floatTypeCode: return FSNode.FLOAT_FS;
- case TypeSystemConstants.fsArrayTypeCode: return FSNode.ARRAY_FS;
- case TypeSystemConstants.byteArrayTypeCode: return FSNode.BYTE_FS;
- case TypeSystemConstants.booleanArrayTypeCode: return FSNode.BOOL_FS;
- case TypeSystemConstants.shortArrayTypeCode: return FSNode.SHORT_FS;
- case TypeSystemConstants.longArrayTypeCode: return FSNode.LONG_FS;
- case TypeSystemConstants.doubleArrayTypeCode: return FSNode.DOUBLE_FS;
- default: return FSNode.STD_FS;
+ switch (((TypeImpl) type).getCode()) {
+ case TypeSystemConstants.intTypeCode:
+ return FSNode.INT_FS;
+ case TypeSystemConstants.floatTypeCode:
+ return FSNode.FLOAT_FS;
+ case TypeSystemConstants.fsArrayTypeCode:
+ return FSNode.ARRAY_FS;
+ case TypeSystemConstants.byteArrayTypeCode:
+ return FSNode.BYTE_FS;
+ case TypeSystemConstants.booleanArrayTypeCode:
+ return FSNode.BOOL_FS;
+ case TypeSystemConstants.shortArrayTypeCode:
+ return FSNode.SHORT_FS;
+ case TypeSystemConstants.longArrayTypeCode:
+ return FSNode.LONG_FS;
+ case TypeSystemConstants.doubleArrayTypeCode:
+ return FSNode.DOUBLE_FS;
+ default:
+ return FSNode.STD_FS;
}
}
}
@@ -208,7 +222,8 @@ int getNodeType(Type type) {
/**
* Gets the child count.
*
- * @param parent the parent
+ * @param parent
+ * the parent
* @return the child count
* @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
*/
@@ -220,7 +235,8 @@ int getNodeType(Type type) {
/**
* Checks if is leaf.
*
- * @param node the node
+ * @param node
+ * the node
* @return true, if is leaf
* @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
*/
@@ -232,8 +248,10 @@ int getNodeType(Type type) {
/**
* Value for path changed.
*
- * @param path the path
- * @param newValue the new value
+ * @param path
+ * the path
+ * @param newValue
+ * the new value
* @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath,
* java.lang.Object)
*/
@@ -245,8 +263,10 @@ int getNodeType(Type type) {
/**
* Gets the index of child.
*
- * @param parent the parent
- * @param child the child
+ * @param parent
+ * the parent
+ * @param child
+ * the child
* @return the index of child
* @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
*/
@@ -260,7 +280,8 @@ int getNodeType(Type type) {
/**
* Adds the tree model listener.
*
- * @param arg0 the arg 0
+ * @param arg0
+ * the arg 0
* @see javax.swing.tree.TreeModel#addTreeModelListener(javax.swing.event.TreeModelListener)
*/
@Override
@@ -271,7 +292,8 @@ int getNodeType(Type type) {
/**
* Removes the tree model listener.
*
- * @param arg0 the arg 0
+ * @param arg0
+ * the arg 0
* @see javax.swing.tree.TreeModel#removeTreeModelListener(javax.swing.event.TreeModelListener)
*/
@Override
@@ -300,13 +322,18 @@ int getNodeType(Type type) {
/**
* Creates the array children.
*
- * @param start the start
- * @param end the end
- * @param array the array
- * @param model the model
+ * @param start
+ * the start
+ * @param end
+ * the end
+ * @param array
+ * the array
+ * @param model
+ * the model
* @return the list
*/
- static List<FSTreeNode> createArrayChildren(int start, int end, List<FSNode> array, FSTreeModel model) {
+ static List<FSTreeNode> createArrayChildren(int start, int end, List<FSNode> array,
+ FSTreeModel model) {
ArrayList<FSTreeNode> kids = new ArrayList<>();
final int size = end - start;
if (size <= ArrayNode.CUTOFF) {
@@ -347,7 +374,8 @@ int getNodeType(Type type) {
/**
* Path to node.
*
- * @param fsNum the fs num
+ * @param fsNum
+ * the fs num
* @return the tree path
*/
public TreePath pathToNode(int fsNum) {
@@ -361,9 +389,12 @@ int getNodeType(Type type) {
/**
* Gets the path to node.
*
- * @param n the n
- * @param dtrs the dtrs
- * @param path the path
+ * @param n
+ * the n
+ * @param dtrs
+ * the dtrs
+ * @param path
+ * the path
* @return the path to node
*/
private void getPathToNode(int n, List<FSTreeNode> dtrs, List<FSTreeNode> path) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeNode.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeNode.java
index a804995..15e434f 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeNode.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/FSTreeNode.java
@@ -22,7 +22,6 @@ package org.apache.uima.tools.cvd;
import java.util.ArrayList;
import java.util.List;
-
/**
* TODO: add type comment for <code>FSTreeNode</code>.
*
@@ -33,7 +32,6 @@ public abstract class FSTreeNode {
/** The children. */
protected List<FSTreeNode> children = null;
-
/**
* Instantiates a new FS tree node.
*/
@@ -51,7 +49,8 @@ public abstract class FSTreeNode {
/**
* Sets the children.
*
- * @param children the new children
+ * @param children
+ * the new children
*/
void setChildren(List<FSTreeNode> children) {
this.children = children;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/IndexTreeNode.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/IndexTreeNode.java
index a445dc0..8380b92 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/IndexTreeNode.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/IndexTreeNode.java
@@ -21,7 +21,6 @@ package org.apache.uima.tools.cvd;
import org.apache.uima.cas.Type;
-
/**
* Class comment for IndexTreeNode.java goes here.
*
@@ -41,9 +40,12 @@ public class IndexTreeNode {
/**
* Instantiates a new index tree node.
*
- * @param name the name
- * @param type the type
- * @param size the size
+ * @param name
+ * the name
+ * @param type
+ * the type
+ * @param size
+ * the size
*/
public IndexTreeNode(String name, Type type, int size) {
this.name = name;
@@ -60,7 +62,9 @@ public class IndexTreeNode {
this.size = 0;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
@Override
@@ -86,7 +90,9 @@ public class IndexTreeNode {
return this.type;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -94,7 +100,9 @@ public class IndexTreeNode {
return (this == o);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/LogFileViewer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/LogFileViewer.java
index de74e8c..c2c09ce 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/LogFileViewer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/LogFileViewer.java
@@ -41,7 +41,6 @@ import javax.swing.text.DefaultEditorKit;
import org.apache.uima.util.FileUtils;
-
/**
* Simple file viewer for viewing log files.
*
@@ -49,144 +48,153 @@ import org.apache.uima.util.FileUtils;
*/
public class LogFileViewer extends JFrame {
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 3599235286749804258L;
-
- /** The log file. */
- private File logFile;
-
- /** The scroll pane. */
- private JScrollPane scrollPane;
-
- /** The text area. */
- private JTextArea textArea;
-
- /**
- * Instantiates a new log file viewer.
- *
- * @throws java.awt.HeadlessException the java.awt. headless exception
- */
- public LogFileViewer() {
- }
-
- /**
- * Instantiates a new log file viewer.
- *
- * @param arg0 the arg 0
- */
- public LogFileViewer(GraphicsConfiguration arg0) {
- super(arg0);
- }
-
- /**
- * Instantiates a new log file viewer.
- *
- * @param arg0 the arg 0
- * @throws java.awt.HeadlessException the java.awt. headless exception
- */
- public LogFileViewer(String arg0) {
- super(arg0);
- }
-
- /**
- * Instantiates a new log file viewer.
- *
- * @param arg0 the arg 0
- * @param arg1 the arg 1
- */
- public LogFileViewer(String arg0, GraphicsConfiguration arg1) {
- super(arg0, arg1);
- }
-
- /**
- * Inits the.
- *
- * @param file the file
- * @param d the d
- */
- public void init(File file, Dimension d) {
- createMenus();
- this.logFile = file;
- this.textArea = new JTextArea();
- // Copy
- Action copyAction = this.textArea.getActionMap().get(DefaultEditorKit.copyAction);
- copyAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C,
- InputEvent.CTRL_MASK));
- copyAction.setEnabled(true);
- this.scrollPane = new JScrollPane(this.textArea);
- this.setContentPane(this.scrollPane);
- this.scrollPane.setPreferredSize(d);
- boolean doneLoadingFile = loadFile();
- if (!doneLoadingFile) {
- this.dispose();
- return;
- }
- this.pack();
- this.setVisible(true);
- }
-
- /**
- * Creates the menus.
- */
- private void createMenus() {
- JMenuBar menuBar = new JMenuBar();
- this.setJMenuBar(menuBar);
- JMenu fileMenu = new JMenu("File");
- menuBar.add(fileMenu);
- JMenuItem reload = new JMenuItem("Reload Log File");
- reload.addActionListener(new ActionListener() {
- @Override
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 3599235286749804258L;
+
+ /** The log file. */
+ private File logFile;
+
+ /** The scroll pane. */
+ private JScrollPane scrollPane;
+
+ /** The text area. */
+ private JTextArea textArea;
+
+ /**
+ * Instantiates a new log file viewer.
+ *
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
+ */
+ public LogFileViewer() {
+ }
+
+ /**
+ * Instantiates a new log file viewer.
+ *
+ * @param arg0
+ * the arg 0
+ */
+ public LogFileViewer(GraphicsConfiguration arg0) {
+ super(arg0);
+ }
+
+ /**
+ * Instantiates a new log file viewer.
+ *
+ * @param arg0
+ * the arg 0
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
+ */
+ public LogFileViewer(String arg0) {
+ super(arg0);
+ }
+
+ /**
+ * Instantiates a new log file viewer.
+ *
+ * @param arg0
+ * the arg 0
+ * @param arg1
+ * the arg 1
+ */
+ public LogFileViewer(String arg0, GraphicsConfiguration arg1) {
+ super(arg0, arg1);
+ }
+
+ /**
+ * Inits the.
+ *
+ * @param file
+ * the file
+ * @param d
+ * the d
+ */
+ public void init(File file, Dimension d) {
+ createMenus();
+ this.logFile = file;
+ this.textArea = new JTextArea();
+ // Copy
+ Action copyAction = this.textArea.getActionMap().get(DefaultEditorKit.copyAction);
+ copyAction.putValue(Action.ACCELERATOR_KEY,
+ KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
+ copyAction.setEnabled(true);
+ this.scrollPane = new JScrollPane(this.textArea);
+ this.setContentPane(this.scrollPane);
+ this.scrollPane.setPreferredSize(d);
+ boolean doneLoadingFile = loadFile();
+ if (!doneLoadingFile) {
+ this.dispose();
+ return;
+ }
+ this.pack();
+ this.setVisible(true);
+ }
+
+ /**
+ * Creates the menus.
+ */
+ private void createMenus() {
+ JMenuBar menuBar = new JMenuBar();
+ this.setJMenuBar(menuBar);
+ JMenu fileMenu = new JMenu("File");
+ menuBar.add(fileMenu);
+ JMenuItem reload = new JMenuItem("Reload Log File");
+ reload.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent event) {
- loadFile();
- }
- });
- fileMenu.add(reload);
- JMenuItem exit = new JMenuItem("Close Window");
- exit.addActionListener(new ActionListener() {
- @Override
+ loadFile();
+ }
+ });
+ fileMenu.add(reload);
+ JMenuItem exit = new JMenuItem("Close Window");
+ exit.addActionListener(new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent event) {
- LogFileViewer.this.dispose();
- }
- });
- fileMenu.add(exit);
- }
-
- /**
- * Load file.
- *
- * @return true, if successful
- */
- private boolean loadFile() {
- if (!this.logFile.exists()) {
- JOptionPane.showMessageDialog(this, "The log file \"" + this.logFile.getAbsolutePath()
- + "\" does not exist (yet).\nThis probably just means that nothing was logged yet.",
- "Information", JOptionPane.INFORMATION_MESSAGE);
- return false;
- }
- String text = null;
- try {
- text = FileUtils.file2String(this.logFile, "UTF-8");
- } catch (IOException e) {
- handleException(e);
- return false;
- }
- this.textArea.setText(text);
- return true;
- }
-
- /**
- * Handle exception.
- *
- * @param e the e
- */
- protected void handleException(Exception e) {
- boolean hasAsserts = false;
- // assert(hasAsserts = true);
- if (hasAsserts) {
- e.printStackTrace();
- }
- JOptionPane.showMessageDialog(this, e.getMessage(), "Exception", JOptionPane.ERROR_MESSAGE);
-
- }
+ LogFileViewer.this.dispose();
+ }
+ });
+ fileMenu.add(exit);
+ }
+
+ /**
+ * Load file.
+ *
+ * @return true, if successful
+ */
+ private boolean loadFile() {
+ if (!this.logFile.exists()) {
+ JOptionPane.showMessageDialog(this, "The log file \"" + this.logFile.getAbsolutePath()
+ + "\" does not exist (yet).\nThis probably just means that nothing was logged yet.",
+ "Information", JOptionPane.INFORMATION_MESSAGE);
+ return false;
+ }
+ String text = null;
+ try {
+ text = FileUtils.file2String(this.logFile, "UTF-8");
+ } catch (IOException e) {
+ handleException(e);
+ return false;
+ }
+ this.textArea.setText(text);
+ return true;
+ }
+
+ /**
+ * Handle exception.
+ *
+ * @param e
+ * the e
+ */
+ protected void handleException(Exception e) {
+ boolean hasAsserts = false;
+ // assert(hasAsserts = true);
+ if (hasAsserts) {
+ e.printStackTrace();
+ }
+ JOptionPane.showMessageDialog(this, e.getMessage(), "Exception", JOptionPane.ERROR_MESSAGE);
+
+ }
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
index c815639..348a5dd 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
@@ -160,7 +160,6 @@ import org.apache.uima.util.Logger;
import org.apache.uima.util.ProcessTrace;
import org.apache.uima.util.XMLInputSource;
-
/**
* Class comment for MainFrame.java goes here.
*
@@ -189,8 +188,7 @@ public class MainFrame extends JFrame {
private static final String loggerPropertiesFileName = "org/apache/uima/tools/annot_view/Logger.properties";
/** The Constant defaultText. */
- private static final String defaultText =
- "Load or edit text here.";
+ private static final String defaultText = "Load or edit text here.";
/** The Constant titleText. */
private static final String titleText = "CAS Visual Debugger (CVD)";
@@ -203,7 +201,7 @@ public class MainFrame extends JFrame {
/** The Constant noIndexReposLabel. */
private static final String noIndexReposLabel = "<html><b>" + htmlGrayColor
- + "CAS Index Repository</b></html>";
+ + "CAS Index Repository</b></html>";
/** The text area. */
// The content areas.
@@ -520,8 +518,10 @@ public class MainFrame extends JFrame {
/**
* Constructor for MainFrame.
*
- * @param iniFile the ini file
- * @throws HeadlessException -
+ * @param iniFile
+ * the ini file
+ * @throws HeadlessException
+ * -
*/
public MainFrame(File iniFile) {
this.iniFile = iniFile;
@@ -531,7 +531,8 @@ public class MainFrame extends JFrame {
/**
* Run AE.
*
- * @param doCasReset the do cas reset
+ * @param doCasReset
+ * the do cas reset
*/
public void runAE(boolean doCasReset) {
setStatusbarMessage("Running Annotator.");
@@ -544,7 +545,7 @@ public class MainFrame extends JFrame {
internalRunAE(doCasReset);
timer.stop();
setStatusbarMessage("Done running AE " + this.ae.getAnalysisEngineMetaData().getName() + " in "
- + timer.getTimeSpan() + ".");
+ + timer.getTimeSpan() + ".");
updateIndexTree(true);
this.allAnnotationViewerItem.setEnabled(false);
this.isDirty = false;
@@ -569,8 +570,8 @@ public class MainFrame extends JFrame {
}
this.showPerfReportItem.setEnabled(false);
timer.stop();
- setStatusbarMessage("Done running CPC on " + this.ae.getAnalysisEngineMetaData().getName() + " in "
- + timer.getTimeSpan() + ".");
+ setStatusbarMessage("Done running CPC on " + this.ae.getAnalysisEngineMetaData().getName()
+ + " in " + timer.getTimeSpan() + ".");
updateIndexTree(true);
this.allAnnotationViewerItem.setEnabled(false);
this.isDirty = false;
@@ -580,7 +581,8 @@ public class MainFrame extends JFrame {
/**
* Sets the data path.
*
- * @param dataPath the new data path
+ * @param dataPath
+ * the new data path
*/
public void setDataPath(String dataPath) {
this.dataPathName = dataPath;
@@ -589,7 +591,8 @@ public class MainFrame extends JFrame {
/**
* Load AE descriptor.
*
- * @param descriptorFile the descriptor file
+ * @param descriptorFile
+ * the descriptor file
*/
public void loadAEDescriptor(File descriptorFile) {
addRecentDescFile(descriptorFile);
@@ -629,9 +632,7 @@ public class MainFrame extends JFrame {
// TODO: properly handle CAS multiplication
if (this.ae != null) {
if (this.ae.getAnalysisEngineMetaData().getOperationalProperties().getOutputsNewCASes()) {
- JOptionPane
- .showMessageDialog(
- this,
+ JOptionPane.showMessageDialog(this,
"This analysis engine uses a CAS multiplier component.\nCAS multiplication/merging is not currently supported in CVD.\nYou can run the analysis engine, but will not see any results.",
"Warning: unsupported operation", JOptionPane.WARNING_MESSAGE);
}
@@ -642,7 +643,8 @@ public class MainFrame extends JFrame {
/**
* Handle exception.
*
- * @param e the e
+ * @param e
+ * the e
*/
public void handleException(Throwable e) {
StringBuffer msg = new StringBuffer();
@@ -652,8 +654,10 @@ public class MainFrame extends JFrame {
/**
* Handle exception.
*
- * @param e the e
- * @param msg the msg
+ * @param e
+ * the e
+ * @param msg
+ * the msg
*/
protected void handleException(Throwable e, StringBuffer msg) {
msg.append(e.getClass().getName() + ": ");
@@ -680,7 +684,8 @@ public class MainFrame extends JFrame {
/**
* Show error.
*
- * @param msg the msg
+ * @param msg
+ * the msg
*/
private void showError(String msg) {
JOptionPane.showMessageDialog(this, msg, "Error", JOptionPane.ERROR_MESSAGE);
@@ -702,8 +707,8 @@ public class MainFrame extends JFrame {
setTitle();
addRecentTextFile(this.textFile);
} else {
- handleException(new IOException("File does not exist or is not readable: "
- + this.textFile.getAbsolutePath()));
+ handleException(new IOException(
+ "File does not exist or is not readable: " + this.textFile.getAbsolutePath()));
}
// Add the loaded file to the recently used files list.
} catch (UnsupportedEncodingException e) {
@@ -717,7 +722,8 @@ public class MainFrame extends JFrame {
/**
* Load xmi file.
*
- * @param xmiCasFile the xmi cas file
+ * @param xmiCasFile
+ * the xmi cas file
*/
public void loadXmiFile(File xmiCasFile) {
try {
@@ -743,43 +749,45 @@ public class MainFrame extends JFrame {
}
}
-
/**
* Gets the mnemonic.
*
- * @param i the i
+ * @param i
+ * the i
* @return the mnemonic
*/
private static final int getMnemonic(int i) {
switch (i) {
- case 1:
- return KeyEvent.VK_1;
- case 2:
- return KeyEvent.VK_2;
- case 3:
- return KeyEvent.VK_3;
- case 4:
- return KeyEvent.VK_4;
- case 5:
- return KeyEvent.VK_5;
- case 6:
- return KeyEvent.VK_6;
- case 7:
- return KeyEvent.VK_7;
- case 8:
- return KeyEvent.VK_8;
- case 9:
- return KeyEvent.VK_9;
- default:
- return KeyEvent.VK_0;
+ case 1:
+ return KeyEvent.VK_1;
+ case 2:
+ return KeyEvent.VK_2;
+ case 3:
+ return KeyEvent.VK_3;
+ case 4:
+ return KeyEvent.VK_4;
+ case 5:
+ return KeyEvent.VK_5;
+ case 6:
+ return KeyEvent.VK_6;
+ case 7:
+ return KeyEvent.VK_7;
+ case 8:
+ return KeyEvent.VK_8;
+ case 9:
+ return KeyEvent.VK_9;
+ default:
+ return KeyEvent.VK_0;
}
}
/**
* Creates the recent text file item.
*
- * @param num the num
- * @param file the file
+ * @param num
+ * the num
+ * @param file
+ * the file
* @return the j menu item
*/
private final JMenuItem createRecentTextFileItem(int num, File file) {
@@ -793,7 +801,8 @@ public class MainFrame extends JFrame {
/**
* Adds the recent text file.
*
- * @param file the file
+ * @param file
+ * the file
*/
private void addRecentTextFile(File file) {
this.recentTextFiles.addFile(file);
@@ -808,8 +817,10 @@ public class MainFrame extends JFrame {
/**
* Creates the recent desc file item.
*
- * @param num the num
- * @param file the file
+ * @param num
+ * the num
+ * @param file
+ * the file
* @return the j menu item
*/
private final JMenuItem createRecentDescFileItem(int num, File file) {
@@ -823,7 +834,8 @@ public class MainFrame extends JFrame {
/**
* Adds the recent desc file.
*
- * @param file the file
+ * @param file
+ * the file
*/
private void addRecentDescFile(File file) {
this.recentDescFiles.addFile(file);
@@ -839,7 +851,7 @@ public class MainFrame extends JFrame {
* Set the text to be analyzed.
*
* @param text
- * The text.
+ * The text.
*/
public void setText(String text) {
this.textFile = null;
@@ -851,7 +863,7 @@ public class MainFrame extends JFrame {
* Load a text file.
*
* @param textFile1
- * The text file.
+ * The text file.
*/
public void loadTextFile(File textFile1) {
this.textFile = textFile1;
@@ -861,7 +873,8 @@ public class MainFrame extends JFrame {
/**
* Sets the text no title.
*
- * @param text the new text no title
+ * @param text
+ * the new text no title
*/
// Set the text.
public void setTextNoTitle(String text) {
@@ -925,26 +938,22 @@ public class MainFrame extends JFrame {
}
return true;
}
-
+
/**
* Confirm overwrite.
*
- * @param f the f
+ * @param f
+ * the f
* @return true, if successful
*/
public boolean confirmOverwrite(File f) {
if (f.exists()) {
- Object[] options = {"Yes, Overwrite.",
- "No"};
+ Object[] options = { "Yes, Overwrite.", "No" };
int n = JOptionPane.showOptionDialog(this,
- "File " + f.getAbsolutePath() + " exists.\nWould you like to overwrite it?",
-
- "Confirm Overwrite",
- JOptionPane.YES_NO_OPTION,
- JOptionPane.QUESTION_MESSAGE,
- null,
- options,
- options[1]);
+ "File " + f.getAbsolutePath() + " exists.\nWould you like to overwrite it?",
+
+ "Confirm Overwrite", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
+ options, options[1]);
if (n == 1) {
return false;
}
@@ -994,8 +1003,8 @@ public class MainFrame extends JFrame {
// Cut
this.cutAction = actionMap.get(DefaultEditorKit.cutAction);
this.cutAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_T);
- this.cutAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_X,
- InputEvent.CTRL_MASK));
+ this.cutAction.putValue(Action.ACCELERATOR_KEY,
+ KeyStroke.getKeyStroke(KeyEvent.VK_X, InputEvent.CTRL_MASK));
this.cutAction.setEnabled(false);
JMenuItem cutItem = new JMenuItem(this.cutAction);
cutItem.setText("Cut");
@@ -1003,8 +1012,8 @@ public class MainFrame extends JFrame {
// Copy
this.copyAction = actionMap.get(DefaultEditorKit.copyAction);
this.copyAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_C);
- this.copyAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_C,
- InputEvent.CTRL_MASK));
+ this.copyAction.putValue(Action.ACCELERATOR_KEY,
+ KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK));
this.copyAction.setEnabled(false);
JMenuItem copyItem = new JMenuItem(this.copyAction);
copyItem.setText("Copy");
@@ -1012,8 +1021,8 @@ public class MainFrame extends JFrame {
// Paste
Action pasteAction = actionMap.get(DefaultEditorKit.pasteAction);
pasteAction.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_P);
- pasteAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V,
- InputEvent.CTRL_MASK));
+ pasteAction.putValue(Action.ACCELERATOR_KEY,
+ KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_MASK));
JMenuItem pasteItem = new JMenuItem(pasteAction);
pasteItem.setText("Paste");
this.editMenu.add(pasteItem);
@@ -1178,7 +1187,8 @@ public class MainFrame extends JFrame {
/**
* Adds the cursor owning component.
*
- * @param comp the comp
+ * @param comp
+ * the comp
*/
private final void addCursorOwningComponent(Component comp) {
this.cursorOwningComponents.add(comp);
@@ -1218,7 +1228,7 @@ public class MainFrame extends JFrame {
// Get supported encodings from JVM
Map<String, Charset> charsetMap = Charset.availableCharsets();
String sysCodePage = Charset.defaultCharset().name();
-
+
this.codePages = new ArrayList<>();
if (sysCodePage != null) {
@@ -1268,13 +1278,14 @@ public class MainFrame extends JFrame {
this.cpButtons.add(item);
this.cpMenu.add(item);
}
-
+
}
/**
* Adds the language.
*
- * @param language1 the language 1
+ * @param language1
+ * the language 1
*/
public void addLanguage(String language1) {
this.language = language1;
@@ -1366,8 +1377,8 @@ public class MainFrame extends JFrame {
this.reRunMenu.addActionListener(new AnnotatorRerunEventHandler(this));
this.reRunMenu.setEnabled(false);
this.runOnCasMenuItem = new JMenuItem("Run AE on CAS", KeyEvent.VK_Y);
- this.runOnCasMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y,
- ActionEvent.CTRL_MASK));
+ this.runOnCasMenuItem
+ .setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Y, ActionEvent.CTRL_MASK));
runMenu.add(this.runOnCasMenuItem);
this.runOnCasMenuItem.addActionListener(new AnnotatorRunOnCasEventHandler(this));
this.runOnCasMenuItem.setEnabled(false);
@@ -1453,8 +1464,8 @@ public class MainFrame extends JFrame {
@Override
public void actionPerformed(ActionEvent event) {
- LogFileViewer viewer = new LogFileViewer("Log file: "
- + MainFrame.this.logFile.getAbsolutePath());
+ LogFileViewer viewer = new LogFileViewer(
+ "Log file: " + MainFrame.this.logFile.getAbsolutePath());
viewer.addWindowListener(new CloseLogViewHandler(MainFrame.this));
Dimension dim = getDimension(logViewSizePref);
if (dim == null) {
@@ -1476,15 +1487,15 @@ public class MainFrame extends JFrame {
// statusPanel.setBorder(BorderFactory.createLineBorder(Color.gray));
this.statusPanel.setLayout(new BoxLayout(this.statusPanel, BoxLayout.X_AXIS));
this.statusBar = new JTextField();
- Border innerCompound = BorderFactory.createCompoundBorder(BorderFactory.createBevelBorder(
- BevelBorder.LOWERED, Color.lightGray, Color.darkGray), BorderFactory.createEmptyBorder(0,
- 3, 0, 3));
- Border leftCompoundBorder = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(
- 0, 0, 0, 1), innerCompound);
- Border middleCompoundBorder = BorderFactory.createCompoundBorder(BorderFactory
- .createEmptyBorder(0, 1, 0, 1), innerCompound);
- Border rightCompoundBorder = BorderFactory.createCompoundBorder(BorderFactory
- .createEmptyBorder(0, 1, 0, 0), innerCompound);
+ Border innerCompound = BorderFactory.createCompoundBorder(
+ BorderFactory.createBevelBorder(BevelBorder.LOWERED, Color.lightGray, Color.darkGray),
+ BorderFactory.createEmptyBorder(0, 3, 0, 3));
+ Border leftCompoundBorder = BorderFactory
+ .createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1), innerCompound);
+ Border middleCompoundBorder = BorderFactory
+ .createCompoundBorder(BorderFactory.createEmptyBorder(0, 1, 0, 1), innerCompound);
+ Border rightCompoundBorder = BorderFactory
+ .createCompoundBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0), innerCompound);
// statusBar.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 2));
this.statusBar.setBorder(leftCompoundBorder);
this.statusBar.setEditable(false);
@@ -1520,8 +1531,10 @@ public class MainFrame extends JFrame {
/**
* Sets the caret status.
*
- * @param dot the dot
- * @param mark the mark
+ * @param dot
+ * the dot
+ * @param mark
+ * the mark
*/
public void setCaretStatus(final int dot, final int mark) {
if (dot == mark) {
@@ -1552,8 +1565,8 @@ public class MainFrame extends JFrame {
textBorder = BorderFactory.createTitledBorder(this.textTitleBorder, "Text");
// textBorder.setTitleJustification(TitledBorder.ABOVE_TOP);
} else {
- textBorder = BorderFactory.createTitledBorder(this.textTitleBorder, this.textFile
- .getAbsolutePath());
+ textBorder = BorderFactory.createTitledBorder(this.textTitleBorder,
+ this.textFile.getAbsolutePath());
}
this.textScrollPane.setBorder(textBorder);
this.textScrollPane.revalidate();
@@ -1569,7 +1582,7 @@ public class MainFrame extends JFrame {
} else {
this.aeStatus.setText(this.aeDescriptorFile.getName());
this.aeStatus.setToolTipText("<html>Currently loaded AE descriptor file:<br>"
- + this.aeDescriptorFile.getAbsolutePath() + "</html>");
+ + this.aeDescriptorFile.getAbsolutePath() + "</html>");
}
this.statusPanel.revalidate();
}
@@ -1577,7 +1590,8 @@ public class MainFrame extends JFrame {
/**
* Sets the statusbar message.
*
- * @param message the new statusbar message
+ * @param message
+ * the new statusbar message
*/
public void setStatusbarMessage(String message) {
// Date date = new Date();
@@ -1626,12 +1640,12 @@ public class MainFrame extends JFrame {
InputStream ins = ClassLoader.getSystemResourceAsStream(loggerPropertiesFileName);
// Try the current class loader if system one cannot find the file
if (ins == null) {
- ins = this.getClass().getClassLoader().getResourceAsStream(loggerPropertiesFileName);
+ ins = this.getClass().getClassLoader().getResourceAsStream(loggerPropertiesFileName);
}
if (ins != null) {
- logManager.readConfiguration(ins);
+ logManager.readConfiguration(ins);
} else {
- System.out.println("WARNING: failed to load "+loggerPropertiesFileName);
+ System.out.println("WARNING: failed to load " + loggerPropertiesFileName);
}
} catch (SecurityException e) {
handleException(e);
@@ -1691,7 +1705,7 @@ public class MainFrame extends JFrame {
this.sofaSelectionPanel.setVisible(false);
this.sofaSelectionComboBox.addItemListener(new SofaSelectionListener(this));
this.sofaSelectionComboBox
- .setToolTipText("This CAS has multiple Views. Select the View to display.");
+ .setToolTipText("This CAS has multiple Views. Select the View to display.");
JSplitPane treePairPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
treePairPane.setDividerSize(dividerSize);
@@ -1759,7 +1773,8 @@ public class MainFrame extends JFrame {
/**
* Setup AE.
*
- * @param aeFile the ae file
+ * @param aeFile
+ * the ae file
* @return true, if successful
*/
protected boolean setupAE(File aeFile) {
@@ -1837,7 +1852,8 @@ public class MainFrame extends JFrame {
/**
* Internal run AE.
*
- * @param doCasReset the do cas reset
+ * @param doCasReset
+ * the do cas reset
*/
protected void internalRunAE(boolean doCasReset) {
try {
@@ -1858,8 +1874,8 @@ public class MainFrame extends JFrame {
this.sofaSelectionComboBox.removeAllItems();
this.sofaSelectionComboBox.addItem(CAS.NAME_DEFAULT_SOFA);
Iterator<?> sofas = ((CASImpl) MainFrame.this.cas).getBaseCAS().getSofaIterator();
- Feature sofaIdFeat = MainFrame.this.cas.getTypeSystem().getFeatureByFullName(
- CAS.FEATURE_FULL_NAME_SOFAID);
+ Feature sofaIdFeat = MainFrame.this.cas.getTypeSystem()
+ .getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
boolean nonDefaultSofaFound = false;
while (sofas.hasNext()) {
SofaFS sofa = (SofaFS) sofas.next();
@@ -1933,7 +1949,8 @@ public class MainFrame extends JFrame {
/**
* Update index tree.
*
- * @param useCAS the use CAS
+ * @param useCAS
+ * the use CAS
*/
@SuppressWarnings("unchecked")
public void updateIndexTree(boolean useCAS) {
@@ -1960,7 +1977,7 @@ public class MainFrame extends JFrame {
DefaultTreeModel model = (DefaultTreeModel) this.indexTree.getModel();
// 1.3 workaround
TreeModelListener[] listeners = org.apache.uima.tools.cvd.tsview.MainFrame
- .getTreeModelListeners(model);
+ .getTreeModelListeners(model);
// TreeModelListener[] listeners = model.getTreeModelListeners();
// System.out.println("Number of tree model listeners: " +
// listeners.length);
@@ -1975,8 +1992,10 @@ public class MainFrame extends JFrame {
/**
* Update FS tree.
*
- * @param indexName the index name
- * @param index1 the index 1
+ * @param indexName
+ * the index name
+ * @param index1
+ * the index 1
*/
public void updateFSTree(String indexName, FSIndex index1) {
FSTreeModel treeModel = (FSTreeModel) this.fsTree.getModel();
@@ -1986,8 +2005,10 @@ public class MainFrame extends JFrame {
/**
* Gets the annotations at pos.
*
- * @param pos the pos
- * @param annots the annots
+ * @param pos
+ * the pos
+ * @param annots
+ * the annots
* @return the annotations at pos
*/
private ArrayList<FSNode> getAnnotationsAtPos(int pos, List<FSNode> annots) {
@@ -2009,10 +2030,14 @@ public class MainFrame extends JFrame {
/**
* Creates the type tree.
*
- * @param type the type
- * @param ts the ts
- * @param label the label
- * @param ir the ir
+ * @param type
+ * the type
+ * @param ts
+ * the ts
+ * @param label
+ * the label
+ * @param ir
+ * the ir
* @return the default mutable tree node
*/
private DefaultMutableTreeNode createTypeTree(org.apache.uima.cas.Type type, TypeSystem ts,
@@ -2021,7 +2046,7 @@ public class MainFrame extends JFrame {
TypeTreeNode typeNode = new TypeTreeNode(type, label, size);
DefaultMutableTreeNode node = new DefaultMutableTreeNode(typeNode);
// UIMA-2565 - Clash btw. cas.Type and Window.Type on JDK 7
- // also on method parameter "type"
+ // also on method parameter "type"
List<org.apache.uima.cas.Type> types = ts.getDirectSubtypes(type);
final int max = types.size();
for (int i = 0; i < max; i++) {
@@ -2037,7 +2062,8 @@ public class MainFrame extends JFrame {
/**
* Load program preferences.
*
- * @throws IOException Signals that an I/O exception has occurred.
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
private void loadProgramPreferences() throws IOException {
if (this.iniFile == null) {
@@ -2105,8 +2131,10 @@ public class MainFrame extends JFrame {
/**
* Sets the preferred size.
*
- * @param comp the comp
- * @param propPrefix the prop prefix
+ * @param comp
+ * the comp
+ * @param propPrefix
+ * the prop prefix
*/
public void setPreferredSize(JComponent comp, String propPrefix) {
// assert(comp != null);
@@ -2116,7 +2144,8 @@ public class MainFrame extends JFrame {
/**
* Gets the dimension.
*
- * @param propPrefix the prop prefix
+ * @param propPrefix
+ * the prop prefix
* @return the dimension
*/
public Dimension getDimension(String propPrefix) {
@@ -2145,7 +2174,8 @@ public class MainFrame extends JFrame {
/**
* String list to string.
*
- * @param list the list
+ * @param list
+ * the list
* @return the string
*/
private static final String stringListToString(List<String> list) {
@@ -2164,7 +2194,8 @@ public class MainFrame extends JFrame {
/**
* String to array list.
*
- * @param s the s
+ * @param s
+ * the s
* @return the list
*/
private static final List<String> stringToArrayList(String s) {
@@ -2181,7 +2212,8 @@ public class MainFrame extends JFrame {
/**
* Save program preferences.
*
- * @throws IOException Signals that an I/O exception has occurred.
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public void saveProgramPreferences() throws IOException {
// File open dialog preferences.
@@ -2231,10 +2263,10 @@ public class MainFrame extends JFrame {
}
this.preferences.setProperty(langListPref, buf.toString());
}
- this.preferences.setProperty(textFileListPref, stringListToString(this.recentTextFiles
- .toStringList()));
- this.preferences.setProperty(descFileListPref, stringListToString(this.recentDescFiles
- .toStringList()));
+ this.preferences.setProperty(textFileListPref,
+ stringListToString(this.recentTextFiles.toStringList()));
+ this.preferences.setProperty(descFileListPref,
+ stringListToString(this.recentDescFiles.toStringList()));
// Write out preferences to file.
FileOutputStream out = new FileOutputStream(this.iniFile);
this.preferences.store(out, "Automatically generated preferences file for Annotation Viewer");
@@ -2243,8 +2275,10 @@ public class MainFrame extends JFrame {
/**
* Save color preferences.
*
- * @param file the file
- * @throws IOException Signals that an I/O exception has occurred.
+ * @param file
+ * the file
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public void saveColorPreferences(File file) throws IOException {
Properties prefs1 = new Properties();
@@ -2266,8 +2300,10 @@ public class MainFrame extends JFrame {
/**
* Load color preferences.
*
- * @param file the file
- * @throws IOException Signals that an I/O exception has occurred.
+ * @param file
+ * the file
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
*/
public void loadColorPreferences(File file) throws IOException {
Style parent = this.styleMap.get(CAS.TYPE_NAME_ANNOTATION);
@@ -2305,34 +2341,36 @@ public class MainFrame extends JFrame {
// Create a key map for focussing the index repository tree panel.
Action focusIRAction = new FocusIRAction(this);
String focusIRActionName = "focusIRAction";
- getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
- KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK), focusIRActionName);
+ getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
+ .put(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK), focusIRActionName);
getRootPane().getActionMap().put(focusIRActionName, focusIRAction);
// Create a key map for focussing the FS tree panel.
Action focusFSAction = new FocusFSAction(this);
String focusFSActionName = "focusFSAction";
- getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
- KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK), focusFSActionName);
+ getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
+ .put(KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK), focusFSActionName);
getRootPane().getActionMap().put(focusFSActionName, focusFSAction);
// Create a key map for focussing the text area.
Action focusTextAction = new FocusTextAction(this);
String focusTextActionName = "focusTextAction";
- getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(
- KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK), focusTextActionName);
+ getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
+ .put(KeyStroke.getKeyStroke(KeyEvent.VK_T, InputEvent.CTRL_MASK), focusTextActionName);
getRootPane().getActionMap().put(focusTextActionName, focusTextAction);
// Create a key map for bringing up the text area context menu.
Action textContextAction = new TextContextMenuAction(this);
String textContextActionName = "textContextAction";
this.textArea.getInputMap(JComponent.WHEN_FOCUSED).put(
- KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_MASK), textContextActionName);
+ KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, InputEvent.ALT_MASK), textContextActionName);
this.textArea.getActionMap().put(textContextActionName, textContextAction);
}
/**
* Show text popup.
*
- * @param x the x
- * @param y the y
+ * @param x
+ * the x
+ * @param y
+ * the y
*/
@SuppressWarnings("unchecked")
public void showTextPopup(int x, int y) {
@@ -2403,7 +2441,8 @@ public class MainFrame extends JFrame {
/**
* Sets the dirty.
*
- * @param isDirty the new dirty
+ * @param isDirty
+ * the new dirty
*/
public void setDirty(boolean isDirty) {
this.isDirty = isDirty;
@@ -2457,7 +2496,8 @@ public class MainFrame extends JFrame {
/**
* Sets the index label.
*
- * @param indexLabel the new index label
+ * @param indexLabel
+ * the new index label
*/
public void setIndexLabel(String indexLabel) {
this.indexLabel = indexLabel;
@@ -2475,7 +2515,8 @@ public class MainFrame extends JFrame {
/**
* Sets the annotation index.
*
- * @param isAnnotationIndex the new annotation index
+ * @param isAnnotationIndex
+ * the new annotation index
*/
public void setAnnotationIndex(boolean isAnnotationIndex) {
this.isAnnotationIndex = isAnnotationIndex;
@@ -2484,7 +2525,8 @@ public class MainFrame extends JFrame {
/**
* Sets the index.
*
- * @param index the new index
+ * @param index
+ * the new index
*/
public void setIndex(FSIndex index) {
this.index = index;
@@ -2493,7 +2535,8 @@ public class MainFrame extends JFrame {
/**
* Sets the all annotation viewer item enable.
*
- * @param enabled the new all annotation viewer item enable
+ * @param enabled
+ * the new all annotation viewer item enable
*/
public void setAllAnnotationViewerItemEnable(boolean enabled) {
this.allAnnotationViewerItem.setEnabled(enabled);
@@ -2511,7 +2554,8 @@ public class MainFrame extends JFrame {
/**
* Sets the file open dir.
*
- * @param fileOpenDir the new file open dir
+ * @param fileOpenDir
+ * the new file open dir
*/
public void setFileOpenDir(File fileOpenDir) {
this.fileOpenDir = fileOpenDir;
@@ -2529,7 +2573,8 @@ public class MainFrame extends JFrame {
/**
* Sets the text file.
*
- * @param textFile the new text file
+ * @param textFile
+ * the new text file
*/
public void setTextFile(File textFile) {
this.textFile = textFile;
@@ -2538,7 +2583,8 @@ public class MainFrame extends JFrame {
/**
* Sets the save text file enable.
*
- * @param enabled the new save text file enable
+ * @param enabled
+ * the new save text file enable
*/
public void setSaveTextFileEnable(boolean enabled) {
this.fileSaveItem.setEnabled(enabled);
@@ -2556,7 +2602,8 @@ public class MainFrame extends JFrame {
/**
* Sets the undo enabled.
*
- * @param enabled the new undo enabled
+ * @param enabled
+ * the new undo enabled
*/
public void setUndoEnabled(boolean enabled) {
this.undoItem.setEnabled(enabled);
@@ -2574,7 +2621,8 @@ public class MainFrame extends JFrame {
/**
* Sets the xcas file open dir.
*
- * @param xcasFileOpenDir the new xcas file open dir
+ * @param xcasFileOpenDir
+ * the new xcas file open dir
*/
public void setXcasFileOpenDir(File xcasFileOpenDir) {
this.xcasFileOpenDir = xcasFileOpenDir;
@@ -2583,7 +2631,8 @@ public class MainFrame extends JFrame {
/**
* Sets the cas.
*
- * @param cas the new cas
+ * @param cas
+ * the new cas
*/
public void setCas(CAS cas) {
this.cas = cas;
@@ -2611,7 +2660,8 @@ public class MainFrame extends JFrame {
/**
* Sets the rerun enabled.
*
- * @param enabled the new rerun enabled
+ * @param enabled
+ * the new rerun enabled
*/
public void setRerunEnabled(boolean enabled) {
this.reRunMenu.setEnabled(enabled);
@@ -2621,7 +2671,8 @@ public class MainFrame extends JFrame {
/**
* Sets the type system viewer enabled.
*
- * @param enabled the new type system viewer enabled
+ * @param enabled
+ * the new type system viewer enabled
*/
public void setTypeSystemViewerEnabled(boolean enabled) {
this.tsViewerItem.setEnabled(enabled);
@@ -2639,7 +2690,8 @@ public class MainFrame extends JFrame {
/**
* Sets the color settings dir.
*
- * @param colorSettingsDir the new color settings dir
+ * @param colorSettingsDir
+ * the new color settings dir
*/
public void setColorSettingsDir(File colorSettingsDir) {
this.colorSettingsDir = colorSettingsDir;
@@ -2657,7 +2709,8 @@ public class MainFrame extends JFrame {
/**
* Sets the color setting file.
*
- * @param colorSettingFile the new color setting file
+ * @param colorSettingFile
+ * the new color setting file
*/
public void setColorSettingFile(File colorSettingFile) {
this.colorSettingFile = colorSettingFile;
@@ -2675,7 +2728,8 @@ public class MainFrame extends JFrame {
/**
* Sets the annot open dir.
*
- * @param annotOpenDir the new annot open dir
+ * @param annotOpenDir
+ * the new annot open dir
*/
public void setAnnotOpenDir(File annotOpenDir) {
this.annotOpenDir = annotOpenDir;
@@ -2693,7 +2747,8 @@ public class MainFrame extends JFrame {
/**
* Sets the data path name.
*
- * @param dataPathName the new data path name
+ * @param dataPathName
+ * the new data path name
*/
public void setDataPathName(String dataPathName) {
this.dataPathName = dataPathName;
@@ -2711,7 +2766,8 @@ public class MainFrame extends JFrame {
/**
* Sets the code page.
*
- * @param codePage the new code page
+ * @param codePage
+ * the new code page
*/
public void setCodePage(String codePage) {
this.codePage = codePage;
@@ -2738,7 +2794,8 @@ public class MainFrame extends JFrame {
/**
* Sets the language.
*
- * @param language the new language
+ * @param language
+ * the new language
*/
public void setLanguage(String language) {
this.language = language;
@@ -2765,13 +2822,13 @@ public class MainFrame extends JFrame {
/**
* Sets the language prefs list.
*
- * @param languagePrefsList the new language prefs list
+ * @param languagePrefsList
+ * the new language prefs list
*/
public void setLanguagePrefsList(String languagePrefsList) {
this.languagePrefsList = languagePrefsList;
}
-
/**
* Handle sofas.
*/
@@ -2783,7 +2840,7 @@ public class MainFrame extends JFrame {
this.sofaSelectionComboBox.addItem(CAS.NAME_DEFAULT_SOFA);
Iterator<?> sofas = ((CASImpl) getCas()).getBaseCAS().getSofaIterator();
Feature sofaIdFeat = getCas().getTypeSystem()
- .getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
+ .getFeatureByFullName(CAS.FEATURE_FULL_NAME_SOFAID);
boolean nonDefaultSofaFound = false;
while (sofas.hasNext()) {
SofaFS sofa = (SofaFS) sofas.next();
@@ -2840,7 +2897,8 @@ public class MainFrame extends JFrame {
* window is being closed. Calling <code>setExitOnClose(false)</code> prevents that. It is then
* the caller's task to shut down the JVM.
*
- * @param exitOnClose the new exit on close
+ * @param exitOnClose
+ * the new exit on close
*/
public void setExitOnClose(boolean exitOnClose) {
this.exitOnClose = exitOnClose;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MarkupExtent.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MarkupExtent.java
index cece6d2..c366350 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MarkupExtent.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MarkupExtent.java
@@ -19,7 +19,6 @@
package org.apache.uima.tools.cvd;
-
/**
* Represents an element in a list of markup extents. Knows about the length of the extent, as well
* as the depth of markup. Depth of markup means, how many annotations cover this extent?
@@ -37,13 +36,15 @@ public class MarkupExtent {
/** The markup depth. */
private int markupDepth;
-
/**
* Instantiates a new markup extent.
*
- * @param start the start
- * @param end the end
- * @param markupDepth the markup depth
+ * @param start
+ * the start
+ * @param end
+ * the end
+ * @param markupDepth
+ * the markup depth
*/
public MarkupExtent(int start, int end, int markupDepth) {
this.start = start;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiAnnotViewerFrame.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiAnnotViewerFrame.java
index 7da3ee5..3052f0b 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiAnnotViewerFrame.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiAnnotViewerFrame.java
@@ -31,7 +31,6 @@ import javax.swing.text.Style;
import javax.swing.text.StyleConstants;
import javax.swing.text.StyleContext;
-
/**
* Class comment for MultiAnnotViewerFrame goes here.
*
@@ -45,7 +44,8 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Instantiates a new multi annot viewer frame.
*
- * @throws java.awt.HeadlessException the java.awt. headless exception
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
*/
public MultiAnnotViewerFrame() {
// TODO Auto-generated constructor stub
@@ -54,7 +54,8 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Instantiates a new multi annot viewer frame.
*
- * @param gc the gc
+ * @param gc
+ * the gc
*/
public MultiAnnotViewerFrame(GraphicsConfiguration gc) {
super(gc);
@@ -64,8 +65,10 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Instantiates a new multi annot viewer frame.
*
- * @param title the title
- * @throws java.awt.HeadlessException the java.awt. headless exception
+ * @param title
+ * the title
+ * @throws java.awt.HeadlessException
+ * the java.awt. headless exception
*/
public MultiAnnotViewerFrame(String title) {
super(title);
@@ -75,8 +78,10 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Instantiates a new multi annot viewer frame.
*
- * @param title the title
- * @param gc the gc
+ * @param title
+ * the title
+ * @param gc
+ * the gc
*/
public MultiAnnotViewerFrame(String title, GraphicsConfiguration gc) {
super(title, gc);
@@ -92,8 +97,10 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Inits the.
*
- * @param text the text
- * @param extents the extents
+ * @param text
+ * the text
+ * @param extents
+ * the extents
*/
public void init(String text, MarkupExtent[] extents) {
this.textPane = new JTextPane();
@@ -138,9 +145,12 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Inits the.
*
- * @param text the text
- * @param extents the extents
- * @param size the size
+ * @param text
+ * the text
+ * @param extents
+ * the extents
+ * @param size
+ * the size
*/
public void init(String text, AnnotationExtent[] extents, Dimension size) {
this.textPane = new JTextPane();
@@ -175,8 +185,10 @@ public class MultiAnnotViewerFrame extends JFrame {
/**
* Inits the html.
*
- * @param text the text
- * @param extents the extents
+ * @param text
+ * the text
+ * @param extents
+ * the extents
*/
public void initHtml(String text, MarkupExtent[] extents) {
this.textPane = new JTextPane();
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiMarkup.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiMarkup.java
index 1f5786d..e531ad9 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiMarkup.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MultiMarkup.java
@@ -30,7 +30,6 @@ import org.apache.uima.cas.CAS;
import org.apache.uima.cas.FSIterator;
import org.apache.uima.cas.text.AnnotationFS;
-
/**
* TODO: add type comment for <code>MultiMarkup</code>.
*
@@ -55,9 +54,12 @@ public abstract class MultiMarkup {
/**
* Instantiates a new extent.
*
- * @param start the start
- * @param end the end
- * @param depth the depth
+ * @param start
+ * the start
+ * @param end
+ * the end
+ * @param depth
+ * the depth
*/
private Extent(int start, int end, int depth) {
this.start = start;
@@ -78,10 +80,14 @@ public abstract class MultiMarkup {
/**
* Instantiates a new annot extent.
*
- * @param start the start
- * @param end the end
- * @param depth the depth
- * @param annotName the annot name
+ * @param start
+ * the start
+ * @param end
+ * the end
+ * @param depth
+ * the depth
+ * @param annotName
+ * the annot name
*/
private AnnotExtent(int start, int end, int depth, String annotName) {
super(start, end, depth);
@@ -93,9 +99,12 @@ public abstract class MultiMarkup {
/**
* Creates the annotation markups.
*
- * @param it the it
- * @param textLen the text len
- * @param styleMap the style map
+ * @param it
+ * the it
+ * @param textLen
+ * the text len
+ * @param styleMap
+ * the style map
* @return the annotation extent[]
*/
public static AnnotationExtent[] createAnnotationMarkups(FSIterator it, int textLen,
@@ -199,8 +208,10 @@ public abstract class MultiMarkup {
/**
* Creates the markup extents.
*
- * @param it the it
- * @param textLen the text len
+ * @param it
+ * the it
+ * @param textLen
+ * the text len
* @return the markup extent[]
*/
public static MarkupExtent[] createMarkupExtents(FSIterator it, int textLen) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/RecentFilesList.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/RecentFilesList.java
index cac4ff9..bd82fc2 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/RecentFilesList.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/RecentFilesList.java
@@ -23,13 +23,12 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
-
/**
* List of recently used files.
*
* <p>
* Provides functionality to keep a list of a certain max size. New files are added to the top. When
- * a file is added that is already in the list, it is shuffled to the top. When the maximum list
+ * a file is added that is already in the list, it is shuffled to the top. When the maximum list
* size has been reached, files start dropping off the end.
*/
public class RecentFilesList {
@@ -41,10 +40,12 @@ public class RecentFilesList {
/** The max. */
// The maximum size to which this list can grow
private final int max;
-
+
/**
* Constructor.
- * @param maxSize The maximum size to which the list can grow.
+ *
+ * @param maxSize
+ * The maximum size to which the list can grow.
*/
public RecentFilesList(int maxSize) {
this.list = new ArrayList<>();
@@ -53,6 +54,7 @@ public class RecentFilesList {
/**
* Get the internal list of files, in the proper order (most recent first).
+ *
* @return A recency-sorted list of files.
*/
public List<File> getFileList() {
@@ -61,7 +63,9 @@ public class RecentFilesList {
/**
* Append a file at the end of the list (useful for initialization).
- * @param file The file to be added.
+ *
+ * @param file
+ * The file to be added.
*/
public void appendFile(File file) {
if (this.list.size() < this.max) {
@@ -70,9 +74,11 @@ public class RecentFilesList {
}
/**
- * Add a file at the beginning. If maximum capacity is exceeded, drop last file. If
+ * Add a file at the beginning. If maximum capacity is exceeded, drop last file. If
* <code>file</code> is already in the list, move it to the front.
- * @param file The file to be added.
+ *
+ * @param file
+ * The file to be added.
*/
public void addFile(File file) {
// Check to see if list contains file already.
@@ -86,13 +92,13 @@ public class RecentFilesList {
// Set file to the beginning
this.list.set(0, file);
} else {
- // File is not contained in list. First, check if list is empty as shift code assumes
+ // File is not contained in list. First, check if list is empty as shift code assumes
// non-empty list.
if (this.list.isEmpty()) {
// To an empty list, we can just add the file.
this.list.add(file);
} else {
- // List is not empty. Shift list right by one, possibly dropping last file.
+ // List is not empty. Shift list right by one, possibly dropping last file.
shiftRight();
// Set file to beginning
this.list.set(0, file);
@@ -108,7 +114,7 @@ public class RecentFilesList {
// If max has not been reached, duplicate last file
this.list.add(this.list.get(this.list.size() - 1));
}
- // Last file has been taken care of (either duplicated or it will be dropped). Shift all
+ // Last file has been taken care of (either duplicated or it will be dropped). Shift all
// others to the right by one.
for (int i = this.list.size() - 2; i >= 0; i--) {
this.list.set(i + 1, this.list.get(i));
@@ -117,6 +123,7 @@ public class RecentFilesList {
/**
* Return the file list as a list of strings for persistence.
+ *
* @return The file list as a list of absolute file names.
*/
public List<String> toStringList() {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/StringFsPopupEventAdapter.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/StringFsPopupEventAdapter.java
index 1d9edd3..e927124 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/StringFsPopupEventAdapter.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/StringFsPopupEventAdapter.java
@@ -32,16 +32,15 @@ import javax.swing.JTextArea;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
-
/**
- * Pop-up event adapter for string valued features in the FS display. Displays a pop-up for string
- * values that were shortened for display purposes. Users can display long strings in a separate
+ * Pop-up event adapter for string valued features in the FS display. Displays a pop-up for string
+ * values that were shortened for display purposes. Users can display long strings in a separate
* window.
*/
public class StringFsPopupEventAdapter extends MouseAdapter {
/**
- * ActionListener for the pop-up menu. Just shows text in a separate text window.
+ * ActionListener for the pop-up menu. Just shows text in a separate text window.
*/
private static class ShowStringHandler implements ActionListener {
@@ -51,13 +50,16 @@ public class StringFsPopupEventAdapter extends MouseAdapter {
/**
* Instantiates a new show string handler.
*
- * @param s the s
+ * @param s
+ * the s
*/
private ShowStringHandler(String s) {
this.string = s;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -80,7 +82,9 @@ public class StringFsPopupEventAdapter extends MouseAdapter {
public StringFsPopupEventAdapter() {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
*/
@Override
@@ -88,7 +92,9 @@ public class StringFsPopupEventAdapter extends MouseAdapter {
showPopupMaybe(e);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
*/
@Override
@@ -99,7 +105,8 @@ public class StringFsPopupEventAdapter extends MouseAdapter {
/**
* Show popup maybe.
*
- * @param e the e
+ * @param e
+ * the e
*/
private void showPopupMaybe(MouseEvent e) {
// Mouse event is pop-up trigger?
@@ -107,22 +114,22 @@ public class StringFsPopupEventAdapter extends MouseAdapter {
Object o = e.getSource();
// Event was triggered over the tree?
if (o instanceof javax.swing.JTree) {
- JTree tree = (JTree) o;
- TreePath path = tree.getPathForLocation(e.getX(), e.getY());
- // Get the node in the tree model where context click occurred.
- Object leafComponent = path.getLastPathComponent();
- if (leafComponent instanceof FSNode) {
- FSNode node = (FSNode) leafComponent;
- // FSNode is a string node and was shortened?
- if (node.getNodeClass() == FSNode.STRING_FS && node.isShortenedString()) {
- // Show pop-up
- JPopupMenu menu = new JPopupMenu();
- JMenuItem showStringItem = new JMenuItem("Show full string");
- showStringItem.addActionListener(new ShowStringHandler(node.getFullString()));
- menu.add(showStringItem);
- menu.show(e.getComponent(), e.getX(), e.getY());
- }
- }
+ JTree tree = (JTree) o;
+ TreePath path = tree.getPathForLocation(e.getX(), e.getY());
+ // Get the node in the tree model where context click occurred.
+ Object leafComponent = path.getLastPathComponent();
+ if (leafComponent instanceof FSNode) {
+ FSNode node = (FSNode) leafComponent;
+ // FSNode is a string node and was shortened?
+ if (node.getNodeClass() == FSNode.STRING_FS && node.isShortenedString()) {
+ // Show pop-up
+ JPopupMenu menu = new JPopupMenu();
+ JMenuItem showStringItem = new JMenuItem("Show full string");
+ showStringItem.addActionListener(new ShowStringHandler(node.getFullString()));
+ menu.add(showStringItem);
+ menu.show(e.getComponent(), e.getX(), e.getY());
+ }
+ }
}
}
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/TypeTreeNode.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/TypeTreeNode.java
index db03969..7415dfa 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/TypeTreeNode.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/TypeTreeNode.java
@@ -21,7 +21,6 @@ package org.apache.uima.tools.cvd;
import org.apache.uima.cas.Type;
-
/**
* Class comment for TypeTreeNode.java goes here.
*
@@ -50,9 +49,12 @@ public class TypeTreeNode {
/**
* Instantiates a new type tree node.
*
- * @param type the type
- * @param label the label
- * @param size the size
+ * @param type
+ * the type
+ * @param label
+ * the label
+ * @param size
+ * the size
*/
public TypeTreeNode(Type type, String label, int size) {
this.type = type;
@@ -60,7 +62,9 @@ public class TypeTreeNode {
this.size = size;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#toString()
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutHandler.java
index ea78784..39c6f73 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -31,7 +30,6 @@ import org.apache.uima.impl.UimaVersion;
import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.tools.images.Images;
-
/**
* The Class AboutHandler.
*/
@@ -43,13 +41,16 @@ public class AboutHandler implements ActionListener {
/**
* Instantiates a new about handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AboutHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -64,15 +65,14 @@ public class AboutHandler implements ActionListener {
versionInfo = "Running Java " + javaVersion + " from " + javaVendor;
}
String msg = "CVD (CAS Visual Debugger)\n" + "Apache UIMA Version "
- + UIMAFramework.getVersionString()
- + " Copyright 2006, " + UimaVersion.getBuildYear() + " The Apache Software Foundation\n" + versionInfo + "\n";
+ + UIMAFramework.getVersionString() + " Copyright 2006, " + UimaVersion.getBuildYear()
+ + " The Apache Software Foundation\n" + versionInfo + "\n";
Icon icon = Images.getImageIcon(Images.UIMA_LOGO_SMALL);
if (icon == null) {
- JOptionPane.showMessageDialog(this.main, msg, "About CVD",
- JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showMessageDialog(this.main, msg, "About CVD", JOptionPane.INFORMATION_MESSAGE);
} else {
- JOptionPane.showMessageDialog(this.main, msg, "About CVD",
- JOptionPane.INFORMATION_MESSAGE, icon);
+ JOptionPane.showMessageDialog(this.main, msg, "About CVD", JOptionPane.INFORMATION_MESSAGE,
+ icon);
}
}
}
\ No newline at end of file
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutUimaHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutUimaHandler.java
index f07c39d..2b4fee5 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutUimaHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AboutUimaHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -26,7 +25,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.tools.util.gui.AboutDialog;
-
/**
* The Class AboutUimaHandler.
*/
@@ -38,13 +36,16 @@ public class AboutUimaHandler implements ActionListener {
/**
* Instantiates a new about uima handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AboutUimaHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AddLanguageHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AddLanguageHandler.java
index a29c801..84dc18b 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AddLanguageHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AddLanguageHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JOptionPane;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class AddLanguageHandler.
*/
@@ -39,13 +37,16 @@ public class AddLanguageHandler implements ActionListener {
/**
* Instantiates a new adds the language handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AddLanguageHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorOpenEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorOpenEventHandler.java
index 03fca0e..a252f18 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorOpenEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorOpenEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JFileChooser;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class AnnotatorOpenEventHandler.
*/
@@ -39,7 +37,8 @@ public class AnnotatorOpenEventHandler implements ActionListener {
/**
* Instantiates a new annotator open event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AnnotatorOpenEventHandler(MainFrame frame) {
this.main = frame;
@@ -48,7 +47,8 @@ public class AnnotatorOpenEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRerunEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRerunEventHandler.java
index 2034a70..d5f97b6 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRerunEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRerunEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class AnnotatorRerunEventHandler.
*/
@@ -37,7 +35,8 @@ public class AnnotatorRerunEventHandler implements ActionListener {
/**
* Instantiates a new annotator rerun event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AnnotatorRerunEventHandler(MainFrame frame) {
this.main = frame;
@@ -46,7 +45,8 @@ public class AnnotatorRerunEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunCPCEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunCPCEventHandler.java
index cf0a400..b88c1c1 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunCPCEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunCPCEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class AnnotatorRunCPCEventHandler.
*/
@@ -37,7 +35,8 @@ public class AnnotatorRunCPCEventHandler implements ActionListener {
/**
* Instantiates a new annotator run CPC event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AnnotatorRunCPCEventHandler(MainFrame frame) {
this.main = frame;
@@ -46,7 +45,8 @@ public class AnnotatorRunCPCEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunOnCasEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunOnCasEventHandler.java
index 5855c7a..01ccab3 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunOnCasEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/AnnotatorRunOnCasEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class AnnotatorRunOnCasEventHandler.
*/
@@ -37,7 +35,8 @@ public class AnnotatorRunOnCasEventHandler implements ActionListener {
/**
* Instantiates a new annotator run on cas event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public AnnotatorRunOnCasEventHandler(MainFrame frame) {
this.main = frame;
@@ -46,7 +45,8 @@ public class AnnotatorRunOnCasEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java
index de7fce9..e04cace 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java
@@ -24,7 +24,6 @@ import javax.swing.event.CaretListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Caret change handler. Enable/disable cut/copy actions, depending on whether there's a non-empty
* text selection.
@@ -37,13 +36,16 @@ public class CaretChangeHandler implements CaretListener {
/**
* Instantiates a new caret change handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public CaretChangeHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.event.CaretListener#caretUpdate(javax.swing.event.CaretEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseAnnotationViewHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseAnnotationViewHandler.java
index 3f23b3c..a391126 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseAnnotationViewHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseAnnotationViewHandler.java
@@ -28,9 +28,8 @@ import javax.swing.JFrame;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
- * Window closing handler for annotation viewer. Remember window position on close.
+ * Window closing handler for annotation viewer. Remember window position on close.
*/
public class CloseAnnotationViewHandler extends WindowAdapter implements WindowListener {
@@ -40,13 +39,16 @@ public class CloseAnnotationViewHandler extends WindowAdapter implements WindowL
/**
* Instantiates a new close annotation view handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
CloseAnnotationViewHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
@@ -55,9 +57,9 @@ public class CloseAnnotationViewHandler extends WindowAdapter implements WindowL
final int x = tsContentPane.getWidth();
final int y = tsContentPane.getHeight();
this.main.getPreferences().setProperty(MainFrame.annotViewSizePref + MainFrame.widthSuffix,
- Integer.toString(x));
+ Integer.toString(x));
this.main.getPreferences().setProperty(MainFrame.annotViewSizePref + MainFrame.heightSuffix,
- Integer.toString(y));
+ Integer.toString(y));
}
}
\ No newline at end of file
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseLogViewHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseLogViewHandler.java
index 4b61cfc..956c1ad 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseLogViewHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseLogViewHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.WindowAdapter;
@@ -29,7 +28,6 @@ import javax.swing.JFrame;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class CloseLogViewHandler.
*/
@@ -41,13 +39,16 @@ public class CloseLogViewHandler extends WindowAdapter implements WindowListener
/**
* Instantiates a new close log view handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public CloseLogViewHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
@@ -55,8 +56,10 @@ public class CloseLogViewHandler extends WindowAdapter implements WindowListener
JComponent contentPane = (JComponent) ((JFrame) event.getComponent()).getContentPane();
final int x = contentPane.getWidth();
final int y = contentPane.getHeight();
- this.main.getPreferences().setProperty(MainFrame.logViewSizePref + MainFrame.widthSuffix, Integer.toString(x));
- this.main.getPreferences().setProperty(MainFrame.logViewSizePref + MainFrame.heightSuffix, Integer.toString(y));
+ this.main.getPreferences().setProperty(MainFrame.logViewSizePref + MainFrame.widthSuffix,
+ Integer.toString(x));
+ this.main.getPreferences().setProperty(MainFrame.logViewSizePref + MainFrame.heightSuffix,
+ Integer.toString(y));
}
}
\ No newline at end of file
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseTypeSystemHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseTypeSystemHandler.java
index 25229d6..e33a743 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseTypeSystemHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CloseTypeSystemHandler.java
@@ -28,7 +28,6 @@ import javax.swing.JFrame;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class CloseTypeSystemHandler.
*/
@@ -40,13 +39,16 @@ public class CloseTypeSystemHandler extends WindowAdapter implements WindowListe
/**
* Instantiates a new close type system handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public CloseTypeSystemHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
@@ -55,9 +57,9 @@ public class CloseTypeSystemHandler extends WindowAdapter implements WindowListe
final int x = tsContentPane.getWidth();
final int y = tsContentPane.getHeight();
this.main.getPreferences().setProperty(MainFrame.tsWindowSizePref + MainFrame.widthSuffix,
- Integer.toString(x));
+ Integer.toString(x));
this.main.getPreferences().setProperty(MainFrame.tsWindowSizePref + MainFrame.heightSuffix,
- Integer.toString(y));
+ Integer.toString(y));
}
}
\ No newline at end of file
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsOpenHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsOpenHandler.java
index c39806e..e7c7dcc 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsOpenHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsOpenHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -29,7 +28,6 @@ import javax.swing.JFileChooser;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class ColorPrefsOpenHandler.
*/
@@ -41,7 +39,8 @@ public class ColorPrefsOpenHandler implements ActionListener {
/**
* Instantiates a new color prefs open handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ColorPrefsOpenHandler(MainFrame frame) {
this.main = frame;
@@ -50,7 +49,8 @@ public class ColorPrefsOpenHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsSaveHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsSaveHandler.java
index 711fba1..eb0724b 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsSaveHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ColorPrefsSaveHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -29,7 +28,6 @@ import javax.swing.JFileChooser;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class ColorPrefsSaveHandler.
*/
@@ -41,7 +39,8 @@ public class ColorPrefsSaveHandler implements ActionListener {
/**
* Instantiates a new color prefs save handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ColorPrefsSaveHandler(MainFrame frame) {
this.main = frame;
@@ -50,7 +49,8 @@ public class ColorPrefsSaveHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FSTreeSelectionListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FSTreeSelectionListener.java
index 0247f26..1964602 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FSTreeSelectionListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FSTreeSelectionListener.java
@@ -26,12 +26,11 @@ import org.apache.uima.tools.cvd.FSNode;
import org.apache.uima.tools.cvd.FSTreeNode;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Handle selection of annotations in annotation frame. If selected node represents an annotation,
* highlight the corresponding extent in the text.
*
-// * @see FSTreeSelectionEvent
+ * // * @see FSTreeSelectionEvent
*/
public class FSTreeSelectionListener implements TreeSelectionListener {
@@ -41,7 +40,8 @@ public class FSTreeSelectionListener implements TreeSelectionListener {
/**
* Instantiates a new FS tree selection listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FSTreeSelectionListener(MainFrame frame) {
this.main = frame;
@@ -50,7 +50,8 @@ public class FSTreeSelectionListener implements TreeSelectionListener {
/**
* Value changed.
*
- * @param event the event
+ * @param event
+ * the event
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileOpenEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileOpenEventHandler.java
index fed4a6a..751fd44 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileOpenEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileOpenEventHandler.java
@@ -27,20 +27,19 @@ import javax.swing.JFileChooser;
import org.apache.uima.internal.util.Timer;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class FileOpenEventHandler.
*/
public class FileOpenEventHandler implements ActionListener {
-
/** The main. */
private final MainFrame main;
/**
* Instantiates a new file open event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FileOpenEventHandler(MainFrame frame) {
this.main = frame;
@@ -49,7 +48,8 @@ public class FileOpenEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
@@ -75,7 +75,7 @@ public class FileOpenEventHandler implements ActionListener {
this.main.getUndoMgr().discardAllEdits();
this.main.setFileStatusMessage();
this.main.setStatusbarMessage("Done loading text file " + this.main.getTextFile().getName()
- + " in " + time.getTimeSpan() + ".");
+ + " in " + time.getTimeSpan() + ".");
}
}
}
\ No newline at end of file
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveAsEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveAsEventHandler.java
index acf8581..b6a73b0 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveAsEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveAsEventHandler.java
@@ -27,7 +27,6 @@ import javax.swing.JFileChooser;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class FileSaveAsEventHandler.
*/
@@ -39,7 +38,8 @@ public class FileSaveAsEventHandler implements ActionListener {
/**
* Instantiates a new file save as event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FileSaveAsEventHandler(MainFrame frame) {
this.main = frame;
@@ -48,7 +48,8 @@ public class FileSaveAsEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
@@ -66,7 +67,7 @@ public class FileSaveAsEventHandler implements ActionListener {
File fileToSaveTo = fileChooser.getSelectedFile();
if (!this.main.confirmOverwrite(fileToSaveTo)) {
return;
- }
+ }
this.main.setTextFile(fileToSaveTo);
boolean fileSaved = this.main.saveFile();
if (fileSaved) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveEventHandler.java
index 5465964..5c7dc0c 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FileSaveEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class FileSaveEventHandler.
*/
@@ -37,13 +35,16 @@ public class FileSaveEventHandler implements ActionListener {
/**
* Instantiates a new file save event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FileSaveEventHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusFSAction.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusFSAction.java
index 727f8ec..5e867a0 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusFSAction.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusFSAction.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.Action;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Focus in annotation frame action handler.
*/
@@ -39,7 +37,8 @@ public class FocusFSAction extends AbstractAction implements Action {
/**
* Instantiates a new focus FS action.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FocusFSAction(MainFrame frame) {
this.main = frame;
@@ -48,7 +47,9 @@ public class FocusFSAction extends AbstractAction implements Action {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8330075846211434833L;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusIRAction.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusIRAction.java
index ef09ca1..632a667 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusIRAction.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusIRAction.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.Action;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Action handler for focus in index repository frame.
*/
@@ -39,7 +37,8 @@ public class FocusIRAction extends AbstractAction implements Action {
/**
* Instantiates a new focus IR action.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FocusIRAction(MainFrame frame) {
this.main = frame;
@@ -48,7 +47,9 @@ public class FocusIRAction extends AbstractAction implements Action {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8128067676842119411L;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusTextAction.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusTextAction.java
index 368b981..0378e7e 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusTextAction.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/FocusTextAction.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.Action;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Focus in text frame action handler.
*/
@@ -39,7 +37,8 @@ public class FocusTextAction extends AbstractAction implements Action {
/**
* Instantiates a new focus text action.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public FocusTextAction(MainFrame frame) {
this.main = frame;
@@ -48,7 +47,9 @@ public class FocusTextAction extends AbstractAction implements Action {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -4867535661038776033L;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/HelpHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/HelpHandler.java
index 160f1ab..d583dfc 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/HelpHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/HelpHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JOptionPane;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class HelpHandler.
*/
@@ -39,20 +37,23 @@ public class HelpHandler implements ActionListener {
/**
* Instantiates a new help handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public HelpHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
String msg = "There is currently no online help."
- + "\nPlease find documentation on CVD and UIMA"
- + "\nin the doc directory of the UIMA installation";
+ + "\nPlease find documentation on CVD and UIMA"
+ + "\nin the doc directory of the UIMA installation";
JOptionPane.showMessageDialog(this.main, msg, "Help", JOptionPane.INFORMATION_MESSAGE);
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexPopupListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexPopupListener.java
index 462e4f5..2601fd4 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexPopupListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexPopupListener.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.MouseAdapter;
@@ -32,34 +31,32 @@ import org.apache.uima.tools.cvd.IndexTreeNode;
import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.tools.cvd.TypeTreeNode;
-
/**
- * The listener interface for receiving indexPopup events.
- * The class that is interested in processing a indexPopup
- * event implements this interface, and the object created
- * with that class is registered with a component using the
- * component's <code>addIndexPopupListener</code> method. When
- * the indexPopup event occurs, that object's appropriate
- * method is invoked.
+ * The listener interface for receiving indexPopup events. The class that is interested in
+ * processing a indexPopup event implements this interface, and the object created with that class
+ * is registered with a component using the component's <code>addIndexPopupListener</code> method.
+ * When the indexPopup event occurs, that object's appropriate method is invoked.
*
-// * @see IndexPopupEvent
+ * // * @see IndexPopupEvent
*/
public class IndexPopupListener extends MouseAdapter {
-
/** The main. */
private final MainFrame main;
/**
* Instantiates a new index popup listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public IndexPopupListener(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
*/
@Override
@@ -67,7 +64,9 @@ public class IndexPopupListener extends MouseAdapter {
maybeShowPopup(e);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
*/
@Override
@@ -78,12 +77,13 @@ public class IndexPopupListener extends MouseAdapter {
/**
* Maybe show popup.
*
- * @param e the e
+ * @param e
+ * the e
*/
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.main.getIndexTree()
- .getLastSelectedPathComponent();
+ .getLastSelectedPathComponent();
if (node == null) {
return;
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexTreeSelectionListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexTreeSelectionListener.java
index 694488d..4db02bb 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexTreeSelectionListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/IndexTreeSelectionListener.java
@@ -30,11 +30,10 @@ import org.apache.uima.tools.cvd.IndexTreeNode;
import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.tools.cvd.TypeTreeNode;
-
/**
* Change the display of the FSTree if a type in an index is selected.
*
-// * @see IndexTreeSelectionEvent
+ * // * @see IndexTreeSelectionEvent
*/
public class IndexTreeSelectionListener implements TreeSelectionListener {
@@ -44,7 +43,8 @@ public class IndexTreeSelectionListener implements TreeSelectionListener {
/**
* Instantiates a new index tree selection listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public IndexTreeSelectionListener(MainFrame frame) {
this.main = frame;
@@ -53,14 +53,15 @@ public class IndexTreeSelectionListener implements TreeSelectionListener {
/**
* Value changed.
*
- * @param arg0 the arg 0
+ * @param arg0
+ * the arg 0
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
*/
@Override
public void valueChanged(TreeSelectionEvent arg0) {
// System.out.println("Tree selection value changed");
DefaultMutableTreeNode node = (DefaultMutableTreeNode) this.main.getIndexTree()
- .getLastSelectedPathComponent();
+ .getLastSelectedPathComponent();
if (node == null) {
return;
}
@@ -82,8 +83,8 @@ public class IndexTreeSelectionListener implements TreeSelectionListener {
this.main.setAnnotationIndex(label.equals(CAS.STD_ANNOTATION_INDEX));
this.main.setIndex(this.main.getCas().getIndexRepository().getIndex(label, type));
this.main.updateFSTree(label, this.main.getIndex());
- this.main.setAllAnnotationViewerItemEnable(((CASImpl) this.main.getCas())
- .isAnnotationType(type));
+ this.main.setAllAnnotationViewerItemEnable(
+ ((CASImpl) this.main.getCas()).isAnnotationType(type));
this.main.getTextArea().getCaret().setVisible(true);
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentDescFileEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentDescFileEventHandler.java
index 3dcfa86..23c8332 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentDescFileEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentDescFileEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -26,7 +25,6 @@ import java.io.File;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class LoadRecentDescFileEventHandler.
*/
@@ -34,22 +32,26 @@ public class LoadRecentDescFileEventHandler implements ActionListener {
/** The main. */
private final MainFrame main;
-
+
/** The file name. */
private final String fileName;
/**
* Instantiates a new load recent desc file event handler.
*
- * @param frame the frame
- * @param fileName the file name
+ * @param frame
+ * the frame
+ * @param fileName
+ * the file name
*/
public LoadRecentDescFileEventHandler(MainFrame frame, String fileName) {
this.main = frame;
this.fileName = fileName;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentTextFileEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentTextFileEventHandler.java
index 3f7a8f9..312def6 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentTextFileEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/LoadRecentTextFileEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -26,7 +25,6 @@ import java.io.File;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class LoadRecentTextFileEventHandler.
*/
@@ -34,22 +32,26 @@ public class LoadRecentTextFileEventHandler implements ActionListener {
/** The main. */
private final MainFrame main;
-
+
/** The file name. */
private final String fileName;
/**
* Instantiates a new load recent text file event handler.
*
- * @param frame the frame
- * @param fileName the file name
+ * @param frame
+ * the frame
+ * @param fileName
+ * the file name
*/
public LoadRecentTextFileEventHandler(MainFrame frame, String fileName) {
this.main = frame;
this.fileName = fileName;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/MainFrameClosing.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/MainFrameClosing.java
index ec5f3c1..7bf18b6 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/MainFrameClosing.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/MainFrameClosing.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.WindowAdapter;
@@ -26,7 +25,6 @@ import java.io.IOException;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Save preferences on closing CVD.
*/
@@ -38,13 +36,16 @@ public class MainFrameClosing extends WindowAdapter {
/**
* Instantiates a new main frame closing.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public MainFrameClosing(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
@@ -55,7 +56,8 @@ public class MainFrameClosing extends WindowAdapter {
/**
* Handle closing event.
*
- * @param main the main
+ * @param main
+ * the main
*/
public static void handleClosingEvent(MainFrame main) {
try {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ManualHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ManualHandler.java
index 49b63f5..d712c66 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ManualHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ManualHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.Dimension;
@@ -38,11 +37,10 @@ import javax.swing.text.html.HTMLFrameHyperlinkEvent;
import org.apache.uima.tools.cvd.CVD;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
- * Show the CVD manual in a Swing html widget. Unfortunately, the html we currently produce from
- * our docbook source is too advanced for the the simple html widget, and is virtually unreadable.
- * That makes this option relatively useless atm (it's better the more recent the Java version).
+ * Show the CVD manual in a Swing html widget. Unfortunately, the html we currently produce from our
+ * docbook source is too advanced for the the simple html widget, and is virtually unreadable. That
+ * makes this option relatively useless atm (it's better the more recent the Java version).
*/
public class ManualHandler implements ActionListener {
@@ -52,7 +50,8 @@ public class ManualHandler implements ActionListener {
/**
* Instantiates a new manual handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ManualHandler(MainFrame frame) {
this.main = frame;
@@ -63,7 +62,9 @@ public class ManualHandler implements ActionListener {
*/
private class Hyperactive implements HyperlinkListener {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.event.HyperlinkListener#hyperlinkUpdate(javax.swing.event.HyperlinkEvent)
*/
@Override
@@ -85,7 +86,9 @@ public class ManualHandler implements ActionListener {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -110,16 +113,16 @@ public class ManualHandler implements ActionListener {
msg += String.format("\n Directory doesn't exist");
}
JOptionPane.showMessageDialog(this.main, msg, "Error loading manual",
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane.ERROR_MESSAGE);
return;
}
}
}
if (manURL == null) {
String msg = "Can't find manual. The manual is loaded via the classpath,\n"
- + "so make sure the manual folder is in the classpath.";
+ + "so make sure the manual folder is in the classpath.";
JOptionPane.showMessageDialog(this.main, msg, "Error loading manual",
- JOptionPane.ERROR_MESSAGE);
+ JOptionPane.ERROR_MESSAGE);
return;
}
editorPane.setPage(manURL);
@@ -130,7 +133,7 @@ public class ManualHandler implements ActionListener {
manFrame.setVisible(true);
URL cvdLinkUrl = new URL(manURL.toString() + "#ugr.tools.cvd");
HyperlinkEvent e = new HyperlinkEvent(editorPane, HyperlinkEvent.EventType.ACTIVATED,
- cvdLinkUrl);
+ cvdLinkUrl);
editorPane.fireHyperlinkUpdate(e);
} catch (Exception e) {
this.main.handleException(e);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/NewTextEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/NewTextEventHandler.java
index 3f50a37..bab5fed 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/NewTextEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/NewTextEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Clear text area.
*/
@@ -37,13 +35,16 @@ public class NewTextEventHandler implements ActionListener {
/**
* Instantiates a new new text event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public NewTextEventHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupHandler.java
index b0ad389..d4f0bf0 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupHandler.java
@@ -27,9 +27,8 @@ import javax.swing.tree.TreePath;
import org.apache.uima.tools.cvd.FSTreeModel;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
- * Action handler for text pop-up menu items. Select chosen annotation in FS tree, make visible.
+ * Action handler for text pop-up menu items. Select chosen annotation in FS tree, make visible.
*/
public class PopupHandler implements ActionListener {
@@ -42,15 +41,19 @@ public class PopupHandler implements ActionListener {
/**
* Instantiates a new popup handler.
*
- * @param frame the frame
- * @param n the n
+ * @param frame
+ * the frame
+ * @param n
+ * the n
*/
public PopupHandler(MainFrame frame, int n) {
this.main = frame;
this.node = n;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupListener.java
index 8034867..9772323 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/PopupListener.java
@@ -24,12 +24,11 @@ import java.awt.event.MouseEvent;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Handle text pop-up (mouse) events. The actual logic for creating the text pop-up menu is not
* here.
*
-// * @see PopupEvent
+ * // * @see PopupEvent
*/
public class PopupListener extends MouseAdapter {
@@ -39,13 +38,16 @@ public class PopupListener extends MouseAdapter {
/**
* Instantiates a new popup listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public PopupListener(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mousePressed(java.awt.event.MouseEvent)
*/
@Override
@@ -53,7 +55,9 @@ public class PopupListener extends MouseAdapter {
maybeShowPopup(e);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mouseReleased(java.awt.event.MouseEvent)
*/
@Override
@@ -64,7 +68,8 @@ public class PopupListener extends MouseAdapter {
/**
* Maybe show popup.
*
- * @param e the e
+ * @param e
+ * the e
*/
private void maybeShowPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RemoveLanguageHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RemoveLanguageHandler.java
index 0ee3ab8..6534856 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RemoveLanguageHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RemoveLanguageHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JMenuItem;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class RemoveLanguageHandler.
*/
@@ -39,13 +37,16 @@ public class RemoveLanguageHandler implements ActionListener {
/**
* Instantiates a new removes the language handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public RemoveLanguageHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RestoreLangDefaultsHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RestoreLangDefaultsHandler.java
index f4f799d..166894e 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RestoreLangDefaultsHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/RestoreLangDefaultsHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class RestoreLangDefaultsHandler.
*/
@@ -37,13 +35,16 @@ public class RestoreLangDefaultsHandler implements ActionListener {
/**
* Instantiates a new restore lang defaults handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public RestoreLangDefaultsHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetCodePageHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetCodePageHandler.java
index f835900..d8a116f 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetCodePageHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetCodePageHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JRadioButtonMenuItem;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class SetCodePageHandler.
*/
@@ -39,13 +37,16 @@ public class SetCodePageHandler implements ActionListener {
/**
* Instantiates a new sets the code page handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public SetCodePageHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetDataPathHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetDataPathHandler.java
index d49955c..c80f038 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetDataPathHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetDataPathHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JOptionPane;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class SetDataPathHandler.
*/
@@ -39,19 +37,22 @@ public class SetDataPathHandler implements ActionListener {
/**
* Instantiates a new sets the data path handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public SetDataPathHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent arg0) {
String result = (String) JOptionPane.showInputDialog(this.main, "Specify the data path",
- "Set data path", JOptionPane.PLAIN_MESSAGE, null, null, this.main.getDataPathName());
+ "Set data path", JOptionPane.PLAIN_MESSAGE, null, null, this.main.getDataPathName());
if (result != null) {
this.main.setDataPath(result);
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLanguageHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLanguageHandler.java
index 97bcc3a..c404464 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLanguageHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLanguageHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -27,7 +26,6 @@ import javax.swing.JRadioButtonMenuItem;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class SetLanguageHandler.
*/
@@ -39,13 +37,16 @@ public class SetLanguageHandler implements ActionListener {
/**
* Instantiates a new sets the language handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public SetLanguageHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLogConfigHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLogConfigHandler.java
index 87877cf..ebde40a 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLogConfigHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SetLogConfigHandler.java
@@ -28,7 +28,6 @@ import org.apache.uima.UIMAFramework;
import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.util.Level;
-
/**
* The Class SetLogConfigHandler.
*/
@@ -40,7 +39,9 @@ public class SetLogConfigHandler implements ActionListener {
public SetLogConfigHandler() {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotatedTextHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotatedTextHandler.java
index 66a9f26..f8daa34 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotatedTextHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotatedTextHandler.java
@@ -28,7 +28,6 @@ import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.tools.cvd.MultiAnnotViewerFrame;
import org.apache.uima.tools.cvd.MultiMarkup;
-
/**
* Show the multi-annotation text window. Is anybody even using this? This is handled much better in
* the DocumentAnalyzer.
@@ -41,13 +40,16 @@ public class ShowAnnotatedTextHandler implements ActionListener {
/**
* Instantiates a new show annotated text handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ShowAnnotatedTextHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -58,8 +60,8 @@ public class ShowAnnotatedTextHandler implements ActionListener {
FSIterator it = this.main.getIndex().iterator();
final String text = this.main.getCas().getDocumentText();
System.out.println("Creating extents.");
- AnnotationExtent[] extents = MultiMarkup.createAnnotationMarkups(it, text.length(), this.main
- .getStyleMap());
+ AnnotationExtent[] extents = MultiMarkup.createAnnotationMarkups(it, text.length(),
+ this.main.getStyleMap());
System.out.println("Initializing text frame.");
f.init(text, extents, this.main.getDimension(MainFrame.annotViewSizePref));
System.out.println("Done.");
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotationCustomizerHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotationCustomizerHandler.java
index bcc9d4a..1841902 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotationCustomizerHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowAnnotationCustomizerHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -26,7 +25,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.AnnotationDisplayCustomizationFrame;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class ShowAnnotationCustomizerHandler.
*/
@@ -38,19 +36,22 @@ public class ShowAnnotationCustomizerHandler implements ActionListener {
/**
* Instantiates a new show annotation customizer handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ShowAnnotationCustomizerHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
public void actionPerformed(ActionEvent event) {
AnnotationDisplayCustomizationFrame acd = new AnnotationDisplayCustomizationFrame(
- "Customize Annotation Display");
+ "Customize Annotation Display");
acd.init(this.main.getStyleMap(), this.main.getCas());
acd.pack();
acd.setVisible(true);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowTypesystemHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowTypesystemHandler.java
index c95eeb6..0539067 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowTypesystemHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/ShowTypesystemHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -28,20 +27,19 @@ import javax.swing.WindowConstants;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class ShowTypesystemHandler.
*/
public class ShowTypesystemHandler implements ActionListener {
-
/** The main. */
private final MainFrame main;
/**
* Instantiates a new show typesystem handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public ShowTypesystemHandler(MainFrame frame) {
this.main = frame;
@@ -50,7 +48,8 @@ public class ShowTypesystemHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SofaSelectionListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SofaSelectionListener.java
index b0c0350..180a7cc 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SofaSelectionListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SofaSelectionListener.java
@@ -24,17 +24,13 @@ import java.awt.event.ItemListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
- * The listener interface for receiving sofaSelection events.
- * The class that is interested in processing a sofaSelection
- * event implements this interface, and the object created
- * with that class is registered with a component using the
- * component's <code>addSofaSelectionListener</code> method. When
- * the sofaSelection event occurs, that object's appropriate
- * method is invoked.
+ * The listener interface for receiving sofaSelection events. The class that is interested in
+ * processing a sofaSelection event implements this interface, and the object created with that
+ * class is registered with a component using the component's <code>addSofaSelectionListener</code>
+ * method. When the sofaSelection event occurs, that object's appropriate method is invoked.
*
-// * @see SofaSelectionEvent
+ * // * @see SofaSelectionEvent
*/
public class SofaSelectionListener implements ItemListener {
@@ -44,13 +40,16 @@ public class SofaSelectionListener implements ItemListener {
/**
* Instantiates a new sofa selection listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public SofaSelectionListener(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SystemExitHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SystemExitHandler.java
index 129f58a..eb55d1d 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SystemExitHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/SystemExitHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -25,7 +24,6 @@ import java.awt.event.ActionListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class SystemExitHandler.
*/
@@ -37,13 +35,16 @@ public class SystemExitHandler implements ActionListener {
/**
* Instantiates a new system exit handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public SystemExitHandler(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextChangedListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextChangedListener.java
index 12e567c..169d189 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextChangedListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextChangedListener.java
@@ -24,13 +24,12 @@ import javax.swing.event.DocumentListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Listener for changes in text frame. When the text is changed, the CAS is removed as the text from
* the CAS does no longer correspond to the text that is displayed in the frame, hence annotation
* offsets are no longer correct.
*
-// * @see TextChangedEvent
+ * // * @see TextChangedEvent
*/
public class TextChangedListener implements DocumentListener {
@@ -40,13 +39,16 @@ public class TextChangedListener implements DocumentListener {
/**
* Instantiates a new text changed listener.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public TextChangedListener(MainFrame frame) {
this.main = frame;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
*/
@Override
@@ -54,7 +56,9 @@ public class TextChangedListener implements DocumentListener {
// Do nothing.
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextContextMenuAction.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextContextMenuAction.java
index 9b59eaf..f4ad2da 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextContextMenuAction.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextContextMenuAction.java
@@ -26,7 +26,6 @@ import javax.swing.AbstractAction;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Text pop-up action (for keyboard accessibility).
*/
@@ -38,7 +37,8 @@ public class TextContextMenuAction extends AbstractAction {
/**
* Instantiates a new text context menu action.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public TextContextMenuAction(MainFrame frame) {
this.main = frame;
@@ -47,7 +47,9 @@ public class TextContextMenuAction extends AbstractAction {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -5518456467913617514L;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextFocusHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextFocusHandler.java
index 4000b11..1e8ac73 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextFocusHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TextFocusHandler.java
@@ -24,7 +24,6 @@ import java.awt.event.FocusListener;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* The Class TextFocusHandler.
*/
@@ -36,7 +35,8 @@ public class TextFocusHandler implements FocusListener {
/**
* Instantiates a new text focus handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public TextFocusHandler(MainFrame frame) {
this.main = frame;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TreeFocusHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TreeFocusHandler.java
index fa147b9..e958f7f 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TreeFocusHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TreeFocusHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.FocusEvent;
@@ -26,7 +25,6 @@ import java.awt.event.FocusListener;
import javax.swing.JTree;
import javax.swing.tree.TreePath;
-
/**
* The Class TreeFocusHandler.
*/
@@ -38,13 +36,16 @@ public class TreeFocusHandler implements FocusListener {
/**
* Instantiates a new tree focus handler.
*
- * @param tree the tree
+ * @param tree
+ * the tree
*/
public TreeFocusHandler(JTree tree) {
this.tree = tree;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)
*/
@Override
@@ -56,7 +57,9 @@ public class TreeFocusHandler implements FocusListener {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TypeSystemFileOpenEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TypeSystemFileOpenEventHandler.java
index 86abeb7..1c91e10 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TypeSystemFileOpenEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/TypeSystemFileOpenEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -34,9 +33,8 @@ import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.util.CasCreationUtils;
import org.apache.uima.util.XMLInputSource;
-
/**
- * Load a type system file. Need to load type system before one can load XCAS.
+ * Load a type system file. Need to load type system before one can load XCAS.
*/
public class TypeSystemFileOpenEventHandler implements ActionListener {
@@ -46,7 +44,8 @@ public class TypeSystemFileOpenEventHandler implements ActionListener {
/**
* Instantiates a new type system file open event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public TypeSystemFileOpenEventHandler(MainFrame frame) {
this.main = frame;
@@ -55,7 +54,8 @@ public class TypeSystemFileOpenEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
@@ -79,8 +79,7 @@ public class TypeSystemFileOpenEventHandler implements ActionListener {
TypeSystemDescription tsDesc = (TypeSystemDescription) descriptor;
tsDesc.resolveImports();
this.main.destroyAe();
- this.main.setCas(CasCreationUtils
- .createCas(tsDesc, null, new FsIndexDescription[0]));
+ this.main.setCas(CasCreationUtils.createCas(tsDesc, null, new FsIndexDescription[0]));
this.main.setRunOnCasEnabled();
this.main.setRerunEnabled(false);
this.main.getTextArea().setText("");
@@ -88,7 +87,8 @@ public class TypeSystemFileOpenEventHandler implements ActionListener {
this.main.setTypeSystemViewerEnabled(true);
this.main.setEnableCasFileReadingAndWriting();
time.stop();
- this.main.setStatusbarMessage("Done loading type system file in " + time.getTimeSpan() + ".");
+ this.main.setStatusbarMessage(
+ "Done loading type system file in " + time.getTimeSpan() + ".");
} catch (Exception e) {
e.printStackTrace();
this.main.handleException(e);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/UndoMgr.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/UndoMgr.java
index fbfa097..4c815bb 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/UndoMgr.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/UndoMgr.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -28,7 +27,6 @@ import javax.swing.undo.UndoableEdit;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Undo manager for text area.
*/
@@ -40,7 +38,8 @@ public class UndoMgr extends UndoManager implements ActionListener {
/**
* Instantiates a new undo mgr.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public UndoMgr(MainFrame frame) {
this.main = frame;
@@ -49,7 +48,9 @@ public class UndoMgr extends UndoManager implements ActionListener {
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7677701629555379146L;
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -60,7 +61,9 @@ public class UndoMgr extends UndoManager implements ActionListener {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.undo.UndoManager#addEdit(javax.swing.undo.UndoableEdit)
*/
@Override
@@ -69,7 +72,9 @@ public class UndoMgr extends UndoManager implements ActionListener {
return super.addEdit(arg0);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.undo.UndoManager#discardAllEdits()
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASFileOpenEventHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASFileOpenEventHandler.java
index f69daba..8d6bc3c 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASFileOpenEventHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASFileOpenEventHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -33,7 +32,6 @@ import org.apache.uima.internal.util.Timer;
import org.apache.uima.internal.util.XMLUtils;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Load an XCAS file.
*/
@@ -45,7 +43,8 @@ public class XCASFileOpenEventHandler implements ActionListener {
/**
* Instantiates a new XCAS file open event handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public XCASFileOpenEventHandler(MainFrame frame) {
this.main = frame;
@@ -54,7 +53,8 @@ public class XCASFileOpenEventHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
@@ -74,8 +74,8 @@ public class XCASFileOpenEventHandler implements ActionListener {
time.start();
SAXParserFactory saxParserFactory = XMLUtils.createSAXParserFactory();
SAXParser parser = saxParserFactory.newSAXParser();
- XCASDeserializer xcasDeserializer = new XCASDeserializer(this.main.getCas()
- .getTypeSystem());
+ XCASDeserializer xcasDeserializer = new XCASDeserializer(
+ this.main.getCas().getTypeSystem());
this.main.getCas().reset();
parser.parse(xcasFile, xcasDeserializer.getXCASHandler(this.main.getCas()));
time.stop();
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveHandler.java
index fa94b6f..be8b7b6 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -35,7 +34,6 @@ import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.util.XMLSerializer;
import org.xml.sax.SAXException;
-
/**
* The Class XCASSaveHandler.
*/
@@ -47,7 +45,8 @@ public class XCASSaveHandler implements ActionListener {
/**
* Instantiates a new XCAS save handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public XCASSaveHandler(MainFrame frame) {
this.main = frame;
@@ -56,7 +55,8 @@ public class XCASSaveHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveTSHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveTSHandler.java
index 2b5210a..0fc0e2e 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveTSHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XCASSaveTSHandler.java
@@ -17,7 +17,6 @@
* under the License.
*/
-
package org.apache.uima.tools.cvd.control;
import java.awt.event.ActionEvent;
@@ -34,7 +33,6 @@ import org.apache.uima.cas.impl.TypeSystem2Xml;
import org.apache.uima.tools.cvd.MainFrame;
import org.xml.sax.SAXException;
-
/**
* The Class XCASSaveTSHandler.
*/
@@ -46,7 +44,8 @@ public class XCASSaveTSHandler implements ActionListener {
/**
* Instantiates a new XCAS save TS handler.
*
- * @param frame the frame
+ * @param frame
+ * the frame
*/
public XCASSaveTSHandler(MainFrame frame) {
this.main = frame;
@@ -55,7 +54,8 @@ public class XCASSaveTSHandler implements ActionListener {
/**
* Action performed.
*
- * @param event the event
+ * @param event
+ * the event
* @see java.awt.event.ActionListener#actionPerformed(ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasFileOpenHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasFileOpenHandler.java
index f73a98e..70e2325 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasFileOpenHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasFileOpenHandler.java
@@ -27,12 +27,11 @@ import javax.swing.JFileChooser;
import org.apache.uima.tools.cvd.MainFrame;
-
/**
* Load a CAS from an XMI file.
*/
public class XmiCasFileOpenHandler implements ActionListener {
-
+
/** The main. */
final MainFrame main;
@@ -48,13 +47,16 @@ public class XmiCasFileOpenHandler implements ActionListener {
/**
* Instantiates a new xmi cas file open handler.
*
- * @param main the main
+ * @param main
+ * the main
*/
public XmiCasFileOpenHandler(MainFrame main) {
this.main = main;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasSaveHandler.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasSaveHandler.java
index 60fe1bf..c872d78 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasSaveHandler.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/XmiCasSaveHandler.java
@@ -34,7 +34,6 @@ import org.apache.uima.tools.cvd.MainFrame;
import org.apache.uima.util.XMLSerializer;
import org.xml.sax.SAXException;
-
/**
* Save CAS to disk as XMI.
*/
@@ -42,7 +41,7 @@ public class XmiCasSaveHandler implements ActionListener {
/** The main. */
private final MainFrame main;
-
+
/**
* Instantiates a new xmi cas save handler.
*/
@@ -51,17 +50,20 @@ public class XmiCasSaveHandler implements ActionListener {
private XmiCasSaveHandler() {
this.main = null;
}
-
+
/**
* Instantiates a new xmi cas save handler.
*
- * @param main the main
+ * @param main
+ * the main
*/
public XmiCasSaveHandler(MainFrame main) {
this.main = main;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -81,7 +83,8 @@ public class XmiCasSaveHandler implements ActionListener {
try {
OutputStream outStream = new BufferedOutputStream(new FileOutputStream(xmiCasFile));
XMLSerializer xmlSerializer = new XMLSerializer(outStream);
- XmiCasSerializer xmiCasSerializer = new XmiCasSerializer(this.main.getCas().getTypeSystem());
+ XmiCasSerializer xmiCasSerializer = new XmiCasSerializer(
+ this.main.getCas().getTypeSystem());
xmiCasSerializer.serialize(this.main.getCas(), xmlSerializer.getContentHandler());
outStream.close();
} catch (IOException e) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/FeatureTableModel.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/FeatureTableModel.java
index 4b9be8f..44c6b89 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/FeatureTableModel.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/FeatureTableModel.java
@@ -49,7 +49,8 @@ public class FeatureTableModel extends AbstractTableModel {
/**
* Constructor for FeatureTableModel.
*
- * @param type the type
+ * @param type
+ * the type
*/
public FeatureTableModel(Type type) {
this.type = type;
@@ -58,14 +59,17 @@ public class FeatureTableModel extends AbstractTableModel {
/**
* Sets the type.
*
- * @param type the new type
+ * @param type
+ * the new type
*/
public void setType(Type type) {
this.type = type;
fireTableDataChanged();
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.table.AbstractTableModel#getColumnName(int)
*/
@Override
@@ -104,8 +108,10 @@ public class FeatureTableModel extends AbstractTableModel {
/**
* Gets the value at.
*
- * @param rowIndex the row index
- * @param columnIndex the column index
+ * @param rowIndex
+ * the row index
+ * @param columnIndex
+ * the column index
* @return the value at
* @see javax.swing.table.TableModel#getValueAt(int, int)
*/
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/MainFrame.java b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/MainFrame.java
index 6e81d03..285e1b9 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/MainFrame.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/tsview/MainFrame.java
@@ -48,7 +48,6 @@ import org.apache.uima.cas.TypeSystem;
import org.apache.uima.cas.admin.CASFactory;
import org.apache.uima.cas.admin.CASMgr;
-
/**
* Insert comment for enclosing_type here.
*
@@ -60,22 +59,21 @@ public class MainFrame extends JFrame {
private static final long serialVersionUID = 5606886216212480040L;
/**
- * The listener interface for receiving typeTreeSelection events.
- * The class that is interested in processing a typeTreeSelection
- * event implements this interface, and the object created
- * with that class is registered with a component using the
- * component's <code>addTypeTreeSelectionListener<code> method. When
- * the typeTreeSelection event occurs, that object's appropriate
- * method is invoked.
+ * The listener interface for receiving typeTreeSelection events. The class that is interested in
+ * processing a typeTreeSelection event implements this interface, and the object created with
+ * that class is registered with a component using the component's
+ * <code>addTypeTreeSelectionListener<code> method. When the typeTreeSelection event occurs, that
+ * object's appropriate method is invoked.
*
* @see TypeTreeSelectionEvent
*/
private class TypeTreeSelectionListener implements TreeSelectionListener {
-
+
/**
* Value changed.
*
- * @param event the event
+ * @param event
+ * the event
* @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
*/
@Override
@@ -111,7 +109,8 @@ public class MainFrame extends JFrame {
/**
* Constructor for MainFrame.
*
- * @throws HeadlessException -
+ * @throws HeadlessException
+ * -
*/
public MainFrame() {
init();
@@ -120,7 +119,8 @@ public class MainFrame extends JFrame {
/**
* Constructor for MainFrame.
*
- * @param gc the gc
+ * @param gc
+ * the gc
*/
public MainFrame(GraphicsConfiguration gc) {
super(gc);
@@ -130,8 +130,10 @@ public class MainFrame extends JFrame {
/**
* Constructor for MainFrame.
*
- * @param title the title
- * @throws HeadlessException -
+ * @param title
+ * the title
+ * @throws HeadlessException
+ * -
*/
public MainFrame(String title) {
super(title);
@@ -141,8 +143,10 @@ public class MainFrame extends JFrame {
/**
* Constructor for MainFrame.
*
- * @param title the title
- * @param gc the gc
+ * @param title
+ * the title
+ * @param gc
+ * the gc
*/
public MainFrame(String title, GraphicsConfiguration gc) {
super(title, gc);
@@ -220,7 +224,8 @@ public class MainFrame extends JFrame {
/**
* Creates the type tree.
*
- * @param type the type
+ * @param type
+ * the type
* @return the default mutable tree node
*/
private DefaultMutableTreeNode createTypeTree(org.apache.uima.cas.Type type) {
@@ -269,7 +274,8 @@ public class MainFrame extends JFrame {
/**
* Gets the tree model listeners.
*
- * @param model the model
+ * @param model
+ * the model
* @return the tree model listeners
*/
public static TreeModelListener[] getTreeModelListeners(DefaultTreeModel model) {
@@ -284,7 +290,8 @@ public class MainFrame extends JFrame {
/**
* Sets the type system.
*
- * @param ts the new type system
+ * @param ts
+ * the new type system
*/
public void setTypeSystem(TypeSystem ts) {
this.ts = ts;
@@ -294,7 +301,8 @@ public class MainFrame extends JFrame {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/AnnotationViewerDialog.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/AnnotationViewerDialog.java
index a0810cc..b3c2c3e 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/AnnotationViewerDialog.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/AnnotationViewerDialog.java
@@ -99,7 +99,6 @@ import org.w3c.dom.NodeList;
import org.w3c.dom.Text;
import org.xml.sax.SAXException;
-
/**
* Dialog that loads analyzed documents stored in XMI or XCAS format and allows them to be viewed
* using the Java-based CAS viewer or a web browser, in either an HTML/Javascript format or in the
@@ -128,7 +127,7 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/** the list of analyzed results */
JList<String> analyzedResultsList;
-
+
/** The input dir path. */
String inputDirPath = null;
@@ -155,26 +154,38 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/** The processed style map. */
private boolean processedStyleMap = false;
-
+
/** The default cas view name. */
private String defaultCasViewName = CAS.NAME_DEFAULT_SOFA;
/**
* Create an AnnotationViewer Dialog.
*
- * @param aParentFrame frame containing this panel
- * @param aDialogTitle title to display for the dialog
- * @param med the med
- * @param aStyleMapFile filename of style map to be used to view files in HTML
- * @param aPerformanceStats string representaiton of performance statistics, optional.
- * @param aTypeSystem the CAS Type System to which the XCAS files must conform.
- * @param aTypesToDisplay array of types that should be highlighted in the viewer. This can be set to the output
+ * @param aParentFrame
+ * frame containing this panel
+ * @param aDialogTitle
+ * title to display for the dialog
+ * @param med
+ * the med
+ * @param aStyleMapFile
+ * filename of style map to be used to view files in HTML
+ * @param aPerformanceStats
+ * string representaiton of performance statistics, optional.
+ * @param aTypeSystem
+ * the CAS Type System to which the XCAS files must conform.
+ * @param aTypesToDisplay
+ * array of types that should be highlighted in the viewer. This can be set to the output
* types of the Analysis Engine. A value of null means to display all types.
- * @param interactiveTempFN the interactive temp FN
- * @param javaViewerRBisSelected the java viewer R bis selected
- * @param javaViewerUCRBisSelected the java viewer UCR bis selected
- * @param xmlRBisSelected the xml R bis selected
- * @param cas the cas
+ * @param interactiveTempFN
+ * the interactive temp FN
+ * @param javaViewerRBisSelected
+ * the java viewer R bis selected
+ * @param javaViewerUCRBisSelected
+ * the java viewer UCR bis selected
+ * @param xmlRBisSelected
+ * the xml R bis selected
+ * @param cas
+ * the cas
*/
public AnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, PrefsMediator med,
File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem,
@@ -196,8 +207,8 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
// Select documents via filter. JMP
final InteractiveFilter iFilter = new InteractiveFilter(filenameFilter);
String[] documents = dir.list(iFilter);
- //create an empty array to display
- if(documents == null) {
+ // create an empty array to display
+ if (documents == null) {
documents = new String[] {};
}
@@ -207,15 +218,24 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/**
* Instantiates a new annotation viewer dialog.
*
- * @param aParentFrame the a parent frame
- * @param aDialogTitle the a dialog title
- * @param med the med
- * @param aStyleMapFile the a style map file
- * @param aPerformanceStats the a performance stats
- * @param aTypeSystem the a type system
- * @param aTypesToDisplay the a types to display
- * @param generatedStyleMap the generated style map
- * @param cas the cas
+ * @param aParentFrame
+ * the a parent frame
+ * @param aDialogTitle
+ * the a dialog title
+ * @param med
+ * the med
+ * @param aStyleMapFile
+ * the a style map file
+ * @param aPerformanceStats
+ * the a performance stats
+ * @param aTypeSystem
+ * the a type system
+ * @param aTypesToDisplay
+ * the a types to display
+ * @param generatedStyleMap
+ * the generated style map
+ * @param cas
+ * the cas
*/
public AnnotationViewerDialog(JFrame aParentFrame, String aDialogTitle, PrefsMediator med,
File aStyleMapFile, String aPerformanceStats, TypeSystem aTypeSystem,
@@ -248,8 +268,8 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/*
* File[] documents = dir.listFiles(); Vector docVector = new Vector(); for (int i = 0; i <
- * documents.length; i++) { if (documents[i].isFile()) { docVector.add(documents[i].getName()); } }
- * final JList analyzedResultsList = new JList(docVector);
+ * documents.length; i++) { if (documents[i].isFile()) { docVector.add(documents[i].getName());
+ * } } final JList analyzedResultsList = new JList(docVector);
*/
JScrollPane scrollPane = new JScrollPane();
scrollPane.getViewport().add(analyzedResultsList, null);
@@ -386,7 +406,9 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
// unwound from small anonymous inner class
@@ -430,14 +452,16 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
* Filter to not show the two interactive-mode directories in the file list.
*/
static class InteractiveFilter implements FilenameFilter {
-
+
private final String filenameFilter;
public InteractiveFilter(String filenameFilter) {
this.filenameFilter = filenameFilter;
}
-
- /* (non-Javadoc)
+
+ /*
+ * (non-Javadoc)
+ *
* @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
*/
@Override
@@ -447,14 +471,13 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
if (name.equals("interactive_out"))
return false;
if (!name.isEmpty())
- return name.contains(filenameFilter);
+ return name.contains(filenameFilter);
return true;
}
}
/**
- * Gets the name of the CAS View that will be displayed first in
- * the annotation viewer.
+ * Gets the name of the CAS View that will be displayed first in the annotation viewer.
*
* @return the default cas view name
*/
@@ -463,15 +486,16 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
}
/**
- * Sets the name of the CAS View that will be displayed first in
- * the annotation viewer. It not set, defaults to {@link CAS#NAME_DEFAULT_SOFA}.
+ * Sets the name of the CAS View that will be displayed first in the annotation viewer. It not
+ * set, defaults to {@link CAS#NAME_DEFAULT_SOFA}.
*
- * @param defaultCasViewName the new default cas view name
+ * @param defaultCasViewName
+ * the new default cas view name
*/
public void setDefaultCasViewName(String defaultCasViewName) {
this.defaultCasViewName = defaultCasViewName;
}
-
+
// Common code to launch viewer for both the Run (file-based) and
// Interactive modes
// JMP
@@ -479,15 +503,24 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/**
* Launch that viewer.
*
- * @param inputDirPath the input dir path
- * @param fileName the file name
- * @param typeSystem the type system
- * @param aTypesToDisplay the a types to display
- * @param javaViewerRBisSelected the java viewer R bis selected
- * @param javaViewerUCRBisSelected the java viewer UCR bis selected
- * @param xmlRBisSelected the xml R bis selected
- * @param styleMapFile the style map file
- * @param viewerDirectory the viewer directory
+ * @param inputDirPath
+ * the input dir path
+ * @param fileName
+ * the file name
+ * @param typeSystem
+ * the type system
+ * @param aTypesToDisplay
+ * the a types to display
+ * @param javaViewerRBisSelected
+ * the java viewer R bis selected
+ * @param javaViewerUCRBisSelected
+ * the java viewer UCR bis selected
+ * @param xmlRBisSelected
+ * the xml R bis selected
+ * @param styleMapFile
+ * the style map file
+ * @param viewerDirectory
+ * the viewer directory
*/
public void launchThatViewer(String inputDirPath, String fileName, TypeSystem typeSystem,
final String[] aTypesToDisplay, boolean javaViewerRBisSelected,
@@ -497,14 +530,14 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
File xcasFile = new File(inputDirPath, fileName);
// create a new CAS
- CAS cas = CasCreationUtils.createCas(Collections.EMPTY_LIST, typeSystem, UIMAFramework
- .getDefaultPerformanceTuningProperties());
+ CAS cas = CasCreationUtils.createCas(Collections.EMPTY_LIST, typeSystem,
+ UIMAFramework.getDefaultPerformanceTuningProperties());
// deserialize XCAS into CAS
try (InputStream xcasInStream = new FileInputStream(xcasFile)) {
XmlCasDeserializer.deserialize(xcasInStream, cas, true);
}
-
- //get the specified view
+
+ // get the specified view
cas = cas.getView(this.defaultCasViewName);
// launch appropriate viewer
@@ -521,8 +554,8 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
viewer.setHiddenTypes(new String[] { "uima.cpm.FileLocation" });
// launch viewer in a new dialog
viewer.setCAS(cas);
- JDialog dialog = new JDialog(AnnotationViewerDialog.this, "Annotation Results for "
- + fileName + " in " + inputDirPath); // JMP
+ JDialog dialog = new JDialog(AnnotationViewerDialog.this,
+ "Annotation Results for " + fileName + " in " + inputDirPath); // JMP
dialog.getContentPane().add(viewer);
dialog.setSize(850, 630);
dialog.pack();
@@ -530,7 +563,8 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
} else {
CAS defaultView = cas.getView(CAS.NAME_DEFAULT_SOFA);
if (defaultView.getDocumentText() == null) {
- displayError("The HTML and XML Viewers can only view the default text document, which was not found in this CAS.");
+ displayError(
+ "The HTML and XML Viewers can only view the default text document, which was not found in this CAS.");
return;
}
// generate inline XML
@@ -576,11 +610,11 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
}
}
-
/**
* Assumes node has a text field and extracts its value. JMP
*
- * @param node the node
+ * @param node
+ * the node
* @return the text value
*/
static public String getTextValue(Node node) {
@@ -595,8 +629,10 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
/**
* Gets the first child with a given name. JMP
*
- * @param node the node
- * @param name the name
+ * @param node
+ * the node
+ * @param name
+ * the name
* @return the first child by name
*/
static public Node getFirstChildByName(Node node, String name) {
@@ -613,8 +649,10 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
* Reads in annotation-color associations from stylemap file. JMP Also reads checked value if
* present.
*
- * @param viewer the viewer
- * @param aStyleMapFile the a style map file
+ * @param viewer
+ * the viewer
+ * @param aStyleMapFile
+ * the a style map file
*/
public void getColorsForTypesFromFile(CasAnnotationViewer viewer, File aStyleMapFile) {
@@ -769,17 +807,20 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
* AnalysisEngineDescription object.
*
* @return the selected AnalysisEngineDescription, null if the user cancelled
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InvalidXMLException the invalid XML exception
- * @throws ResourceInitializationException the resource initialization exception
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ * @throws InvalidXMLException
+ * the invalid XML exception
+ * @throws ResourceInitializationException
+ * the resource initialization exception
*/
- protected AnalysisEngineDescription promptForAE() throws IOException, InvalidXMLException,
- ResourceInitializationException {
+ protected AnalysisEngineDescription promptForAE()
+ throws IOException, InvalidXMLException, ResourceInitializationException {
if (med1.getTAEfile() != null) {
File taeFile = new File(med1.getTAEfile());
XMLInputSource in = new XMLInputSource(taeFile);
- AnalysisEngineDescription aed = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(
- in);
+ AnalysisEngineDescription aed = UIMAFramework.getXMLParser()
+ .parseAnalysisEngineDescription(in);
return aed;
} else {
String taeDir = med1.getTAEfile();
@@ -797,7 +838,7 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
}
/**
- * set default look and feel.
+ * set default look and feel.
*/
private static void setLF() {
// Force SwingApp to come up in the System L&F
@@ -810,7 +851,7 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
System.err.println("Error loading " + laf + ": " + exc);
}
}
-
+
/**
* Creates the temp dir.
*
@@ -828,7 +869,7 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
*/
// image icon
static class MyListCellRenderer extends JLabel implements ListCellRenderer {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7231915634689270693L;
@@ -839,8 +880,11 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
setOpaque(true);
}
- /* (non-Javadoc)
- * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList,
+ * java.lang.Object, int, boolean, boolean)
*/
@Override
public Component getListCellRendererComponent(JList analyzedResultsList, Object value,
@@ -859,7 +903,9 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
*/
class ListMouseAdapter extends MouseAdapter {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
*/
@Override
@@ -870,9 +916,9 @@ public class AnnotationViewerDialog extends JDialog implements ActionListener {
if (fileName != null) {
analyzedResultsList.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// Start LTV here
- launchThatViewer(inputDirPath, fileName, typeSystem, typesToDisplay, javaViewerRB
- .isSelected(), javaViewerUCRB.isSelected(), xmlRB.isSelected(), styleMapFile,
- tempDir);
+ launchThatViewer(inputDirPath, fileName, typeSystem, typesToDisplay,
+ javaViewerRB.isSelected(), javaViewerUCRB.isSelected(), xmlRB.isSelected(),
+ styleMapFile, tempDir);
analyzedResultsList.setCursor(Cursor.getDefaultCursor());
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/DocumentAnalyzer.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/DocumentAnalyzer.java
index 7257f5e..044b815 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/DocumentAnalyzer.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/DocumentAnalyzer.java
@@ -99,7 +99,6 @@ import org.apache.uima.util.FileUtils;
import org.apache.uima.util.InvalidXMLException;
import org.apache.uima.util.XMLInputSource;
-
/**
* A simple GUI for the RunTextAnalysis application library. Note that currently this will only run
* under Windows since it relies on Windows-specific commands for invoking a web browser to view the
@@ -109,7 +108,7 @@ import org.apache.uima.util.XMLInputSource;
*
*/
public class DocumentAnalyzer extends JFrame implements StatusCallbackListener, ActionListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 8795969283257780425L;
@@ -117,8 +116,7 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
private static final String HELP_MESSAGE = "Instructions for using UIMA Document Analyzer:\n\n"
+ "* In the \"Input Directory\" field, either type or use the browse\n"
+ "button to select a directory containing the documents that you want\n"
- + "to analyze.\n\n"
- + "* In the \"Input File Format\" field, type or use the browse\n"
+ + "to analyze.\n\n" + "* In the \"Input File Format\" field, type or use the browse\n"
+ "button to select \"text\", \"xcas\", or \"xmi\".\n"
+ "* If using \"xmi\" or \"xcas\", check the \"Lenient\" box to indicate if it's OK if the annotator's type system doesn't define all the types or features in the input CAS.\n\n"
+ "* In the \"Output Directory\" field, either type or use the browse\n"
@@ -140,10 +138,10 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/** The input file selector. */
private FileSelector inputFileSelector;
-
+
/** The input file format combo box. */
private JComboBox inputFileFormatComboBox;
-
+
/** The lenient checkbox. */
private JCheckBox lenientCheckbox;
@@ -255,7 +253,7 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/** The using xml detagger. */
private boolean usingXmlDetagger;
-
+
/**
* Constructor. Sets up the GUI.
*/
@@ -266,9 +264,12 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Instantiates a new document analyzer.
*
- * @param outputFileSelected the output file selected
- * @param interactiveDA the interactive DA
- * @param jvucrbis the jvucrbis
+ * @param outputFileSelected
+ * the output file selected
+ * @param interactiveDA
+ * the interactive DA
+ * @param jvucrbis
+ * the jvucrbis
*/
public DocumentAnalyzer(String outputFileSelected, boolean interactiveDA, boolean jvucrbis) {
super("Document Analyzer");
@@ -341,7 +342,7 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
// Create field label captions (right-aligned JLabel):
labelInputFile = new Caption(inputString);
-
+
labelInputFileFormat = new Caption(inputFileFormatString);
labelOutputFile = new Caption(outputString);
@@ -377,63 +378,60 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
inputFileSelector.addFileSelectorListener(fsl);
inputFileSelector.addDocumentListener(dl);
-
// UIMA-2305.
-
+
lenientCheckbox = new JCheckBox("Lenient deserialization");
- lenientCheckbox.setToolTipText("Allow extra types and features in the input CAS, not defined by the annotator type system, to be ignored");
+ lenientCheckbox.setToolTipText(
+ "Allow extra types and features in the input CAS, not defined by the annotator type system, to be ignored");
lenientCheckbox.setSelected(prefsMed.getLenient());
-
+
JPanel inputFileFormatPanel = new JPanel();
inputFileFormatPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
-
+
inputFileFormatComboBox = new JComboBox(new Object[] { "text", "xmi", "xcas" });
inputFileFormatComboBox.setEditable(false);
inputFileFormatComboBox.setSelectedItem(prefsMed.getInputFileFormat());
- inputFileFormatComboBox.addActionListener(new ActionListener() {
+ inputFileFormatComboBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String inputFileFormat = (String) inputFileFormatComboBox.getSelectedItem();
- lenientCheckbox.setEnabled(
- "xcas".equalsIgnoreCase(inputFileFormat) ||
- "xmi".equalsIgnoreCase(inputFileFormat));
+ lenientCheckbox.setEnabled("xcas".equalsIgnoreCase(inputFileFormat)
+ || "xmi".equalsIgnoreCase(inputFileFormat));
}
});
-
+
String inputFileFormat = (String) inputFileFormatComboBox.getSelectedItem();
lenientCheckbox.setEnabled(
- "xcas".equalsIgnoreCase(inputFileFormat) ||
- "xmi".equalsIgnoreCase(inputFileFormat));
+ "xcas".equalsIgnoreCase(inputFileFormat) || "xmi".equalsIgnoreCase(inputFileFormat));
+
+ inputFileFormatPanel.add(inputFileFormatComboBox);
-
- inputFileFormatPanel.add(inputFileFormatComboBox);
-
inputFileFormatPanel.add(lenientCheckbox);
-
+
Map<String, Charset> charsetMap = Charset.availableCharsets();
Set<String> charsets = charsetMap.keySet();
String[] charsetArr = charsets.toArray(new String[charsets.size()]);
encodingComboBox = new JComboBox(charsetArr);
encodingComboBox.setEditable(false);
encodingComboBox.setSelectedItem(prefsMed.getEncoding());
-
+
JPanel displayEncodingFormatPanel = new JPanel();
displayEncodingFormatPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
- displayEncodingFormatPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+ displayEncodingFormatPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
displayEncodingFormatPanel.add(labelEncoding);
displayEncodingFormatPanel.add(encodingComboBox);
-
+
inputFileFormatPanel.add(displayEncodingFormatPanel);
-
+
outputFileSelector = new FileSelector(prefsMed.getOutputDir(), "Output Directory",
JFileChooser.DIRECTORIES_ONLY, browserRootDir);
// outputFileSelector.addFocusListener( tlf);
outputFileSelector.addFileSelectorListener(fsl);
outputFileSelector.addDocumentListener(dl);
- xmlFileSelector = new FileSelector(prefsMed.getTAEfile(),
- "Analysis Engine Descriptor XML file", JFileChooser.FILES_ONLY, browserRootDir);
+ xmlFileSelector = new FileSelector(prefsMed.getTAEfile(), "Analysis Engine Descriptor XML file",
+ JFileChooser.FILES_ONLY, browserRootDir);
// xmlFileSelector.addFocusListener( tlf);
xmlFileSelector.addFileSelectorListener(fsl);
xmlFileSelector.addDocumentListener(dl);
@@ -454,7 +452,6 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
languagePanel.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 2));
languagePanel.add(languageComboBox);
-
controlPanel.add(labelInputFile);
controlPanel.add(inputFileSelector);
controlPanel.add(labelInputFileFormat);
@@ -493,8 +490,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
helpMenuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent evt) {
- JOptionPane.showMessageDialog(DocumentAnalyzer.this, HELP_MESSAGE,
- "Document Analyzer Help", JOptionPane.PLAIN_MESSAGE);
+ JOptionPane.showMessageDialog(DocumentAnalyzer.this, HELP_MESSAGE, "Document Analyzer Help",
+ JOptionPane.PLAIN_MESSAGE);
}
});
@@ -594,7 +591,9 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
// View button clicked
@@ -605,8 +604,7 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
aeSpecifierFile = new File(xmlFileSelector.getSelected());
interactive = false; // prevent re-viewing temp file
showAnalysisResults(outputDirectory);
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
displayError(ex);
}
}
@@ -617,7 +615,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
* processing is complete, allows the user to view the results. JMP added arg for input text to
* analyze.
*
- * @param analysisText the analysis text
+ * @param analysisText
+ * the analysis text
*/
public void analyzeDocuments(String analysisText) {
// get field values from GUI
@@ -625,10 +624,9 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
File inputDir = new File(inputFileSelector.getSelected());
if (outputFileSelector.getSelected().length() > 0) {
- outputDirectory = new File(outputFileSelector.getSelected());
- }
- else {
- outputDirectory = null;
+ outputDirectory = new File(outputFileSelector.getSelected());
+ } else {
+ outputDirectory = null;
}
// reset file pointers in case of typed-in text. JMP
@@ -638,12 +636,12 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
inputDir = new File(tempFileDir);
if (!inputDir.exists()) {
inputDir.mkdirs();
- }
+ }
outputFileSelected = outputFileSelector.getSelected() + "/interactive_out";
prefsMed.setOutputDirForInteractiveMode(outputFileSelected, outputFileSelector.getSelected());
outputDirectory = new File(outputFileSelected);
} else {
- analysisText = null; //
+ analysisText = null; //
} // should just return
aeSpecifierFile = new File(xmlFileSelector.getSelected());
@@ -669,8 +667,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
} else if (inputDir.getName().equals("")) {
displayError("An Input Directory is Required");
} else if (!inputDir.exists()) {
- displayError("The input directory \"" + inputFileSelector.getSelected()
- + "\" does not exist.");
+ displayError(
+ "The input directory \"" + inputFileSelector.getSelected() + "\" does not exist.");
} else if (!inputDir.isDirectory()) {
displayError("The input directory (" + inputFileSelector.getSelected()
+ ") must be a directory, not a file.");
@@ -716,10 +714,11 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
filename = filename.substring(0, filename.length() - 4);
}
if (!new File(inputDir, filename).exists()) {
- int choice = JOptionPane.showConfirmDialog(DocumentAnalyzer.this, "All files in "
- + outputDirectory.getPath() + " will be deleted. These files don't "
- + "appear to match the files in the input directory. Is this OK?", "Confirm",
- JOptionPane.YES_NO_OPTION);
+ int choice = JOptionPane.showConfirmDialog(DocumentAnalyzer.this,
+ "All files in " + outputDirectory.getPath()
+ + " will be deleted. These files don't "
+ + "appear to match the files in the input directory. Is this OK?",
+ "Confirm", JOptionPane.YES_NO_OPTION);
if (choice == JOptionPane.NO_OPTION) {
return;
} else {
@@ -740,8 +739,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
// start separate thread to do component initialization and
// processing
- ProcessingThread thread = new ProcessingThread(inputDir, inputFileFormat, lenient, outputDirectory, aeSpecifierFile,
- xmlTag, language, encoding);
+ ProcessingThread thread = new ProcessingThread(inputDir, inputFileFormat, lenient,
+ outputDirectory, aeSpecifierFile, xmlTag, language, encoding);
thread.start();
}
}
@@ -761,8 +760,10 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Entity process complete.
*
- * @param aCas the a cas
- * @param aStatus the a status
+ * @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)
*/
@@ -881,7 +882,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Show analysis results.
*
- * @param aOutputDir the a output dir
+ * @param aOutputDir
+ * the a output dir
*/
// this call is used when you click the "View" button
public void showAnalysisResults(File aOutputDir) {
@@ -894,10 +896,10 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
}
statsString = null;
-
+
// Not sure if the following code makes sense... If a style map file exists,
// this restricts the set of types displayed by the viewer to only the types
- // in that file. But why is this only done in "View" mode? It seems like this
+ // in that file. But why is this only done in "View" mode? It seems like this
// belongs in AnnotationViewerDialog with the other code that sets up the
// viewer (e.g., the colors) from the style map file.
if (prefsMed.getStylemapFile().exists()) {
@@ -917,16 +919,20 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
* Creates a CAS from an descriptor. Supports both local AE descriptors and remote service
* specifiers. In the latter case the service is contacted to obtain its type system.
*
- * @param aDescriptorFile the a descriptor file
+ * @param aDescriptorFile
+ * the a descriptor file
* @return the cas
- * @throws ResourceInitializationException -
- * @throws InvalidXMLException -
- * @throws IOException -
+ * @throws ResourceInitializationException
+ * -
+ * @throws InvalidXMLException
+ * -
+ * @throws IOException
+ * -
*/
protected CAS createCasFromDescriptor(String aDescriptorFile) // JMP
throws ResourceInitializationException, InvalidXMLException, IOException {
- ResourceSpecifier spec = UIMAFramework.getXMLParser().parseResourceSpecifier(
- new XMLInputSource(aDescriptorFile));
+ ResourceSpecifier spec = UIMAFramework.getXMLParser()
+ .parseResourceSpecifier(new XMLInputSource(aDescriptorFile));
if (spec instanceof AnalysisEngineDescription) {
return CasCreationUtils.createCas((AnalysisEngineDescription) spec);
} else {
@@ -938,7 +944,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Read stylemap file.
*
- * @param smapFile the smap file
+ * @param smapFile
+ * the smap file
* @return the string
*/
protected String readStylemapFile(File smapFile) // JMP
@@ -960,7 +967,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Show analysis.
*
- * @param outputDir the output dir
+ * @param outputDir
+ * the output dir
*/
private void show_analysis(File outputDir) {
File styleMapFile = getStyleMapFile();
@@ -980,9 +988,9 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
} else {
// this version of the AnnotationViewerDialog constructor does
// not automatically launch the viewer.
- AnnotationViewerDialog viewerDialog = new AnnotationViewerDialog(this,
- "Analysis Results", prefsMed, styleMapFile, statsString, currentTypeSystem,
- currentTaeOutputTypes, useGeneratedStyleMap, cas);
+ AnnotationViewerDialog viewerDialog = new AnnotationViewerDialog(this, "Analysis Results",
+ prefsMed, styleMapFile, statsString, currentTypeSystem, currentTaeOutputTypes,
+ useGeneratedStyleMap, cas);
if (usingXmlDetagger) {
viewerDialog.setDefaultCasViewName("plainTextDocument");
}
@@ -1080,7 +1088,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Runs the application.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
public static void main(String[] args) {
final DocumentAnalyzer frame = new DocumentAnalyzer();
@@ -1095,7 +1104,7 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
* Class for dialog in which user types in text to be analyzed, and sets browser parameters.
*/
class TextAreaViewer extends JPanel {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -7503162930412929062L;
@@ -1105,8 +1114,10 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Constructor for dialog.
*
- * @param aiDialog the ai dialog
- * @param generatedStyleMap the generated style map
+ * @param aiDialog
+ * the ai dialog
+ * @param generatedStyleMap
+ * the generated style map
*/
public TextAreaViewer(final JDialog aiDialog, boolean generatedStyleMap) {
@@ -1151,10 +1162,9 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
if (generatedStyleMap) {
javaViewerRB.setSelected(true);
- }
- else {
+ } else {
javaViewerUCRB.setSelected(true);
- }
+ }
ButtonGroup displayFormatButtonGroup = new ButtonGroup();
displayFormatButtonGroup.add(javaViewerRB);
@@ -1232,27 +1242,36 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Run processing thread.
*
- * @param inputDir the input dir
- * @param inputFileFormat the input file format
- * @param lenient the lenient
- * @param outputDir the output dir
- * @param aeSpecifierFile the ae specifier file
- * @param xmlTag the xml tag
- * @param language the language
- * @param encoding the encoding
+ * @param inputDir
+ * the input dir
+ * @param inputFileFormat
+ * the input file format
+ * @param lenient
+ * the lenient
+ * @param outputDir
+ * the output dir
+ * @param aeSpecifierFile
+ * the ae specifier file
+ * @param xmlTag
+ * the xml tag
+ * @param language
+ * the language
+ * @param encoding
+ * the encoding
*/
- public void runProcessingThread(File inputDir, String inputFileFormat, Boolean lenient, File outputDir, File aeSpecifierFile,
- String xmlTag, String language, String encoding) {
+ public void runProcessingThread(File inputDir, String inputFileFormat, Boolean lenient,
+ File outputDir, File aeSpecifierFile, String xmlTag, String language, String encoding) {
try {
// create and configure collection reader that will read input docs
CollectionReaderDescription collectionReaderDesc = FileSystemCollectionReader
.getDescription();
ConfigurationParameterSettings paramSettings = collectionReaderDesc.getMetaData()
.getConfigurationParameterSettings();
- paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR, inputDir
- .getAbsolutePath());
+ paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_INPUTDIR,
+ inputDir.getAbsolutePath());
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_XCAS, inputFileFormat);
- paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_LENIENT, lenient ? "true" : "false");
+ paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_LENIENT,
+ lenient ? "true" : "false");
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_LANGUAGE, language);
paramSettings.setParameterValue(FileSystemCollectionReader.PARAM_ENCODING, encoding);
collectionReader = (FileSystemCollectionReader) UIMAFramework
@@ -1289,8 +1308,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
CasConsumerDescription casConsumerDesc = XmiWriterCasConsumer.getDescription();
ConfigurationParameterSettings consumerParamSettings = casConsumerDesc.getMetaData()
.getConfigurationParameterSettings();
- consumerParamSettings.setParameterValue(XmiWriterCasConsumer.PARAM_OUTPUTDIR, outputDir
- .getAbsolutePath());
+ consumerParamSettings.setParameterValue(XmiWriterCasConsumer.PARAM_OUTPUTDIR,
+ outputDir.getAbsolutePath());
// declare uima.cas.TOP as an input so that ResultSpec on user's AE will be set to produce all
// types
casConsumerDesc.getCasConsumerMetaData().getCapabilities()[0].addInputType("uima.cas.TOP",
@@ -1304,58 +1323,57 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
.getConfigurationParameterSettings();
xmlDetaggerParamSettings.setParameterValue(XmlDetagger.PARAM_TEXT_TAG, xmlTag);
usingXmlDetagger = true;
- }
- else {
+ } else {
usingXmlDetagger = false;
}
-
+
// create an aggregate AE that includes the XmlDetagger (if needed), followed by
- //th user's AE descriptor, followed by the XMI Writer CAS Consumer, using fixed flow.
- // We use an aggregate AE here, rather than just adding the CAS Consumer to the CPE, so
- //that we can support the user's AE being a CAS Multiplier and we can specify sofa mappings.
+ // th user's AE descriptor, followed by the XMI Writer CAS Consumer, using fixed flow.
+ // We use an aggregate AE here, rather than just adding the CAS Consumer to the CPE, so
+ // that we can support the user's AE being a CAS Multiplier and we can specify sofa mappings.
AnalysisEngineDescription aggDesc = UIMAFramework.getResourceSpecifierFactory()
.createAnalysisEngineDescription();
aggDesc.setPrimitive(false);
aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("UserAE", aeSpecifier);
aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("XmiWriter", casConsumerDesc);
- FixedFlow flow = UIMAFramework.getResourceSpecifierFactory().createFixedFlow();
-
+ FixedFlow flow = UIMAFramework.getResourceSpecifierFactory().createFixedFlow();
+
if (xmlDetaggerDesc != null) {
- aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("XmlDetagger", xmlDetaggerDesc);
- flow.setFixedFlow(new String[] {"XmlDetagger", "UserAE", "XmiWriter"});
-
- //to run XmlDetagger we need sofa mappings
- //XmlDetagger's "xmlDocument" input sofa gets mapped to the default sofa
+ aggDesc.getDelegateAnalysisEngineSpecifiersWithImports().put("XmlDetagger",
+ xmlDetaggerDesc);
+ flow.setFixedFlow(new String[] { "XmlDetagger", "UserAE", "XmiWriter" });
+
+ // to run XmlDetagger we need sofa mappings
+ // XmlDetagger's "xmlDocument" input sofa gets mapped to the default sofa
SofaMapping sofaMapping1 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping();
sofaMapping1.setComponentKey("XmlDetagger");
sofaMapping1.setComponentSofaName("xmlDocument");
sofaMapping1.setAggregateSofaName(CAS.NAME_DEFAULT_SOFA);
-
- //for UserAE and XmiWriter, may default sofa to the "plainTextDocument" produced by the XmlDetagger
+
+ // for UserAE and XmiWriter, may default sofa to the "plainTextDocument" produced by the
+ // XmlDetagger
SofaMapping sofaMapping2 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping();
sofaMapping2.setComponentKey("UserAE");
sofaMapping2.setAggregateSofaName("plainTextDocument");
SofaMapping sofaMapping3 = UIMAFramework.getResourceSpecifierFactory().createSofaMapping();
sofaMapping3.setComponentKey("XmiWriter");
sofaMapping3.setAggregateSofaName("plainTextDocument");
-
- aggDesc.setSofaMappings(new SofaMapping[] {sofaMapping1, sofaMapping2, sofaMapping3});
- }
- else {
- //no XML detagger needed in the aggregate in flow
- flow.setFixedFlow(new String[] { "UserAE", "XmiWriter" });
+
+ aggDesc.setSofaMappings(new SofaMapping[] { sofaMapping1, sofaMapping2, sofaMapping3 });
+ } else {
+ // no XML detagger needed in the aggregate in flow
+ flow.setFixedFlow(new String[] { "UserAE", "XmiWriter" });
}
-
aggDesc.getAnalysisEngineMetaData().setName("DocumentAnalyzerAE");
aggDesc.getAnalysisEngineMetaData().setFlowConstraints(flow);
- aggDesc.getAnalysisEngineMetaData().getOperationalProperties().setMultipleDeploymentAllowed(
- false);
+ aggDesc.getAnalysisEngineMetaData().getOperationalProperties()
+ .setMultipleDeploymentAllowed(false);
progressMonitor.setProgress(1);
// instantiate AE
// keep this a local variable - so it doesn't hang on to the ae object
- // preventing gc (some ae objects are huge)
+ // preventing gc (some ae objects are huge)
AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(aggDesc);
mCPM.setAnalysisEngine(ae);
@@ -1419,12 +1437,11 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
} catch (Throwable t) {
// special check for using XML detagger with remotes, which will generate an error
// since sofa mappings aren't supported for remotes
- if (usingXmlDetagger
- && (t instanceof UIMAException)
- && ((UIMAException) t)
- .hasMessageKey(ResourceInitializationException.SOFA_MAPPING_NOT_SUPPORTED_FOR_REMOTE)) {
- displayError("The XML detagging feature is not supported for remote Analysis Engines or for Aggregates containing remotes. "
- + "If you are running a remote Analysis Engine the \"XML Tag Containing Text\" field must be left blank.");
+ if (usingXmlDetagger && (t instanceof UIMAException) && ((UIMAException) t).hasMessageKey(
+ ResourceInitializationException.SOFA_MAPPING_NOT_SUPPORTED_FOR_REMOTE)) {
+ displayError(
+ "The XML detagging feature is not supported for remote Analysis Engines or for Aggregates containing remotes. "
+ + "If you are running a remote Analysis Engine the \"XML Tag Containing Text\" field must be left blank.");
} else {
displayError(t);
}
@@ -1436,13 +1453,13 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
* The Class ProcessingThread.
*/
class ProcessingThread extends Thread {
-
+
/** The input dir. */
File inputDir;
/** The input file format. */
String inputFileFormat;
-
+
/** The output dir. */
File outputDir;
@@ -1457,24 +1474,32 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/** The encoding. */
String encoding;
-
+
/** The lenient. */
Boolean lenient;
/**
* Instantiates a new processing thread.
*
- * @param inputDir the input dir
- * @param inputFileFormat the input file format
- * @param lenient the lenient
- * @param outputDir the output dir
- * @param taeSpecifierFile the tae specifier file
- * @param xmlTag the xml tag
- * @param language the language
- * @param encoding the encoding
+ * @param inputDir
+ * the input dir
+ * @param inputFileFormat
+ * the input file format
+ * @param lenient
+ * the lenient
+ * @param outputDir
+ * the output dir
+ * @param taeSpecifierFile
+ * the tae specifier file
+ * @param xmlTag
+ * the xml tag
+ * @param language
+ * the language
+ * @param encoding
+ * the encoding
*/
- ProcessingThread(File inputDir, String inputFileFormat, Boolean lenient, File outputDir, File taeSpecifierFile, String xmlTag,
- String language, String encoding) {
+ ProcessingThread(File inputDir, String inputFileFormat, Boolean lenient, File outputDir,
+ File taeSpecifierFile, String xmlTag, String language, String encoding) {
this.inputDir = inputDir;
this.inputFileFormat = inputFileFormat;
this.outputDir = outputDir;
@@ -1485,14 +1510,17 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
this.lenient = lenient;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Thread#run()
*/
@Override
public void run() {
// Code moved outside class to make accessible by programs that call
// DocumentAnalyzer. JMP
- runProcessingThread(inputDir, inputFileFormat, lenient, outputDir, taeSpecifierFile, xmlTag, language, encoding);
+ runProcessingThread(inputDir, inputFileFormat, lenient, outputDir, taeSpecifierFile, xmlTag,
+ language, encoding);
}
}
@@ -1511,7 +1539,8 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
/**
* Sets the style map file.
*
- * @param styleMapFile The styleMapFile to set.
+ * @param styleMapFile
+ * The styleMapFile to set.
*/
public void setStyleMapFile(File styleMapFile) {
this.userStyleMapFile = styleMapFile;
@@ -1522,9 +1551,9 @@ public class DocumentAnalyzer extends JFrame implements StatusCallbackListener,
*
* @see java.awt.Component#getPreferredSize()
*/
-// @Override
-// public Dimension getPreferredSize() {
-// return new Dimension(800, 350);
-// }
+ // @Override
+ // public Dimension getPreferredSize() {
+ // return new Dimension(800, 350);
+ // }
}
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelector.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelector.java
index a6627f3..1fa4422 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelector.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelector.java
@@ -39,7 +39,6 @@ import javax.swing.SwingUtilities;
import javax.swing.event.DocumentListener;
import javax.swing.filechooser.FileFilter;
-
/**
*
*
@@ -48,7 +47,7 @@ import javax.swing.filechooser.FileFilter;
*/
public class FileSelector extends JPanel implements FocusListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = -8710960143421949274L;
@@ -73,9 +72,12 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Instantiates a new file selector.
*
- * @param initialValue the initial value
- * @param fileChooserTitle the file chooser title
- * @param selectionMode the selection mode
+ * @param initialValue
+ * the initial value
+ * @param fileChooserTitle
+ * the file chooser title
+ * @param selectionMode
+ * the selection mode
*/
public FileSelector(String initialValue, String fileChooserTitle, int selectionMode) // Can be
// either
@@ -89,10 +91,14 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Instantiates a new file selector.
*
- * @param initialValue the initial value
- * @param fileChooserTitle the file chooser title
- * @param selectionMode the selection mode
- * @param currentDir the current dir
+ * @param initialValue
+ * the initial value
+ * @param fileChooserTitle
+ * the file chooser title
+ * @param selectionMode
+ * the selection mode
+ * @param currentDir
+ * the current dir
*/
public FileSelector(String initialValue, String fileChooserTitle, int selectionMode, // Can be
// either
@@ -213,13 +219,16 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Adds the file selector listener.
*
- * @param aFileSelectorListener the a file selector listener
+ * @param aFileSelectorListener
+ * the a file selector listener
*/
public void addFileSelectorListener(FileSelectorListener aFileSelectorListener) {
this.fileSelectorListener = aFileSelectorListener;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.Component#addFocusListener(java.awt.event.FocusListener)
*/
// added this to make focus change available to mediator
@@ -232,7 +241,8 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Adds the choosable file filter.
*
- * @param ff the ff
+ * @param ff
+ * the ff
*/
public void addChoosableFileFilter(FileFilter ff) {
fileChooser.addChoosableFileFilter(ff);
@@ -250,7 +260,8 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Sets the selected.
*
- * @param s the new selected
+ * @param s
+ * the new selected
*/
public void setSelected(String s) {
s = s.trim();
@@ -267,7 +278,9 @@ public class FileSelector extends JPanel implements FocusListener {
}
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.JComponent#setEnabled(boolean)
*/
@Override
@@ -287,20 +300,23 @@ public class FileSelector extends JPanel implements FocusListener {
* The Class BrowseButton.
*/
static class BrowseButton extends JButton {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 7366026783079468609L;
/**
* Instantiates a new browse button.
*
- * @param s the s
+ * @param s
+ * the s
*/
public BrowseButton(String s) {
super(s);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see javax.swing.JComponent#getInsets()
*/
@Override
@@ -332,7 +348,8 @@ public class FileSelector extends JPanel implements FocusListener {
}
File file = new File(path);
- if (this.fileChooser.getFileSelectionMode() == JFileChooser.FILES_ONLY && file.isDirectory()) {
+ if (this.fileChooser.getFileSelectionMode() == JFileChooser.FILES_ONLY
+ && file.isDirectory()) {
this.fileChooser.setCurrentDirectory(file);
} else {
this.fileChooser.setSelectedFile(file);
@@ -347,7 +364,8 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Adds the document listener.
*
- * @param l the l
+ * @param l
+ * the l
*/
/*
* (non-Javadoc)
@@ -361,7 +379,8 @@ public class FileSelector extends JPanel implements FocusListener {
/**
* Removes the document listener.
*
- * @param l the l
+ * @param l
+ * the l
*/
/*
* (non-Javadoc)
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelectorListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelectorListener.java
index d170b6c..500e1bf 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelectorListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/FileSelectorListener.java
@@ -21,25 +21,23 @@ package org.apache.uima.tools.docanalyzer;
import javax.swing.JComponent;
-
/**
- * The listener interface for receiving fileSelector events.
- * The class that is interested in processing a fileSelector
- * event implements this interface, and the object created
- * with that class is registered with a component using the
- * component's <code>addFileSelectorListener</code> method. When
- * the fileSelector event occurs, that object's appropriate
- * method is invoked.
+ * The listener interface for receiving fileSelector events. The class that is interested in
+ * processing a fileSelector event implements this interface, and the object created with that class
+ * is registered with a component using the component's <code>addFileSelectorListener</code> method.
+ * When the fileSelector event occurs, that object's appropriate method is invoked.
*
-// * @see FileSelectorEvent
+ * // * @see FileSelectorEvent
*/
public interface FileSelectorListener {
-
+
/**
* File selected.
*
- * @param source the source
- * @param fileString the file string
+ * @param source
+ * the source
+ * @param fileString
+ * the file string
* @return true, if successful
*/
boolean fileSelected(JComponent source, String fileString);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/PrefsMediator.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/PrefsMediator.java
index cb38133..a51e169 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/PrefsMediator.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/PrefsMediator.java
@@ -29,7 +29,6 @@ import java.util.prefs.Preferences;
import javax.swing.JButton;
-
/**
* The Class PrefsMediator.
*/
@@ -67,7 +66,7 @@ public class PrefsMediator {
/** The input file format. */
private String inputFileFormat;
-
+
/** The language. */
private String language;
@@ -79,7 +78,7 @@ public class PrefsMediator {
/** The xml tag. */
private String xmlTag;
-
+
/** The lenient. */
private boolean lenient;
@@ -92,7 +91,7 @@ public class PrefsMediator {
/** The Constant INPUTFILEFORMAT. */
private static final String INPUTFILEFORMAT = "inputFileFormat";
-
+
/** The Constant LANGUAGE. */
private static final String LANGUAGE = "language";
@@ -104,10 +103,10 @@ public class PrefsMediator {
/** The Constant INDIR. */
private static final String INDIR = "inDir";
-
+
/** The Constant XMLTAG. */
private static final String XMLTAG = "xmlTag";
-
+
/** The Constant LENIENT. */
private static final String LENIENT = "lenient";
@@ -163,7 +162,8 @@ public class PrefsMediator {
/**
* Sets the input dir.
*
- * @param inputDir The inputDir to set.
+ * @param inputDir
+ * The inputDir to set.
*/
public void setInputDir(String inputDir) {
this.inputDir = inputDir;
@@ -183,7 +183,8 @@ public class PrefsMediator {
/**
* Sets the output dir.
*
- * @param outputDir The outputDir to set.
+ * @param outputDir
+ * The outputDir to set.
*/
public void setOutputDir(String outputDir) {
this.outputDir = outputDir;
@@ -251,11 +252,12 @@ public class PrefsMediator {
}
/**
- * Gets index of last file separator character in a file path.
- * Supports File.separator but also / on Windows.
+ * Gets index of last file separator character in a file path. Supports File.separator but also /
+ * on Windows.
*
- * @param path the path
- * @return index of the last file separator char. Returns -1 if none.
+ * @param path
+ * the path
+ * @return index of the last file separator char. Returns -1 if none.
*/
private int indexOfLastFileSeparator(String path) {
int index = path.lastIndexOf(File.separator);
@@ -268,7 +270,8 @@ public class PrefsMediator {
/**
* Sets the TA efile.
*
- * @param edir set the TAE directory
+ * @param edir
+ * set the TAE directory
*/
public void setTAEfile(String edir) {
taeDir = edir;
@@ -287,13 +290,14 @@ public class PrefsMediator {
/**
* Sets the encoding.
*
- * @param encoding The encoding to set.
+ * @param encoding
+ * The encoding to set.
*/
public void setEncoding(String encoding) {
this.encoding = encoding;
prefs.put(ENCODING, encoding);
}
-
+
/**
* Gets the input file format.
*
@@ -306,7 +310,8 @@ public class PrefsMediator {
/**
* Sets the input file format.
*
- * @param inputFileFormat The input file format to set.
+ * @param inputFileFormat
+ * The input file format to set.
*/
public void setInputFileFormat(String inputFileFormat) {
this.inputFileFormat = inputFileFormat;
@@ -325,7 +330,8 @@ public class PrefsMediator {
/**
* Sets the language.
*
- * @param language The language to set.
+ * @param language
+ * The language to set.
*/
public void setLanguage(String language) {
this.language = language;
@@ -344,7 +350,8 @@ public class PrefsMediator {
/**
* Sets the view type.
*
- * @param viewType The view type to set.
+ * @param viewType
+ * The view type to set.
*/
public void setViewType(String viewType) {
this.viewType = viewType;
@@ -363,7 +370,8 @@ public class PrefsMediator {
/**
* Sets the xml tag.
*
- * @param xmlTag The xmlTag to set.
+ * @param xmlTag
+ * The xmlTag to set.
*/
public void setXmlTag(String xmlTag) {
this.xmlTag = xmlTag;
@@ -382,15 +390,16 @@ public class PrefsMediator {
/**
* Sets the lenient.
*
- * @param lenient The lenient to set.
+ * @param lenient
+ * The lenient to set.
*/
public void setLenient(Boolean lenient) {
this.lenient = lenient;
prefs.putBoolean(LENIENT, lenient);
}
-
+
/**
- * returns the new edited stylemap file.
+ * returns the new edited stylemap file.
*
* @return the stylemap file
*/
@@ -402,9 +411,12 @@ public class PrefsMediator {
/**
* Sets the doc buttons.
*
- * @param run the run
- * @param inter the inter
- * @param view the view
+ * @param run
+ * the run
+ * @param inter
+ * the inter
+ * @param view
+ * the view
*/
// gets copies of buttonreference se it can mediate their on-ness
public void setDocButtons(JButton run, JButton inter, JButton view) {
@@ -418,9 +430,12 @@ public class PrefsMediator {
/**
* Sets the file selectors.
*
- * @param input the input
- * @param output the output
- * @param xml the xml
+ * @param input
+ * the input
+ * @param output
+ * the output
+ * @param xml
+ * the xml
*/
// sets the File Seelctors
public void setFileSelectors(FileSelector input, FileSelector output, FileSelector xml) {
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfDocumentListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfDocumentListener.java
index 415a2cc..f682810 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfDocumentListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfDocumentListener.java
@@ -22,22 +22,22 @@ package org.apache.uima.tools.docanalyzer;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
-
/**
* * This class tells the Mediator to check the length of the 3 text fields and adjust whether the 3
* buttons are enabeld or not.
*
-// * @see TfDocumentEvent
+ * // * @see TfDocumentEvent
*/
public class TfDocumentListener implements DocumentListener {
-
+
/** The med. */
private PrefsMediator med;
/**
* Instantiates a new tf document listener.
*
- * @param med the med
+ * @param med
+ * the med
*/
public TfDocumentListener(PrefsMediator med) {
this.med = med;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFileSelectorListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFileSelectorListener.java
index 4e5efe8..446a8bf 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFileSelectorListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFileSelectorListener.java
@@ -21,22 +21,22 @@ package org.apache.uima.tools.docanalyzer;
import javax.swing.JComponent;
-
/**
* * This class tells the Mediator to check the length of the 3 text fields and adjust whether the 3
* buttons are enabeld or not.
*
-// * @see TfFileSelectorEvent
+ * // * @see TfFileSelectorEvent
*/
public class TfFileSelectorListener implements FileSelectorListener {
-
+
/** The med. */
private PrefsMediator med;
/**
* Instantiates a new tf file selector listener.
*
- * @param med the med
+ * @param med
+ * the med
*/
public TfFileSelectorListener(PrefsMediator med) {
this.med = med;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFocusListener.java b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFocusListener.java
index faabb09..009bb28 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFocusListener.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/docanalyzer/TfFocusListener.java
@@ -22,22 +22,22 @@ package org.apache.uima.tools.docanalyzer;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
-
/**
* This class tells the Mediator to check the lenght of the 3 text fields and adjust whether the 3
* buttons are enabeld or not.
*
-// * @see TfFocusEvent
+ * // * @see TfFocusEvent
*/
public class TfFocusListener implements FocusListener {
-
+
/** The med. */
private PrefsMediator med;
/**
* Instantiates a new tf focus listener.
*
- * @param med the med
+ * @param med
+ * the med
*/
public TfFocusListener(PrefsMediator med) {
this.med = med;
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GUI.java b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GUI.java
index 846c63e..304909d 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GUI.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GUI.java
@@ -46,12 +46,11 @@ import javax.swing.UnsupportedLookAndFeelException;
import org.apache.uima.tools.images.Images;
import org.apache.uima.tools.util.gui.AboutDialog;
-
/**
* The Class GUI.
*/
public class GUI extends JFrame {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
@@ -71,7 +70,7 @@ public class GUI extends JFrame {
* The Class G.
*/
class G extends JPanel implements ActionListener {
-
+
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
@@ -144,7 +143,8 @@ public class GUI extends JFrame {
/**
* Instantiates a new g.
*
- * @param gui the gui
+ * @param gui
+ * the gui
*/
public G(GUI gui) {
this.gui = gui;
@@ -261,7 +261,9 @@ public class GUI extends JFrame {
add(lbResult);
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
*/
@Override
@@ -284,7 +286,8 @@ public class GUI extends JFrame {
/**
* Browse file.
*
- * @param f the f
+ * @param f
+ * the f
*/
void browseFile(JTextArea f) {
String startingDir = f.getText();
@@ -306,7 +309,8 @@ public class GUI extends JFrame {
/**
* Browse dir.
*
- * @param f the f
+ * @param f
+ * the f
*/
void browseDir(JTextArea f) {
String startingDir = f.getText();
@@ -345,13 +349,14 @@ public class GUI extends JFrame {
/**
* Show in status.
*
- * @param message the message
+ * @param message
+ * the message
* @return the string
*/
String showInStatus(String message) {
taStatus.setText(taStatus.getText() + message + NL);
- areaScrollPane.getVerticalScrollBar().setValue(
- areaScrollPane.getVerticalScrollBar().getMaximum());
+ areaScrollPane.getVerticalScrollBar()
+ .setValue(areaScrollPane.getVerticalScrollBar().getMaximum());
gui.repaint();
return message;
}
@@ -363,7 +368,8 @@ public class GUI extends JFrame {
/**
* The main method.
*
- * @param args the arguments
+ * @param args
+ * the arguments
*/
// for testing only
public static void main(String args[]) {
@@ -380,7 +386,8 @@ public class GUI extends JFrame {
/**
* Instantiates a new gui.
*
- * @param jg the jg
+ * @param jg
+ * the jg
*/
public GUI(Jg jg) {
super("JCasGen");
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiErrorImpl.java b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiErrorImpl.java
index 4c27270..2259e60 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiErrorImpl.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiErrorImpl.java
@@ -27,12 +27,11 @@ import org.apache.uima.tools.jcasgen.Jg.ErrorExit;
import org.apache.uima.util.Level;
import org.apache.uima.util.Logger;
-
/**
* The Class GuiErrorImpl.
*/
public class GuiErrorImpl implements IError {
-
+
/** The sev msg. */
private static String[] sevMsg = new String[] { "Info", "Warning", "Error" };
@@ -47,8 +46,8 @@ public class GuiErrorImpl implements IError {
@Override
public void newError(int severity, String message, Exception exception) {
Logger log = UIMAFramework.getLogger();
- log.log(logLevels[severity], GUI.theGUI.pnG.showInStatus("JCasGen " + sevMsg[severity] + ": "
- + message), exception);
+ log.log(logLevels[severity],
+ GUI.theGUI.pnG.showInStatus("JCasGen " + sevMsg[severity] + ": " + message), exception);
if (null != exception) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
PrintStream ps = new PrintStream(b);
diff --git a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiProgressMonitor.java b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiProgressMonitor.java
index a9fc159..f12dde5 100644
--- a/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiProgressMonitor.java
+++ b/uimaj-tools/src/main/java/org/apache/uima/tools/jcasgen/GuiProgressMonitor.java
@@ -22,20 +22,23 @@ package org.apache.uima.tools.jcasgen;
... 7236 lines suppressed ...