/** * create a SimpleFeature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to * match all) * @param rules - the rules that make up the FeatureTypeStyle * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule[] rules) { FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(rules); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a SimpleFeature type styler * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to * match all) * @param r - the rule that driver this feature typ style * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule r) { // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] {r}); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a SimpleFeature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to * match all) * @param symbolizers - an array of symbolizers to use * @param minScaleDenominator - the minimim scale to draw the feature at * @param maxScaleDenominator - the maximum scale to draw the feature at * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle( String typeName, Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator) { Rule r = createRule(symbolizers, minScaleDenominator, maxScaleDenominator); // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] {r}); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
ft.setSemanticTypeIdentifiers(sti.toArray(new String[0])); ft.setRules(rules.toArray(new Rule[0]));
copy.setRules(rulesCopy);
featureTypeStyle.setRules((Rule[]) rules.toArray(new Rule[rules.size()]));
rule2.setSymbolizers(new Symbolizer[] {linesym(sFac)}); FeatureTypeStyle fts2 = sFac.createFeatureTypeStyle(); fts2.setRules(new Rule[] {rule2}); fts2.setFeatureTypeName("linefeature"); rule3.setSymbolizers(new Symbolizer[] {pointsym}); FeatureTypeStyle fts3 = sFac.createFeatureTypeStyle(); fts3.setRules(new Rule[] {rule3}); fts3.setFeatureTypeName("pointfeature"); rule4.setSymbolizers(new Symbolizer[] {polysym(sFac), linesym(sFac)}); FeatureTypeStyle fts4 = sFac.createFeatureTypeStyle(); fts4.setRules(new Rule[] {rule4}); fts4.setFeatureTypeName("collFeature"); rule5.setSymbolizers(new Symbolizer[] {linesym(sFac)}); FeatureTypeStyle fts5 = sFac.createFeatureTypeStyle(); fts5.setRules(new Rule[] {rule5}); fts5.setFeatureTypeName("ringFeature");
/** * Creates a deep copy clone of the FeatureTypeStyle. * * @see org.geotools.styling.FeatureTypeStyle#clone() */ public Object clone() { FeatureTypeStyle clone; try { clone = (FeatureTypeStyle) super.clone(); } catch (CloneNotSupportedException e) { throw new AssertionError(e); // this should never happen. } Rule[] ruleArray = new Rule[ruleList.size()]; for (int i = 0; i < ruleArray.length; i++) { Rule rule = (Rule) ruleList.get(i); ruleArray[i] = (Rule) ((Cloneable) rule).clone(); } clone.setRules(ruleArray); return clone; }
/** * create a SimpleFeature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param rules - the rules that make up the FeatureTypeStyle * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule[] rules) { FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(rules); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a Feature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param rules - the rules that make up the FeatureTypeStyle * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule[] rules) { FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(rules); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a SimpleFeature type styler * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param r - the rule that driver this feature typ style * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule r) { // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] { r }); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a Feature type styler * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param r - the rule that driver this feature typ style * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle(String typeName, Rule r) { // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] { r }); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
rulep.setSymbolizers(new Symbolizer[] {pointsym}); FeatureTypeStyle ftsP = sFac.createFeatureTypeStyle(); ftsP.setRules(new Rule[] {rulep}); ftsP.setFeatureTypeName("querytest"); rule2.setSymbolizers(new Symbolizer[] {linesym}); FeatureTypeStyle ftsL = sFac.createFeatureTypeStyle(); ftsL.setRules(new Rule[] {rule2}); ftsL.setFeatureTypeName("querytest");
copy.setRules(rulesCopy);
/** * create a SimpleFeature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param symbolizers - an array of symbolizers to use * @param minScaleDenominator - the minimim scale to draw the feature at * @param maxScaleDenominator - the maximum scale to draw the feature at * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle( String typeName, Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator) { Rule r = createRule(symbolizers, minScaleDenominator, maxScaleDenominator); // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] { r }); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
/** * create a Feature type styler see the SLD Spec for more details of scaleDenominators * * @param typeName - The feature typeName you want to draw (use "Feature" as a wild card to match all) * @param symbolizers - an array of symbolizers to use * @param minScaleDenominator - the minimim scale to draw the feature at * @param maxScaleDenominator - the maximum scale to draw the feature at * * @return the new feature type styler */ public FeatureTypeStyle createFeatureTypeStyle( String typeName, Symbolizer[] symbolizers, double minScaleDenominator, double maxScaleDenominator) { Rule r = createRule(symbolizers, minScaleDenominator, maxScaleDenominator); // setup the feature type style FeatureTypeStyle fts = sf.createFeatureTypeStyle(); fts.setRules(new Rule[] { r }); if (typeName != null) { fts.setFeatureTypeName(typeName); } return fts; }
public void visit(FeatureTypeStyle fts) { FeatureTypeStyle copy = null; Rule[] rules = fts.getRules(); int length=rules.length; Rule[] rulesCopy = new Rule[length]; for (int i = 0; i < length; i++) { if (rules[i] != null) { rules[i].accept(this); rulesCopy[i] = (Rule) pages.pop(); } } copy = sf.createFeatureTypeStyle(); copy.setName(fts.getName()); copy.setTitle(fts.getTitle()); copy.setAbstract(fts.getAbstract()); copy.setFeatureTypeName(fts.getFeatureTypeName()); copy.setRules(rulesCopy); copy.setSemanticTypeIdentifiers((String[]) fts.getSemanticTypeIdentifiers().clone()); pages.push(copy); }
public void visit(FeatureTypeStyle fts) { FeatureTypeStyle copy = null; Rule[] rules = fts.getRules(); int length=rules.length; Rule[] rulesCopy = new Rule[length]; for (int i = 0; i < length; i++) { if (rules[i] != null) { rules[i].accept(this); rulesCopy[i] = (Rule) getPages().pop(); } } copy = sf.createFeatureTypeStyle(); copy.setName(fts.getName()); copy.setTitle(fts.getTitle()); copy.setAbstract(fts.getAbstract()); copy.setFeatureTypeName(fts.getFeatureTypeName()); copy.setRules(rulesCopy); copy.setSemanticTypeIdentifiers((String[]) fts.getSemanticTypeIdentifiers().clone()); getPages().push(copy); }
@SuppressWarnings({"deprecation"}) private static Style createStyle() { StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null); FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null); PolygonSymbolizer symbolizer = styleFactory.createPolygonSymbolizer(); Fill fill = styleFactory.createFill( filterFactory.literal("#FFAA00"), filterFactory.literal(0.5) ); symbolizer.setFill(fill); Rule rule = styleFactory.createRule(); rule.setSymbolizers(new Symbolizer[]{symbolizer}); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); fts.setRules(new Rule[]{rule}); Style style = styleFactory.createStyle(); style.addFeatureTypeStyle(fts); return style; }
@SuppressWarnings({"deprecation"}) private static Style createStyle() { StyleFactory styleFactory = CommonFactoryFinder.getStyleFactory(null); FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null); PolygonSymbolizer symbolizer = styleFactory.createPolygonSymbolizer(); Fill fill = styleFactory.createFill( filterFactory.literal("#FFAA00"), filterFactory.literal(0.5) ); symbolizer.setFill(fill); Rule rule = styleFactory.createRule(); rule.setSymbolizers(new Symbolizer[]{symbolizer}); FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle(); fts.setRules(new Rule[]{rule}); Style style = styleFactory.createStyle(); style.addFeatureTypeStyle(fts); return style; }