Revision: 17845
          http://sourceforge.net/p/gate/code/17845
Author:   markagreenwood
Date:     2014-04-16 15:41:56 +0000 (Wed, 16 Apr 2014)
Log Message:
-----------
moved the wordnet gui into the wordnet plugin where it should have been since I 
moved the rest of the code, also removed some dead code and merged a couple of 
exceptions as the docs suggested they should be used for the same thing, and 
corrected the exception type in a few places to something more appropriate

Modified Paths:
--------------
    gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/ClassNode.java
    
gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
    gate/trunk/src/main/gate/CreoleRegister.java
    gate/trunk/src/main/gate/creole/CreoleRegisterImpl.java
    gate/trunk/src/main/gate/util/MethodNotImplementedException.java

Added Paths:
-----------
    gate/trunk/plugins/WordNet/src/gate/gui/
    gate/trunk/plugins/WordNet/src/gate/gui/wordnet/

Removed Paths:
-------------
    gate/trunk/src/main/gate/gui/wordnet/
    gate/trunk/src/main/gate/util/LazyProgrammerException.java

Modified: 
gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/ClassNode.java
===================================================================
--- gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/ClassNode.java   
2014-04-16 15:17:12 UTC (rev 17844)
+++ gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/ClassNode.java   
2014-04-16 15:41:56 UTC (rev 17845)
@@ -1,12 +1,26 @@
 package com.ontotext.gate.vr;
 
-import java.util.*;
-import gate.creole.ontology.*;
-import gate.util.*;
-import gate.creole.gazetteer.*;
-import java.awt.datatransfer.*;
-import java.io.*;
+import gate.creole.gazetteer.MappingDefinition;
+import gate.creole.gazetteer.MappingNode;
+import gate.creole.ontology.AnonymousClass;
+import gate.creole.ontology.OClass;
+import gate.creole.ontology.OConstants;
+import gate.creole.ontology.OInstance;
+import gate.creole.ontology.OURI;
+import gate.creole.ontology.Ontology;
+import gate.creole.ontology.OntologyUtilities;
+import gate.util.GateRuntimeException;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+import java.io.Serializable;
 import java.net.URL;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
 
 /** Represents a single class node from the visualized ontology */
 public class ClassNode implements IFolder, Transferable, Cloneable,
@@ -36,7 +50,7 @@
        public static ClassNode createRootNode(Ontology o,
                        boolean includeInstances, boolean 
includeAnonymousClasses) {
                if (null == o)
-                       throw new gate.util.LazyProgrammerException("ontology 
is null.");
+                       throw new NullPointerException("ontology is null.");
 
                ClassNode root = new ClassNode(o);
                Iterator<OClass> itops = o.getOClasses(true).iterator();
@@ -133,7 +147,7 @@
        public static ClassNode createRootNode(Ontology o,
                        MappingDefinition mapping, Map<String, ClassNode> 
nameVsNode) {
                if (null == o || null == nameVsNode || null == mapping)
-                       throw new gate.util.LazyProgrammerException(
+                       throw new NullPointerException(
                                        "mapping, nameVsNode or ontology-o is 
null.");
                ClassNode root = new ClassNode(o);
                Iterator<OClass> itops = o.getOClasses(true).iterator();

Modified: 
gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java
===================================================================
--- 
gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java 
    2014-04-16 15:17:12 UTC (rev 17844)
+++ 
gate/trunk/plugins/Ontology_Tools/src/com/ontotext/gate/vr/MappingTreeView.java 
    2014-04-16 15:41:56 UTC (rev 17845)
@@ -4,7 +4,6 @@
 import gate.creole.gazetteer.MappingNode;
 import gate.creole.ontology.OClass;
 import gate.gui.MainFrame;
-import gate.util.LazyProgrammerException;
 
 import java.awt.Component;
 import java.awt.event.ActionEvent;
@@ -68,11 +67,11 @@
     super(model);
 
     if (null == mappingDef)
-      throw new LazyProgrammerException(
+      throw new NullPointerException(
         "Mapping Def cannot be null on contructing MappingTreeView");
 
     if (null == gazeVR)
-      throw new LazyProgrammerException(
+      throw new NullPointerException(
         "Gazetteer Editor - Gaze VR - cannot be null on contructing 
MappingTreeView");
 
     mapping = mappingDef;

Modified: gate/trunk/src/main/gate/CreoleRegister.java
===================================================================
--- gate/trunk/src/main/gate/CreoleRegister.java        2014-04-16 15:17:12 UTC 
(rev 17844)
+++ gate/trunk/src/main/gate/CreoleRegister.java        2014-04-16 15:41:56 UTC 
(rev 17845)
@@ -16,16 +16,17 @@
 
 package gate;
 
-import java.io.File;
-import java.io.Serializable;
-import java.net.URL;
-import java.util.*;
-
 import gate.creole.ResourceData;
 import gate.creole.metadata.CreoleResource;
 import gate.event.CreoleListener;
 import gate.util.GateException;
 
+import java.io.Serializable;
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
 /** The CREOLE register records the set of resources that are currently
   * known to the system. Each member of the register is a
   * <A HREF=creole/ResourceData.html>ResourceData</A> object, indexed by
@@ -118,15 +119,6 @@
     */
   public void registerBuiltins() throws GateException;
 
-  /** This is a utility method for creating CREOLE directory files
-    * (typically called <CODE>creole.xml</CODE>) from a list of Jar
-    * files that contain resources. The method concatenates the
-    * <CODE>resource.xml</CODE> files that the Jars contain.
-    * <P>
-    * If Java allowed class methods in interfaces this would be static.
-    */
-  public File createCreoleDirectoryFile(File directoryFile, Set<String> 
jarFileNames);
-
   /** Get the list of types of LR in the register. */
   public Set<String> getLrTypes();
 

Modified: gate/trunk/src/main/gate/creole/CreoleRegisterImpl.java
===================================================================
--- gate/trunk/src/main/gate/creole/CreoleRegisterImpl.java     2014-04-16 
15:17:12 UTC (rev 17844)
+++ gate/trunk/src/main/gate/creole/CreoleRegisterImpl.java     2014-04-16 
15:41:56 UTC (rev 17845)
@@ -33,11 +33,9 @@
 import gate.util.GateClassLoader;
 import gate.util.GateException;
 import gate.util.GateRuntimeException;
-import gate.util.LazyProgrammerException;
 import gate.util.LuckyException;
 import gate.util.Out;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
@@ -401,25 +399,6 @@
   } // registerBuiltins()
 
   /**
-   * This is a utility method for creating CREOLE directory files (typically
-   * called <CODE>creole.xml</CODE>) from a list of Jar files that contain
-   * resources. The method concatenates the <CODE>resource.xml</CODE> files 
that
-   * the Jars contain.
-   * <P>
-   * If Java allowed class methods in interfaces this would be static.
-   */
-  @Override
-  public File createCreoleDirectoryFile(File directoryFile, Set<String> 
jarFileNames) {
-    // //////////////////
-    // dump xml header and comment header and <CREOLE-DIRECTORY> into dirfile
-    // for each jar file pick out resource.xml
-    // strip xml header
-    // dump into dirfile
-    // put </CREOLE-DIRECTORY> into dirfile
-    throw new LazyProgrammerException();
-  } // createCreoleDirectoryFile
-
-  /**
    * Overide HashMap's put method to maintain a list of all the types of LR in
    * the register, and a list of tool types. The key is the resource type, the
    * value its data.

Deleted: gate/trunk/src/main/gate/util/LazyProgrammerException.java
===================================================================
--- gate/trunk/src/main/gate/util/LazyProgrammerException.java  2014-04-16 
15:17:12 UTC (rev 17844)
+++ gate/trunk/src/main/gate/util/LazyProgrammerException.java  2014-04-16 
15:41:56 UTC (rev 17845)
@@ -1,50 +0,0 @@
-/*
- *  LazyProgrammerException.java
- *
- *  Copyright (c) 1995-2012, The University of Sheffield. See the file
- *  COPYRIGHT.txt in the software or at http://gate.ac.uk/gate/COPYRIGHT.txt
- *
- *  This file is part of GATE (see http://gate.ac.uk/), and is free
- *  software, licenced under the GNU Library General Public License,
- *  Version 2, June 1991 (in the distribution as file licence.html,
- *  and also available at http://gate.ac.uk/gate/licence.html).
- *  
- *  Hamish Cunningham, 14/Feb/00
- *
- *  $Id$
- */
-
-package gate.util;
-
-/** What to throw in a method that hasn't been implemented yet. 
-  * Yes, there are good reasons never to throw RuntimeExceptions
-  * and thereby sidestep Java's exception checking mechanism. But
-  * we're so lazy we don't care. And anyway, none of these are
-  * ever supposed to make it into released versions (who are we
-  * kidding?).
-  */
-public class LazyProgrammerException extends RuntimeException {
-
-  private static final long serialVersionUID = -2698792997757384311L;
-
-  /** In a fit of complete laziness we didn't even document this
-    * class properly.
-    */
-  public LazyProgrammerException() {
-    super(defaultMessage);
-  }
-
-  /** In a fit of complete laziness we didn't even document this
-    * class properly.
-    */
-  public LazyProgrammerException(String s) {
-    super(s + defaultMessage);
-  }
-
-  /** In a fit of complete laziness we didn't even document this
-    * class properly.
-    */
-  static String defaultMessage = 
-    " It was Valentin's fault. I never touched it.";
-
-} // LazyProgrammerException

Modified: gate/trunk/src/main/gate/util/MethodNotImplementedException.java
===================================================================
--- gate/trunk/src/main/gate/util/MethodNotImplementedException.java    
2014-04-16 15:17:12 UTC (rev 17844)
+++ gate/trunk/src/main/gate/util/MethodNotImplementedException.java    
2014-04-16 15:41:56 UTC (rev 17845)
@@ -16,16 +16,26 @@
 
 package gate.util;
 
-
+/** What to throw in a method that hasn't been implemented yet. 
+ * Yes, there are good reasons never to throw RuntimeExceptions
+ * and thereby sidestep Java's exception checking mechanism. But
+ * we're so lazy we don't care. And anyway, none of these are
+ * ever supposed to make it into released versions (who are we
+ * kidding?).
+ */
 public class MethodNotImplementedException extends GateRuntimeException {
 
   private static final long serialVersionUID = 6273189553052866276L;
 
+  /**The default message carried by this type of exceptions*/
+  static String defaultMessage = 
+          " It was Valentin's fault. I never touched it.";
+  
   public MethodNotImplementedException() {
+    super(defaultMessage);
   }
 
   public MethodNotImplementedException(String message) {
-    super(message);
+    super(defaultMessage+"\n"+message);
   }
-
 }
\ No newline at end of file

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to