Revision: 934
Author: allain.lalonde
Date: Tue Jan 19 12:49:37 2010
Log: Removing deprecated code from 2.0-spike.
http://code.google.com/p/piccolo2d/source/detail?r=934

Modified:
/piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCamera.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCanvas.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/activities/PActivity.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/event/PBasicInputEventHandler.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/nodes/PText.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PPaintContext.java /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PUtil.java /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCameraTest.java /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCanvasTest.java /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PNodeTest.java /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/nodes/PTextTest.java /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/util/PUtilTest.java /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/PFrame.java /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/nodes/P3DRect.java /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/pswing/PSwing.java /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/PSemanticStroke.java /piccolo2d.java/branches/2.0-spike/swt/src/main/java/org/piccolo2d/swt/SWTGraphics2D.java

=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCamera.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCamera.java Tue Jan 19 12:49:37 2010
@@ -208,17 +208,7 @@
Rectangle2D.intersect(TEMP_REPAINT_RECT, getBoundsReference(), TEMP_REPAINT_RECT);
             repaintFrom(TEMP_REPAINT_RECT, repaintedLayer);
         }
-    }
-
-    /**
- * @deprecated by {...@link #repaintFromLayer(PBounds, PLayer)}. Will be removed
-     *    in version 2.0.
- * @param viewBounds bounds that require repainting, in view coordinates
-     * @param repaintedLayer layer dispatching the repaint notification
-     */
- public void repaintFromLayer(final PBounds viewBounds, final PNode repaintedLayer) { - throw new IllegalArgumentException("repaintedLayer not an instance of PLayer");
-    }
+    }

     /**
      * Return a reference to the list of layers viewed by this camera.
@@ -744,27 +734,7 @@
         }

         return null;
-    }
-
-    /**
- * Pan the camera's view from its current transform when the activity starts - * to a new transform so that the view bounds will contain (if possible, - * intersect if not possible) the new bounds in the camera layers coordinate
-     * system. If the duration is 0 then the view will be transformed
- * immediately, and null will be returned. Else a new PTransformActivity - * will get returned that is set to animate the camera's view transform to
-     * the new bounds.
-     *
-     * @deprecated Renamed to animateViewToPanToBounds
-     *
-     * @param includeBounds the bounds to which the view will animate to
-     * @param duration the duration of the animation given in milliseconds
-     *
-     * @return the scheduled PTransformActivity
-     */
- public PTransformActivity animateViewToIncludeBounds(final Rectangle2D includeBounds, final long duration) {
-        return animateViewToPanToBounds(includeBounds, duration);
-    }
+    }

     /**
      * Animate the cameras view transform from its current value when the
@@ -772,7 +742,7 @@
      *
* @param destination the transform to which the view should be transformed
      *            into
- * @param duration the duraiton in milliseconds the animation should take + * @param duration the duration in milliseconds the animation should take
      *
      * @return the scheduled PTransformActivity
      */
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCanvas.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PCanvas.java Tue Jan 19 12:49:37 2010
@@ -78,34 +78,12 @@
      */
     private static final long serialVersionUID = 1L;

-    /**
-     * @deprecated this is a typo and clients should change their code to
-     *             reflect the correct spelling
-     */
- public static final String INTERATING_CHANGED_NOTIFICATION = "INTERATING_CHANGED_NOTIFICATION";
-
-    /**
-     * The property name that identifies a change in the interacting state.
-     *
-     * @since 1.3
-     * @deprecated in favor of PROPERTY_INTERACTING
-     */
- public static final String INTERACTING_CHANGED_NOTIFICATION = "INTERACTING_CHANGED_NOTIFICATION";
-
     /**
      * The property name that identifies a change in the interacting state.
      *
      * @since 1.3
      */
- public static final String PROPERTY_INTERACTING = "INTERACTING_CHANGED_NOTIFICATION";
-
-    /**
-     * Used as a public global to track the current canvas.
-     *
- * @deprecated since it falsely assumes that there is only one PCanvas per
-     *             program
-     */
-    public static PCanvas CURRENT_ZCANVAS = null;
+ public static final String PROPERTY_INTERACTING = "INTERACTING_CHANGED_NOTIFICATION";

     /** The camera though which this Canvas is viewing. */
     private PCamera camera;
@@ -165,8 +143,7 @@
      * Construct a canvas with the basic scene graph consisting of a root,
      * camera, and layer. Zooming and panning are automatically installed.
      */
-    public PCanvas() {
-        CURRENT_ZCANVAS = this;
+    public PCanvas() {
         cursorStack = new PStack();
         setCamera(createDefaultCamera());
         setDefaultRenderQuality(PPaintContext.HIGH_QUALITY_RENDERING);
@@ -648,17 +625,6 @@
public Timer createTimer(final int delay, final ActionListener listener) {
         return new Timer(delay, listener);
     }
-
-    /**
-     * Returns the quality to use when not animating or interacting.
-     *
-     * @since 1.3
-     * @deprecated in favor or getNormalRenderQuality
-     * @return the render quality to use when not animating or interacting
-     */
-    public int getDefaultRenderQuality() {
-        return normalRenderQuality;
-    }

     /**
      * Returns the quality to use when not animating or interacting.
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java Tue Jan 19 12:49:37 2010
@@ -831,37 +831,6 @@

         return value.doubleValue();
     }
-
-    /**
-     * @deprecated use getAttribute(Object key)instead.
-     *
-     * @param key name of property to search for
-     * @return value of matching client property
-     */
-    public Object getClientProperty(final Object key) {
-        return getAttribute(key);
-    }
-
-    /**
-     * @deprecated use addAttribute(Object key, Object value)instead.
-     *
-     * @param key name of property to add
-     * @param value value or new attribute
-     */
-    public void addClientProperty(final Object key, final Object value) {
-        addAttribute(key, value);
-    }
-
-    /**
-     * @deprecated use getClientPropertyKeysEnumerator() instead.
-     *
-     * @return iterator for client property keys
-     */
-    public Iterator getClientPropertyKeysIterator() {
-        final Enumeration enumeration = getClientPropertyKeysEnumeration();
-
-        return new ClientPropertyKeyIterator(enumeration);
-    }

     // ****************************************************************
     // Copying - Methods for copying this node and its descendants.
@@ -2407,47 +2376,7 @@
             at.translate(dx, dy);
             return animateToTransform(at, millis);
         }
-    }
-
-    /**
-     * @deprecated in favor of animateToRelativePosition
-     *
- * It will calculate the necessary transform in order to make - * this node appear at a particular position relative to the - * specified bounding box. The source point specifies a point in - * the unit square (0, 0) - (1, 1) that represents an anchor
-     *             point on the corresponding node to this transform. The
- * destination point specifies an anchor point on the reference - * node. The position method then computes the transform that - * results in transforming this node so that the source anchor - * point coincides with the reference anchor point. This can be
-     *             useful for layout algorithms as it is straightforward to
-     *             position one object relative to another.
-     *             <p>
- * For example, If you have two nodes, A and B, and you call
-     *
-     *             <PRE>
-     * Point2D srcPt = new Point2D.Double(1.0, 0.0);
-     * Point2D destPt = new Point2D.Double(0.0, 0.0);
-     * A.position(srcPt, destPt, B.getGlobalBounds(), 750, null);
-     * </PRE>
-     *
- * The result is that A will move so that its upper-right corner - * is at the same place as the upper-left corner of B, and the - * transition will be smoothly animated over a period of 750
-     *             milliseconds.
-     *
- * @param srcPt The anchor point on this transform's node (normalized to a
-     *            unit square)
- * @param destPt The anchor point on destination bounds (normalized to a
-     *            unit square)
- * @param destBounds The bounds (in global coordinates) used to calculate
-     *            this transform's node
- * @param millis Number of milliseconds over which to perform the animation
-     */
- public void position(final Point2D srcPt, final Point2D destPt, final Rectangle2D destBounds, final int millis) {
-        animateToRelativePosition(srcPt, destPt, destBounds, millis);
-    };
+    }

     /**
      * Return a copy of the transform associated with this node.
@@ -3682,16 +3611,7 @@
private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException {
         in.defaultReadObject();
         parent = (PNode) in.readObject();
-    }
-
-    /**
- * @deprecated see http://code.google.com/p/piccolo2d/issues/detail?id=99
-     *
-     * @return a string representation of this node's state
-     */
-    protected String paramString() {
-        return "";
-    }
+    }

     /**
* Returns an array of input event listeners that are attached to this node.
@@ -3711,27 +3631,7 @@
             result[i] = (PInputEventListener) listeners[i];
         }
         return result;
-    }
-
- private static final class ClientPropertyKeyIterator implements Iterator {
-        private final Enumeration enumeration;
-
-        private ClientPropertyKeyIterator(final Enumeration enumeration) {
-            this.enumeration = enumeration;
-        }
-
-        public boolean hasNext() {
-            return enumeration.hasMoreElements();
-        }
-
-        public Object next() {
-            return enumeration.nextElement();
-        }
-
-        public void remove() {
-            throw new UnsupportedOperationException();
-        }
-    }
+    }

     /**
      * <b>PSceneGraphDelegate</b> is an interface to receive low level node
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/activities/PActivity.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/activities/PActivity.java Tue Jan 19 12:49:37 2010
@@ -426,16 +426,7 @@
             return Long.MAX_VALUE;
         }
         return startTime + duration;
-    }
-
-    /**
- * @deprecated see http://code.google.com/p/piccolo2d/issues/detail?id=99
-     *
-     * @return string representation of this activity
-     */
-    protected String paramString() {
-        return "";
-    }
+    }

     /**
* <b>PActivityDelegate</b> is used by classes to learn about and act on the
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/event/PBasicInputEventHandler.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/event/PBasicInputEventHandler.java Tue Jan 19 12:49:37 2010
@@ -300,14 +300,5 @@
      *            details
      */
     public void keyboardFocusLost(final PInputEvent event) {
-    }
-
-    /**
- * @deprecated see http://code.google.com/p/piccolo2d/issues/detail?id=99
-     *
-     * @return empty string since this method is deprecated
-     */
-    protected String paramString() {
-        return "";
-    }
-}
+    }
+}
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/nodes/PText.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/nodes/PText.java Tue Jan 19 12:49:37 2010
@@ -192,25 +192,7 @@
     public PText(final String text) {
         this();
         setText(text);
-    }
-
-    /**
-     * @deprecated by {...@link #getHorizontalAlignment()}
-     *
-     * @return the horizontal alignment value of this node
-     */
-    public float getJustification() {
-        return getHorizontalAlignment();
-    }
-
-    /**
-     * @deprecated by {...@link #setHorizontalAlignment(float)}
-     *
- * @param justification horizontal alignment value to assign to this node
-     */
-    public void setJustification(final float justification) {
-        setHorizontalAlignment(justification);
-    }
+    }

     /**
      * Return the horizontal alignment for this text node. The horizontal
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PPaintContext.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PPaintContext.java Tue Jan 19 12:49:37 2010
@@ -60,13 +60,7 @@
public static FontRenderContext RENDER_QUALITY_LOW_FRC = new FontRenderContext(null, false, true);

     /** Font context to use while in high quality rendering. */
- public static FontRenderContext RENDER_QUALITY_HIGH_FRC = new FontRenderContext(null, true, true);
-
-    /**
- * @deprecated will disappear as soon as possible Global for accessing the
-     *             current paint context while painting.
-     **/
-    public static PPaintContext CURRENT_PAINT_CONTEXT;
+ public static FontRenderContext RENDER_QUALITY_HIGH_FRC = new FontRenderContext(null, true, true);

     /** Used while calculating scale at which rendering is occurring. */
     private static final double[] PTS = new double[4];
@@ -113,8 +107,6 @@
         }

         localClipStack.push(clip.getBounds2D());
-
-        CURRENT_PAINT_CONTEXT = this;
     }

     /**
@@ -161,16 +153,7 @@
      */
     public void pushCamera(final PCamera aCamera) {
         cameraStack.push(aCamera);
-    }
-
-    /**
-     * @deprecated in favor of popCamera()
-     *
-     * @param aCamera absolute not used in any way
-     */
-    public void popCamera(final PCamera aCamera) {
-        cameraStack.pop();
-    }
+    }

     /**
      * Removes the camera at the top of the camera stack.
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PUtil.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/util/PUtil.java Tue Jan 19 12:49:37 2010
@@ -35,7 +35,6 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
-import java.io.OutputStream;
 import java.io.Serializable;
 import java.util.Collections;
 import java.util.Enumeration;
@@ -81,28 +80,7 @@
         public Object nextElement() {
             return null;
         }
-    };
-
-    /**
-     * @deprecated This has been moved into a private static class of
-     *             PObjectOutputStream
-     */
-    public static OutputStream NULL_OUTPUT_STREAM = new OutputStream() {
-        public void close() {
-        }
-
-        public void flush() {
-        }
-
-        public void write(final byte[] b) {
-        }
-
-        public void write(final byte[] b, final int off, final int len) {
-        }
-
-        public void write(final int b) {
-        }
-    };
+    };

     /**
      * Creates the simplest possible scene graph. 1 Camera, 1 Layer, 1 Root
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCameraTest.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCameraTest.java Tue Jan 19 12:49:37 2010
@@ -40,11 +40,8 @@
 import java.io.IOException;
 import java.util.Collection;

-import org.piccolo2d.PCamera;
-import org.piccolo2d.PCanvas;
-import org.piccolo2d.PComponent;
-import org.piccolo2d.PLayer;
-import org.piccolo2d.PNode;
+import junit.framework.TestCase;
+
 import org.piccolo2d.activities.PActivity;
 import org.piccolo2d.activities.PTransformActivity;
 import org.piccolo2d.util.PAffineTransform;
@@ -54,8 +51,6 @@
 import org.piccolo2d.util.PPaintContext;
 import org.piccolo2d.util.PPickPath;

-import junit.framework.TestCase;
-
 /**
  * Unit test for PCamera.
  */
@@ -475,17 +470,7 @@
         PLayer layer = new PLayer();
// todo: layer is not contained in list of layers viewed by camera, should complain
         camera.repaintFromLayer(new PBounds(0, 0, 1, 1), layer);
-    }
-
-    public void testRepaintFromLayerNotALayer() {
-        try {
-            camera.repaintFromLayer(new PBounds(0, 0, 1, 1), new PNode());
- fail("repaintFromLayer(PBounds, PNode) expected IllegalArgumentException");
-        }
-        catch (IllegalArgumentException e) {
-            // expected
-        }
-    }
+    }

     public void testRemoveLayerAtIndex() {
         PLayer layer = new PLayer();
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCanvasTest.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PCanvasTest.java Tue Jan 19 12:49:37 2010
@@ -74,13 +74,13 @@

     public void testSetInteractingFiresChangeEvent() {
final MockPropertyChangeListener mockListener = new MockPropertyChangeListener(); - canvas.addPropertyChangeListener(PCanvas.INTERACTING_CHANGED_NOTIFICATION, mockListener); + canvas.addPropertyChangeListener(PCanvas.PROPERTY_INTERACTING, mockListener);
         canvas.setInteracting(true);
         assertEquals(1, mockListener.getPropertyChangeCount());
     }

-    public void testDefaultRenderQualityIsHigh() {
- assertEquals(PPaintContext.HIGH_QUALITY_RENDERING, canvas.getDefaultRenderQuality());
+    public void testNormalRenderQualityIsHigh() {
+ assertEquals(PPaintContext.HIGH_QUALITY_RENDERING, canvas.getNormalRenderQuality());
     }

     public void testDefaultAnimatingRenderQualityIsLow() {
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PNodeTest.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/PNodeTest.java Tue Jan 19 12:49:37 2010
@@ -41,14 +41,12 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Enumeration;
-import java.util.Iterator;
 import java.util.ListIterator;

 import javax.swing.text.MutableAttributeSet;

-import org.piccolo2d.PCanvas;
-import org.piccolo2d.PLayer;
-import org.piccolo2d.PNode;
+import junit.framework.TestCase;
+
 import org.piccolo2d.activities.PActivity;
 import org.piccolo2d.activities.PColorActivity;
 import org.piccolo2d.activities.PInterpolatingActivity;
@@ -64,8 +62,6 @@
 import org.piccolo2d.util.PPickPath;
 import org.piccolo2d.util.PUtil;

-import junit.framework.TestCase;
-
 /**
  * Unit test for PNode.
  */
@@ -595,31 +591,7 @@
public void testGetDoubleAttributeReturnsValueIfFoundWhenDefaultProvided() {
         node.addAttribute("Found", new Double(5));
         assertEquals(5, node.getIntegerAttribute("Found", 10), 0.001);
-    }
-
-    public void testGetAddClienProperty() {
-        assertNull(node.getClientProperty("Testing"));
-        node.addClientProperty("Testing", "Hello");
-        assertEquals("Hello", node.getClientProperty("Testing"));
-    }
-
- public void testGetClientPropertyKeysIteratorIsNotNullOnEmptyClientProperties() {
-        final Iterator iterator = node.getClientPropertyKeysIterator();
-        assertNotNull(iterator);
-        assertFalse(iterator.hasNext());
-    }
-
- public void testGetClientPropertyKeysIteratorReturnsValidIteraotOnPropertiesExist() {
-        node.addClientProperty("A", "Aval");
-        node.addClientProperty("B", "Bval");
-        final Iterator iterator = node.getClientPropertyKeysIterator();
-        assertNotNull(iterator);
-        assertTrue(iterator.hasNext());
-        assertEquals("A", iterator.next());
-        assertTrue(iterator.hasNext());
-        assertEquals("B", iterator.next());
-        assertFalse(iterator.hasNext());
-    }
+    }

     public void testLocalToParentModifiesGivenPoint() {
         final PNode parent = new PNode();
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/nodes/PTextTest.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/nodes/PTextTest.java Tue Jan 19 12:49:37 2010
@@ -100,16 +100,7 @@
     public void testToString() {
         textNode.setText("hello world");
         assertNotNull(textNode.toString());
-    }
-
-    public void testJustificationIsLeftByDefault() {
- assertEquals(Component.LEFT_ALIGNMENT, textNode.getJustification(), 0.000001);
-    }
-
-    public void testSetJustificationPersists() {
-        textNode.setJustification(Component.RIGHT_ALIGNMENT);
- assertEquals(Component.RIGHT_ALIGNMENT, textNode.getJustification(), 0.000001);
-    }
+    }

     public void testHorizontalAlignmentIsLeftByDefault() {
assertEquals(Component.LEFT_ALIGNMENT, textNode.getHorizontalAlignment(), 0.000001);
=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/util/PUtilTest.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/test/java/org/piccolo2d/util/PUtilTest.java Tue Jan 19 12:49:37 2010
@@ -27,12 +27,9 @@
  */
 package org.piccolo2d.util;

-import java.io.OutputStream;
 import java.util.Enumeration;
 import java.util.Iterator;

-import org.piccolo2d.util.PUtil;
-
 import junit.framework.TestCase;

 /**
@@ -56,15 +53,7 @@
         }
         finally {
             PUtil.NULL_ITERATOR = ni;
-        }
-
-        final OutputStream no = PUtil.NULL_OUTPUT_STREAM;
-        try {
-            PUtil.NULL_OUTPUT_STREAM = null;
-        }
-        finally {
-            PUtil.NULL_OUTPUT_STREAM = no;
-        }
+        }
     }

 }
=======================================
--- /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/PFrame.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/PFrame.java Tue Jan 19 12:49:37 2010
@@ -329,16 +329,5 @@
      * beforeInitialize();
      */
     public void initialize() {
-    }
-
-    /**
-     * Method for testing the creating of PFrame.
-     *
-     * @deprecated since it's not terribly useful
-     *
-     * @param argv command line arguments
-     */
-    public static void main(final String[] argv) {
-        new PFrame();
-    }
-}
+    }
+}
=======================================
--- /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/nodes/P3DRect.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/nodes/P3DRect.java Tue Jan 19 12:49:37 2010
@@ -212,15 +212,5 @@
         topLeftInnerColor = topLeftOuterColor.darker();
         bottomRightInnerColor = color.brighter();
         bottomRightOuterColor = bottomRightInnerColor.brighter();
-    }
-
-    /**
-     * TODO can we remove this?
-     *
-     * @deprecated since it has been moved to P3DRectExample.
-     *
-     * @param args Command line arguments
-     */
-    public static void main(final String[] args) {
-    }
-}
+    }
+}
=======================================
--- /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/pswing/PSwing.java Thu Jan 14 13:48:07 2010 +++ /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/pswing/PSwing.java Tue Jan 19 12:49:37 2010
@@ -340,17 +340,7 @@

         updateBounds();
         listenForCanvas(this);
-    }
-
-    /**
-     * @deprecated by {...@link #PSwing(JComponent)}
-     *
-     * @param swingCanvas canvas on which the PSwing node will be embedded
-     * @param component not used
-     */
- public PSwing(final PSwingCanvas swingCanvas, final JComponent component) {
-        this(component);
-    }
+    }

     /**
* Ensures the bounds of the underlying component are accurate, and sets the
=======================================
--- /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/PSemanticStroke.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/extras/src/main/java/org/piccolo2d/extras/util/PSemanticStroke.java Tue Jan 19 12:49:37 2010
@@ -34,7 +34,6 @@
 import org.piccolo2d.util.PPaintContext;
 import org.piccolo2d.util.PPickPath;

-
 /**
  *
  * @see org.piccolo2d.nodes.PPath
@@ -43,100 +42,91 @@
  * @author Marcus Rohrmoser
  */
 abstract class PSemanticStroke implements Stroke {
-    protected static final double THRESHOLD = 1e-6;
-
-    private transient float recentScale;
-    private transient Stroke recentStroke;
-    protected final Stroke stroke;
-
-    protected PSemanticStroke(final Stroke stroke) {
-        this.stroke = stroke;
-        recentStroke = stroke;
-        recentScale = 1.0F;
-    }
-
-    /**
-     * Ask {...@link #getActiveScale()}, call {...@link #newStroke(float)} if
-     * necessary and delegate to {...@link Stroke#createStrokedShape(Shape)}.
-     *
-     * @param s
-     */
-    public Shape createStrokedShape(final Shape s) {
-        final float currentScale = getActiveScale();
-        if (Math.abs(currentScale - recentScale) > THRESHOLD) {
-            recentScale = currentScale;
-            recentStroke = newStroke(recentScale);
-        }
-        return recentStroke.createStrokedShape(s);
-    }
-
-    /**
-     * Returns true if this stroke is equivalent to the object provided.
-     *
-     * @param obj Object being tested
-     * @return true if object is equivalent
-     */
-    public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final PSemanticStroke other = (PSemanticStroke) obj;
-        if (stroke == null) {
-            if (other.stroke != null) {
-                return false;
-            }
-        }
-        else if (!stroke.equals(other.stroke)) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Detect the current scale. Made protected to enable custom
-     * re-implementations.
-     */
-    protected float getActiveScale() {
- // FIXME Honestly I don't understand this distinction - shouldn't it
-        // always be PPaintContext.CURRENT_PAINT_CONTEXT regardless of the
-        // debugging flag?
-        if (PDebug.getProcessingOutput()) {
-            if (PPaintContext.CURRENT_PAINT_CONTEXT != null) {
- return (float) PPaintContext.CURRENT_PAINT_CONTEXT.getScale();
-            }
-        }
-        else {
-            if (PPickPath.CURRENT_PICK_PATH != null) {
-                return (float) PPickPath.CURRENT_PICK_PATH.getScale();
-            }
-        }
-        return 1.0f;
-    }
-
-    public int hashCode() {
-        final int prime = 31;
-        int result = prime;
-
-        if (stroke != null) {
-            result += stroke.hashCode();
-        }
-
-        return result;
-    }
-
-    /**
-     * Factory to create a new internal stroke delegate. Made protected to
-     * enable custom re-implementations.
-     */
-    protected abstract Stroke newStroke(final float activeScale);
-
-    public String toString() {
-        return stroke.toString();
-    }
-}
+       protected static final double THRESHOLD = 1e-6;
+
+       private transient float recentScale;
+       private transient Stroke recentStroke;
+       protected final Stroke stroke;
+
+       protected PSemanticStroke(final Stroke stroke) {
+               this.stroke = stroke;
+               recentStroke = stroke;
+               recentScale = 1.0F;
+       }
+
+       /**
+        * Ask {...@link #getActiveScale()}, call {...@link #newStroke(float)} 
if
+        * necessary and delegate to {...@link 
Stroke#createStrokedShape(Shape)}.
+        *
+        * @param s
+        */
+       public Shape createStrokedShape(final Shape s) {
+               final float currentScale = getActiveScale();
+               if (Math.abs(currentScale - recentScale) > THRESHOLD) {
+                       recentScale = currentScale;
+                       recentStroke = newStroke(recentScale);
+               }
+               return recentStroke.createStrokedShape(s);
+       }
+
+       /**
+        * Returns true if this stroke is equivalent to the object provided.
+        *
+        * @param obj
+        *            Object being tested
+        * @return true if object is equivalent
+        */
+       public boolean equals(final Object obj) {
+               if (this == obj) {
+                       return true;
+               }
+               if (obj == null) {
+                       return false;
+               }
+               if (getClass() != obj.getClass()) {
+                       return false;
+               }
+               final PSemanticStroke other = (PSemanticStroke) obj;
+               if (stroke == null) {
+                       if (other.stroke != null) {
+                               return false;
+                       }
+               } else if (!stroke.equals(other.stroke)) {
+                       return false;
+               }
+               return true;
+       }
+
+       /**
+        * Detect the current scale. Made protected to enable custom
+        * re-implementations.
+        */
+       protected float getActiveScale() {
+               if (PPickPath.CURRENT_PICK_PATH != null) {
+                       return (float) PPickPath.CURRENT_PICK_PATH.getScale();
+               }
+
+               return 1.0f;
+       }
+
+       public int hashCode() {
+               final int prime = 31;
+               int result = prime;
+
+               if (stroke != null) {
+                       result += stroke.hashCode();
+               }
+
+               return result;
+       }
+
+       /**
+        * Factory to create a new internal stroke delegate. Made protected to
+        * enable custom re-implementations.
+        */
+       protected abstract Stroke newStroke(final float activeScale);
+
+       public String toString() {
+               return stroke.toString();
+       }
+}
=======================================
--- /piccolo2d.java/branches/2.0-spike/swt/src/main/java/org/piccolo2d/swt/SWTGraphics2D.java Tue Jan 19 12:39:24 2010 +++ /piccolo2d.java/branches/2.0-spike/swt/src/main/java/org/piccolo2d/swt/SWTGraphics2D.java Tue Jan 19 12:49:37 2010
@@ -393,28 +393,7 @@
             FONT_CACHE.put(fontString, cachedFont);
         }
         return cachedFont;
-    }
-
-    /**
-     * Deprecated since SWT now handles this.
-     *
-     * @deprecated
-     * @return font that's been transformed by the current transform
-     */
-    protected org.eclipse.swt.graphics.Font getTransformedFont() {
-        if (curFont != null) {
-            final FontData fontData = curFont.getFontData()[0];
-            int height = fontData.getHeight();
-            TEMP_RECT.setRect(0, 0, height, height);
-            SWTShapeManager.transform(TEMP_RECT, transform);
-            height = (int) (TEMP_RECT.getHeight() + 0.5);
-
- final String fontString = "name=" + fontData.getName() + ";bold=" + ((fontData.getStyle() & SWT.BOLD) != 0) - + ";italic=" + ((fontData.getStyle() & SWT.ITALIC) != 0) + ";size=" + height;
-            return getFont(fontString);
-        }
-        return null;
-    }
+    }

     // /////////////////////////
     // AFFINE TRANSFORM METHODS
@@ -1200,15 +1179,7 @@
         SWTShapeManager.awtToSWT(TEMP_RECT, SWT_RECT);

gc.fillGradientRectangle(SWT_RECT.x, SWT_RECT.y, SWT_RECT.width, SWT_RECT.height, vertical);
-    }
-
-    /**
-     * @deprecated since underlying method has been deprecated
-     * @param xOr whether to be in xOr mode
-     */
-    public void setXORMode(final boolean xOr) {
-        gc.setXORMode(xOr);
-    }
+    }

     /**
* Returns the advance width of the character provided in the current font.
-- 
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to