[piccolo2d-dev] Issue 116 in piccolo2d: New round of clirr errors, as of r624

2009-07-30 Thread codesite-noreply

Updates:
Status: Started
Labels: Milestone-1.3

Comment #2 on issue 116 by mr0...@mro.name: New round of clirr errors, as  
of r624
http://code.google.com/p/piccolo2d/issues/detail?id=116

As of final see commits r625 + r626.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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



[piccolo2d-dev] Issue 116 in piccolo2d: New round of clirr errors, as of r624

2009-07-30 Thread codesite-noreply


Comment #3 on issue 116 by heuermh: New round of clirr errors, as of r624
http://code.google.com/p/piccolo2d/issues/detail?id=116

The code cleaner is smarter than we are.  I like it.  ;)

No clirr errors or significant warnings remain.

I misunderstood the ...has been removed, but an inherited definition  
exists
warnings before.  I took that to mean that a some subclass of PNode was  
still
overriding toString or paramString.  The warning actually says that in a  
subclass of
PNode, say PText, its paramString method was removed and it now defaults to  
the
deprecated definition in PNode, which is fine.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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



[piccolo2d-dev] [piccolo2d] r627 commited - Refactored PCacheCamera to cleanup and made it work in Headless mode.

2009-07-30 Thread codesite-noreply

Revision: 627
Author: allain.lalonde
Date: Thu Jul 30 12:23:57 2009
Log: Refactored PCacheCamera to cleanup and made it work in Headless mode.
http://code.google.com/p/piccolo2d/source/detail?r=627

Modified:
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PCacheCamera.java

===
---  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PCacheCamera.java
   
Tue Jul 28 12:46:54 2009
+++  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PCacheCamera.java
   
Thu Jul 30 12:23:57 2009
@@ -56,7 +56,7 @@
   *
   */
  private static final long serialVersionUID = 1L;
-private BufferedImage paintBuffer;
+private transient BufferedImage paintBuffer;
  private boolean imageAnimate;
  private PBounds imageAnimateBounds;

@@ -65,15 +65,28 @@
   */
  protected BufferedImage getPaintBuffer() {
  final PBounds fRef = getFullBoundsReference();
-// TODO eclipse formatting made this ugly
-if (paintBuffer == null || paintBuffer.getWidth()  fRef.getWidth()
-|| paintBuffer.getHeight()  fRef.getHeight()) {
-paintBuffer =  
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice()
-.getDefaultConfiguration().createCompatibleImage((int)  
Math.ceil(fRef.getWidth()),
-(int) Math.ceil(fRef.getHeight()));
+if (paintBuffer == null || isBufferSmallerThanBounds(fRef)) {
+paintBuffer = buildPaintBuffer(fRef);
  }
  return paintBuffer;
  }
+
+private boolean isBufferSmallerThanBounds(final PBounds bounds) {
+return paintBuffer.getWidth()  bounds.getWidth() ||  
paintBuffer.getHeight()  bounds.getHeight();
+}
+
+private BufferedImage buildPaintBuffer(final PBounds fRef) {
+final int newBufferWidth = (int) Math.ceil(fRef.getWidth());
+final int newBufferHeight = (int) Math.ceil(fRef.getHeight());
+
+if (GraphicsEnvironment.isHeadless()) {
+return new BufferedImage(newBufferWidth, newBufferHeight,  
BufferedImage.TYPE_4BYTE_ABGR);
+}
+else {
+return  
GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration()
+.createCompatibleImage(newBufferWidth,  
newBufferHeight);
+}
+}

  /**
   * Caches the information necessary to animate from the current view  
bounds

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



[piccolo2d-dev] Re: [piccolo2d] r628 commited - FingBugs Hunting.

2009-07-30 Thread Michael Heuer

 snip
 /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java
      /**
       * The cutoff at which the Swing component is rendered greek
       */
 -    private final double renderCutoff = 0.3;
 +    private static final double GREEK_SCALE_CUT_OFF = 0.3d;

Similar values in PText are called greekThreshold and
DEFAULT_GREEK_THRESHOLD.  PText also has get/setGreekThreshold.

      private JComponent component = null;
      private double minFontSize = Double.MAX_VALUE;
 -    private Stroke defaultStroke = new BasicStroke();
 +    private transient Stroke defaultStroke = new BasicStroke();
      private Font defaultFont = new Font(Serif, Font.PLAIN, 12);

Should these defaults be static and final?


Strange that PSwing overrides protected void paint(PPaintContext) with
public void paint(PPaintContext).  I recommend refactoring to

public void paint(PPaintContext) -- protected void paint(PPaintContext)
public void paintAsGreek(Graphics2D) -- protected void
paintGreek(PPaintContext)
public void paint(Graphics2D) -- protected void paintComponent(PPaintContext)

Subclasses might want access to the entire paint context for
paintGreek and paintComponent, not just the graphics.  I wonder how
much work this change would be though. . .

   michael

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



[piccolo2d-dev] Re: [piccolo2d] r628 commited - FingBugs Hunting.

2009-07-30 Thread allain

Yes they should be protected, should you do it? No.

Not until 2.0 at least since client code that calls it directly would
break.

If you want to do it anyway, I'm all for it, but since we're not
marking constants as final till 2.0, this one seems like a no go till
then either.

On Jul 30, 4:31 pm, Michael Heuer heue...@gmail.com wrote:
  snip
  /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwin 
  g.java
       /**
        * The cutoff at which the Swing component is rendered greek
        */
  -    private final double renderCutoff = 0.3;
  +    private static final double GREEK_SCALE_CUT_OFF = 0.3d;

 Similar values in PText are called greekThreshold and
 DEFAULT_GREEK_THRESHOLD.  PText also has get/setGreekThreshold.

       private JComponent component = null;
       private double minFontSize = Double.MAX_VALUE;
  -    private Stroke defaultStroke = new BasicStroke();
  +    private transient Stroke defaultStroke = new BasicStroke();
       private Font defaultFont = new Font(Serif, Font.PLAIN, 12);

 Should these defaults be static and final?

 Strange that PSwing overrides protected void paint(PPaintContext) with
 public void paint(PPaintContext).  I recommend refactoring to

 public void paint(PPaintContext) -- protected void paint(PPaintContext)
 public void paintAsGreek(Graphics2D) -- protected void
 paintGreek(PPaintContext)
 public void paint(Graphics2D) -- protected void paintComponent(PPaintContext)

 Subclasses might want access to the entire paint context for
 paintGreek and paintComponent, not just the graphics.  I wonder how
 much work this change would be though. . .

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



[piccolo2d-dev] Re: [piccolo2d] r628 commited - FingBugs Hunting.

2009-07-30 Thread Michael Heuer

Breaking binary compatibility is not really an issue with extras.  I
still wouldn't do it lightly though.  I'm not a user of PSwing, is it
a common to extend it in client code?

I will create an issue and an updated patch with some additional API
cleanup for review.

   michael


allainallain.lalo...@gmail.com wrote:

 Yes they should be protected, should you do it? No.

 Not until 2.0 at least since client code that calls it directly would
 break.

 If you want to do it anyway, I'm all for it, but since we're not
 marking constants as final till 2.0, this one seems like a no go till
 then either.

 On Jul 30, 4:31 pm, Michael Heuer heue...@gmail.com wrote:
  snip
  /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwin
   g.java
       /**
        * The cutoff at which the Swing component is rendered greek
        */
  -    private final double renderCutoff = 0.3;
  +    private static final double GREEK_SCALE_CUT_OFF = 0.3d;

 Similar values in PText are called greekThreshold and
 DEFAULT_GREEK_THRESHOLD.  PText also has get/setGreekThreshold.

       private JComponent component = null;
       private double minFontSize = Double.MAX_VALUE;
  -    private Stroke defaultStroke = new BasicStroke();
  +    private transient Stroke defaultStroke = new BasicStroke();
       private Font defaultFont = new Font(Serif, Font.PLAIN, 12);

 Should these defaults be static and final?

 Strange that PSwing overrides protected void paint(PPaintContext) with
 public void paint(PPaintContext).  I recommend refactoring to

 public void paint(PPaintContext) -- protected void paint(PPaintContext)
 public void paintAsGreek(Graphics2D) -- protected void
 paintGreek(PPaintContext)
 public void paint(Graphics2D) -- protected void 
 paintComponent(PPaintContext)

 Subclasses might want access to the entire paint context for
 paintGreek and paintComponent, not just the graphics.  I wonder how
 much work this change would be though. . .

    michael
 


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



[piccolo2d-dev] Issue 115 in piccolo2d: Discontinue .Net

2009-07-30 Thread codesite-noreply


Comment #1 on issue 115 by allain.lalonde: Discontinue .Net
http://code.google.com/p/piccolo2d/issues/detail?id=115

Amen.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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



[piccolo2d-dev] [piccolo2d] r629 committed - PMD bugs attack.

2009-07-30 Thread codesite-noreply

Revision: 629
Author: allain.lalonde
Date: Thu Jul 30 14:59:39 2009
Log: PMD bugs attack.
http://code.google.com/p/piccolo2d/source/detail?r=629

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/activities/PTransformActivity.java
  /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/PFrame.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/POffscreenCanvas.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/swing/PViewport.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/util/PFixedWidthStroke.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/util/POcclusionDetection.java
   
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTBoundsHandle.java
   
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java
   
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/SWTTimerQueue.java

===
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java
 
Thu Jul 30 12:36:17 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java
 
Thu Jul 30 14:59:39 2009
@@ -176,7 +176,8 @@
  public void repaintFromLayer(final PBounds viewBounds, final PNode  
repaintedLayer) {
  if (repaintedLayer instanceof PLayer) {
  this.repaintFromLayer(viewBounds, (PLayer) repaintedLayer);
-} else {
+}
+else {
  throw new RuntimeException(Passed non PLayer node to  
repaintFromLayer);
  }
  }
===
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java
   
Thu Jul 30 12:36:17 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/activities/PTransformActivity.java
   
Thu Jul 30 14:59:39 2009
@@ -31,7 +31,6 @@
  import java.awt.geom.AffineTransform;

  import edu.umd.cs.piccolo.util.PAffineTransform;
-import edu.umd.cs.piccolo.util.PUtil;

  /**
   * bPTransformActivity/b interpolates between two transforms setting  
its
@@ -112,7 +111,12 @@
   * target when the transform activity stops stepping.
   */
  public double[] getDestinationTransform() {
-return (destination == null) ? null : (double[])  
destination.clone();
+if (destination == null) {
+return null;
+}
+else {
+return (double[]) destination.clone();
+}
  }

  /**
@@ -120,7 +124,12 @@
   * target when the transform activity stops stepping.
   */
  public void setDestinationTransform(final double[] newDestination) {
-destination = (newDestination == null) ? null : (double[])  
newDestination.clone();
+if (newDestination == null) {
+destination = null;
+}
+else {
+destination = (double[]) newDestination.clone();
+}
  }

  protected void activityStarted() {
===
---  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/PFrame.java  
 
Tue Jul 28 12:46:54 2009
+++  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/PFrame.java  
 
Thu Jul 30 14:59:39 2009
@@ -57,9 +57,6 @@
   */
  public class PFrame extends JFrame {

-/**
- *
- */
  private static final long serialVersionUID = 1L;
  private PCanvas canvas;
  private final GraphicsDevice graphicsDevice;
@@ -85,7 +82,8 @@
  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
  catch (final SecurityException e) {
-} // expected from applets
+// expected from applets
+}

  if (aCanvas == null) {
  canvas = new PCanvas();
===
---  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/POffscreenCanvas.java
 
Tue Jul 28 12:46:54 2009
+++  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/POffscreenCanvas.java
 
Thu Jul 30 14:59:39 2009
@@ -143,27 +143,27 @@
  }

  /** {...@inheritdoc} */
-public final void paintImmediately() {
+public void paintImmediately() {
  // empty
  }

  /** {...@inheritdoc} */
-public final void popCursor() {
+public void popCursor() {
  // empty
  }

  /** {...@inheritdoc} */
-public final void pushCursor(final Cursor cursor) {
+public void pushCursor(final Cursor cursor) {
  // empty
  }

  /** {...@inheritdoc} */
-public final void repaint(final PBounds repaintBounds) {
+public void repaint(final PBounds repaintBounds) {
  // empty
  }

  /** {...@inheritdoc} */
-public final void setInteracting(final boolean 

[piccolo2d-dev] Issue 117 in piccolo2d: Text rendering in PText and JLabel via PSwing appear not to respect antialiasing rendering hints

2009-07-30 Thread codesite-noreply

Status: New
Owner: 
Labels: Type-Enhancement Priority-Medium OpSys-All Toolkit-Piccolo2D.Java

New issue 117 by heuermh: Text rendering in PText and JLabel via PSwing  
appear not to respect antialiasing rendering hints
http://code.google.com/p/piccolo2d/issues/detail?id=117

Consider the attached screenshots which demonstrate JLabel, PText, and
JLabel via PSwing text rendering with different text antialiasing rendering
hints provided.  See
http://java.sun.com/javase/6/docs/api/java/awt/RenderingHints.html#KEY_TEXT_ANTIALIASING,
in particular those values available in jdk 1.6+.

Neither PText nor JLabel via PSwing renders text the same as JLabel.  PText
always antialiases, poorly at that, and JLabel via PSwing does not appear
to respect any of the LCD_* values.

An interesting observation is that when JLabel renders directly to a
BufferedImage instead of to the screen, it renders text similar to that of
JLabel via PSwing.  See attached tarball of a web page.

I still need to add JTextComponent, PStyledText, PSWTText, direct Java2D
text rendering and the new PHtml/PHtmlView node to the benchmark.

Attachments:
text-rendering-winxp.png  44.2 KB
text-rendering-linux-gtk.png  33.0 KB
result-winxp.tar.gz  9.1 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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



[piccolo2d-dev] Issue 31 in piccolo2d: PActivity activityFinished gets called multiple times

2009-07-30 Thread codesite-noreply


Comment #6 on issue 31 by allain.lalonde: PActivity activityFinished gets  
called multiple times
http://code.google.com/p/piccolo2d/issues/detail?id=31

This can be resolved by adding a reset/reschedule method to the activity  
that would
reschedule the event when called.

Activity could be single serving things (which I like) and then reused when  
needed.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

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