You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by jo...@apache.org on 2009/04/15 20:08:26 UTC
svn commit: r765289 - in
/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model:
./ delta/ dotcorpus/
Author: joern
Date: Wed Apr 15 18:08:25 2009
New Revision: 765289
URL: http://svn.apache.org/viewvc?rev=765289&view=rev
Log:
UIMA-546 Formated source code according to UIMA code conventions
Modified:
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AbstractNlpElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CorpusElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/INlpElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpModel.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/AbstractResourceDelta.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpElementDelta.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelChangeListener.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelDeltaVisitor.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/Kind.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/NlpModelDeltaImpl.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java
incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AbstractNlpElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AbstractNlpElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AbstractNlpElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AbstractNlpElement.java Wed Apr 15 18:08:25 2009
@@ -19,7 +19,6 @@
package org.apache.uima.caseditor.core.model;
-
import org.apache.uima.caseditor.core.model.delta.INlpElementDelta;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -29,6 +28,7 @@
* The abstract base class of all nlp element implementations.
*/
public abstract class AbstractNlpElement extends PlatformObject implements INlpElement {
+
/**
* Checks if the current elements resource equals the given resource, if so it returns the current
* element, otherwise null.
@@ -61,7 +61,7 @@
/**
* Checks if the given resource equals the current elements resource, if so it returns the parent
* of the current element, otherwise null.
- *
+ *
* @throws CoreException
*/
public INlpElement getParent(IResource resource) throws CoreException {
@@ -78,27 +78,31 @@
/**
* Adds resources after the element was initialized.
- * @param delta TODO
- * @param resource
+ *
+ * @param delta
+ * TODO
+ * @param resource
* the added resource
- *
+ *
* @throws CoreException
*/
abstract void addResource(INlpElementDelta delta, IResource resource) throws CoreException;
/**
* Removes resources after the element was initialized.
- * @param delta TODO
- * @param resource
+ *
+ * @param delta
+ * TODO
+ * @param resource
* the removed resource
- *
+ *
* @throws CoreException
*/
abstract void removeResource(INlpElementDelta delta, IResource resource) throws CoreException;
/**
* Changed resource after the element was initialized.
- *
+ *
* @param resource
*/
@SuppressWarnings("all")
@@ -112,4 +116,4 @@
public String toString() {
return getResource().toString();
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/AnnotatorElement.java Wed Apr 15 18:08:25 2009
@@ -46,7 +46,7 @@
/**
* Initializes the current instance.
- *
+ *
* @param config
* @param annotatorFile
*/
@@ -59,7 +59,7 @@
/**
* Retrieves the {@link AnnotatorConfiguration}.
- *
+ *
* @return the {@link AnnotatorConfiguration}
*/
public AnnotatorConfiguration getAnnotatorConfiguration() {
@@ -68,7 +68,6 @@
private AnnotatorConfiguration createAnnotatorConfiguration() {
-
Runnable clearMarkers = new Runnable() {
public void run() {
try {
@@ -118,9 +117,9 @@
}
// TODO: refactor here
- AnnotatorConfiguration annotatorConfiguration = new AnnotatorConfiguration(this,
- specifier); // cast is unsafe !!!
+ AnnotatorConfiguration annotatorConfiguration = new AnnotatorConfiguration(this, specifier);
+ // TODO: cast is unsafe !!!
annotatorConfiguration.setBaseFolder((IFolder) mParent.getResource());
return annotatorConfiguration;
@@ -135,7 +134,7 @@
@Override
void changedResource(IResource resource, INlpElementDelta delta) throws CoreException {
- mAnnotatorConfig = createAnnotatorConfiguration();
+ mAnnotatorConfig = createAnnotatorConfiguration();
}
@Override
@@ -170,4 +169,4 @@
public IResource getResource() {
return mAnnotatorResource;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CasProcessorFolder.java Wed Apr 15 18:08:25 2009
@@ -45,14 +45,13 @@
/**
* Initializes a new instance.
- *
+ *
* @param configFolder
* @param sourceFolder
* @param project
* @throws CoreException
*/
- CasProcessorFolder(IFolder configFolder, NlpProject project)
- throws CoreException {
+ CasProcessorFolder(IFolder configFolder, NlpProject project) throws CoreException {
mConfigFolder = configFolder;
mProject = project;
createAnnotatorConfigurations();
@@ -61,7 +60,7 @@
/**
* Retrieves the {@link AnnotatorConfiguration}.
- *
+ *
* @return the {@link AnnotatorConfiguration}
*/
public Collection<AnnotatorElement> getAnnotators() {
@@ -83,7 +82,7 @@
/**
* Retrieves the consumers.
- *
+ *
* @return consumers
*/
public Collection<ConsumerElement> getConsumers() {
@@ -106,7 +105,7 @@
/**
* Retrieves all contained {@link IFile} and {@link IFolder} resources.
- *
+ *
* @return {@link IFile}s and {@link IFolder}s
* @throws CoreException
*/
@@ -127,7 +126,7 @@
/**
* Retrieves the {@link NlpProject}.
- *
+ *
* @return the {@link NlpProject}
*/
public NlpProject getNlpProject() {
@@ -168,7 +167,7 @@
/**
* Retrieves the parent.
- *
+ *
* @return the parent
*/
public INlpElement getParent() {
@@ -275,4 +274,4 @@
}
}
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/ConsumerElement.java Wed Apr 15 18:08:25 2009
@@ -53,7 +53,7 @@
/**
* Retrieves the {@link CasConsumerConfiguration}.
- *
+ *
* @return the configuration
*/
public CasConsumerConfiguration getConsumerConfiguration() {
@@ -62,7 +62,7 @@
/**
* @return the configuration
- *
+ *
* @throws CoreException
*/
private CasConsumerConfiguration createConsumerConfiguration() throws CoreException {
@@ -78,14 +78,14 @@
((NlpModel) getNlpProject().getParent()).asyncExcuteQueue(clearMarkers);
String dataPath = ((IFolder) mParent.getResource()).getLocation().toOSString();
- XMLInputSource inCasConsumer = new XMLInputSource(mConsumerResource.getContents(),
- new File(dataPath));
+ XMLInputSource inCasConsumer =
+ new XMLInputSource(mConsumerResource.getContents(), new File(dataPath));
XMLParser xmlParser = UIMAFramework.getXMLParser();
CasConsumerDescription casConsumerDesciptor;
try {
- // TODO: this throws a class cast exception if the file has an other descriptor, check it
+ // TODO: this throws a class cast exception if the file has an other descriptor, check it
casConsumerDesciptor = (CasConsumerDescription) xmlParser.parse(inCasConsumer);
} catch (final InvalidXMLException e) {
Runnable createMarker = new Runnable() {
@@ -115,8 +115,8 @@
return null;
}
- CasConsumerConfiguration trainerConfiguration = new CasConsumerConfiguration(this,
- casConsumerDesciptor);
+ CasConsumerConfiguration trainerConfiguration =
+ new CasConsumerConfiguration(this, casConsumerDesciptor);
trainerConfiguration.setBaseFolder((IFolder) getParent().getResource());
@@ -130,7 +130,7 @@
@Override
void changedResource(IResource resource, INlpElementDelta delta) throws CoreException {
- mConsumerConfiguration = createConsumerConfiguration();
+ mConsumerConfiguration = createConsumerConfiguration();
}
@Override
@@ -165,4 +165,4 @@
public IResource getResource() {
return mConsumerResource;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CorpusElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CorpusElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CorpusElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/CorpusElement.java Wed Apr 15 18:08:25 2009
@@ -32,7 +32,7 @@
/**
* The CorpusElement is a container for {@link IDocument}s.
- *
+ *
* TODO: do not include defective elements!
*/
public final class CorpusElement extends AbstractNlpElement implements INlpElement, IAdaptable {
@@ -44,7 +44,7 @@
/**
* Creates a new <code>CorpusElement</code> object.
- *
+ *
* @param nlpProject
* @param corpusFolder
*/
@@ -63,7 +63,7 @@
/**
* Checks if the current document still exists.
- *
+ *
* @return true if exists
*/
public boolean exists() {
@@ -72,7 +72,7 @@
/**
* Retrieves all documents contained in the current corpus instance.
- *
+ *
* @return the documents
*/
public Collection<DocumentElement> getDocuments() {
@@ -81,7 +81,7 @@
/**
* Returns all <code>DocumentElement</code>s inside this corpus.
- *
+ *
* @throws CoreException
*/
private void createDocuments() throws CoreException {
@@ -131,7 +131,7 @@
/**
* Retrieves the name of the current instance.
- *
+ *
* @return the name
*/
public String getName() {
@@ -174,7 +174,8 @@
/**
* Adds the given resource.
- * @param resource
+ *
+ * @param resource
*/
@Override
void addResource(INlpElementDelta delta, IResource resource) {
@@ -195,7 +196,8 @@
/**
* Removes the given resource.
- * @param resource
+ *
+ * @param resource
*/
@Override
void removeResource(INlpElementDelta delta, IResource resource) {
@@ -232,4 +234,4 @@
return result;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DocumentElement.java Wed Apr 15 18:08:25 2009
@@ -37,7 +37,6 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-
/**
* The document element contains the uima cas document.
*/
@@ -47,25 +46,24 @@
private IFile mDocumentFile;
/**
- * The working copy of the document. This instance is
- * shared by everyone who wants to edit the document.
+ * The working copy of the document. This instance is shared by everyone who wants to edit the
+ * document.
*/
- private SoftReference<DocumentUimaImpl> mWorkingCopy =
- new SoftReference<DocumentUimaImpl>(null);
+ private SoftReference<DocumentUimaImpl> mWorkingCopy = new SoftReference<DocumentUimaImpl>(null);
private boolean isSavingWorkingCopy;
/**
* Initializes a new instance.
- *
+ *
* @param corpus
* @param documentFile
*/
DocumentElement(CorpusElement corpus, IFile documentFile) {
- if (corpus == null || documentFile == null) {
- throw new IllegalArgumentException("Parameters must not be null!");
- }
+ if (corpus == null || documentFile == null) {
+ throw new IllegalArgumentException("Parameters must not be null!");
+ }
mParent = corpus;
mDocumentFile = documentFile;
@@ -85,7 +83,6 @@
return mDocumentFile.getName();
}
-
/**
* Retrieves the parent.
*/
@@ -95,7 +92,7 @@
/**
* Retrieves the working copy.
- *
+ *
* @throws CoreException
* @return the working copy
*/
@@ -105,35 +102,33 @@
if (project.getTypesystemElement() == null) {
mWorkingCopy = null;
- throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID,
- 0, "Typesystem not available!", null));
+ throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
+ "Typesystem not available!", null));
}
DocumentUimaImpl document = mWorkingCopy.get();
if (reload || document == null) {
- InputStream in = mDocumentFile.getContents();
+ InputStream in = mDocumentFile.getContents();
+
+ DocumentFormat format;
+
+ if (getResource().getFileExtension().equalsIgnoreCase("xcas")) {
+ format = DocumentFormat.XCAS;
+ } else if (getResource().getFileExtension().equalsIgnoreCase("xmi")) {
+ format = DocumentFormat.XMI;
+ } else {
+ throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID, 0,
+ "Unkown file extension!", null));
+ }
- DocumentFormat format;
+ // TODO: check if this is correct this way
+ CAS cas = project.getTypesystemElement().getCAS();
- if (getResource().getFileExtension().equalsIgnoreCase("xcas")) {
- format = DocumentFormat.XCAS;
- }
- else if (getResource().getFileExtension().equalsIgnoreCase("xmi")) {
- format = DocumentFormat.XMI;
- }
- else {
- throw new CoreException(new Status(IStatus.ERROR, CasEditorPlugin.ID,
- 0, "Unkown file extension!", null));
- }
-
- // TODO: check if this is correct this way
- CAS cas = project.getTypesystemElement().getCAS();
-
- document = new DocumentUimaImpl(cas, in, format);
+ document = new DocumentUimaImpl(cas, in, format);
- mWorkingCopy = new SoftReference<DocumentUimaImpl>(document);
+ mWorkingCopy = new SoftReference<DocumentUimaImpl>(document);
}
return document;
@@ -141,10 +136,10 @@
/**
* Writes the document element to the file system.
- *
- * TODO: move it to the document, maybe the document gets not
- * saved if the caller lost the reference to it, before this call
- *
+ *
+ * TODO: move it to the document, maybe the document gets not saved if the caller lost the
+ * reference to it, before this call
+ *
* @throws CoreException
*/
public void saveDocument() throws CoreException {
@@ -162,7 +157,7 @@
/**
* Retrieves the corresponding {@link NlpProject} instance.
- *
+ *
* @return the {@link NlpProject} instance
*/
public NlpProject getNlpProject() {
@@ -179,8 +174,8 @@
@Override
void changedResource(IResource resource, INlpElementDelta delta) {
- // TODO: What should happen if the document is changed externally
- // e.g. with a text editor ?
+ // TODO: What should happen if the document is changed externally
+ // e.g. with a text editor ?
// if saveDocument() was called, we receive a changedResource event
// in this case do not remove a reference to the working copy, cause its in sync
@@ -207,4 +202,4 @@
public int hashCode() {
return getName().hashCode();
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/DotCorpusElement.java Wed Apr 15 18:08:25 2009
@@ -39,8 +39,8 @@
import org.eclipse.core.runtime.CoreException;
/**
- * The <code>DotCorpus</code> is responsible to load/store the project dependent configuration.
- * It has several methods to set and retrieve configuration parameters.
+ * The <code>DotCorpus</code> is responsible to load/store the project dependent configuration. It
+ * has several methods to set and retrieve configuration parameters.
*/
public class DotCorpusElement extends AbstractNlpElement {
private DotCorpus mDotCorpus;
@@ -52,7 +52,7 @@
/**
* The creation of the DotCorpus class is controlled by the factory method
* <code>createDefaultDotCorpus(...)</code>.
- *
+ *
* @param resource
* internal use only
* @param nlpProject
@@ -66,7 +66,7 @@
/**
* Retrieves the name of the type system file.
- *
+ *
* @return - type system file name or null if no set
*/
public IFile getTypeSystemFile() {
@@ -83,7 +83,7 @@
/**
* Returns true if the given file is the type system file.
- *
+ *
* @param file
* @return true if type system file otherwise false
*/
@@ -93,8 +93,8 @@
/**
* Sets the type system file name.
- *
- * @param filename -
+ *
+ * @param filename
* type system file name
*/
public void setTypeSystemFilename(String filename) {
@@ -103,7 +103,7 @@
/**
* Retrieves the corpus folder names.
- *
+ *
* @return - corpus folder names
*/
public Collection<IFolder> getCorpusFolderNameList() {
@@ -118,7 +118,7 @@
/**
* Adds a corpus folder.
- *
+ *
* @param name
* the corpus folder.
*/
@@ -128,7 +128,7 @@
/**
* Removes the given corpus folder;
- *
+ *
* @param folder
*/
public void removeCorpusFolder(IFolder folder) {
@@ -137,7 +137,7 @@
/**
* Returns true if the given folder is a corpus folder.
- *
+ *
* @param folder
* @return - true if corpus folder otherwise false
*/
@@ -156,7 +156,7 @@
/**
* Retrieves the annotation styles.
- *
+ *
* @return - the annotation styles
*/
Collection<AnnotationStyle> getAnnotationStyles() {
@@ -165,7 +165,7 @@
/**
* Adds an AnnotationStyle. TODO: move style stuff to nlp project
- *
+ *
* @param style
*/
public void setStyle(AnnotationStyle style) {
@@ -174,7 +174,7 @@
/**
* Removes an AnnotationStyle for the given name, does nothing if not existent.
- *
+ *
* @param name
*/
public void removeStyle(String name) {
@@ -183,7 +183,7 @@
/**
* Retrieves the AnnotationStyle for the given type or null if not available.
- *
+ *
* @param type
* @return the requested style or null if none
*/
@@ -193,12 +193,11 @@
/**
* Retrieves the config folder name.
- *
+ *
* @return - config folder name
*/
public Collection<IFolder> getCasProcessorFolders() {
-
Collection<IFolder> casProcessorFolders = new LinkedList<IFolder>();
for (String corpusFolderString : mDotCorpus.getCasProcessorFolderNames()) {
@@ -223,7 +222,7 @@
/**
* Returns true if the given folder is a uima config folder.
- *
+ *
* @param folder
* @return true if is config folder
*/
@@ -233,8 +232,8 @@
/**
* Sets the config folder name
- *
- * @param name -
+ *
+ * @param name
* the new name
*/
public void removeCasProcessorFolder(String name) {
@@ -255,7 +254,7 @@
/**
* Retrieves the line length hint of the editor.
- *
+ *
* @return line length hint of the current editor, 0 means disabled
*/
public int getEditorLineLengthHint() {
@@ -264,8 +263,8 @@
/**
* Sets the line length hint of the current editor.
- *
- * @param lineLengthHint -
+ *
+ * @param lineLengthHint
* line length hint of the current editor, 0 means disabled
*/
public void setEditorLineLengthHint(int lineLengthHint) {
@@ -274,7 +273,7 @@
/**
* Serializes the <code>DotCorpus</code> instance to the given <code>IFile</code>.
- *
+ *
* @throws CoreException
*/
public void serialize() throws CoreException {
@@ -299,15 +298,14 @@
if (this == object) {
result = true;
- }
- else if (object instanceof DotCorpusElement) {
+ } else if (object instanceof DotCorpusElement) {
DotCorpusElement element = (DotCorpusElement) object;
- result = mDotCorpus.equals(element.mDotCorpus) && mResource.equals(element.mResource)
- && mNlpProject.equals(element.mNlpProject);
- }
- else {
+ result =
+ mDotCorpus.equals(element.mDotCorpus) && mResource.equals(element.mResource)
+ && mNlpProject.equals(element.mNlpProject);
+ } else {
result = false;
}
@@ -318,7 +316,7 @@
* Creates a new <code>DotCorpus</code> object from an <code>IFile</code> object. If creation
* fails, the default dotCorpus is returned and if possible markers are added to the invalid
* .corpus resource.
- *
+ *
* @param file
* @param project
* @return - the new <code>DotCorpus</code> instance.
@@ -401,4 +399,4 @@
void removeResource(INlpElementDelta delta, IResource resource) {
// not needed here, there are no child resources
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/INlpElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/INlpElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/INlpElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/INlpElement.java Wed Apr 15 18:08:25 2009
@@ -28,28 +28,28 @@
public interface INlpElement {
/**
* Retrieves the name of the nlp element.
- *
+ *
* @return the name
*/
String getName();
/**
* Retrieves the corresponding resource.
- *
+ *
* @return corresponding resource
*/
IResource getResource();
/**
* Retrieves the parent element.
- *
+ *
* @return the parent element
*/
INlpElement getParent();
/**
* Retrieves the INlpElement parent of a resource.
- *
+ *
* @param resource
* @return the INlpElement parent or null if none
* @throws CoreException
@@ -58,14 +58,14 @@
/**
* Retrieves the nlp project.
- *
+ *
* @return the project
*/
NlpProject getNlpProject();
/**
* Searches the corresponding nlp element for the given resource.
- *
+ *
* @param resource
* the resource to search
* @return the nlp element or null if not found
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpModel.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpModel.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpModel.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpModel.java Wed Apr 15 18:08:25 2009
@@ -49,8 +49,8 @@
*/
public final class NlpModel extends AbstractNlpElement {
private final class ResourceChangeListener implements IResourceChangeListener {
- EventDispatcher<Kind, NlpModelDeltaImpl> mEventDispatcher = new EventDispatcher<Kind, NlpModelDeltaImpl>(
- new DefaultEventHandler());
+ EventDispatcher<Kind, NlpModelDeltaImpl> mEventDispatcher =
+ new EventDispatcher<Kind, NlpModelDeltaImpl>(new DefaultEventHandler());
ResourceChangeListener() {
mEventDispatcher.register(Kind.ADDED, new AddHandler(mEventDispatcher));
@@ -224,8 +224,9 @@
}
};
- NlpModelDeltaImpl removeProjectDelta = new NlpModelDeltaImpl((NlpModelDeltaImpl) delta
- .getParent(), removeProjectResourceDelta);
+ NlpModelDeltaImpl removeProjectDelta =
+ new NlpModelDeltaImpl((NlpModelDeltaImpl) delta.getParent(),
+ removeProjectResourceDelta);
NlpModelDeltaImpl parent = (NlpModelDeltaImpl) delta.getParent();
@@ -265,8 +266,9 @@
}
};
- NlpModelDeltaImpl removeProjectDelta = new NlpModelDeltaImpl((NlpModelDeltaImpl) delta
- .getParent(), removeProjectResourceDelta);
+ NlpModelDeltaImpl removeProjectDelta =
+ new NlpModelDeltaImpl((NlpModelDeltaImpl) delta.getParent(),
+ removeProjectResourceDelta);
NlpModelDeltaImpl parent = (NlpModelDeltaImpl) delta.getParent();
@@ -304,8 +306,9 @@
}
};
- NlpModelDeltaImpl removeProjectDelta = new NlpModelDeltaImpl((NlpModelDeltaImpl) delta
- .getParent(), removeProjectResourceDelta);
+ NlpModelDeltaImpl removeProjectDelta =
+ new NlpModelDeltaImpl((NlpModelDeltaImpl) delta.getParent(),
+ removeProjectResourceDelta);
NlpModelDeltaImpl parent = (NlpModelDeltaImpl) delta.getParent();
@@ -337,7 +340,8 @@
}
}
- private Set<INlpModelChangeListener> mModelChangeListeners = new HashSet<INlpModelChangeListener>();
+ private Set<INlpModelChangeListener> mModelChangeListeners =
+ new HashSet<INlpModelChangeListener>();
private IWorkspaceRoot mWorkspaceRoot;
@@ -349,7 +353,7 @@
/**
* Initializes a new instance.
- *
+ *
* @throws CoreException
*/
public NlpModel() throws CoreException {
@@ -439,7 +443,7 @@
/**
* Retrieves all nlp projects.
- *
+ *
* @return the nlp projects
*/
public NlpProject[] getNlpProjects() {
@@ -470,7 +474,7 @@
/**
* Retrieves the resource projects in the workspace without a nlp nature.
- *
+ *
* @return array of projects
* @throws CoreException
*/
@@ -556,7 +560,7 @@
/**
* Checks if the given element is a {@link INlpElement}.
- *
+ *
* @param resource
* @return true if it is a {@link INlpElement} otherwise false.
*/
@@ -566,7 +570,7 @@
/**
* The {@link NlpModel} does not have a parent.
- *
+ *
* @return null
*/
public INlpElement getParent() {
@@ -582,7 +586,7 @@
/**
* Registers a model change listener.
- *
+ *
* @param listener
*/
public void addNlpModelChangeListener(INlpModelChangeListener listener) {
@@ -591,7 +595,7 @@
/**
* Removes a model change listener.
- *
+ *
* @param listener
*/
public void removeNlpModelChangeListener(INlpModelChangeListener listener) {
@@ -621,7 +625,7 @@
/**
* Asynchrony executes the workers on the queue. This method can be used to post resource tree
* changes inside the event handler, where the resource tree is locked.
- *
+ *
* @param worker
*/
public void asyncExcuteQueue(Runnable worker) {
@@ -634,4 +638,4 @@
public void destroyForTesting() {
ResourcesPlugin.getWorkspace().removeResourceChangeListener(mListener);
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/NlpProject.java Wed Apr 15 18:08:25 2009
@@ -70,7 +70,7 @@
/**
* Initializes the current nlp project instance.
- *
+ *
* @param model
*/
void setNlpModel(NlpModel model) {
@@ -80,9 +80,9 @@
/**
* Initializes the current instance. This method is called before this instance can be used.
* Currently it recognizes and loads all nlp resources.
- *
+ *
* Note: This method should only be called during static {@link NlpModel} creation.
- *
+ *
* @throws CoreException
*/
@SuppressWarnings("unchecked")
@@ -97,9 +97,9 @@
createCasProcessorFolders();
- //for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
- // sourceFolder.initialize();
- //}
+ // for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
+ // sourceFolder.initialize();
+ // }
IFile typeSystemFile = getDotCorpus().getTypeSystemFile();
@@ -118,8 +118,7 @@
// removes the document annotation
displayTypes.remove(typeSystem.getType(CAS.TYPE_NAME_DOCUMENT_ANNOTATION));
- mEditorAnnotationStatus = new EditorAnnotationStatus(
- annotationType.getName(), displayTypes);
+ mEditorAnnotationStatus = new EditorAnnotationStatus(annotationType.getName(), displayTypes);
}
}
@@ -174,7 +173,7 @@
/**
* Retrieves the {@link EditorAnnotationStatus} for the current project instance.
- *
+ *
* @return status
*/
public EditorAnnotationStatus getEditorAnnotationStatus() {
@@ -183,7 +182,7 @@
/**
* Sets the {@link EditorAnnotationStatus} for the current project instance.
- *
+ *
* @param status
*/
public void setEditorAnnotationStatus(EditorAnnotationStatus status) {
@@ -203,7 +202,7 @@
/**
* Retrieves the corpora.
- *
+ *
* @return the corpus collection
*/
public Collection<CorpusElement> getCorpora() {
@@ -222,7 +221,7 @@
/**
* Retrieves all non-nlp resources of the current instance.
- *
+ *
* @return the resources
* @throws CoreException
*/
@@ -275,9 +274,9 @@
}
if (mTypesystem != null) {
- if (mTypesystem.getResource().equals(resource)) {
- return this;
- }
+ if (mTypesystem.getResource().equals(resource)) {
+ return this;
+ }
}
for (IResource candiadte : getResources()) {
@@ -316,9 +315,8 @@
if (result == null) {
if (DOT_CORPUS_FILENAME.equals(resource.getName())) {
return mDotCorpusElement;
- }
- else if (mTypesystem != null && mTypesystem.findMember(resource) != null) {
- return mTypesystem.findMember(resource);
+ } else if (mTypesystem != null && mTypesystem.findMember(resource) != null) {
+ return mTypesystem.findMember(resource);
}
for (CasProcessorFolder sourceFolder : getCasProcessorFolders()) {
@@ -343,7 +341,7 @@
/**
* Retrieves the UimaSourceFolder
- *
+ *
* @return the UimaSourceFolder
*/
public Collection<CasProcessorFolder> getCasProcessorFolders() {
@@ -353,8 +351,7 @@
private void createCasProcessorFolders() throws CoreException {
for (IFolder processorFolder : mDotCorpusElement.getCasProcessorFolders()) {
if (processorFolder.exists()) {
- CasProcessorFolder processorElement =
- new CasProcessorFolder(processorFolder, this);
+ CasProcessorFolder processorElement = new CasProcessorFolder(processorFolder, this);
mUimaSourceFolder.add(processorElement);
}
@@ -363,19 +360,19 @@
/**
* Retrieves the {@link DotCorpusElement}.
- *
+ *
* @return the {@link DotCorpusElement}
*/
public DotCorpusElement getDotCorpus() {
- Assert.isTrue(mDotCorpusElement != null);
+ Assert.isTrue(mDotCorpusElement != null);
- return mDotCorpusElement;
- }
+ return mDotCorpusElement;
+ }
/**
- * Retrieves the {@link NlpProject}.
- */
+ * Retrieves the {@link NlpProject}.
+ */
public NlpProject getNlpProject() {
return this;
}
@@ -405,31 +402,31 @@
}
// if type system is set, it could had been renamed
else if (mDotCorpusElement.getTypeSystemFile() != null
- && (delta.getFlags() & IResourceDelta.MOVED_FROM) > 0
- && mDotCorpusElement.getTypeSystemFile().getFullPath()
- .equals(delta.getMovedFromPath())) {
- // rename type system in dot corpus
- mDotCorpusElement.setTypeSystemFilename(resource.getName());
-
- // dot corpus was changed and must be writen
- // do this after the delta processing
-
-
- Runnable serialze = new Runnable() {
-
- public void run() {
- try {
- mDotCorpusElement.serialize();
- } catch (CoreException e) {
- CasEditorPlugin.log(e);
- }
- }};
+ && (delta.getFlags() & IResourceDelta.MOVED_FROM) > 0
+ && mDotCorpusElement.getTypeSystemFile().getFullPath().equals(
+ delta.getMovedFromPath())) {
+ // rename type system in dot corpus
+ mDotCorpusElement.setTypeSystemFilename(resource.getName());
+
+ // dot corpus was changed and must be writen
+ // do this after the delta processing
+
+ Runnable serialze = new Runnable() {
+
+ public void run() {
+ try {
+ mDotCorpusElement.serialize();
+ } catch (CoreException e) {
+ CasEditorPlugin.log(e);
+ }
+ }
+ };
- ((NlpModel) getNlpProject().getParent()).asyncExcuteQueue(serialze);
+ ((NlpModel) getNlpProject().getParent()).asyncExcuteQueue(serialze);
}
// check if file is type system
- else if (mDotCorpusElement.getTypeSystemFile() != null &&
- mDotCorpusElement.getTypeSystemFile().equals(resource)) {
+ else if (mDotCorpusElement.getTypeSystemFile() != null
+ && mDotCorpusElement.getTypeSystemFile().equals(resource)) {
mTypesystem = new TypesystemElement((IFile) resource, this);
}
} else if (resource instanceof IFolder) {
@@ -478,13 +475,12 @@
void changedResource(IResource resource, INlpElementDelta delta) throws CoreException {
if (DOT_CORPUS_FILENAME.equals(resource.getName())) {
mIsDotCorpusDirty = true;
- }
- else if (mTypesystem != null && resource.equals(mTypesystem.getResource())) {
+ } else if (mTypesystem != null && resource.equals(mTypesystem.getResource())) {
mTypesystem.changedResource(resource, delta);
if (getTypesystemElement().getTypeSystem() != null) {
- mEditorAnnotationStatus = new EditorAnnotationStatus(CAS.TYPE_NAME_ANNOTATION, null);
- }
+ mEditorAnnotationStatus = new EditorAnnotationStatus(CAS.TYPE_NAME_ANNOTATION, null);
+ }
}
}
@@ -534,10 +530,10 @@
/**
* Adds a NLP nature to a project.
- *
- * @param project -
+ *
+ * @param project
* the project to add the nature
- *
+ *
* @throws CoreException
*/
public static void addNLPNature(IProject project) throws CoreException {
@@ -552,10 +548,10 @@
/**
* Retrieves the type system.
- *
+ *
* @return type system
*/
public TypesystemElement getTypesystemElement() {
return mTypesystem;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/TypesystemElement.java Wed Apr 15 18:08:25 2009
@@ -48,6 +48,7 @@
* TODO: add javadoc
*/
public class TypesystemElement extends AbstractNlpElement {
+
private IFile mTypesytemFile;
private NlpProject mProject;
@@ -71,12 +72,10 @@
}
/**
- * Retrieves the {@link CAS}.
- *
- * @return the {@link CAS} or null if there is an error in the type system.
- * @deprecated
- */
- @Deprecated
+ * Retrieves the {@link CAS}.
+ *
+ * @return the {@link CAS} or null if there is an error in the type system.
+ */
public CAS getCAS() {
Runnable clearMarkers = new Runnable() {
public void run() {
@@ -191,7 +190,7 @@
@Override
void changedResource(IResource resource, INlpElementDelta delta) throws CoreException {
- getCAS();
+ getCAS();
}
@Override
@@ -203,4 +202,4 @@
void removeResource(INlpElementDelta delta, IResource resource) throws CoreException {
// not needed here, there are no child resources
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/AbstractResourceDelta.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/AbstractResourceDelta.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/AbstractResourceDelta.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/AbstractResourceDelta.java Wed Apr 15 18:08:25 2009
@@ -30,6 +30,7 @@
* Abstract base class, so clients must not implement all methods.
*/
public abstract class AbstractResourceDelta implements IResourceDelta {
+
/**
* Dummy method, does nothing.
*/
@@ -142,4 +143,4 @@
public Object getAdapter(Class adapter) {
return null;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpElementDelta.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpElementDelta.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpElementDelta.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpElementDelta.java Wed Apr 15 18:08:25 2009
@@ -27,14 +27,15 @@
/**
* A element delta represents changes in the state of a element tree between two discrete points in
* time.
- *
+ *
* @see IResourceDelta
*/
public interface INlpElementDelta {
+
/**
* Accepts the given visitor. The only kinds of resource deltas visited are <code>ADDED</code>,
* <code>REMOVED</code>, and <code>CHANGED</code>.
- *
+ *
* @param visotor
*/
void accept(INlpModelDeltaVisitor visotor);
@@ -42,56 +43,57 @@
/**
* Returns resource deltas for all children of this resource which were added, removed, or
* changed. Returns an empty array if there are no affected children.
- *
+ *
* @return - children or empty array
*/
public INlpElementDelta[] getAffectedChildren();
/**
* Returns true if the given element is an nlp element.
- *
+ *
* @return true if an nlp element otherwise false
*/
boolean isNlpElement();
/**
* Retrieves the nlp element.
- *
+ *
* @return the nlp element or if non null.
*/
INlpElement getNlpElement();
/**
* Retrieves the resource belonging to this delta.
- *
+ *
* @return the resource
*/
IResource getResource();
/**
* Retrieves the kind.
- *
+ *
* @return the kind
*/
Kind getKind();
/**
* Retrieves the flags.
- *
+ *
* @return the flags
*/
int getFlags();
/**
* Retrieves the moved to path.
- *
+ *
* @return
*/
IPath getMovedToPath();
/**
* Retrieves the moved from path.
+ *
* @return
*/
IPath getMovedFromPath();
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelChangeListener.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelChangeListener.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelChangeListener.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelChangeListener.java Wed Apr 15 18:08:25 2009
@@ -25,9 +25,10 @@
* This listener is notified when the nlp model changes.
*/
public interface INlpModelChangeListener {
+
/**
* Called if the nlp model changed.
- *
+ *
* @param delta
* contains the change from one point in time to the next.
*/
@@ -35,7 +36,7 @@
/**
* The given {@link INlpElement} was changed. Clients must refresh.
- *
+ *
* @param element
*/
void refresh(INlpElement element);
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelDeltaVisitor.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelDeltaVisitor.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelDeltaVisitor.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/INlpModelDeltaVisitor.java Wed Apr 15 18:08:25 2009
@@ -23,11 +23,12 @@
* The listener is used to visit the given delta.
*/
public interface INlpModelDeltaVisitor {
+
/**
* Called to visit the given delta.
- *
+ *
* @param delta
* @return true if the implementor wants to visit children.
*/
public boolean visit(INlpElementDelta delta);
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/Kind.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/Kind.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/Kind.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/Kind.java Wed Apr 15 18:08:25 2009
@@ -23,6 +23,7 @@
* The kind of the {@link INlpElementDelta}.
*/
public enum Kind {
+
/**
* Added a resource.
*/
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/NlpModelDeltaImpl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/NlpModelDeltaImpl.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/NlpModelDeltaImpl.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/delta/NlpModelDeltaImpl.java Wed Apr 15 18:08:25 2009
@@ -29,7 +29,7 @@
/**
* The internal implementation of the nlp model delta interface.
- *
+ *
* TODO: Add a filter to avoid node with Kind.NOTHING.
*/
public final class NlpModelDeltaImpl implements INlpElementDelta {
@@ -51,7 +51,7 @@
/**
* Initializes a new instance.
- *
+ *
* @param parent
* @param resourceDelta
*/
@@ -72,8 +72,8 @@
}
/**
- * Sets the nlp element Note: do not call this method from ouside code
- *
+ * Sets the nlp element Note: do not call this method from outside code
+ *
* @param element
*/
public void setNlpElement(INlpElement element) {
@@ -82,7 +82,7 @@
/**
* Retrieves the parent element or null if this is the root delta.
- *
+ *
* @return parent element or null
*/
public INlpElementDelta getParent() {
@@ -91,7 +91,7 @@
/**
* Adds a child to the current element instance.
- *
+ *
* @param child
*/
public void addChild(NlpModelDeltaImpl child) {
@@ -147,9 +147,9 @@
}
/**
- * Sets the new kind. This method should only be called from the event handlers snd not by any
+ * Sets the new kind. This method should only be called from the event handlers and not by any
* client.
- *
+ *
* @param kind
*/
public void setKind(Kind kind) {
@@ -165,7 +165,7 @@
/**
* Retrieves the resource delta.
- *
+ *
* @return the resource delta
*/
public IResourceDelta getResourceDelta() {
@@ -177,7 +177,7 @@
}
public IPath getMovedToPath() {
- return mResourceDelta.getMovedToPath();
+ return mResourceDelta.getMovedToPath();
}
/**
@@ -203,4 +203,4 @@
return kind;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpus.java Wed Apr 15 18:08:25 2009
@@ -65,7 +65,7 @@
/**
* Retrieves type system name parameter.
- *
+ *
* @return type system name parameter
*/
public String getTypeSystemFileName() {
@@ -74,7 +74,7 @@
/**
* Sets type system name parameter.
- *
+ *
* @param name
* type system name parameter
*/
@@ -84,7 +84,7 @@
/**
* Retrieves the uima config folder name parameter.
- *
+ *
* @return uima config folder name parameter.
*/
public Collection<String> getCasProcessorFolderNames() {
@@ -93,7 +93,7 @@
/**
* Sets the uima config folder name parameter.
- *
+ *
* @param folder
* uima config folder name parameter.
*/
@@ -107,7 +107,7 @@
/**
* Adds a corpus folder
- *
+ *
* @param name
*/
public void addCorpusFolder(String name) {
@@ -116,7 +116,7 @@
/**
* Removes the given corpus folder.
- *
+ *
* @param name
*/
public void removeCorpusFolder(String name) {
@@ -125,7 +125,7 @@
/**
* Retrieves the list of all corpus folders.
- *
+ *
* @return corpus folder list
*/
public Collection<String> getCorpusFolderNameList() {
@@ -134,7 +134,7 @@
/**
* Retrieves the editor line length hint parameter.
- *
+ *
* @return line length hint
*/
public int getEditorLineLengthHint() {
@@ -143,7 +143,7 @@
/**
* Sets the editor line length hint parameter.
- *
+ *
* @param lineLengthHint
*/
public void setEditorLineLength(int lineLengthHint) {
@@ -152,7 +152,7 @@
/**
* Retrieves the annotation styles.
- *
+ *
* @return - the annotation styles
*/
public Collection<AnnotationStyle> getAnnotationStyles() {
@@ -161,14 +161,14 @@
/**
* Adds an AnnotationStyle. TODO: move style stuff to nlp project
- *
+ *
* @param style
*/
public void setStyle(AnnotationStyle style) {
- boolean isDefaultAnnotation = AnnotationStyle.DEFAULT_COLOR.equals(style.getColor()) &&
- AnnotationStyle.DEFAULT_STYLE.equals(style.getStyle()) &&
- AnnotationStyle.DEFAULT_LAYER == style.getLayer();
+ boolean isDefaultAnnotation = AnnotationStyle.DEFAULT_COLOR.equals(style.getColor())
+ && AnnotationStyle.DEFAULT_STYLE.equals(style.getStyle())
+ && AnnotationStyle.DEFAULT_LAYER == style.getLayer();
if (isDefaultAnnotation) {
mStyleMap.remove(style.getAnnotation());
@@ -179,7 +179,7 @@
/**
* Removes an AnnotationStyle for the given name, does nothing if not existent.
- *
+ *
* @param name
*/
public void removeStyle(String name) {
@@ -188,7 +188,7 @@
/**
* Retrieves the AnnotationStyle for the given type or null if not available.
- *
+ *
* @param type
* @return the requested style or null if none
*/
@@ -209,12 +209,11 @@
@Override
public boolean equals(Object obj) {
- boolean result;
+ boolean result;
if (obj == this) {
- result = true;
- }
- else if (obj instanceof DotCorpus) {
+ result = true;
+ } else if (obj instanceof DotCorpus) {
DotCorpus corpus = (DotCorpus) obj;
@@ -223,9 +222,8 @@
&& isEqual(mCasProcessorFolders, corpus.mCasProcessorFolders)
&& isEqual(mStyleMap, corpus.mStyleMap)
&& isEqual(mEditorLineLengthHint, corpus.mEditorLineLengthHint);
- }
- else {
- result = false;
+ } else {
+ result = false;
}
return result;
@@ -233,12 +231,12 @@
/**
* Compares two objects for equality.
- *
- * @param a -
+ *
+ * @param a
* the first object or null
- * @param b -
+ * @param b
* the second object or null
- * @return - a.equals(b) or true if both null
+ * @return a.equals(b) or true if both null
*/
private static boolean isEqual(Object a, Object b) {
boolean result;
@@ -255,4 +253,4 @@
return result;
}
-}
\ No newline at end of file
+}
Modified: incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java?rev=765289&r1=765288&r2=765289&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java (original)
+++ incubator/uima/sandbox/trunk/CasEditorEclipsePlugin/src/main/java/org/apache/uima/caseditor/core/model/dotcorpus/DotCorpusSerializer.java Wed Apr 15 18:08:25 2009
@@ -45,6 +45,7 @@
* This class is responsible to read and write {@link DotCorpus} objects from or to a byte stream.
*/
public class DotCorpusSerializer {
+
private static final String CONFIG_ELEMENT = "config";
private static final String CORPUS_ELEMENT = "corpus";
@@ -75,7 +76,7 @@
/**
* Creates a {@link DotCorpus} object from a given {@link InputStream}.
- *
+ *
* @param dotCorpusStream
* @return the {@link DotCorpus} instance.
* @throws CoreException
@@ -145,7 +146,8 @@
String styleString = corporaChildElement.getAttribute(STYLE_STYLE_ATTRIBUTE);
- int colorInteger = Integer.parseInt(corporaChildElement.getAttribute(STYLE_COLOR_ATTRIBUTE));
+ int colorInteger = Integer
+ .parseInt(corporaChildElement.getAttribute(STYLE_COLOR_ATTRIBUTE));
Color color = new Color(colorInteger);
@@ -154,8 +156,8 @@
int drawingLayer;
try {
- drawingLayer = Integer.parseInt(drawingLayerString);
- } catch(NumberFormatException e) {
+ drawingLayer = Integer.parseInt(drawingLayerString);
+ } catch (NumberFormatException e) {
drawingLayer = 0;
}
@@ -164,7 +166,8 @@
dotCorpus.setStyle(style);
} else if (CAS_PROCESSOR_ELEMENT.equals(corporaChildElement.getNodeName())) {
- dotCorpus.addCasProcessorFolder(corporaChildElement.getAttribute(CAS_PROCESSOR_FOLDER_ATTRIBUTE));
+ dotCorpus.addCasProcessorFolder(corporaChildElement
+ .getAttribute(CAS_PROCESSOR_FOLDER_ATTRIBUTE));
} else if (EDITOR_ELEMENT.equals(corporaChildElement.getNodeName())) {
String lineLengthHintString = corporaChildElement
.getAttribute(EDITOR_LINE_LENGTH_ATTRIBUTE);
@@ -186,11 +189,11 @@
/**
* Writes the <code>DotCorpus</code> instance to the given <code>OutputStream</code>.
- *
+ *
* @param dotCorpus
* the {@link DotCorpus} object to serialize.
- * @param out -
- * the stream to write the current <code>DotCorpus</code> instance.
+ * @param out
+ * - the stream to write the current <code>DotCorpus</code> instance.
* @throws CoreException
*/
public static void serialize(DotCorpus dotCorpus, OutputStream out) throws CoreException {
@@ -204,7 +207,7 @@
for (String corpusFolder : dotCorpus.getCorpusFolderNameList()) {
AttributesImpl corpusFolderAttributes = new AttributesImpl();
- corpusFolderAttributes.addAttribute("", "",CORPUS_FOLDER_ATTRIBUTE, "", corpusFolder);
+ corpusFolderAttributes.addAttribute("", "", CORPUS_FOLDER_ATTRIBUTE, "", corpusFolder);
xmlSerHandler.startElement("", CORPUS_ELEMENT, CORPUS_ELEMENT, corpusFolderAttributes);
xmlSerHandler.endElement("", CORPUS_ELEMENT, CORPUS_ELEMENT);
@@ -212,16 +215,14 @@
for (AnnotationStyle style : dotCorpus.getAnnotationStyles()) {
AttributesImpl styleAttributes = new AttributesImpl();
- styleAttributes
- .addAttribute("", "", STYLE_TYPE_ATTRIBUTE, "", style.getAnnotation());
- styleAttributes.addAttribute("", "", STYLE_STYLE_ATTRIBUTE, "", style.getStyle()
- .name());
+ styleAttributes.addAttribute("", "", STYLE_TYPE_ATTRIBUTE, "", style.getAnnotation());
+ styleAttributes.addAttribute("", "", STYLE_STYLE_ATTRIBUTE, "", style.getStyle().name());
Color color = style.getColor();
Integer colorInt = new Color(color.getRed(), color.getGreen(), color.getBlue()).getRGB();
styleAttributes.addAttribute("", "", STYLE_COLOR_ATTRIBUTE, "", colorInt.toString());
- styleAttributes.addAttribute("", "", STYLE_LAYER_ATTRIBUTE, "",
- Integer.toString(style.getLayer()));
+ styleAttributes.addAttribute("", "", STYLE_LAYER_ATTRIBUTE, "", Integer.toString(style
+ .getLayer()));
xmlSerHandler.startElement("", STYLE_ELEMENT, STYLE_ELEMENT, styleAttributes);
xmlSerHandler.endElement("", STYLE_ELEMENT, STYLE_ELEMENT);
@@ -232,7 +233,8 @@
typeSystemFileAttributes.addAttribute("", "", TYPESYTEM_FILE_ATTRIBUTE, "", dotCorpus
.getTypeSystemFileName());
- xmlSerHandler.startElement("", TYPESYSTEM_ELEMENT, TYPESYSTEM_ELEMENT, typeSystemFileAttributes);
+ xmlSerHandler.startElement("", TYPESYSTEM_ELEMENT, TYPESYSTEM_ELEMENT,
+ typeSystemFileAttributes);
xmlSerHandler.endElement("", TYPESYSTEM_ELEMENT, TYPESYSTEM_ELEMENT);
}
@@ -240,7 +242,8 @@
AttributesImpl taggerConfigAttributes = new AttributesImpl();
taggerConfigAttributes.addAttribute("", "", CAS_PROCESSOR_FOLDER_ATTRIBUTE, "", folder);
- xmlSerHandler.startElement("", CAS_PROCESSOR_ELEMENT, CAS_PROCESSOR_ELEMENT, taggerConfigAttributes);
+ xmlSerHandler.startElement("", CAS_PROCESSOR_ELEMENT, CAS_PROCESSOR_ELEMENT,
+ taggerConfigAttributes);
xmlSerHandler.endElement("", CAS_PROCESSOR_ELEMENT, CAS_PROCESSOR_ELEMENT);
}
@@ -249,7 +252,8 @@
editorLineLengthHintAttributes.addAttribute("", "", EDITOR_LINE_LENGTH_ATTRIBUTE, "",
Integer.toString(dotCorpus.getEditorLineLengthHint()));
- xmlSerHandler.startElement("", EDITOR_ELEMENT, EDITOR_ELEMENT, editorLineLengthHintAttributes);
+ xmlSerHandler.startElement("", EDITOR_ELEMENT, EDITOR_ELEMENT,
+ editorLineLengthHintAttributes);
xmlSerHandler.endElement("", EDITOR_ELEMENT, EDITOR_ELEMENT);
}
@@ -262,4 +266,4 @@
throw new CoreException(s);
}
}
-}
\ No newline at end of file
+}