本文整理汇总了Java中com.github.javacliparser.StringOption类的典型用法代码示例。如果您正苦于以下问题:Java StringOption类的具体用法?Java StringOption怎么用?Java StringOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StringOption类属于com.github.javacliparser包,在下文中一共展示了StringOption类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createScript
import com.github.javacliparser.StringOption; //导入依赖的package包/类
/**
* Creates the content of the gnuplot script.
* @param resultFile path of the plot output file
* @return gnuplot script
*/
private String createScript(File resultFile) {
String newLine = System.getProperty("line.separator");
int sourceFileIdx = 0;
// terminal options;
String script = "set term "
+ terminalOptions(Terminal.valueOf(outputTypeOption
.getChosenLabel())) + newLine;
script += "set output '" + resultFile.getAbsolutePath() + "'" + newLine;
script += "set datafile separator ','" + newLine;
script += "set grid" + newLine;
script += "set style line 1 pt 8" + newLine;
script += "set style line 2 lt rgb '#00C000'" + newLine;
script += "set style line 5 lt rgb '#FFD800'" + newLine;
script += "set style line 6 lt rgb '#4E0000'" + newLine;
script += "set format x '%.0s %c" + getAxisUnit(xUnitOption.getValue())
+ "'" + newLine;
script += "set format y '%.0s %c" + getAxisUnit(yUnitOption.getValue())
+ "'" + newLine;
script += "set ylabel '" + yTitleOption.getValue() + "'" + newLine;
script += "set xlabel '" + xTitleOption.getValue() + "'" + newLine;
if (!legendTypeOption.getChosenLabel().equals(LegendType.NONE)) {
script += "set key "
+ legendTypeOption.getChosenLabel().toLowerCase().replace(
'_', ' ')
+ " "
+ legendLocationOption.getChosenLabel().toLowerCase()
.replace('_', ' ') + newLine;
}
// additional commands
script += additionalSetOption.getValue();
// plot command
script += "plot " + additionalPlotOption.getValue() + " ";
// plot for each input file
for (int i = 0; i < inputFilesOption.getList().length; i++) {
if (sourceFileIdx > 0) {
script += ", ";
}
sourceFileIdx++;
script += "'" + ((StringOption) inputFilesOption
.getList()[i]).getValue() + "' using "
+ xColumnOption.getValue() + ":" + yColumnOption.getValue();
if (smoothOption.isSet()) {
script += ":(1.0) smooth bezier";
}
script += " with " + plotStyleOption.getChosenLabel().toLowerCase()
+ " ls " + sourceFileIdx + " lw "
+ lineWidthOption.getValue();
if (plotStyleOption.getChosenLabel().equals(
PlotStyle.LINESPOINTS.toString())
&& pointIntervalOption.getValue() > 0) {
script += " pointinterval " + pointIntervalOption.getValue();
}
script += " title '" + ((StringOption) fileAliasesOption
.getList()[i]).getValue() + "'";
}
script += newLine;
return script;
}