当前位置: 首页>>代码示例>>Java>>正文


Java StringOption类代码示例

本文整理汇总了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;
   }
 
开发者ID:Waikato,项目名称:moa,代码行数:71,代码来源:Plot.java


注:本文中的com.github.javacliparser.StringOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。