[piccolo2d-dev] Hudson server in my basement

2009-07-15 Thread allain

I've setup a hudson server in my basement that performs a build
anytime a check in occurs.

It's having some troubles, but I'll gladly give admin rights to any
developers who'd like to configure it (I'm not having much luck I
think)  Just create an account and email me your username, I'll bump
your account up to admin.

Hopefully someone can configure it to build properly.

http://allain.homelinux.org:2121/


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



[piccolo2d-dev] [piccolo2d commit] r469 - Part of a solution to Issue #53; made toImage not use GraphicsEnvironment in the case of r...

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 09:39:14 2009
New Revision: 469

Modified:
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java

Log:
Part of a solution to Issue #53; made toImage not use GraphicsEnvironment  
in the case of running in Headless mode.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
==
--- piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java   
 
(original)
+++ piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java   
 
Wed Jul 15 09:39:14 2009
@@ -2469,10 +2469,17 @@
   * @param height pixel height of the resulting image
   * @return a new image representing this node and its descendents
   */
-public Image toImage(int width, int height, Paint backGroundPaint) {
-GraphicsConfiguration graphicsConfiguration =  
GraphicsEnvironment.getLocalGraphicsEnvironment()
-.getDefaultScreenDevice().getDefaultConfiguration();
-BufferedImage result =  
graphicsConfiguration.createCompatibleImage(width, height,  
Transparency.TRANSLUCENT);
+public Image toImage(int width, int height, Paint backGroundPaint) {
+BufferedImage result;
+
+if (GraphicsEnvironment.isHeadless()) {
+result = new BufferedImage(width, height,  
BufferedImage.TYPE_INT_ARGB);
+}
+else {
+GraphicsConfiguration graphicsConfiguration =  
GraphicsEnvironment.getLocalGraphicsEnvironment()
+.getDefaultScreenDevice().getDefaultConfiguration();
+result =  graphicsConfiguration.createCompatibleImage(width,  
height, Transparency.TRANSLUCENT);
+}

  return toImage(result, backGroundPaint);
  }

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



[piccolo2d-dev] [piccolo2d commit] r470 - Replaced complex xor logic with Java's xor operator.

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 10:48:37 2009
New Revision: 470

Modified:
 
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java

Log:
Replaced complex xor logic with Java's xor operator.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
==
---  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
 
(original)
+++  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PBounds.java
 
Wed Jul 15 10:48:37 2009
@@ -227,29 +227,25 @@
  double maxY = getMaxY();
  double minY = getMinY();

-if (!(bMaxX  maxX  bMinX  minX)) {
-if (bMaxX  maxX || bMinX  minX) {
-double difMaxX = bMaxX - maxX;
-double difMinX = bMinX - minX;
-if (Math.abs(difMaxX)  Math.abs(difMinX)) {
-result.width = difMaxX;
-}
-else {
-result.width = difMinX;
-}
+if ((bMaxX  maxX) ^ (bMinX  minX)) {
+double difMaxX = bMaxX - maxX;
+double difMinX = bMinX - minX;
+if (Math.abs(difMaxX)  Math.abs(difMinX)) {
+result.width = difMaxX;
+}
+else {
+result.width = difMinX;
  }
  }

-if (!(bMaxY  maxY  bMinY  minY)) {
-if (bMaxY  maxY || bMinY  minY) {
-double difMaxY = bMaxY - maxY;
-double difMinY = bMinY - minY;
-if (Math.abs(difMaxY)  Math.abs(difMinY)) {
-result.height = difMaxY;
-}
-else {
-result.height = difMinY;
-}
+if ((bMaxY  maxY) ^ (bMinY  minY)) {
+double difMaxY = bMaxY - maxY;
+double difMinY = bMinY - minY;
+if (Math.abs(difMaxY)  Math.abs(difMinY)) {
+result.height = difMaxY;
+}
+else {
+result.height = difMinY;
  }
  }
  }

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



[piccolo2d-dev] [piccolo2d commit] r471 - Refactored PDebug code so that PMD didn't complain about two ifs that could be joined. In...

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 10:59:40 2009
New Revision: 471

Modified:
 
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java

Log:
Refactored PDebug code so that PMD didn't complain about two ifs that could  
be joined.  In the process making it slightly clearer.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java
==
---  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java 
 
(original)
+++  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/util/PDebug.java 
 
Wed Jul 15 10:59:40 2009
@@ -101,19 +101,17 @@
  processOutputTime += (System.currentTimeMillis() -  
startProcessingOutputTime);
  framesProcessed++;

-if (PDebug.debugPrintFrameRate) {
-if (framesProcessed % printResultsFrameRate == 0) {
+if (framesProcessed % printResultsFrameRate == 0) {
+if (PDebug.debugPrintFrameRate ) {
  System.out.println(Process output frame rate:  +  
getOutputFPS() +  fps);
  System.out.println(Process input frame rate:  +  
getInputFPS() +  fps);
  System.out.println(Total frame rate:  + getTotalFPS()  
+  fps);
  System.out.println();
  resetFPSTiming();
  }
-}
-
-if (PDebug.debugPrintUsedMemory) {
-if (framesProcessed % printResultsFrameRate == 0) {
-System.out.println(Approximate used memory:  +  
getApproximateUsedMemory() / 1024 +  k);
+
+if (PDebug.debugPrintUsedMemory) {
+System.out.println(Approximate used memory:  +  
getApproximateUsedMemory() / 1024 +  k);
  }
  }


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



[piccolo2d-dev] [piccolo2d commit] r472 - Folding nested if statements into themselves. Makes PMD stop complaining so loudly.

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 11:49:27 2009
New Revision: 472

Modified:
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
 
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java

Log:
Folding nested if statements into themselves. Makes PMD stop complaining so  
loudly.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
==
--- piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java   
 
(original)
+++ piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java   
 
Wed Jul 15 11:49:27 2009
@@ -2678,10 +2678,8 @@

  boolean thisPickable = getPickable()   
pickPath.acceptsNode(this);

-if (thisPickable) {
-if (pick(pickPath)) {
-return true;
-}
+if (thisPickable  pick(pickPath)) {
+return true;
  }

  if (getChildrenPickable()) {
@@ -2693,10 +2691,8 @@
  }
  }

-if (thisPickable) {
-if (pickAfterChildren(pickPath)) {
-return true;
-}
+if (thisPickable  pickAfterChildren(pickPath)) {
+return true;
  }

  pickPath.popTransform(transform);

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
==
---  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
  
(original)
+++  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PDragSequenceEventHandler.java
  
Wed Jul 15 11:49:27 2009
@@ -208,10 +208,8 @@
  }

  getMousePressedCanvasPoint().setLocation(e.getCanvasPosition());
-if (!isDragging()) {
-if (shouldStartDragInteraction(e)) {
-startDrag(e);
-}
+if (!isDragging()  shouldStartDragInteraction(e)) {
+startDrag(e);
  }
  }


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



[piccolo2d-dev] [piccolo2d commit] r473 - Removing local private members which are no longer needed since Buffering has been removed.

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 12:17:10 2009
New Revision: 473

Modified:
 
piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java

Log:
Removing local private members which are no longer needed since Buffering  
has been removed.

Also applied the formatting defined in the eclipse formatting file.

Modified:  
piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java
==
---  
piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java
 
(original)
+++  
piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java
 
Wed Jul 15 12:17:10 2009
@@ -52,119 +52,120 @@
  import java.util.Arrays;

  /*
-  This message was sent to Sun on August 27, 1999
+ This message was sent to Sun on August 27, 1999

-  ---
+ ---

-  We are currently developing Piccolo, a scenegraph for use in 2D  
graphics.
-  One of our ultimate goals is to support Swing lightweight components
-  within Piccolo, whose graphical space supports arbitray affine  
transforms.
-  The challenge in this pursuit is getting the components to respond and
-  render properly though not actually displayed in a standard Java  
component
-  hierarchy.
-
-
-  The first issues involved making the Swing components focusable and
-  showing.  This was accomplished by adding the Swing components to a 0x0
-  JComponent which was in turn added to our main Piccolo application  
component.
-  To our good fortune, a Java component is showing merely if it and its
-  ancestors are showing and not based on whether it is ACTUALLY visible.
-  Likewise, focus in a JComponent depends merely on the component's
-  containing window having focus.
-
-
-  The second issue involved capturing the repaint calls on a Swing
-  component.  Normally, for a repaint and the consequent call to
-  paintImmediately, a Swing component obtains the Graphics object necessary
-  to render itself through the Java component heirarchy.  However, for  
Piccolo
-  we would like the component to render using a Graphics object that  
Piccolo
-  may have arbitrarily transformed in some way.  By capturing in the
-  RepaintManager the repaint calls made on our special Swing components, we
-  are able to redirect the repaint requests through the Piccolo  
architecture to
-  put the Graphics in its proper context.  Unfortunately, this means that
-  if the Swing component contains other Swing components, then any repaint
-  requests made by one of these nested components must go through
-  the Piccolo architecture then through the top level Swing component
-  down to the nested Swing component.  This normally doesn't cause a
-  problem.  However, if calling paint on one of these nested
-  children causes a call to repaint then an infinite loop ensues.  This  
does
-  in fact happen in the Swing components that use cell renderers.  Before
-  the cell renderer is painted, it is invalidated and consequently
-  repainted.  We solved this problem by putting a lock on repaint calls for
-  a component while that component is painting.  (A similar problem faced
-  the Swing team over this same issue.  They solved it by inserting a
-  CellRendererPane to capture the renderer's invalidate calls.)
-
-
-  Another issue arose over the forwarding of mouse events to the Swing
-  components.  Since our Swing components are not actually displayed on
-  screen in the standard manner, we must manually dispatch any MouseEvents
-  we want the component to receive.  Hence, we needed to find the deepest
-  visible component at a particular location that accepts MouseEvents.
-  Finding the deepest visible component at a point was achieved with the
-  findComponentAt method in java.awt.Container.  With the
-  getListeners(Class listenerType) method added in JDK1.3 Beta we are  
able
-  to determine if the component has any Mouse Listeners. However, we  
haven't
-  yet found a way to determine if MouseEvents have been specifically  
enabled
-  for a component. The package private method eventEnabled in
-  java.awt.Component does exactly what we want but is, of course,
-  inaccessible.  In order to dispatch events correctly we would need a
-  public accessor to the method boolean eventEnabled(AWTEvent) in
-  java.awt.Component.
-
-
-  Still another issue involves the management of cursors when the mouse is
-  over a Swing component in our application.  To the Java mechanisms, the
-  mouse never appears to enter the bounds of the Swing components since  
they
-  are contained by a 0x0 JComponent.  Hence, we must manually change the
-  cursor when the mouse enters one of the Swing components in our
-  application. This generally works but becomes a problem if the Swing
-  component's cursor changes while we are over that Swing component (for
-  instance, if 

[piccolo2d-dev] [piccolo2d commit] r474 - Added some trivial tests for PPanEventHandler and added come accesors to it for maxAutoPan...

2009-07-15 Thread codesite-noreply

Author: allain.lalonde
Date: Wed Jul 15 12:31:15 2009
New Revision: 474

Added:
 
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/event/PPanEventHandlerTest.java
Modified:
 
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PPanEventHandler.java
 
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PAffineTransformTest.java

Log:
Added some trivial tests for PPanEventHandler and added come accesors to it  
for maxAutoPanSpeed and minAutoPanSpeed.

Also, cleaned up test for PAffineTransform.

Modified:  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PPanEventHandler.java
==
---  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PPanEventHandler.java
   
(original)
+++  
piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/event/PPanEventHandler.java
   
Wed Jul 15 12:31:15 2009
@@ -102,6 +102,26 @@
  public void setMaxAutopanSpeed(double maxAutopanSpeed) {
  this.maxAutopanSpeed = maxAutopanSpeed;
  }
+
+/**
+ * Returns the minAutoPan speed in pixels per second.
+ *
+ * @param minAutopanSpeed
+ * @return minAutopanSpeed in pixels
+ */
+public double getMinAutoPanSpeed() {
+return minAutopanSpeed;
+}
+
+/**
+ * Returns the maxAutoPan speed in pixels per second.
+ *
+ * @param maxAutopanSpeed
+ * @return maxAutopanSpeed in pixels
+ */
+public double getMaxAutoPanSpeed() {
+return maxAutopanSpeed;
+}

  /**
   * Do auto panning even when the mouse is not moving.

Added:  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/event/PPanEventHandlerTest.java
==
--- (empty file)
+++  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/event/PPanEventHandlerTest.java
   
Wed Jul 15 12:31:15 2009
@@ -0,0 +1,38 @@
+package edu.umd.cs.piccolo.event;
+
+import junit.framework.TestCase;
+
+public class PPanEventHandlerTest extends TestCase {
+private PPanEventHandler handler;
+
+public void setUp() {
+handler = new PPanEventHandler();
+}
+
+public void testAutoPanIsTrueByDefault() {
+assertTrue(handler.getAutopan());
+}
+
+public void testSetAutoPanPersists() {
+handler.setAutopan(true);
+assertTrue(handler.getAutopan());
+}
+
+public void testDefaultMinAutoPanSpeed() {
+assertEquals(250, handler.getMinAutoPanSpeed(), 0.001);
+}
+
+public void testMinAutoPanSpeedPersists() {
+handler.setMinAutopanSpeed(10);
+assertEquals(10, handler.getMinAutoPanSpeed(), 0.01);
+}
+
+public void testMaxDefaultAutoPanSpeed() {
+assertEquals(250, handler.getMinAutoPanSpeed(), 0.001);
+}
+
+public void testMaxAutoPanSpeedPersists() {
+handler.setMaxAutopanSpeed(10);
+assertEquals(10, handler.getMaxAutoPanSpeed(), 0.01);
+}
+}

Modified:  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PAffineTransformTest.java
==
---  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PAffineTransformTest.java

(original)
+++  
piccolo2d.java/trunk/core/src/test/java/edu/umd/cs/piccolo/util/PAffineTransformTest.java

Wed Jul 15 12:31:15 2009
@@ -40,9 +40,9 @@
  public PAffineTransformTest(String aName) {
  super(aName);
  }
-
+
  public void setUp() {
-at = new PAffineTransform();
+at = new PAffineTransform();
  }

  public void testRotation() {
@@ -52,7 +52,7 @@
  assertEquals(at.getRotation(), Math.toRadians(90), 0.1);
  }

-public void testScale() {
+public void testScale() {
  at.scaleAboutPoint(0.45, 0, 1);
  assertEquals(at.getScale(), 0.45, 0.1);
  at.setScale(0.11);
@@ -60,49 +60,50 @@
  }

  public void testTransformRectLeavesEmptyBoundsEmpty() {
-PBounds b1 = new PBounds();
+PBounds b1 = new PBounds();
  at.scale(0.5, 0.5);
  at.translate(100, 50);

  at.transform(b1, b1);
  assertTrue(b1.isEmpty());
  }
-
+
  public void testTransformRect() {
  PBounds b1 = new PBounds(0, 0, 100, 80);
  PBounds b2 = new PBounds(100, 100, 100, 80);
-
+
  at.scale(0.5, 0.5);
  at.translate(100, 50);

  at.transform(b1, b1);
  at.transform(b2, b2);
-
-assertSameBounds(new PBounds(50, 25, 50, 40), b1);
-assertSameBounds(new PBounds(100, 75, 50, 40), b2);
-
+
+assertEquals(new PBounds(50, 25, 50, 40), b1);
+assertEquals(new PBounds(100, 75, 50, 40), b2);
+
  at.inverseTransform(b1, b1);
  at.inverseTransform(b2, b2);

-assertSameBounds(new PBounds(0, 0, 100, 80), 

[piccolo2d-dev] Re: Any objections to me adding Cobertura coverage report to the Maven Build?

2009-07-15 Thread Michael Heuer

allain wrote:

 My reasons for wanting to do this are:
 - Obviously Code Coverage Metrics are good but this one is IDE
 agnostic.
 - It has a Hudson plugin that can be installed allowing us to diagram
 the (hopefully) increasing progression of code coverage over time in a
 nice convenient graph.

 http://wiki.hudson-ci.org//display/HUDSON/Cobertura+Plugin

The javascript code used in the Cobertura reports themselves are
licensed under the GPL, and there was concern in e.g. the Apache
Commons community that distributing those reports violates the terms
of the license.  You may find some discussion threads in archives of
the commons-dev mailing list.  I can't recall what the resolution of
the issue was though.

   michael

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



[piccolo2d-dev] Re: Any objections to me adding Cobertura coverage report to the Maven Build?

2009-07-15 Thread Samuel Robert Reid





GPL itself says output from a GPL program is not covered:
http://www.gnu.org/licenses/gpl-faq.html#GPLOutput

Sam Reid

Michael Heuer wrote:

  allain wrote:

  
  
My reasons for wanting to do this are:
- Obviously Code Coverage Metrics are good but this one is IDE
agnostic.
- It has a Hudson plugin that can be installed allowing us to diagram
the (hopefully) increasing progression of code coverage over time in a
nice convenient graph.

http://wiki.hudson-ci.org//display/HUDSON/Cobertura+Plugin

  
  
The _javascript_ code used in the Cobertura reports themselves are
licensed under the GPL, and there was concern in e.g. the Apache
Commons community that distributing those reports violates the terms
of the license.  You may find some discussion threads in archives of
the commons-dev mailing list.  I can't recall what the resolution of
the issue was though.

   michael


  


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