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


Java UserProperties.keySet方法代码示例

本文整理汇总了Java中org.freehep.graphicsbase.util.UserProperties.keySet方法的典型用法代码示例。如果您正苦于以下问题:Java UserProperties.keySet方法的具体用法?Java UserProperties.keySet怎么用?Java UserProperties.keySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.freehep.graphicsbase.util.UserProperties的用法示例。


在下文中一共展示了UserProperties.keySet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

import org.freehep.graphicsbase.util.UserProperties; //导入方法依赖的package包/类
/**
 * Converts an SVG graphic to another vector format.
 * @param properties conversion properties
 * @param converter target converter
 * @return -1 in case of error (messages printed on STDERR), 0 if successful
 */
public int convert(TargetProperties properties, SVG converter){
	String res = this.resources.generateURI(this.cli.getFile(), this.cli.getURI());
	if(!"".equals(res)){
		this.printError(res);
		return -1;
	}
	if(this.resources.getBasename()==null || this.resources.getUri()==null){
		return -1;
	}

	res = this.resources.testOutputDir(this.cli.getDirectory());
	if(!"".equals(res)){
		this.printError(res);
		return -1;
	}

	res = this.resources.testOutput(this.cli.getOutput());
	if(!"".equals(res)){
		this.printError(res);
		return -1;
	}

	this.printProgress("input URI=" + this.resources.getUri());
	this.printProgress("input file basename=" + this.resources.getBasename());
	this.printProgress("output directory=" + this.resources.getDirectory());
	this.printProgress("output file=" + this.resources.getOutput());

	converter.load(this.resources.getUri());

	if(this.cli.isVerbose()==true){
		UserProperties up = properties.getProperties();
		Set<Object> keys = up.keySet();
		Iterator<Object>it = keys.iterator();
		while(it.hasNext()){
			String key = it.next().toString();
			String val = up.getProperty(key);
			key=key.substring(key.lastIndexOf('.')+1, key.length());
			this.printProgress("SVG property <" + key + ">=" + val);
		}
	}

	converter.convert(this.resources.getDirectory(), this.resources.getOutput());
	return 0;
}
 
开发者ID:atosorigin,项目名称:gendoc,代码行数:51,代码来源:Tool.java

示例2: executeApplication

import org.freehep.graphicsbase.util.UserProperties; //导入方法依赖的package包/类
@Override
public int executeApplication(String[] args) {
	// parse command line, exit with help screen if error
	int ret = super.executeApplication(args);
	if(ret!=0){
		return ret;
	}

	SvgTargets target = this.getProps().getTarget();

	FhConverter converter = TARGET_2_CONVERTER(target);
	if(converter==null){
		this.printErrorMessage("no converter found for target <" + target.name() + ">");
		return -20;
	}

	converter.setPropertyTransparent(!this.optionNotTransparent.inCli());
	converter.setPropertyClip(this.optionClip.inCli());
	converter.setPropertyBackground(!this.optionNoBackground.inCli());
	converter.setPropertyTextAsShapes(this.getProps().doesTextAsShape());
	if(this.optionBackgroundColor.inCli()){
		Color color = Color.getColor(this.optionBackgroundColor.getValue());
		converter.setPropertyBackgroundColor(color);
	}

	UserProperties up = converter.getProperties();
	Set<Object> keys = up.keySet();
	Iterator<Object>it = keys.iterator();
	while(it.hasNext()){
		String key = it.next().toString();
		String val = up.getProperty(key);
		key=key.substring(key.lastIndexOf('.')+1, key.length());
		this.printDetailMessage("using SVG property " + key + "=" + val);
	}

	String err;
	BatikLoader loader = this.getProps().getLoader();
	if(this.getProps().doesLayers()){
		for(Entry<String, Integer> entry : loader.getLayers().entrySet()){
			loader.switchOffAllLayers();
			loader.switchOnLayer(entry.getKey());
			this.printProgressMessage("processing layer " + entry.getKey());
			this.printDetailMessage("writing to file " + this.getProps().getFnOut(entry) + "." + target.name());
			if(this.getProps().canWriteFiles()){
				err = converter.convertDocument(loader, new File(this.getProps().getFnOut(entry) + "." + target.name()));
				if(err!=null){
					this.printErrorMessage(err);
					return -99;//TODO
				}
			}
		}
	}
	else{
		this.printProgressMessage("converting input");
		this.printDetailMessage("writing to file " + this.getProps().getFoutFile());
		if(this.getProps().canWriteFiles()){
			err = converter.convertDocument(loader, this.getProps().getFoutFile());
			if(err!=null){
				this.printErrorMessage(err);
				return -99;//TODO
			}
		}
	}

	this.printProgressMessage("finished successfully");
	return 0;
}
 
开发者ID:vdmeer,项目名称:svg2vector,代码行数:68,代码来源:Svg2Vector_FH.java


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