Revision: 14744
          http://gate.svn.sourceforge.net/gate/?rev=14744&view=rev
Author:   nirajaswani
Date:     2011-12-12 14:55:08 +0000 (Mon, 12 Dec 2011)
Log Message:
-----------
if the annotation is not selected and user right clicks, the annotation should 
be highlighted and the option menu with at least the align and  reset selection 
options

Modified Paths:
--------------
    gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/LinksView.java
    
gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/ParallelTextView.java

Modified: 
gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/LinksView.java
===================================================================
--- gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/LinksView.java    
2011-12-12 14:34:20 UTC (rev 14743)
+++ gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/LinksView.java    
2011-12-12 14:55:08 UTC (rev 14744)
@@ -470,6 +470,29 @@
           if(alignment.isAnnotationAligned(ah.annotation)) {
             // lets clear the latest selection
             clearLatestAnnotationsSelection();
+          } else {
+            // if user has right clicked and the unit is not already 
highlighted
+            // highlight it and show the right menu
+            // reducing one click for the user
+            if(!ah.highlighted) {
+              if(color == Color.WHITE)
+                color = AlignmentEditor.getColor(null, 0.5f);
+              ah.setHighlighted(true, color);
+              if(ah.isSourceDocument()) {
+                if(sourceLatestAnnotationsSelection == null) {
+                  sourceLatestAnnotationsSelection = new 
ArrayList<Annotation>();
+                }
+
+                if(!sourceLatestAnnotationsSelection.contains(ah.annotation))
+                  sourceLatestAnnotationsSelection.add(ah.annotation);
+              } else {
+                if(targetLatestAnnotationsSelection == null) {
+                  targetLatestAnnotationsSelection = new 
ArrayList<Annotation>();
+                }
+                if(!targetLatestAnnotationsSelection.contains(ah.annotation))
+                  targetLatestAnnotationsSelection.add(ah.annotation);
+              }
+            }
           }
 
           // we should show the option menu here

Modified: 
gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/ParallelTextView.java
===================================================================
--- 
gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/ParallelTextView.java 
    2011-12-12 14:34:20 UTC (rev 14743)
+++ 
gate/trunk/plugins/Alignment/src/gate/alignment/gui/views/ParallelTextView.java 
    2011-12-12 14:55:08 UTC (rev 14744)
@@ -524,14 +524,37 @@
           if(alignment.isAnnotationAligned(ah.annotation)) {
             // lets clear the latest selection
             clearLatestAnnotationsSelection();
+          } else {
+            // if user has right clicked and the unit is not already 
highlighted
+            // highlight it and show the right menu
+            // reducing one click for the user
+            if(!ah.highlighted) {
+              if(color == Color.WHITE)
+                color = AlignmentEditor.getColor(null, 0.5f);
+              ah.setHighlighted(true, color);
+              if(ah.isSourceDocument()) {
+                if(sourceLatestAnnotationsSelection == null) {
+                  sourceLatestAnnotationsSelection = new 
ArrayList<Annotation>();
+                }
+
+                if(!sourceLatestAnnotationsSelection.contains(ah.annotation))
+                  sourceLatestAnnotationsSelection.add(ah.annotation);
+              } else {
+                if(targetLatestAnnotationsSelection == null) {
+                  targetLatestAnnotationsSelection = new 
ArrayList<Annotation>();
+                }
+                if(!targetLatestAnnotationsSelection.contains(ah.annotation))
+                  targetLatestAnnotationsSelection.add(ah.annotation);
+              }
+            }
           }
 
           // we should show the option menu here
           JPopupMenu optionsMenu =
-                  alignmentTask.getAlignmentActionsManager()
-                          .prepareOptionsMenu(thisInstance,
-                                  alignment.isAnnotationAligned(ah.annotation),
-                                  ah.highlighted);
+                  
alignmentTask.getAlignmentActionsManager().prepareOptionsMenu(
+                          thisInstance,
+                          alignment.isAnnotationAligned(ah.annotation),
+                          ah.highlighted);
           optionsMenu.show(ah, (int)pt.getX(), (int)pt.getY());
           optionsMenu.setVisible(true);
           return;

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


------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
GATE-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gate-cvs

Reply via email to