tmpSerieName = serieName;
if(!(serie_values.keySet().contains(serieName))) // new serie create the arrays
{
i=0;
newSerie=true;
SerieCluster serieCluster=new SerieCluster(serieName, new double[listAtts.size()], new double[listAtts.size()], new double[listAtts.size()]);
serie_values.put(serieName, serieCluster);
}
else // serie already present
{ newSerie=false;
i++;
}
}
else if (name.equalsIgnoreCase("x") || name.equalsIgnoreCase("y") || name.equalsIgnoreCase("z")){
// after the name of serie here are values
SerieCluster serieCluster=(SerieCluster)serie_values.get(serieName);
if(serieCluster == null){
logger.error("Order of dataset not correct");
return null;
}
double valueD=0.0;
try{
Integer intero=Integer.valueOf(value);
valueD=intero.doubleValue();
}
catch (NumberFormatException e) {
valueD=(Double.valueOf(value)).doubleValue();
if(name.equalsIgnoreCase("x")){
decimalXValues=true;
}
else if(name.equalsIgnoreCase("y")){
decimalYValues=true;
}
}
if(name.equalsIgnoreCase("x")){
double[] xArr=serieCluster.getX();
xArr[i]=valueD;
if(firstX){
xTempMin=valueD;
xTempMax=valueD;
firstX=false;
}
if(valueD<xTempMin)xTempMin=valueD;
if(valueD>xTempMax)xTempMax=valueD;
serieCluster.setX(xArr);
}
else
if(name.equalsIgnoreCase("y")){
double[] yArr=serieCluster.getY();
yArr[i]=valueD;
if(firstY){
yTempMin=valueD;
yTempMax=valueD;
firstY=false;
}
if(valueD<yTempMin)yTempMin=valueD;
if(valueD>yTempMax)yTempMax=valueD;
serieCluster.setY(yArr);
}
else
if(name.equalsIgnoreCase("z")){
double[] zArr=serieCluster.getZ();
zArr[i]=valueD;
if(firstZ){
zMax=valueD;
firstZ=false;
}
if(zMax<valueD)zMax=valueD;
serieCluster.setZ(zArr);
}
}
else if (name.equalsIgnoreCase(colSel)){
//defines map with selection series informations
String tmpName = tmpSerieName.replaceAll(" ", "");
tmpName = tmpName.replace('.', ' ').trim();
if(!(serie_selected.keySet().contains(tmpName)) && !tmpName.equals(""))
serie_selected.put(tmpName, value);
}
}
}
//xMin=xTempMin-zMax;
//xMax=xTempMax+zMax;
xMin=xTempMin-1.0;
xMax=xTempMax+1.0;
yMin=yTempMin;
yMax=yTempMax;
double xOrder=calculateOrder(xMax)*10;
// I have all the map full, create the Dataset
for (Iterator iterator = serie_values.keySet().iterator(); iterator.hasNext();) {
String serieName = (String) iterator.next();
SerieCluster serieCluster=(SerieCluster)serie_values.get(serieName);
double[] xArr=serieCluster.getX();
double[] yArr=serieCluster.getY();
double[] zArr=serieCluster.getZ();
// normalizing all z
for (int j = 0; j < zArr.length; j++) {
zArr[j]=(zArr[j]/zMax);
if(xOrder>0) zArr[j]=zArr[j]*xOrder;