public StyleBuilder reset(Style style) { if (style == null) { return unset(); } fts.clear(); for (FeatureTypeStyle ft : style.featureTypeStyles()) { fts.add(new FeatureTypeStyleBuilder(this).reset(ft)); } name = style.getName(); styleAbstract = style.getAbstract(); title = style.getTitle(); isDefault = style.isDefault(); unset = false; return this; }
public void visit(Style style) { Style copy = null; FeatureTypeStyle[] fts = style.getFeatureTypeStyles(); final int length = fts.length; FeatureTypeStyle[] ftsCopy = new FeatureTypeStyle[length]; for (int i = 0; i < length; i++) { if (fts[i] != null) { fts[i].accept(this); ftsCopy[i] = (FeatureTypeStyle) pages.pop(); } } copy = sf.createStyle(); copy.setAbstract(style.getAbstract()); copy.setName(style.getName()); copy.setTitle(style.getTitle()); copy.setFeatureTypeStyles(ftsCopy); if (STRICT && !copy.equals(style)) { throw new IllegalStateException("Was unable to duplicate provided Style:" + style); } pages.push(copy); }
@Override protected void encode(StyledLayerDescriptor sld) { Style style = SLD.defaultStyle(sld); if (style != null) { put("name", style.getName()); put("title", style.getTitle()); put("abstract", style.getAbstract()); put("feature-styles", new FeatureStyleEncoder(style)); } } }
@Test public void testPointSimple() throws Exception { // <UserStyle> // <Title>SLD Cook Book: Simple Point With Stroke</Title> // <FeatureTypeStyle> // <Rule> // <PointSymbolizer> // <Graphic> // <Mark> // <WellKnownName>circle</WellKnownName> // <Fill> // <CssParameter name="fill">#FF0000</CssParameter> // </Fill> // </Mark> // <Size>6</Size> // </Graphic> // </PointSymbolizer> // </Rule> // </FeatureTypeStyle> // </UserStyle> Style style = parse("point", "simple.sld"); assertEquals("SLD Cook Book: Simple Point With Stroke", style.getTitle()); PointSymbolizer point = SLD.pointSymbolizer(style); assertEquals("circle", SLD.wellKnownName(SLD.mark(point))); assertEquals(1, point.getGraphic().graphicalSymbols().size()); assertEquals(Color.red, SLD.color(SLD.fill(point))); assertEquals(6, SLD.pointSize(point)); }
public void visit(Style style) { Style copy = null; FeatureTypeStyle[] fts = style.getFeatureTypeStyles(); final int length=fts.length; FeatureTypeStyle[] ftsCopy = new FeatureTypeStyle[length]; for (int i = 0; i < length; i++) { if (fts[i] != null) { fts[i].accept(this); ftsCopy[i] = (FeatureTypeStyle) pages.pop(); } } copy = sf.createStyle(); copy.setAbstract(style.getAbstract()); copy.setName(style.getName()); copy.setTitle(style.getTitle()); copy.setFeatureTypeStyles(ftsCopy); if( STRICT && !copy.equals( style )){ throw new IllegalStateException("Was unable to duplicate provided Style:"+style ); } pages.push(copy); }
/** * Encodes the url of a GetMap request. * <p> * If the <tt>layer</tt> argument is <code>null</code>, the request is * made including all layers in the <tt>mapContexT</tt>. * </p> * <p> * If the <tt>bbox</tt> argument is <code>null</code>. {@link WMSMapContext#getAreaOfInterest()} * is used for the bbox parameter. * </p> * * @param req The getMap request * @param layer The Map layer, may be <code>null</code>. * @param layerIndex The index of the layer in the request * @param bbox The bounding box of the request, may be <code>null</code>. * @param kvp Additional or overidding kvp parameters, may be <code>null</code> * * @return The full url for a getMap request. */ public static String getGetMapUrl(GetMapRequest req, MapLayer layer, int layerIndex, Envelope bbox, String[] kvp) { //base url String baseUrl = getBaseUrl( req ); String layerName = layer != null ? layer.getTitle() : null; String style = layer != null ? layer.getStyle().getTitle() : null; return getGetMapUrl( baseUrl, req, layerName, layerIndex, style, bbox, kvp ); }
copy.setAbstract(style.getAbstract()); copy.setName(style.getName()); copy.setTitle(style.getTitle()); copy.setFeatureTypeStyles(ftsCopy);
public void visit(Style style) { Style copy = null; FeatureTypeStyle[] fts = style.getFeatureTypeStyles(); final int length=fts.length; FeatureTypeStyle[] ftsCopy = new FeatureTypeStyle[length]; for (int i = 0; i < length; i++) { if (fts[i] != null) { fts[i].accept(this); ftsCopy[i] = (FeatureTypeStyle) pages.pop(); } } copy = sf.createStyle(); copy.setAbstract(style.getAbstract()); copy.setName(style.getName()); copy.setTitle(style.getTitle()); copy.setFeatureTypeStyles(ftsCopy); pages.push(copy); }
public void visit(Style style) { Style copy = null; FeatureTypeStyle[] fts = style.getFeatureTypeStyles(); final int length=fts.length; FeatureTypeStyle[] ftsCopy = new FeatureTypeStyle[length]; for (int i = 0; i < length; i++) { if (fts[i] != null) { fts[i].accept(this); ftsCopy[i] = (FeatureTypeStyle) getPages().pop(); } } copy = sf.createStyle(); copy.setAbstract(style.getAbstract()); copy.setName(style.getName()); copy.setTitle(style.getTitle()); copy.setFeatureTypeStyles(ftsCopy); getPages().push(copy); }
@Override protected void encode(StyledLayerDescriptor sld) { Style style = SLD.defaultStyle(sld); if (style != null) { put("name", style.getName()); put("title", style.getTitle()); put("abstract", style.getAbstract()); put("feature-styles", new FeatureStyleEncoder(style)); } } }
public void visit(Style style) { if (style instanceof NamedStyle) { start("NamedStyle"); element("Name", style.getName()); end("NamedStyle"); } else { start("UserStyle"); element("Name", style.getName()); element("Title", style.getTitle()); element("Abstract", style.getAbstract()); FeatureTypeStyle[] fts = style.getFeatureTypeStyles(); for (int i = 0; i < fts.length; i++) { visit(fts[i]); } end("UserStyle"); } }