You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/09/25 16:57:17 UTC

svn commit: r818866 - /incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java

Author: tvolkert
Date: Fri Sep 25 14:57:16 2009
New Revision: 818866

URL: http://svn.apache.org/viewvc?rev=818866&view=rev
Log:
Made TerraTableViewSkin trigger highlight-based repaints more conservatively (in was triggering repaints even if the highlight wasn't being painted)

Modified:
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java?rev=818866&r1=818865&r2=818866&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java Fri Sep 25 14:57:16 2009
@@ -873,10 +873,14 @@
     public boolean mouseMove(Component component, int x, int y) {
         boolean consumed = super.mouseMove(component, x, y);
 
+        TableView tableView = (TableView)getComponent();
+
         int previousHighlightedIndex = this.highlightedIndex;
         highlightedIndex = getRowAt(y);
 
-        if (previousHighlightedIndex != highlightedIndex) {
+        if (previousHighlightedIndex != highlightedIndex
+            && tableView.getSelectMode() != TableView.SelectMode.NONE
+            && showHighlight) {
             if (previousHighlightedIndex != -1) {
                 repaintComponent(getRowBounds(previousHighlightedIndex));
             }
@@ -893,7 +897,11 @@
     public void mouseOut(Component component) {
         super.mouseOut(component);
 
-        if (highlightedIndex != -1) {
+        TableView tableView = (TableView)getComponent();
+
+        if (highlightedIndex != -1
+            && tableView.getSelectMode() != TableView.SelectMode.NONE
+            && showHighlight) {
             repaintComponent(getRowBounds(highlightedIndex));
         }
 
@@ -985,13 +993,17 @@
     @Override
     public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
         int wheelRotation, int x, int y) {
-        if (highlightedIndex != -1) {
-            Bounds rowBounds = getRowBounds(highlightedIndex);
+        TableView tableView = (TableView)getComponent();
 
-            highlightedIndex = -1;
+        if (highlightedIndex != -1
+            && tableView.getSelectMode() != TableView.SelectMode.NONE
+            && showHighlight) {
+            Bounds rowBounds = getRowBounds(highlightedIndex);
             repaintComponent(rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height, true);
         }
 
+        highlightedIndex = -1;
+
         return super.mouseWheel(component, scrollType, scrollAmount, wheelRotation, x, y);
     }
 
@@ -1051,11 +1063,14 @@
         }
 
         // Clear the highlight
-        if (highlightedIndex != -1) {
-            highlightedIndex = -1;
+        if (highlightedIndex != -1
+            && tableView.getSelectMode() != TableView.SelectMode.NONE
+            && showHighlight) {
             repaintComponent(getRowBounds(highlightedIndex));
         }
 
+        highlightedIndex = -1;
+
         return consumed;
     }