本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例5: getProperties
import org.freehep.graphicsbase.util.UserProperties; //导入依赖的package包/类
/**
* Returns user properties.
* @return user properties
*/
public UserProperties getProperties(){
return this.properties;
}
示例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;
}