← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11442: PNG maps cleanup

 

------------------------------------------------------------
revno: 11442
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2013-07-18 17:55:16 +0200
message:
  PNG maps cleanup
removed:
  dhis-2/dhis-services/dhis-service-mapgeneration/src/test/java/org/hisp/dhis/mapgenerator/GeoToolsMapTest.java
modified:
  dhis-2/dhis-api/src/test/java/org/hisp/dhis/common/CombinationGeneratorTest.java
  dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMap.java
  dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/MapUtils.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/test/java/org/hisp/dhis/common/CombinationGeneratorTest.java'
--- dhis-2/dhis-api/src/test/java/org/hisp/dhis/common/CombinationGeneratorTest.java	2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-api/src/test/java/org/hisp/dhis/common/CombinationGeneratorTest.java	2013-07-18 15:55:16 +0000
@@ -106,6 +106,20 @@
         assertNull( generator.getNext() );
         assertNull( generator.getNext() );
     }
+
+    @Test
+    public void testGetNextD()
+    {
+        IdentifiableObject[] a1 = {a,b};
+        IdentifiableObject[] a2 = {};
+        
+        CombinationGenerator<IdentifiableObject> generator = new CombinationGenerator<IdentifiableObject>( a1, a2 );
+        
+        assertTrue( equals( generator.getNext(), a ) );
+        assertTrue( equals( generator.getNext(), b ) );
+        assertNull( generator.getNext() );
+        assertNull( generator.getNext() );
+    }
     
     @Test
     public void testHasNextA()

=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMap.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMap.java	2013-07-06 20:17:27 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/InternalMap.java	2013-07-18 15:55:16 +0000
@@ -27,7 +27,6 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-import java.awt.Color;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
@@ -46,36 +45,12 @@
  */
 public class InternalMap
 {
-    protected Color backgroundColor = null;
-
-    protected boolean isAntiAliasingEnabled = true;
-    
     private List<InternalMapObject> mapObjects = new ArrayList<InternalMapObject>();
 
     public InternalMap()
     {
     }
     
-    public Color getBackgroundColor()
-    {
-        return backgroundColor;
-    }
-
-    public void setBackgroundColor( Color backgroundColor )
-    {
-        this.backgroundColor = backgroundColor;
-    }
-
-    public boolean isAntiAliasingEnabled()
-    {
-        return isAntiAliasingEnabled;
-    }
-
-    public void setAntiAliasingEnabled( boolean isAntiAliasingEnabled )
-    {
-        this.isAntiAliasingEnabled = isAntiAliasingEnabled;
-    }
-
     public List<InternalMapObject> getMapObjects()
     {
         return mapObjects;

=== modified file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/MapUtils.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/MapUtils.java	2013-07-06 21:02:50 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/main/java/org/hisp/dhis/mapgeneration/MapUtils.java	2013-07-18 15:55:16 +0000
@@ -183,24 +183,8 @@
         BufferedImage image = new BufferedImage( imageBounds.width, imageBounds.height, BufferedImage.TYPE_INT_ARGB );
         Graphics2D g = (Graphics2D) image.getGraphics();
 
-        // Draw a background if the background color is specified
-        // NOTE It will be transparent otherwise, which is desired
-        if ( map.getBackgroundColor() != null )
-        {
-            g.setColor( map.getBackgroundColor() );
-            g.fill( imageBounds );
-        }
-
-        // Enable anti-aliasing if specified
-        if ( map.isAntiAliasingEnabled() )
-        {
-            g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
-        }
-        else
-        {
-            g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF );
-        }
-
+        g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
+        
         // Render the map
         renderer.paint( g, imageBounds, mapBounds );
 

=== removed file 'dhis-2/dhis-services/dhis-service-mapgeneration/src/test/java/org/hisp/dhis/mapgenerator/GeoToolsMapTest.java'
--- dhis-2/dhis-services/dhis-service-mapgeneration/src/test/java/org/hisp/dhis/mapgenerator/GeoToolsMapTest.java	2013-07-06 20:00:33 +0000
+++ dhis-2/dhis-services/dhis-service-mapgeneration/src/test/java/org/hisp/dhis/mapgenerator/GeoToolsMapTest.java	1970-01-01 00:00:00 +0000
@@ -1,50 +0,0 @@
-package org.hisp.dhis.mapgenerator;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import java.awt.Color;
-
-import org.hisp.dhis.DhisSpringTest;
-import org.hisp.dhis.mapgeneration.InternalMap;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * @author Kenneth Solbø Andersen <kennetsa@xxxxxxxxxx>
- */
-public class GeoToolsMapTest
-    extends DhisSpringTest
-{
-    private InternalMap geoToolsMap;
-
-    @Override
-    public void setUpTest()
-    {
-        geoToolsMap = new InternalMap();
-    }
-
-    @Test
-    public void testSetGetBackground()
-    {
-        geoToolsMap.setBackgroundColor( Color.BLUE );
-        assertEquals( Color.BLUE, geoToolsMap.getBackgroundColor() );
-    }
-
-    @Test
-    public void testSetGetAntiAliasingEnabled()
-    {
-        geoToolsMap.setAntiAliasingEnabled( false );
-        assertFalse( geoToolsMap.isAntiAliasingEnabled() );
-        geoToolsMap.setAntiAliasingEnabled( true );
-        assertTrue( geoToolsMap.isAntiAliasingEnabled() );
-    }
-
-    @Test
-    @Ignore
-    public void testRender()
-    {
-        //TODO
-    }
-}