本文整理匯總了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
}