← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11079: Removed unused method

 

------------------------------------------------------------
revno: 11079
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-05-29 15:18:45 +0200
message:
  Removed unused method
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java
  dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.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/main/java/org/hisp/dhis/chart/ChartService.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2013-05-29 13:05:35 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/chart/ChartService.java	2013-05-29 13:18:45 +0000
@@ -29,7 +29,6 @@
 
 import java.util.Collection;
 import java.util.Date;
-import java.util.List;
 import java.util.Map;
 
 import org.hisp.dhis.dataelement.DataElement;
@@ -50,6 +49,10 @@
 {
     String ID = ChartService.class.getName();
 
+    // -------------------------------------------------------------------------
+    // JFreeChart
+    // -------------------------------------------------------------------------
+
     JFreeChart getJFreeChart( int id, I18nFormat format );
 
     JFreeChart getJFreeChart( Chart chart, I18nFormat format );
@@ -70,15 +73,16 @@
 
     JFreeChart getJFreeOrganisationUnitChart( Indicator indicator, OrganisationUnit parent, boolean title, I18nFormat format );
 
-    JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements, List<Period> periods,
-                              List<OrganisationUnit> organisationUnits, String series, String category, String filter, boolean regression, I18nFormat format );
-
     JFreeChart getJFreeChart( String name, PlotOrientation orientation, CategoryLabelPositions labelPositions,
                               Map<String, Double> categoryValues );
 
     JFreeChart getJFreeChartHistory( DataElement dataElement, DataElementCategoryOptionCombo categoryOptionCombo,
                                      Period lastPeriod, OrganisationUnit organisationUnit, int historyLength, I18nFormat format );
 
+    // -------------------------------------------------------------------------
+    // Chart CRUD
+    // -------------------------------------------------------------------------
+
     int addChart( Chart chart );
 
     void updateChart( Chart chart );

=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2013-05-29 13:05:35 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/chart/impl/DefaultChartService.java	2013-05-29 13:18:45 +0000
@@ -103,7 +103,6 @@
 
 /**
  * @author Lars Helge Overland
- * @version $Id$
  */
 @Transactional
 public class DefaultChartService
@@ -199,10 +198,10 @@
         
         chart.init( user, date, organisationUnit, format );
 
-        return getJFreeChart( chart, !chart.isHideSubtitle() );
+        return getJFreeChart( chart );
     }
 
-    public JFreeChart getJFreePeriodChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format ) //TODO remove?
+    public JFreeChart getJFreePeriodChart( Indicator indicator, OrganisationUnit unit, boolean title, I18nFormat format )
     {
         List<Period> periods = periodService.reloadPeriods(
             new RelativePeriods().setLast12Months( true ).getRelativePeriods( format, true ) );
@@ -220,13 +219,14 @@
         chart.getIndicators().add( indicator );
         chart.setRelativePeriods( periods );
         chart.getOrganisationUnits().add( unit );
+        chart.setHideSubtitle( title );
         chart.setFormat( format );
 
-        return getJFreeChart( chart, title );
+        return getJFreeChart( chart );
     }
 
     public JFreeChart getJFreeOrganisationUnitChart( Indicator indicator, OrganisationUnit parent, boolean title,
-        I18nFormat format ) //TODO remove?
+        I18nFormat format )
     {
         List<Period> periods = periodService.reloadPeriods(
             new RelativePeriods().setThisYear( true ).getRelativePeriods( format, true ) );
@@ -244,30 +244,10 @@
         chart.getIndicators().add( indicator );
         chart.setRelativePeriods( periods );
         chart.setOrganisationUnits( parent.getSortedChildren() );
-        chart.setFormat( format );
-
-        return getJFreeChart( chart, title );
-    }
-
-    public JFreeChart getJFreeChart( List<Indicator> indicators, List<DataElement> dataElements,
-        List<Period> periods, List<OrganisationUnit> organisationUnits,
-        String series, String category, String filter,
-        boolean regression, I18nFormat format )
-    {
-        Chart chart = new Chart();
-
-        chart.setType( TYPE_COLUMN );
-        chart.setDimensions( series, category, filter );
-        chart.setHideLegend( false );
-        chart.setRegression( regression );
-        chart.setIndicators( indicators );
-        chart.setDataElements( dataElements );
-        chart.setRelativePeriods( periods );
-        chart.setOrganisationUnits( organisationUnits );
-        chart.setFormat( format );
-        chart.setName( chart.generateTitle() );
-
-        return getJFreeChart( chart, false );
+        chart.setHideSubtitle( title );
+        chart.setFormat( format );
+
+        return getJFreeChart( chart );
     }
 
     public JFreeChart getJFreeChart( String name, PlotOrientation orientation, CategoryLabelPositions labelPositions,
@@ -504,7 +484,7 @@
     /**
      * Returns a JFreeChart of type defined in the chart argument.
      */
-    private JFreeChart getJFreeChart( Chart chart, boolean subTitle )
+    private JFreeChart getJFreeChart( Chart chart )
     {
         final BarRenderer barRenderer = getBarRenderer();
         final LineAndShapeRenderer lineRenderer = getLineRenderer();
@@ -571,7 +551,7 @@
             plot.addRangeMarker( getMarker( chart.getBaseLineValue(), chart.getBaseLineLabel() ) );
         }
 
-        if ( subTitle )
+        if ( chart.isHideSubtitle() )
         {
             jFreeChart.addSubtitle( getSubTitle( chart ) );
         }