Revision: 819 Author: allain.lalonde Date: Sat Oct 24 08:13:41 2009 Log: cleaning up checkstyle warnings introduced by latest refactorings. http://code.google.com/p/piccolo2d/source/detail?r=819
Modified: /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java /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/util/XYArray.java ======================================= --- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java Fri Oct 23 15:21:11 2009 +++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PCamera.java Sat Oct 24 08:13:41 2009 @@ -663,7 +663,7 @@ /** * Set the view transform applied to the list of layers - * viewed by this camera to <code>viewTransform</code> + * viewed by this camera to <code>viewTransform</code>. * * @param viewTransform view transform applied to the list of layers * viewed by this camera @@ -678,7 +678,7 @@ /** * Animate the camera's view from its current transform when the activity * starts to a new transform that centers the given bounds in the camera - * layers coordinate system into the cameras view bounds. If the duration is + * layer's coordinate system into the cameras view bounds. 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. If shouldScale is ======================================= --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java Thu Oct 22 19:28:10 2009 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/event/PNotificationCenter.java Sat Oct 24 08:13:41 2009 @@ -66,7 +66,7 @@ public static final Object NULL_MARKER = new Object(); /** Singleton instance of the notification center. */ - protected volatile static PNotificationCenter DEFAULT_CENTER; + protected static volatile PNotificationCenter DEFAULT_CENTER; /** A map of listeners keyed by NotificationKey objects. */ protected HashMap listenersMap; ======================================= --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Sat Oct 24 08:03:14 2009 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/pswing/PSwing.java Sat Oct 24 08:13:41 2009 @@ -216,7 +216,7 @@ /** Minimum font size. */ private double minFontSize = Double.MAX_VALUE; - + private static final AffineTransform IDENTITY_TRANSFORM = new AffineTransform(); /** @@ -225,8 +225,8 @@ */ private transient Stroke defaultStroke = new BasicStroke(); - private static final Color BUFFER_BACKGROUND_COLOR = new Color( 0, 0, 0, 0 ); - + private static final Color BUFFER_BACKGROUND_COLOR = new Color(0, 0, 0, 0); + /** * Default font, 12 point <code>"SansSerif"</code>. Will be made final in * version 2.0. @@ -242,7 +242,7 @@ private PSwingCanvas canvas; private BufferedImage buffer; - + /** * Used to keep track of which nodes we've attached listeners to since no * built in support in PNode. @@ -329,8 +329,8 @@ * bounds of this PNode. */ void reshape() { - component.setBounds( 0, 0, component.getPreferredSize().width, component.getPreferredSize().height ); - setBounds( 0, 0, component.getPreferredSize().width, component.getPreferredSize().height ); + component.setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); + setBounds(0, 0, component.getPreferredSize().width, component.getPreferredSize().height); } /** {...@inheritdoc} */ @@ -347,15 +347,15 @@ if (component.getParent() == null) { component.revalidate(); } - + if (shouldRenderGreek(paintContext)) { paintGreek(graphics); } else { paintComponent(graphics); - } - } - + } + } + /** * Return the greek threshold in scale. When the scale will be below this * threshold the Swing component is rendered as 'greek' instead of painting @@ -401,7 +401,7 @@ * * @param paintContext paint context */ - protected void paintGreek(final Graphics2D graphics) { + protected void paintGreek(final Graphics2D graphics) { final Color background = component.getBackground(); final Color foreground = component.getForeground(); final Rectangle2D rect = getBounds(); @@ -433,54 +433,59 @@ * @param paintContext paint context */ protected void paintComponent(final Graphics2D g2) { - if( component.getBounds().isEmpty() ) { + if (component.getBounds().isEmpty()) { // The component has not been initialized yet. return; } - PSwingRepaintManager manager = (PSwingRepaintManager)RepaintManager.currentManager( component ); - manager.lockRepaint( component ); + PSwingRepaintManager manager = (PSwingRepaintManager) RepaintManager.currentManager(component); + manager.lockRepaint(component); Graphics2D bufferedGraphics = null; - if( !isBufferValid() ) { + if (!isBufferValid()) { // Get the graphics context associated with a new buffered image. - // Use TYPE_INT_ARGB_PRE so that transparent components look good on Windows. - buffer = new BufferedImage( component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE ); + // Use TYPE_INT_ARGB_PRE so that transparent components look good on + // Windows. + buffer = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_ARGB_PRE); bufferedGraphics = buffer.createGraphics(); } else { - // Use the graphics context associated with the existing buffered image + // Use the graphics context associated with the existing buffered + // image bufferedGraphics = buffer.createGraphics(); // Clear the buffered image to prevent artifacts on Macintosh - bufferedGraphics.setBackground( BUFFER_BACKGROUND_COLOR ); - bufferedGraphics.clearRect( 0, 0, component.getWidth(), component.getHeight() ); + bufferedGraphics.setBackground(BUFFER_BACKGROUND_COLOR); + bufferedGraphics.clearRect(0, 0, component.getWidth(), component.getHeight()); } // Start with the rendering hints from the provided graphics context - bufferedGraphics.setRenderingHints( g2.getRenderingHints() ); - - //PSwing sometimes causes JComponent text to render with "..." when fractional font metrics are enabled. These are now always disabled for the offscreen buffer. - bufferedGraphics.setRenderingHint( RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF ); + bufferedGraphics.setRenderingHints(g2.getRenderingHints()); + + // PSwing sometimes causes JComponent text to render with "..." when + // fractional font metrics are enabled. These are now always disabled + // for the offscreen buffer. + bufferedGraphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, + RenderingHints.VALUE_FRACTIONALMETRICS_OFF); // Draw the component to the buffer - component.paint( bufferedGraphics ); + component.paint(bufferedGraphics); // Draw the buffer to g2's associated drawing surface - g2.drawRenderedImage( buffer, IDENTITY_TRANSFORM ); - - manager.unlockRepaint( component ); - } - + g2.drawRenderedImage(buffer, IDENTITY_TRANSFORM); + + manager.unlockRepaint(component); + } + /** - * Tells whether the buffer for the image of the Swing components - * is currently valid. - * + * Tells whether the buffer for the image of the Swing components is + * currently valid. + * * @return true if the buffer is currently valid */ private boolean isBufferValid() { - return !( buffer == null || buffer.getWidth() != component.getWidth() || buffer.getHeight() != component.getHeight() ); - } - + return !(buffer == null || buffer.getWidth() != component.getWidth() || buffer.getHeight() != component + .getHeight()); + } /** {...@inheritdoc} */ public void setVisible(final boolean visible) { ======================================= --- /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/util/XYArray.java Wed Oct 14 08:47:49 2009 +++ /piccolo2d.java/trunk/extras/src/main/java/edu/umd/cs/piccolox/util/XYArray.java Sat Oct 24 08:13:41 2009 @@ -365,7 +365,7 @@ ps.numPoints = numPoints; } catch (final CloneNotSupportedException e) { - + // wow, this is terrible. } return ps; --~--~---------~--~----~------------~-------~--~----~ Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en -~----------~----~----~----~------~----~------~--~---