[Schmitzm-commits] r948 - in trunk: src/schmitzm/geotools/styling src_junit/schmitzm/geotools/styling
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jul 28 11:45:13 CEST 2010
Author: alfonx
Date: 2010-07-28 11:45:11 +0200 (Wed, 28 Jul 2010)
New Revision: 948
Added:
trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java
Removed:
trunk/src/schmitzm/geotools/styling/StylingUtilTest.java
Log:
Fixed the problem with test test class
Deleted: trunk/src/schmitzm/geotools/styling/StylingUtilTest.java
===================================================================
--- trunk/src/schmitzm/geotools/styling/StylingUtilTest.java 2010-07-28 09:36:12 UTC (rev 947)
+++ trunk/src/schmitzm/geotools/styling/StylingUtilTest.java 2010-07-28 09:45:11 UTC (rev 948)
@@ -1,84 +0,0 @@
-package schmitzm.geotools.styling;
-
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.GraphicsEnvironment;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import junit.framework.TestCase;
-
-import org.geotools.feature.FeatureCollection;
-import org.geotools.geometry.jts.ReferencedEnvelope;
-import org.geotools.map.DefaultMapContext;
-import org.geotools.map.DefaultMapLayer;
-import org.geotools.renderer.lite.StreamingRenderer;
-import org.geotools.styling.Style;
-import org.junit.Test;
-import org.opengis.feature.simple.SimpleFeature;
-import org.opengis.feature.simple.SimpleFeatureType;
-
-import schmitzm.geotools.JTSUtil;
-import schmitzm.geotools.styling.StylingUtil.SelectionStylesTypes;
-import schmitzm.swing.TestingUtil;
-
-public class StylingUtilTest extends TestCase {
-
- boolean INTERACTIVE = !GraphicsEnvironment.isHeadless();
-
- @Test
- public void testSelectionStyles() throws Throwable {
-
- FeatureCollection<SimpleFeatureType, SimpleFeature> testFeatures = TestingUtil2
- .getTestFeatures();
-
- JPanel jPanel = new JPanel();
-
- for (SelectionStylesTypes st : SelectionStylesTypes.values()) {
- Style style = StylingUtil.createSelectionStyle(testFeatures, st);
-
- DefaultMapContext mc = new DefaultMapContext();
- mc.addLayer(new DefaultMapLayer(testFeatures, style));
-
- StreamingRenderer sr = new StreamingRenderer();
- sr.setContext(mc);
-
- // DIe Bounds werden vom selected Feature genommen
- ReferencedEnvelope bounds = testFeatures.getBounds();
- Double imageW = 300.;
- Double imageH = imageW * bounds.getHeight() / bounds.getWidth();
-
- if (imageH > 200.) {
- imageH = 200.;
- imageW = imageH * bounds.getWidth() / bounds.getHeight();
- }
-
- BufferedImage img = new BufferedImage(imageW.intValue(), imageH
- .intValue(), BufferedImage.TYPE_INT_ARGB);
- Graphics2D gr = (Graphics2D) img.getGraphics();
-
- gr.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON);
- gr.setRenderingHint(RenderingHints.KEY_RENDERING,
- RenderingHints.VALUE_RENDER_QUALITY);
-
- sr.paint(gr, new Rectangle(new Dimension(imageW
- .intValue(), imageH.intValue())), JTSUtil
- .expandEnvelope(testFeatures.getBounds(), .1));
-
- gr.dispose();
-
- jPanel.add(new JLabel(new ImageIcon(img, st.toString())));
- }
- TestingUtil.testPanel(jPanel, "Different selection styles");
-
- }
-
-}
Copied: trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java (from rev 947, trunk/src/schmitzm/geotools/styling/StylingUtilTest.java)
===================================================================
--- trunk/src/schmitzm/geotools/styling/StylingUtilTest.java 2010-07-28 09:36:12 UTC (rev 947)
+++ trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java 2010-07-28 09:45:11 UTC (rev 948)
@@ -0,0 +1,84 @@
+package schmitzm.geotools.styling;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.GraphicsEnvironment;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.image.BufferedImage;
+
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import junit.framework.TestCase;
+
+import org.geotools.feature.FeatureCollection;
+import org.geotools.geometry.jts.ReferencedEnvelope;
+import org.geotools.map.DefaultMapContext;
+import org.geotools.map.DefaultMapLayer;
+import org.geotools.renderer.lite.StreamingRenderer;
+import org.geotools.styling.Style;
+import org.junit.Test;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.feature.simple.SimpleFeatureType;
+
+import schmitzm.geotools.JTSUtil;
+import schmitzm.geotools.styling.StylingUtil.SelectionStylesTypes;
+import schmitzm.swing.TestingUtil;
+
+public class StylingUtilTest extends TestCase {
+
+ boolean INTERACTIVE = !GraphicsEnvironment.isHeadless();
+
+ @Test
+ public void testSelectionStyles() throws Throwable {
+
+ FeatureCollection<SimpleFeatureType, SimpleFeature> testFeatures = TestingUtil2
+ .getTestFeatures();
+
+ JPanel jPanel = new JPanel();
+
+ for (SelectionStylesTypes st : SelectionStylesTypes.values()) {
+ Style style = StylingUtil.createSelectionStyle(testFeatures, st);
+
+ DefaultMapContext mc = new DefaultMapContext();
+ mc.addLayer(new DefaultMapLayer(testFeatures, style));
+
+ StreamingRenderer sr = new StreamingRenderer();
+ sr.setContext(mc);
+
+ // DIe Bounds werden vom selected Feature genommen
+ ReferencedEnvelope bounds = testFeatures.getBounds();
+ Double imageW = 300.;
+ Double imageH = imageW * bounds.getHeight() / bounds.getWidth();
+
+ if (imageH > 200.) {
+ imageH = 200.;
+ imageW = imageH * bounds.getWidth() / bounds.getHeight();
+ }
+
+ BufferedImage img = new BufferedImage(imageW.intValue(), imageH
+ .intValue(), BufferedImage.TYPE_INT_ARGB);
+ Graphics2D gr = (Graphics2D) img.getGraphics();
+
+ gr.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
+ RenderingHints.VALUE_INTERPOLATION_BICUBIC);
+ gr.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ RenderingHints.VALUE_ANTIALIAS_ON);
+ gr.setRenderingHint(RenderingHints.KEY_RENDERING,
+ RenderingHints.VALUE_RENDER_QUALITY);
+
+ sr.paint(gr, new Rectangle(new Dimension(imageW
+ .intValue(), imageH.intValue())), JTSUtil
+ .expandEnvelope(testFeatures.getBounds(), .1));
+
+ gr.dispose();
+
+ jPanel.add(new JLabel(new ImageIcon(img, st.toString())));
+ }
+ TestingUtil.testPanel(jPanel, "Different selection styles");
+
+ }
+
+}
Property changes on: trunk/src_junit/schmitzm/geotools/styling/StylingUtilTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id URL
Name: svn:eol-style
+ native
More information about the Schmitzm-commits
mailing list