← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 217: Previous commit completed.

 

------------------------------------------------------------
revno: 217
committer: Jan Henrik Overland janhenrik.overland@xxxxxxxxx
branch nick: trunk
timestamp: Tue 2009-04-21 18:24:05 +0200
message:
  Previous commit completed.
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegendSet.java
modified:
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java
  dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java

=== added file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegendSet.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegendSet.java	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/mapping/MapLegendSet.java	2009-04-21 16:24:05 +0000
@@ -0,0 +1,148 @@
+package org.hisp.dhis.mapping;
+
+import java.util.Collection;
+
+import org.hisp.dhis.indicator.Indicator;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @author Jan Henrik Overland
+ * @version $Id$
+ */
+public class MapLegendSet
+{
+    private int id;
+
+    private String name;
+    
+    private String colorLow;
+    
+    private String colorHigh;
+    
+    private Collection<Indicator> indicators;
+
+    public MapLegendSet()
+    {
+    }
+
+    public MapLegendSet( String name, String colorLow, String colorHigh, Collection<Indicator> indicators )
+    {
+        this.name = name;
+        this.colorLow = colorLow;
+        this.colorHigh = colorHigh;
+        this.indicators = indicators;
+    }
+    
+    // -------------------------------------------------------------------------
+    // hashCode, equals and toString
+    // -------------------------------------------------------------------------
+    
+    @Override
+    public int hashCode()
+    {
+        return name.hashCode();
+    }
+
+    @Override
+    public boolean equals( Object object )
+    {
+        if ( this == object )
+        {
+            return true;
+        }
+        
+        if ( object == null )
+        {
+            return false;
+        }
+        
+        if ( getClass() != object.getClass() )
+        {
+            return false;
+        }
+        
+        MapLegendSet other = (MapLegendSet) object;
+        
+        return name.equals( other.name );
+    }
+    
+    // -------------------------------------------------------------------------
+    // Getters and setters
+    // -------------------------------------------------------------------------
+
+    public int getId()
+    {
+        return id;
+    }
+
+    public void setId( int id )
+    {
+        this.id = id;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+
+    public String getColorLow()
+    {
+        return colorLow;
+    }
+
+    public void setColorLow( String colorLow )
+    {
+        this.colorLow = colorLow;
+    }
+
+    public String getColorHigh()
+    {
+        return colorHigh;
+    }
+
+    public void setColorHigh( String colorHigh )
+    {
+        this.colorHigh = colorHigh;
+    }
+
+    public Collection<Indicator> getIndicators()
+    {
+        return indicators;
+    }
+
+    public void setIndicators( Collection<Indicator> indicators )
+    {
+        this.indicators = indicators;
+    }
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2009-04-21 16:21:49 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/DefaultMappingService.java	2009-04-21 16:24:05 +0000
@@ -31,7 +31,6 @@
 import java.util.Collection;
 import java.util.Set;
 
-import org.hisp.dhis.gis.Legend;
 import org.hisp.dhis.gis.LegendSet;
 import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.indicator.IndicatorService;
@@ -321,4 +320,4 @@
         
         return false;
     }
-}
+}
\ No newline at end of file

=== modified file 'dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java'
--- dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java	2009-04-21 16:21:49 +0000
+++ dhis-2/dhis-services/dhis-service-mapping/src/main/java/org/hisp/dhis/mapping/hibernate/HibernateMappingStore.java	2009-04-21 16:24:05 +0000
@@ -33,10 +33,8 @@
 import org.hibernate.Query;
 import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
-import org.hisp.dhis.gis.Legend;
 import org.hisp.dhis.gis.LegendSet;
 import org.hisp.dhis.hibernate.HibernateSessionManager;
-import org.hisp.dhis.indicator.Indicator;
 import org.hisp.dhis.mapping.Map;
 import org.hisp.dhis.mapping.MapOrganisationUnitRelation;
 import org.hisp.dhis.mapping.MappingStore;



--
Trunk
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.