← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 87: dhis-web-dataentry: Codestyle fix

 

------------------------------------------------------------
revno: 87
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-03-19 14:32:36 +0100
message:
  dhis-web-dataentry: Codestyle fix
modified:
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MinMaxGeneratingAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DataElementHistory.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DefaultHistoryRetriever.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/HistoryRetriever.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultStatefulDataValueSaver.java
  dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/FormAction.java	2009-03-19 13:32:36 +0000
@@ -264,9 +264,9 @@
     {    	
     	zeroValueSaveMode = (Boolean) systemSettingManager.getSystemSetting( KEY_ZERO_VALUE_SAVE_MODE, false );
     	
-    	if( zeroValueSaveMode == null )
+    	if ( zeroValueSaveMode == null )
     	{
-    		zeroValueSaveMode = false;
+    	    zeroValueSaveMode = false;
     	}
     	
     	OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
@@ -348,7 +348,7 @@
         
         if ( cdeFormExists )
         {        	
-        	customDataEntryFormCode = dataEntryScreenManager.populateCustomDataEntryScreen( dataEntryForm.getHtmlCode(), dataValues, calculatedValueMap, minMaxMap, disabled, zeroValueSaveMode, i18n );
+            customDataEntryFormCode = dataEntryScreenManager.populateCustomDataEntryScreen( dataEntryForm.getHtmlCode(), dataValues, calculatedValueMap, minMaxMap, disabled, zeroValueSaveMode, i18n );
         }            
 
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java	2009-03-10 10:19:13 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/HistoryAction.java	2009-03-19 13:32:36 +0000
@@ -176,8 +176,7 @@
 
     public String execute()
         throws Exception
-    {
-    	
+    {    	
     	DataElement dataElement = dataElementService.getDataElement( dataElementId );       
         
         DataElementCategoryOptionCombo optionCombo = dataElementCategoryOptionComboService.getDataElementCategoryOptionCombo( optionComboId );
@@ -186,7 +185,7 @@
         {
             String defaultName = DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME;
             
-        	optionCombo = dataElementCategoryComboService.getDataElementCategoryComboByName( defaultName ).getOptionCombos().iterator().next();
+            optionCombo = dataElementCategoryComboService.getDataElementCategoryComboByName( defaultName ).getOptionCombos().iterator().next();
         }
 
         if ( dataElement == null )
@@ -208,9 +207,9 @@
 
         standardComments = standardCommentsManager.getStandardComments();
         
-        if( dataElementHistory == null )
+        if ( dataElementHistory == null )
         {
-        	isHistoryValid = false;
+            isHistoryValid = false;
         }
 
         return SUCCESS;

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MinMaxGeneratingAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MinMaxGeneratingAction.java	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/MinMaxGeneratingAction.java	2009-03-19 13:32:36 +0000
@@ -120,8 +120,8 @@
             {            	
                 for( DataElementCategoryOptionCombo optionCombo : dataelement.getCategoryCombo().getOptionCombos() )
                 {                	
-                	DataElementHistory dataElementHistory = historyRetriever.getHistory( dataelement, optionCombo, organisationUnit,
-                            period, HISTORY_LENGTH );                	
+                    DataElementHistory dataElementHistory = historyRetriever.getHistory( 
+                        dataelement, optionCombo, organisationUnit, period, HISTORY_LENGTH );                	
                     setMinMaxLimits( dataElementHistory, organisationUnit, dataelement, optionCombo );
                 }
             	

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/SelectAction.java	2009-03-19 13:32:36 +0000
@@ -379,8 +379,7 @@
 
         if ( selectedDataSetId != null && selectedPeriodIndex != null && organisationUnit != null )
         {
-        	registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, period,
-                organisationUnit );
+            registration = registrationService.getCompleteDataSetRegistration( selectedDataSet, period, organisationUnit );
 
             registrationDate = registration != null ? registration.getDate() : new Date();
         }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/action/multidimensional/FormAction.java	2009-03-19 13:32:36 +0000
@@ -338,15 +338,14 @@
 
     public String execute()
         throws Exception
-    {      	
-    	
+    {    	
     	disableDefaultForm = false;
     	
     	zeroValueSaveMode = (Boolean) systemSettingManager.getSystemSetting( KEY_ZERO_VALUE_SAVE_MODE, false );
     	
-    	if( zeroValueSaveMode == null )
+    	if ( zeroValueSaveMode == null )
     	{
-    		zeroValueSaveMode = false;
+    	    zeroValueSaveMode = false;
     	}
     	   	
     	OrganisationUnit organisationUnit = selectedStateManager.getSelectedOrganisationUnit();
@@ -367,17 +366,17 @@
             return SUCCESS;
         }
         
-        for( DataElement de : dataElements )
+        for ( DataElement de : dataElements )
         {  
-        	Collection<DataElementCategoryOptionCombo> optionCombos = dataElementCategoryOptionComboService.sortDataElementCategoryOptionCombos( de.getCategoryCombo() ) ;
+            Collection<DataElementCategoryOptionCombo> optionCombos = dataElementCategoryOptionComboService.sortDataElementCategoryOptionCombos( de.getCategoryCombo() ) ;
         	
-        	for( DataElementCategoryOptionCombo optionCombo : optionCombos )
-        	{
-        		if( !orderdCategoryOptionCombos.contains( optionCombo ) )
-        		{
-        			orderdCategoryOptionCombos.add(optionCombo);
-        		}
-        	}	
+            for ( DataElementCategoryOptionCombo optionCombo : optionCombos )
+            {
+                if ( !orderdCategoryOptionCombos.contains( optionCombo ) )
+                {
+                    orderdCategoryOptionCombos.add(optionCombo);
+                }
+            }	
         }
         
         /*
@@ -399,16 +398,16 @@
         
         for ( DataElementCategory category : categories ) // Get the order of categories
         {                   
-        	DataElementDimensionRowOrder rowOrder = dataElementDimensionRowOrderService.getDataElementDimensionRowOrder( decbo, category );
+            DataElementDimensionRowOrder rowOrder = dataElementDimensionRowOrderService.getDataElementDimensionRowOrder( decbo, category );
         	
-        	if( rowOrder != null )
-        	{
-        		categoryMap.put( rowOrder.getDisplayOrder(), category );
-        	}
-        	else
-        	{
-        		categoryMap.put( category.getId(), category );
-        	}
+            if( rowOrder != null )
+            {
+                categoryMap.put( rowOrder.getDisplayOrder(), category );
+            }
+            else
+            {
+                categoryMap.put( category.getId(), category );
+            }
         }
 
         orderedCategories = categoryMap.values();
@@ -421,13 +420,13 @@
             {
             	DataElementDimensionColumnOrder columnOrder = dataElementDimensionColumnOrderService.getDataElementDimensionColumnOrder( dec, option );
             	
-            	if( columnOrder != null )
+            	if ( columnOrder != null )
             	{
-            		optionsMap.put( columnOrder.getDisplayOrder(), option );
+            	    optionsMap.put( columnOrder.getDisplayOrder(), option );
             	}
             	else
             	{
-            		optionsMap.put( option.getId(), option );
+            	    optionsMap.put( option.getId(), option );
             	}            	
             }            	
 
@@ -465,9 +464,9 @@
             catRepeat.put( cat.getId(), catColSpan );
         }       
         
-        for( DataElementCategoryOptionCombo deOptionCombo : orderdCategoryOptionCombos )
+        for ( DataElementCategoryOptionCombo deOptionCombo : orderdCategoryOptionCombos )
         {
-        	optionComboNames.put( deOptionCombo.getId(), dataElementCategoryOptionComboService.getOptionNames( deOptionCombo ) );        	
+            optionComboNames.put( deOptionCombo.getId(), dataElementCategoryOptionComboService.getOptionNames( deOptionCombo ) );        	
         }
         
         // ---------------------------------------------------------------------
@@ -535,16 +534,15 @@
                 dataValues, calculatedValueMap, minMaxMap, disabled, zeroValueSaveMode, i18n );
         }        
         
-        if( dataEntryScreenManager.hasMixOfDimensions( dataSet ) )
+        if ( dataEntryScreenManager.hasMixOfDimensions( dataSet ) )
         {          	
-        	
-    		disableDefaultForm = true;  		
+            disableDefaultForm = true;  		
     	
-    		if ( !cdeFormExists )
+            if ( !cdeFormExists )
             {    			
-    			customDataEntryFormCode = i18n.getString( "please_design_a_custom_form" );
+                customDataEntryFormCode = i18n.getString( "please_design_a_custom_form" );
     			
-    			return SUCCESS;
+                return SUCCESS;
             }        	        	
         }   
         	

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DataElementHistory.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DataElementHistory.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DataElementHistory.java	2009-03-19 13:32:36 +0000
@@ -52,13 +52,19 @@
 
     private int historyLength;
     
-    //max value used to draw the history graph
+    /**
+     * Max value used to draw the history graph
+     */
     private double maxHistoryValue;
     
-    //the lowest entered value
+    /**
+     * The lowest entered value
+     */
     private double minValue;
     
-    //the highest entered value
+    /**
+     * The highest entered value
+     */
     private double maxValue = Double.NEGATIVE_INFINITY;
     
     private List<DataElementHistoryPoint> historyPoints = new ArrayList<DataElementHistoryPoint>();

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DefaultHistoryRetriever.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DefaultHistoryRetriever.java	2009-03-09 19:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/DefaultHistoryRetriever.java	2009-03-19 13:32:36 +0000
@@ -78,8 +78,10 @@
         {	
             return null;
         	
-            /*throw new HistoryRetrieverException( "DataElement is not of type " + DataElement.TYPE_INT + ": "
-                + dataElement.getShortName() ) ; */
+            /*
+            throw new HistoryRetrieverException( "DataElement is not of type " + DataElement.TYPE_INT + ": "
+                + dataElement.getShortName() ) ;
+            */
         }
 
         // ---------------------------------------------------------------------
@@ -149,7 +151,11 @@
 
         return history;
     }   
-    
+
+    // -------------------------------------------------------------------------
+    // Supportive methods
+    // -------------------------------------------------------------------------
+
     private void addMinMaxLimits( OrganisationUnit organisationUnit, DataElement dataElement, DataElementCategoryOptionCombo optionCombo, DataElementHistory history )
     {
         MinMaxDataElement minMaxDataElement = minMaxDataElementStore.getMinMaxDataElement( organisationUnit,

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/HistoryRetriever.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/HistoryRetriever.java	2009-03-09 19:32:51 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/history/HistoryRetriever.java	2009-03-19 13:32:36 +0000
@@ -40,8 +40,8 @@
 {
     String ID = HistoryRetriever.class.getName();
 
-    DataElementHistory getHistory( DataElement dataElement, DataElementCategoryOptionCombo optionCombo, OrganisationUnit organisationUnit, Period lastPeriod,
-        int historyLength )
-        throws HistoryRetrieverException;    
+    DataElementHistory getHistory( DataElement dataElement, DataElementCategoryOptionCombo optionCombo, 
+        OrganisationUnit organisationUnit, Period lastPeriod, int historyLength )
+            throws HistoryRetrieverException;    
     
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DataEntryScreenManager.java	2009-03-19 13:32:36 +0000
@@ -35,5 +35,4 @@
     String populateCustomDataEntryScreen( String dataEntryFormCode, Collection<DataValue> dataValues, Map<CalculatedDataElement,Integer> calculatedValueMap, Map<Integer, MinMaxDataElement> minMaxMap, String disabled, Boolean saveMode, I18n i18n );
     
     String populateCustomDataEntryScreenForMultiDimensional( String dataEntryFormCode, Collection<DataValue> dataValues, Map<CalculatedDataElement,Integer> calculatedValueMap, Map<String, MinMaxDataElement> minMaxMap, String disabled, Boolean saveMode, I18n i18n );
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java	2009-03-12 11:40:58 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/screen/DefaultDataEntryScreenManager.java	2009-03-19 13:32:36 +0000
@@ -87,8 +87,7 @@
 
     private DataElementCategoryOptionComboService dataElementCategoryOptionComboService;
 
-    public void setDataElementCategoryOptionComboService(
-        DataElementCategoryOptionComboService dataElementCategoryOptionComboService )
+    public void setDataElementCategoryOptionComboService( DataElementCategoryOptionComboService dataElementCategoryOptionComboService )
     {
         this.dataElementCategoryOptionComboService = dataElementCategoryOptionComboService;
     }
@@ -105,26 +104,23 @@
     // -------------------------------------------------------------------------
     
     public boolean hasMixOfDimensions( DataSet dataSet )
-    {      	
-    	
+    {    	
     	if ( dataSet.getDataElements().size() > 0 )
         {       
-        	Iterator<DataElement> dataElementIterator = dataSet.getDataElements().iterator();
+    	    Iterator<DataElement> dataElementIterator = dataSet.getDataElements().iterator();
         	
-        	DataElementCategoryCombo catCombo = dataElementIterator.next().getCategoryCombo();       	
+    	    DataElementCategoryCombo catCombo = dataElementIterator.next().getCategoryCombo();       	
 
             for ( DataElement de : dataSet.getDataElements() )
             {           	
-            	
-            	if( catCombo != de.getCategoryCombo() )
+            	if ( catCombo != de.getCategoryCombo() )
             	{            		
-            		return true;
+            	    return true;
             	}                
             }
         }
 
         return false;
-        
     }
 
     public boolean hasMultiDimensionalDataElement( DataSet dataSet )
@@ -152,7 +148,6 @@
 
     public String getScreenType( DataSet dataSet )
     {
-
         int numberOfTotalColumns = 1;
 
         if ( dataSet.getDataElements().size() > 0 )
@@ -196,7 +191,6 @@
 
     public Map<CalculatedDataElement, Map<DataElement, Integer>> getNonSavedCalculatedDataElements( DataSet dataSet )
     {
-
         Map<CalculatedDataElement, Map<DataElement, Integer>> calculatedDataElementMap = new HashMap<CalculatedDataElement, Map<DataElement, Integer>>();
 
         CalculatedDataElement cde;

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java	2009-03-08 11:21:22 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultSelectedStateManager.java	2009-03-19 13:32:36 +0000
@@ -120,11 +120,19 @@
     // SelectedStateManager implementation
     // -------------------------------------------------------------------------
 
+    // -------------------------------------------------------------------------
+    // OrganisationUnit
+    // -------------------------------------------------------------------------
+    
     public OrganisationUnit getSelectedOrganisationUnit()
     {
         return selectionManager.getSelectedOrganisationUnit();
     }
 
+    // -------------------------------------------------------------------------
+    // DataSet
+    // -------------------------------------------------------------------------
+    
     @SuppressWarnings( "unchecked" )
     public void setSelectedDataSet( DataSet dataSet )
     {
@@ -148,6 +156,10 @@
         getSession().remove( SESSION_KEY_SELECTED_DATASET_ID );
     }
 
+    // -------------------------------------------------------------------------
+    // Period
+    // -------------------------------------------------------------------------
+    
     @SuppressWarnings( "unchecked" )
     public void setSelectedPeriodIndex( Integer index )
     {
@@ -210,7 +222,7 @@
         {
             Period period = iterator.next();
 
-            if ( period.getStartDate().after( now ) || !persistedPeriods.contains( period ))
+            if ( period.getStartDate().after( now ) || !persistedPeriods.contains( period ) )
             {
                 iterator.remove();
             }
@@ -347,7 +359,7 @@
         {
             DataSet dataSet = iterator.next();
 
-            if ( !(dataSet.getPeriodType() instanceof CalendarPeriodType) )
+            if ( !( dataSet.getPeriodType() instanceof CalendarPeriodType) )
             {
                 iterator.remove();
             }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultStatefulDataValueSaver.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultStatefulDataValueSaver.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/DefaultStatefulDataValueSaver.java	2009-03-19 13:32:36 +0000
@@ -125,5 +125,4 @@
         return dataValue;
         
     }
-
 }

=== modified file 'dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java'
--- dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-web/dhis-web-dataentry/src/main/java/org/hisp/dhis/de/state/SelectedStateManager.java	2009-03-19 13:32:36 +0000
@@ -61,7 +61,5 @@
 
     void previousPeriodSpan();
     
-    List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit );  
-    
-    
+    List<DataSet> loadDataSetsForSelectedOrgUnit( OrganisationUnit organisationUnit );    
 }



--

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.