Author: allain.lalonde
Date: Fri Jul 17 09:08:52 2009
New Revision: 488

Modified:
    piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java
     
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PLayerTest.java

Log:
Fixed Issue 91; deprecated repaintFromlayer(PBounds, PNode) in favor of the  
more specific repaintFromlayer(PBounds, PLayer) making it impossible to  
accidentally pass a camera say to this method.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java
==============================================================================
--- piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java     
 
(original)
+++ piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java     
 
Fri Jul 17 09:08:52 2009
@@ -151,7 +151,7 @@
       * transformed from view to local in this case. Unlike most repaint  
methods
       * in piccolo this one must not modify the viewBounds parameter.
       */
-    public void repaintFromLayer(PBounds viewBounds, PNode repaintedLayer)  
{
+    public void repaintFromLayer(PBounds viewBounds, PLayer  
repaintedLayer) {
          TEMP_REPAINT_RECT.setRect(viewBounds);

          viewToLocal(TEMP_REPAINT_RECT);
@@ -159,6 +159,17 @@
              PBounds.intersect(TEMP_REPAINT_RECT, getBoundsReference(),  
TEMP_REPAINT_RECT);
              repaintFrom(TEMP_REPAINT_RECT, repaintedLayer);
          }
+    }
+
+    /**
+     * @deprected since a more specific repaintFromLayer method is  
available
+     *
+     * Repaint from one of the cameras layers. The repaint region needs to  
be
+     * transformed from view to local in this case. Unlike most repaint  
methods
+     * in piccolo this one must not modify the viewBounds parameter.
+     */
+    public void repaintFromLayer(PBounds viewBounds, PNode repaintedLayer)  
{
+        this.repaintFromLayer(viewBounds, (PLayer)repaintedLayer);
      }

      // ****************************************************************

Modified:  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PLayerTest.java
==============================================================================
---  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PLayerTest.java      
 
(original)
+++  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/PLayerTest.java      
 
Fri Jul 17 09:08:52 2009
@@ -123,7 +123,7 @@
                
                List notifications = new ArrayList();
                
-               public void repaintFromLayer(PBounds bounds, PNode layer) {     
                
+               public void repaintFromLayer(PBounds bounds, PLayer layer) {    
                
                        notifications.add(new Notification("repaintFromLayer", 
bounds, layer));
                        super.repaintFromLayer(bounds, layer);
                }               

--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to