本文整理汇总了Java中org.geotools.metadata.iso.citation.OnLineResourceImpl类的典型用法代码示例。如果您正苦于以下问题:Java OnLineResourceImpl类的具体用法?Java OnLineResourceImpl怎么用?Java OnLineResourceImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OnLineResourceImpl类属于org.geotools.metadata.iso.citation包,在下文中一共展示了OnLineResourceImpl类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: styleFactoryExample
import org.geotools.metadata.iso.citation.OnLineResourceImpl; //导入依赖的package包/类
/**
* This example is limited to just the gt-opengis style interfaces which are immutable once created.
*
* @throws Exception
*/
private void styleFactoryExample() throws Exception {
// styleFactoryExample start
//
org.opengis.style.StyleFactory sf = CommonFactoryFinder.getStyleFactory();
FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
//
// create the graphical mark used to represent a city
Stroke stroke = sf.stroke(ff.literal("#000000"), null, null, null, null, null, null);
Fill fill = sf.fill(null, ff.literal(Color.BLUE), ff.literal(1.0));
// OnLineResource implemented by gt-metadata - so no factory!
OnLineResourceImpl svg = new OnLineResourceImpl(new URI("file:city.svg"));
svg.freeze(); // freeze to prevent modification at runtime
OnLineResourceImpl png = new OnLineResourceImpl(new URI("file:city.png"));
png.freeze(); // freeze to prevent modification at runtime
//
// List of symbols is considered in order with the rendering engine choosing
// the first one it can handle. Allowing for svg, png, mark order
List<GraphicalSymbol> symbols = new ArrayList<GraphicalSymbol>();
symbols.add(sf.externalGraphic(svg, "svg", null)); // svg preferred
symbols.add(sf.externalGraphic(png, "png", null)); // png preferred
symbols.add(sf.mark(ff.literal("circle"), fill, stroke)); // simple circle backup plan
Expression opacity = null; // use default
Expression size = ff.literal(10);
Expression rotation = null; // use default
AnchorPoint anchor = null; // use default
Displacement displacement = null; // use default
// define a point symbolizer of a small circle
Graphic circle = sf.graphic(symbols, opacity, size, rotation, anchor, displacement);
PointSymbolizer pointSymbolizer = sf.pointSymbolizer("point", ff.property("the_geom"), null,
null, circle);
// styleFactoryExample end
}