You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ctakes.apache.org by se...@apache.org on 2017/04/13 20:18:36 UTC

svn commit: r1791303 - /ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java

Author: seanfinan
Date: Thu Apr 13 20:18:36 2017
New Revision: 1791303

URL: http://svn.apache.org/viewvc?rev=1791303&view=rev
Log:
fix for clicking build with no umls selected
better handling of selection meta/

Modified:
    ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java

Modified: ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java?rev=1791303&r1=1791302&r2=1791303&view=diff
==============================================================================
--- ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java (original)
+++ ctakes/trunk/ctakes-gui/src/main/java/org/apache/ctakes/gui/dictionary/MainPanel.java Thu Apr 13 20:18:36 2017
@@ -111,13 +111,14 @@ final class MainPanel extends JPanel {
       File mrConso = new File( umlsDirPath, "MRCONSO.RRF" );
       if ( mrConso.isFile() ) {
          _umlsDirPath = mrConso.getParentFile().getParent();
-      }
-      final String plusMetaPath = new File( umlsDirPath, "META" ).getPath();
-      mrConso = new File( plusMetaPath, "MRCONSO.RRF" );
-      if ( mrConso.isFile() ) {
-         _umlsDirPath = umlsDirPath;
       } else {
-         error( "Invalid UMLS Installation", umlsDirPath + " is not a valid path to a UMLS installation" );
+         final String plusMetaPath = new File( umlsDirPath, "META" ).getPath();
+         mrConso = new File( plusMetaPath, "MRCONSO.RRF" );
+         if ( mrConso.isFile() ) {
+            _umlsDirPath = umlsDirPath;
+         } else {
+            error( "Invalid UMLS Installation", umlsDirPath + " is not a valid path to a UMLS installation" );
+         }
       }
       return _umlsDirPath;
    }
@@ -252,6 +253,10 @@ final class MainPanel extends JPanel {
 
       @Override
       public void actionPerformed( final ActionEvent event ) {
+         if ( _sourceModel.getRowCount() == 0 ) {
+            error( "UMLS not yet loaded", "Please specify a UMLS installation." );
+            return;
+         }
          final String dictionaryName = __textComponent.getText();
          if ( dictionaryName != null && !dictionaryName.isEmpty() ) {
             buildDictionary( dictionaryName.toLowerCase() );