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


Java UserProperties类代码示例

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


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

示例1: TargetProperties

import org.freehep.graphicsbase.util.UserProperties; //导入依赖的package包/类
/**
 * Constructor.
 * Sets transparency to true, background to false, background color to white, clipping to false and text-as-shapes to true
 */
public TargetProperties(){
	this.properties=new UserProperties();

	this.setPropertyTransparent(true);
	this.setPropertyBackground(false);
	this.setPropertyBackgroundColor(Color.WHITE);
	this.setPropertyClip(false);
	this.setPropertyTextAsShapes(true);
}
 
开发者ID:atosorigin,项目名称:gendoc,代码行数:14,代码来源:TargetProperties.java

示例2: FhConverter

import org.freehep.graphicsbase.util.UserProperties; //导入依赖的package包/类
/**
 * Creates a new converter with default configuration.
 * Sets transparency to true, background to false, background color to white, clipping to false, text as shapes to false.
 */
public FhConverter(){
	this.properties=new UserProperties();

	this.setPropertyTransparent(true);
	this.setPropertyBackground(false);
	this.setPropertyBackgroundColor(Color.WHITE);
	this.setPropertyClip(false);
	this.setPropertyTextAsShapes(false);
}
 
开发者ID:vdmeer,项目名称:svg2vector,代码行数:14,代码来源:FhConverter.java

示例3: 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

示例4: 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

示例5: getProperties

import org.freehep.graphicsbase.util.UserProperties; //导入依赖的package包/类
/**
 * Returns user properties.
 * @return user properties
 */
public UserProperties getProperties(){
	return this.properties;
}
 
开发者ID:atosorigin,项目名称:gendoc,代码行数:8,代码来源:TargetProperties.java

示例6: getProperties

import org.freehep.graphicsbase.util.UserProperties; //导入依赖的package包/类
/**
 * Returns the user properties of the converter.
 * @return user properties
 */
public UserProperties getProperties(){
	return this.properties;
}
 
开发者ID:vdmeer,项目名称:svg2vector,代码行数:8,代码来源:FhConverter.java


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