Revision: 647
Author: allain.lalonde
Date: Tue Aug  4 18:13:28 2009
Log: More CheckStyles and some stack usage cleanup on PNode
http://code.google.com/p/piccolo2d/source/detail?r=647

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/PNode.java
   
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java

=======================================
---  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java        
 
Mon Aug  3 19:46:04 2009
+++  
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java        
 
Tue Aug  4 18:13:28 2009
@@ -356,7 +356,7 @@
          paintCameraView(paintContext);
          paintDebugInfo(paintContext);

-        paintContext.popTransform(viewTransform);
+        paintContext.popTransform();
          paintContext.popClip(getBoundsReference());
      }

=======================================
--- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java      
 
Mon Aug  3 19:46:04 2009
+++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java      
 
Tue Aug  4 18:13:28 2009
@@ -2800,7 +2800,7 @@
              paintAfterChildren(paintContext);

              paintContext.popTransparency(transparency);
-            paintContext.popTransform(transform);
+            paintContext.popTransform();
          }
      }

@@ -2836,7 +2836,7 @@
       * @param backgroundPaint paint to fill the image with before drawing  
this
       *            node, may be null
       *
-     * @return a new image representing this node and its descendents
+     * @return a new image representing this node and its descendants
       */
      public Image toImage(final int width, final int height, final Paint  
backgroundPaint) {
          BufferedImage result;
=======================================
---  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java
    
Tue Aug  4 13:42:37 2009
+++  
/piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/nodes/PStyledText.java
    
Tue Aug  4 18:13:28 2009
@@ -84,8 +84,13 @@
      /** Whether this node is currently being edited. */
      protected boolean editing;

+    /** Insets represent how far away from the bounding box text will be  
drawn. */
      protected Insets insets = new Insets(0, 0, 0, 0);
+
+    /** Whether width will be forced to match containing text's height. */
      protected boolean constrainHeightToTextHeight = true;
+
+    /** Whether width will be forced to match containing text's width. */
      protected boolean constrainWidthToTextWidth = true;

      /**
@@ -519,7 +524,7 @@
      }

      /**
-     * Get the height of the font at the beginning of the document
+     * Get the height of the font at the beginning of the document.
       */
      public double getInitialFontHeight() {

@@ -535,6 +540,7 @@
          return curFM.getMaxAscent() + curFM.getMaxDescent() +  
curFM.getLeading();
      }

+    /** {...@inheritdoc} */
      protected void paint(final PPaintContext paintContext) {
          if (lines == null || lines.length == 0) {
              return;
@@ -595,6 +601,9 @@
          }
      }

+    /**
+     * {...@inheritdoc}
+     */
      public void fullPaint(final PPaintContext paintContext) {
          if (!editing) {
              super.fullPaint(paintContext);
@@ -661,45 +670,45 @@
       */
      protected static class RunInfo {
          public int startIndex;
-        public int endIndex;
-
-        public RunInfo() {
-        }
+        public int endIndex;

          public RunInfo(final int runStart, final int runLimit) {
              startIndex = runStart;
              endIndex = runLimit;
          }

+        /**
+         * Returns whether the run is empty.
+         *
+         * @return true is run is empty
+         */
          public boolean isEmpty() {
              return startIndex == endIndex;
          }

+        /**
+         * Returns the length of the run.
+         *
+         * @return length of run
+         */
          public int length() {
              return endIndex - startIndex;
          }
-    }
-
-    /**
-     * Class to represent an integer run and the font in that run.
-     */
-    protected static class MetricsRunInfo extends RunInfo {
-        public FontMetrics metrics;
-
-        public MetricsRunInfo() {
-            super();
-        }
-    }
+    }

      /**
       * The info for rendering and computing the bounds of a line.
       */
      protected static class LineInfo {
+        /** Segments which make up this line's formatting segments. */
          public List segments;
          public double maxAscent;
          public double maxDescent;
          public double leading;

+        /**
+         * Creates a LineInfo that contains no segments.
+         */
          public LineInfo() {
              segments = new ArrayList();
          }

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

Reply via email to