You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/08/21 14:50:04 UTC

svn commit: r806535 - in /incubator/pivot/trunk: core/src/org/apache/pivot/collections/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/ wtk/src/org/apache/pivot/wtk/skin/ wtk/src/org/apache/pivot/wtk/skin/terra/

Author: gbrown
Date: Fri Aug 21 12:50:04 2009
New Revision: 806535

URL: http://svn.apache.org/viewvc?rev=806535&view=rev
Log:
Various minor fixes.

Modified:
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/FilteredList.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTableViewSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/FilteredList.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/FilteredList.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/FilteredList.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/FilteredList.java Fri Aug 21 12:50:04 2009
@@ -472,7 +472,7 @@
 
     @Override
     public void setComparator(Comparator<T> comparator) {
-        Comparator<T> previousComparator = view.getComparator();
+        Comparator<T> previousComparator = this.comparator;
 
         if (previousComparator != comparator) {
             this.comparator = comparator;

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Fri Aug 21 12:50:04 2009
@@ -1384,6 +1384,9 @@
 
     /**
      * Returns this application's origin (the URL of it's originating server).
+     *
+     * @return
+     * The application's origin, or <tt>null</tt> if the origin cannot be determined.
      */
     public static URL getOrigin() {
         return origin;

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewDateCellRenderer.java Fri Aug 21 12:50:04 2009
@@ -32,7 +32,7 @@
 public class TableViewDateCellRenderer extends TableViewCellRenderer {
     private DateFormat dateFormat = DEFAULT_DATE_FORMAT;
 
-    public static final DateFormat DEFAULT_DATE_FORMAT = DateFormat.getDateInstance();
+    protected static final DateFormat DEFAULT_DATE_FORMAT = DateFormat.getDateInstance();
 
     public DateFormat getDateFormat() {
         return dateFormat;

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java Fri Aug 21 12:50:04 2009
@@ -312,4 +312,10 @@
             component.repaint(x, y, width, height);
         }
     }
+
+    protected void repaintComponent(int x, int y, int width, int height, boolean immediate) {
+        if (component != null) {
+            component.repaint(x, y, width, height, immediate);
+        }
+    }
 }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java Fri Aug 21 12:50:04 2009
@@ -683,10 +683,10 @@
         int wheelRotation, int x, int y) {
         if (highlightedIndex != -1) {
             Bounds itemBounds = getItemBounds(highlightedIndex);
-            repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
-        }
 
-        highlightedIndex = -1;
+            highlightedIndex = -1;
+            repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height, true);
+        }
 
         return super.mouseWheel(component, scrollType, scrollAmount, wheelRotation, x, y);
     }

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=806535&r1=806534&r2=806535&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 Aug 21 12:50:04 2009
@@ -944,10 +944,10 @@
         int wheelRotation, int x, int y) {
         if (highlightedIndex != -1) {
             Bounds rowBounds = getRowBounds(highlightedIndex);
-            repaintComponent(rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height);
-        }
 
-        highlightedIndex = -1;
+            highlightedIndex = -1;
+            repaintComponent(rowBounds.x, rowBounds.y, rowBounds.width, rowBounds.height, true);
+        }
 
         return super.mouseWheel(component, scrollType, scrollAmount, wheelRotation, x, y);
     }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=806535&r1=806534&r2=806535&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Fri Aug 21 12:50:04 2009
@@ -26,6 +26,7 @@
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.serialization.JSONSerializer;
 import org.apache.pivot.serialization.SerializationException;
+import org.apache.pivot.util.ThreadUtilities;
 import org.apache.pivot.util.concurrent.TaskExecutionException;
 import org.apache.pivot.wtk.Accordion;
 import org.apache.pivot.wtk.ActivityIndicator;
@@ -100,6 +101,18 @@
 
     /**
      * Constructs a theme, pulling the font and color palette from a JSON file
+     * at the specified location.
+     *
+     * @param location
+     *
+     * @see #TerraTheme(URL)
+     */
+    public TerraTheme(String location) {
+        this(ThreadUtilities.getClassLoader().getResource(location));
+    }
+
+    /**
+     * Constructs a theme, pulling the font and color palette from a JSON file
      * at the specified location. The JSON file should represent a <tt>Map</tt>
      * containing the following properties:
      * <p>
@@ -137,6 +150,7 @@
      * @param location
      * The location of the JSON file that defines the theme's font and colors.
      */
+    @SuppressWarnings("unchecked")
     public TerraTheme(URL location) {
         if (location == null) {
             throw new IllegalArgumentException("location is null.");
@@ -202,11 +216,6 @@
         componentSkinMap.put(TerraSplitPaneSkin.SplitterShadow.class, TerraSplitPaneSkin.SplitterShadowSkin.class);
         componentSkinMap.put(TerraTabPaneSkin.TabButton.class, TerraTabPaneSkin.TabButtonSkin.class);
 
-        loadScheme(location);
-    }
-
-    @SuppressWarnings("unchecked")
-    public void loadScheme(URL location) {
         try {
             InputStream inputStream = location.openStream();