You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by tw...@apache.org on 2007/05/30 17:10:50 UTC

svn commit: r542836 - in /incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd: MainFrame.java control/CaretChangeHandler.java

Author: twgoetz
Date: Wed May 30 08:10:50 2007
New Revision: 542836

URL: http://svn.apache.org/viewvc?view=rev&rev=542836
Log:
Jira UIMA-421: fix cut/copy in CVD.  Also remove unused variable.

https://issues.apache.org/jira/browse/UIMA-421

Modified:
    incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
    incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java

Modified: incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java?view=diff&rev=542836&r1=542835&r2=542836
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/MainFrame.java Wed May 30 08:10:50 2007
@@ -436,7 +436,7 @@
 
   private JPanel sofaSelectionPanel;
 
-  private boolean disableSofaListener = false;
+//  private boolean disableSofaListener = false;
 
   /**
    * Constructor for MainFrame.
@@ -1280,6 +1280,9 @@
       this.caretStatus.setText("Selection: " + from + " - " + to);
     }
     this.statusPanel.revalidate();
+    boolean enable = (dot != mark);
+    this.cutAction.setEnabled(enable);
+    this.copyAction.setEnabled(enable);
   }
 
   public void setFileStatusMessage() {
@@ -1506,11 +1509,11 @@
       this.reRunMenu.setEnabled(true);
 
       // reset sofa combo box with just the initial view
-      this.disableSofaListener = true;
+//      this.disableSofaListener = true;
       this.sofaSelectionComboBox.removeAllItems();
       this.sofaSelectionComboBox.addItem(CAS.NAME_DEFAULT_SOFA);
       this.sofaSelectionPanel.setVisible(false);
-      this.disableSofaListener = false;
+//      this.disableSofaListener = false;
       // MainFrame.this.textArea.setText(null);
       // MainFrame.this.textArea.repaint();
       MainFrame.this.updateIndexTree(true);
@@ -1529,12 +1532,12 @@
         this.cas.reset();
         setLanguage();
         this.cas.setDocumentText(this.textArea.getText());
-        this.disableSofaListener = true;
+//        this.disableSofaListener = true;
         this.sofaSelectionComboBox.setSelectedIndex(0);
       }
       this.ae.process(this.cas);
       // Update sofacombobox here
-      this.disableSofaListener = true;
+//      this.disableSofaListener = true;
       int currentViewID = this.sofaSelectionComboBox.getSelectedIndex();
       this.sofaSelectionComboBox.removeAllItems();
       this.sofaSelectionComboBox.addItem(CAS.NAME_DEFAULT_SOFA);
@@ -1550,7 +1553,7 @@
           nonDefaultSofaFound = true;
         }
       }
-      this.disableSofaListener = false;
+//      this.disableSofaListener = false;
       this.sofaSelectionComboBox.setSelectedIndex(currentViewID);
       // make sofa selector visible if any text sofa other than the
       // default was found
@@ -1986,11 +1989,6 @@
     this.isDirty = isDirty;
   }
 
-  public void setCutCopyEnabled(boolean enable) {
-    this.cutAction.setEnabled(enable);
-    this.copyAction.setEnabled(enable);
-  }
-
   public Properties getPreferences() {
     return this.preferences;
   }
@@ -2067,10 +2065,6 @@
     this.xcasFileOpenDir = xcasFileOpenDir;
   }
 
-  public void setDisableSofaListener(boolean disableSofaListener) {
-    this.disableSofaListener = disableSofaListener;
-  }
-
   public void setCas(CAS cas) {
     this.cas = cas;
   }
@@ -2173,13 +2167,11 @@
   }
 
   /**
-   * @param handler TODO
-   * 
+   *  
    */
   public void handleSofas() {
     // Populate sofa combo box with the names of all text
     // Sofas in the CAS
-    setDisableSofaListener(true);
     String currentView = (String) this.sofaSelectionComboBox.getSelectedItem();
     this.sofaSelectionComboBox.removeAllItems();
     this.sofaSelectionComboBox.addItem(CAS.NAME_DEFAULT_SOFA);
@@ -2209,7 +2201,6 @@
     // than the default was found
     this.sofaSelectionPanel.setVisible(nonDefaultSofaFound);
     setCas(getCas().getView(newView));
-    setDisableSofaListener(false);
   
     this.sofaSelectionComboBox.setSelectedIndex(newIndex);
     String text = getCas().getDocumentText();

Modified: incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java
URL: http://svn.apache.org/viewvc/incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java?view=diff&rev=542836&r1=542835&r2=542836
==============================================================================
--- incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java (original)
+++ incubator/uima/uimaj/trunk/uimaj-tools/src/main/java/org/apache/uima/tools/cvd/control/CaretChangeHandler.java Wed May 30 08:10:50 2007
@@ -40,7 +40,6 @@
     final int dot = ce.getDot();
     final int mark = ce.getMark();
     this.main.setCaretStatus(dot, mark);
-    this.main.setCutCopyEnabled(dot == mark);
   }
 
 }