|
|
|
svn_geotools
|
Author: mbedward
Date: 2009-10-27 10:06:32 -0400 (Tue, 27 Oct 2009) New Revision: 34268 Modified: trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapPane.java trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/RenderingExecutor.java Log: Correcting log message for r34265: Fixed thread race between rendering task cancellation and submittal Modified: trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapPane.java =================================================================== --- trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapPane.java 2009-10-27 13:42:29 UTC (rev 34267) +++ trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/JMapPane.java 2009-10-27 14:06:32 UTC (rev 34268) @@ -77,7 +77,7 @@ * @see JMapFrame * @see MapPaneListener * @see CursorTool - * + * * @author Michael Bedward * @author Ian Turton * @since 2.6 @@ -185,8 +185,8 @@ private boolean clearLabelCache; - /** - * Constructor - creates an instance of JMapPane with no map + /** + * Constructor - creates an instance of JMapPane with no map * context or renderer initially */ public JMapPane() { @@ -196,7 +196,7 @@ /** * Constructor - creates an instance of JMapPane with the given * renderer and map context. - * + * * @param renderer a renderer object * @param context an instance of MapContext */ @@ -301,7 +301,7 @@ } repaint(); - + MapPaneEvent ev = new MapPaneEvent(this, MapPaneEvent.Type.PANE_RESIZED); publishEvent(ev); } @@ -310,7 +310,7 @@ /** * Set the current cursor tool - * + * * @param tool the tool to set; null means no active cursor tool */ public void setCursorTool(CursorTool tool) { @@ -358,7 +358,7 @@ /** * Register an object that wishes to receive {@code MapPaneEvent}s - * + * * @param listener an object that implements {@code MapPaneListener} * @see MapPaneListener */ @@ -397,7 +397,7 @@ } /** - * Set the renderer for this map pane. + * Set the renderer for this map pane. * * @param renderer the renderer to use */ @@ -441,7 +441,7 @@ */ public void setMapContext(MapContext context) { if (this.context != context) { - + if (this.context != null) { this.context.removeMapLayerListListener(this); for( MapLayer layer : this.context.getLayers() ){ @@ -462,7 +462,7 @@ layer.setSelected(true); if( layer instanceof ComponentListener){ addComponentListener( (ComponentListener) layer ); - } + } } setFullExtent(); @@ -525,7 +525,7 @@ * <p> * Note: This method does <b>not</b> check that the requested area overlaps * the bounds of the current map layers. - * + * * @param envelope the bounds of the map to display * * @throws IllegalStateException if a map context is not set @@ -533,7 +533,7 @@ public void setDisplayArea(Envelope envelope) { if (context != null) { /* - * If the pane has not been displayed yet or is zero size then + * If the pane has not been displayed yet or is zero size then * just record the requested display area and defer setting transforms * etc. */ @@ -544,7 +544,7 @@ clearLabelCache = true; repaint(); } - + } else { throw new IllegalStateException("Map context must be set before setting the display area"); } @@ -637,7 +637,7 @@ /** * Specify whether the map pane should defer its normal - * repainting behaviour. + * repainting behaviour. * <p> * Typical use: * <pre>{@code @@ -740,7 +740,7 @@ /** * Get a (copy of) the world to screen coordinate transform - * being used by this map pane. This method can be + * being used by this map pane. This method can be * used to determine the current drawing scale... * <pre>{@code * double scale = mapPane.getWorldToScreenTransform().getScaleX(); @@ -761,7 +761,7 @@ * allows dragging the map without the overhead of redrawing * the features during the drag. For example, it is used by * {@link org.geotools.swing.tool.PanTool}. - * + * * @param dx the x offset in pixels * @param dy the y offset in pixels. */ @@ -783,11 +783,11 @@ if (acceptRepaintRequests) { - if (curPaintArea == null || + if (curPaintArea == null || context == null || context.getLayerCount() == 0 || renderer == null) { - + return; } @@ -826,7 +826,7 @@ Graphics2D g2 = (Graphics2D) g; g2.drawImage(baseImage, imageOrigin.x, imageOrigin.y, null); } - + redrawBaseImage = true; } } @@ -916,7 +916,7 @@ if( layer instanceof ComponentListener ){ addComponentListener( (ComponentListener) layer ); } - + if (context.getLayerCount() == 1) { setFullExtent(); reset(); @@ -1012,7 +1012,7 @@ * <p> * Tne transform is calculated such that {@code envelope} will * be centred in the display - * + * * @param envelope the current map extent (world coordinates) * @param paintArea the current map pane extent (screen units) */ @@ -1030,7 +1030,7 @@ worldToScreen = new AffineTransform(scale, 0, 0, -scale, -xoff, yoff); try { screenToWorld = worldToScreen.createInverse(); - + } catch (NoninvertibleTransformException ex) { ex.printStackTrace(); } @@ -1052,7 +1052,7 @@ /** * Publish a MapPaneEvent to registered listeners - * + * * @param ev the event to publish * @see MapPaneListener */ Modified: trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/RenderingExecutor.java =================================================================== --- trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/RenderingExecutor.java 2009-10-27 13:42:29 UTC (rev 34267) +++ trunk/modules/unsupported/swing/src/main/java/org/geotools/swing/RenderingExecutor.java 2009-10-27 14:06:32 UTC (rev 34268) @@ -147,7 +147,7 @@ numFeatures = 0; renderer.paint(graphics, mapPane.getVisibleRect(), envelope, mapPane.getWorldToScreenTransform()); - + } finally { renderer.removeRenderListener(this); } ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ GeoTools-commits mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/geotools-commits |
||||||||||||||||
| Free Embeddable Forum Powered by Nabble | Help |