本文整理汇总了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;
}
示例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;
}