You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by sc...@apache.org on 2016/11/13 16:08:26 UTC
svn commit: r1769510 [8/8] - in /uima/uimaj/branches/experiment-v3-jcas:
uimaj-adapter-soap/src/main/java/org/apache/uima/adapter/soap/
uimaj-adapter-soap/src/main/java/org/apache/uima/adapter/soap/axis11/
uimaj-component-test-util/src/main/java/org/ap...
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewer.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewer.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewer.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewer.java Sun Nov 13 16:08:24 2016
@@ -62,6 +62,7 @@ import org.apache.uima.tools.images.Imag
import org.apache.uima.util.FileUtils;
import org.apache.uima.util.XMLInputSource;
+// TODO: Auto-generated Javadoc
/**
* A GUI that displays annotation results in a Swing tree viewer. This class extends {@link JPanel}
* and so can be reused within any Swing application.
@@ -69,13 +70,14 @@ import org.apache.uima.util.XMLInputSour
*/
public class CasTreeViewer extends JPanel {
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = -674412767134245565L;
/**
* Creates a CAS Tree Viewer.
- *
- * @param aCAS
- * the CAS containing the annotations to be displayed in the tree viewer GUI
+ *
+ * @param aCAS the CAS containing the annotations to be displayed in the tree viewer GUI
+ * @throws CASException the CAS exception
*/
public CasTreeViewer(CAS aCAS) throws CASException {
super();
@@ -108,6 +110,7 @@ public class CasTreeViewer extends JPane
// add an event handler to catch tree selection changes and update the table
tree.addTreeSelectionListener(new TreeSelectionListener() {
+ @Override
public void valueChanged(TreeSelectionEvent aEvent) {
TreePath selPath = tree.getSelectionPath();
if (selPath != null) {
@@ -228,11 +231,10 @@ public class CasTreeViewer extends JPane
/**
* Builds a tree from a CAS.
- *
- * @param aRootNode
- * an existing root node for the tree
- * @param aCAS
- * CAS from which annotations will be extracted
+ *
+ * @param aCAS CAS from which annotations will be extracted
+ * @return the tree node
+ * @throws CASException the CAS exception
*/
private TreeNode buildTree(CAS aCAS) throws CASException {
// get iterator over all annotations
@@ -357,6 +359,7 @@ public class CasTreeViewer extends JPane
frame.pack();
frame.show();
frame.addWindowListener(new WindowAdapter() {
+ @Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
@@ -372,11 +375,9 @@ public class CasTreeViewer extends JPane
* Gets text to be processed by the TAE. If the document contains XML tags named TEXT like this:
* <code><TEXT%gt;Process this text.</TEXT%gt;</code>, then only the text within those
* tags is returned. Otherwise the whole document is returned.
- *
- * @param aFile
- * file to process
- * @param aTAE
- * Text Analysis Engine that will process the file
+ *
+ * @param text the text
+ * @return the text
*/
static private String getText(String text) {
int start = text.indexOf("<TEXT>");
@@ -397,8 +398,12 @@ public class CasTreeViewer extends JPane
}
/**
+ * Sets the size.
+ *
+ * @param d the new size
* @see java.awt.Component#setSize(Dimension)
*/
+ @Override
public void setSize(Dimension d) {
super.setSize(d);
Insets insets = getInsets();
@@ -409,23 +414,35 @@ public class CasTreeViewer extends JPane
splitPane.setSize(paneSize);
}
+ /** The split pane. */
// GUI components
private JSplitPane splitPane;
+ /** The tree. */
private JTree tree;
+ /** The right panel. */
private JPanel rightPanel;
+ /** The annotation type label. */
private JLabel annotationTypeLabel;
+ /** The annotation text pane. */
private JTextPane annotationTextPane;
+ /** The feature table. */
private JTable featureTable;
/**
* Inner class containing data for a node in the tree.
*/
static class AnnotationTreeNodeObject {
+
+ /**
+ * Instantiates a new annotation tree node object.
+ *
+ * @param aAnnotation the a annotation
+ */
public AnnotationTreeNodeObject(AnnotationFS aAnnotation) {
mAnnotation = aAnnotation;
mCaption = aAnnotation.getCoveredText();
@@ -434,16 +451,27 @@ public class CasTreeViewer extends JPane
}
+ /**
+ * Gets the annotation.
+ *
+ * @return the annotation
+ */
public AnnotationFS getAnnotation() {
return mAnnotation;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
public String toString() {
return mCaption;
}
+ /** The m annotation. */
private AnnotationFS mAnnotation;
+ /** The m caption. */
private String mCaption;
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewerApplet.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewerApplet.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewerApplet.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/CasTreeViewerApplet.java Sun Nov 13 16:08:24 2016
@@ -37,6 +37,7 @@ import org.apache.uima.cas.impl.CASCompl
import org.apache.uima.cas.impl.Serialization;
import org.apache.uima.internal.util.SerializationUtils;
+// TODO: Auto-generated Javadoc
/**
* The CasTreeViewer as an Applet.
*
@@ -44,14 +45,16 @@ import org.apache.uima.internal.util.Ser
*/
public class CasTreeViewerApplet extends JApplet {
+ /** The Constant serialVersionUID. */
private static final long serialVersionUID = 7539612752281789849L;
- /** The CAS Tree Viewer panel */
+ /** The CAS Tree Viewer panel. */
private CasTreeViewer mTreeViewer;
/**
* Called when the applet is initialized.
*/
+ @Override
public void init() {
try {
// get applet parameter - URL from which to get the CAS
@@ -119,8 +122,15 @@ public class CasTreeViewerApplet extends
/**
* A listener for detecting resize events. Sets the size of the TreeViewer panel whenever the
* applet's size changes.
+ *
+ * @see MyComponentEvent
*/
class MyComponentListener extends ComponentAdapter {
+
+ /* (non-Javadoc)
+ * @see java.awt.event.ComponentAdapter#componentResized(java.awt.event.ComponentEvent)
+ */
+ @Override
public void componentResized(ComponentEvent e) {
resizeTreeViewer();
}
Modified: uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/EntityResolver.java
URL: http://svn.apache.org/viewvc/uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/EntityResolver.java?rev=1769510&r1=1769509&r2=1769510&view=diff
==============================================================================
--- uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/EntityResolver.java (original)
+++ uima/uimaj/branches/experiment-v3-jcas/uimaj-tools/src/main/java/org/apache/uima/tools/viewer/EntityResolver.java Sun Nov 13 16:08:24 2016
@@ -20,6 +20,7 @@ package org.apache.uima.tools.viewer;
import org.apache.uima.jcas.tcas.Annotation;
+// TODO: Auto-generated Javadoc
/**
* Pluggable interface that supports Entity View mode in the CasAnnotationViewer. Users implement
* this interface with logic that for their particular type system can determine which Entity an