resourceType = resource.getResource().getResourceType();
measurementDisplayMap = new HashMap<String, List<MeasurementDisplay>>();
MeasurementUtils measurementUtils = new MeasurementUtils(resource);
measurementDefinitionMap = measurementUtils.getMeasurementDefinitionMap();
List<MeasurementData> measurementDataList = measurementUtils.loadMeasurementData(null, DataType.MEASUREMENT);
measurementCategoryList = measurementUtils.loadCategoryList(measurementDefinitionMap,
measurementDataList, measurementDisplayMap);
List<MeasurementData> traitDataList = measurementUtils.loadMeasurementData(null, DataType.TRAIT);
if (traitDataList != null)
{
traitDisplayList = new ArrayList<Map<String, MeasurementDisplay>>();
String[] columnNames = new String[]{"a", "b"};
int columnCount = 0;
Map<String, MeasurementDisplay> currentMap = new HashMap<String, MeasurementDisplay>();
// split all the traits into 3 columns so it can be displayed correctly in the UI
for (MeasurementData traitData : traitDataList)
{
if (columnCount % columnNames.length == 0)
{
currentMap = new HashMap<String, MeasurementDisplay>();
traitDisplayList.add(currentMap);
}
currentMap.put(columnNames[columnCount % columnNames.length],
measurementUtils.createMeasurementDisplay(traitData, measurementDefinitionMap.get(traitData.getName())));
columnCount++;
}
}