ChartGenerator.java revision d81978a0815d5b8a75633c35e3e1f8708d36f017
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
*/
public class ChartGenerator {
this.parsedArguments = parsedArguments;
}
try {
"datas"));
}
}
int it = 2;
it++;
}
throw new ParseException("Unknown attribute " +
}
}
Second.class));
} else {
}
}
int periodCount = 0;
periodCount++;
} else {
}
} else {
} else {
values[i+2]));
}
}
}
}
while (keys.hasMoreElements()) {
}
}
} catch (IOException e) {
} catch (ParseException e) {
}
return dataset;
}
while (keys.hasMoreElements()) {
title, // title
"Date", // x-axis label
"Values", // y-axis label
tsc, // datas
true, // create legend?
true, // generate tooltips?
false // generate URLs?
)
);
}
return charts;
}
try {
r.mkdirs();
while (keys.hasMoreElements()) {
);
}
} catch (IOException e) {
}
}
}
/**
* Parse the command line argument.
*
* @param args the command line argument
* @return the parsed argument
*/
"[-i] [-m] [-w <width>] [-h <height] [-f <filesRepository>] " +
"[-r <chartrepositiry>]\n";
try {
"datas\n\n" +
usage + "\n" +
"-a, --attribute\n" +
" Attribute we need to generate the chart\n" +
"-i, --ignore\n" +
" Ignore the errors to generate the chart\n" +
"-m, --movingAverage" +
" Generate moving average from the datas file" +
"-w, --width\n" +
" Image width (in pixels)\n" +
"-h, --height\n" +
" Image height (in pixels)\n" +
"-f, --filesRepository\n" +
" Repository where data are to take in input\n" +
"-r, --repository\n" +
" Repository of the generated charts\n"
);
}
} else {
throw new IllegalArgumentException();
}
i++;
i++;
i++;
} else {
throw new IllegalArgumentException();
}
i++;
} else {
throw new IllegalArgumentException();
}
i++;
} else {
}
} else {
throw new IllegalArgumentException();
}
i++;
} else {
}
} else {
throw new IllegalArgumentException();
}
i++;
} else {
throw new IllegalArgumentException();
}
}
// throw new IllegalArgumentException();
}
// throw new IllegalArgumentException();
}
// throw new IllegalArgumentException();
}
// throw new IllegalArgumentException();
}
} catch (IllegalArgumentException e) {
"more usage help");
} catch (ArrayIndexOutOfBoundsException e) {
"more usage help");
}
return parsedArguments;
}
}