本文整理汇总了Java中org.geotools.styling.FeatureTypeStyleImpl类的典型用法代码示例。如果您正苦于以下问题:Java FeatureTypeStyleImpl类的具体用法?Java FeatureTypeStyleImpl怎么用?Java FeatureTypeStyleImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FeatureTypeStyleImpl类属于org.geotools.styling包,在下文中一共展示了FeatureTypeStyleImpl类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.geotools.styling.FeatureTypeStyleImpl; //导入依赖的package包/类
/**
* Overridden to add transform.
*/
@Override
public void visit(FeatureTypeStyle fts) {
FeatureTypeStyle copy = new FeatureTypeStyleImpl(
(FeatureTypeStyleImpl) fts);
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.setRules(rulesCopy);
if (fts.getTransformation() != null) {
copy.setTransformation(copy(fts.getTransformation()));
}
if (STRICT && !copy.equals(fts)) {
throw new IllegalStateException(
"Was unable to duplicate provided FeatureTypeStyle:" + fts);
}
pages.push(copy);
}
示例2: saveData
import org.geotools.styling.FeatureTypeStyleImpl; //导入依赖的package包/类
/**
* Save data.
*/
private void saveData() {
if (dataModel.applyData(application)) {
if (application != null) {
application.refreshPanel(FeatureTypeStyleImpl.class, RuleImpl.class);
}
}
}
示例3: createTreeItemMap
import org.geotools.styling.FeatureTypeStyleImpl; //导入依赖的package包/类
/**
* Creates the tree item map.
*/
private void createTreeItemMap() {
if (treeItemMap.isEmpty()) {
/** The sld tree item. */
StyledLayerDescriptorTreeItem sldTreeItem = new StyledLayerDescriptorTreeItem();
/** The style tree item. */
StyleTreeItem styleTreeItem = new StyleTreeItem();
/** The fts tree item. */
FeatureTypeStyleTreeItem ftsTreeItem = new FeatureTypeStyleTreeItem();
/** The name layer tree item. */
NameLayerTreeItem nameLayerTreeItem = new NameLayerTreeItem();
/** The user layer tree item. */
UserLayerTreeItem userLayerTreeItem = new UserLayerTreeItem();
/** The fill tree item. */
FillTreeItem fillTreeItem = new FillTreeItem();
/** The stroke tree item. */
StrokeTreeItem strokeTreeItem = new StrokeTreeItem();
treeItemMap.put(StyledLayerDescriptorImpl.class, sldTreeItem);
treeItemMap.put(StyleImpl.class, styleTreeItem);
treeItemMap.put(FeatureTypeStyleImpl.class, ftsTreeItem);
treeItemMap.put(RuleImpl.class, ruleTreeItem);
treeItemMap.put(PointSymbolizerImpl.class, symbolizerTreeItem);
treeItemMap.put(LineSymbolizerImpl.class, symbolizerTreeItem);
treeItemMap.put(PolygonSymbolizerImpl.class, symbolizerTreeItem);
treeItemMap.put(TextSymbolizerImpl.class, symbolizerTreeItem);
treeItemMap.put(NamedLayerImpl.class, nameLayerTreeItem);
treeItemMap.put(UserLayerImpl.class, userLayerTreeItem);
treeItemMap.put(StrokeImpl.class, strokeTreeItem);
treeItemMap.put(FillImpl.class, fillTreeItem);
treeItemMap.put(RasterSymbolizerImpl.class, symbolizerTreeItem);
}
}
示例4: visit
import org.geotools.styling.FeatureTypeStyleImpl; //导入依赖的package包/类
/**
* Visit.
*
* @param fts the fts
*/
/*
* (non-Javadoc)
*
* @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.
* FeatureTypeStyle)
*/
@SuppressWarnings("deprecation")
@Override
public void visit(FeatureTypeStyle fts) {
FeatureTypeStyle copy = new FeatureTypeStyleImpl((FeatureTypeStyleImpl) fts);
if (!options.isTransformationApplied()) {
copy.setTransformation(null);
}
Rule[] rules = fts.getRules();
int length = rules.length;
Rule[] rulesCopy = null;
if (this.ruleToRender == null) {
rulesCopy = new Rule[length];
for (int i = 0; i < length; i++) {
if (rules[i] != null) {
rules[i].accept(this);
rulesCopy[i] = (Rule) pages.pop();
}
}
} else {
rulesCopy = new Rule[1];
for (int i = 0; i < length; i++) {
if (rules[i] != null) {
if (renderRule(rules[i])) {
rules[i].accept(this);
rulesCopy[0] = (Rule) pages.pop();
}
}
}
}
copy.setRules(rulesCopy);
if (STRICT && !copy.equals(fts)) {
throw new IllegalStateException(
"Was unable to duplicate provided FeatureTypeStyle:" + fts);
}
pages.push(copy);
}
示例5: testRemoveItem
import org.geotools.styling.FeatureTypeStyleImpl; //导入依赖的package包/类
/**
* Test method for {@link com.sldeditor.ui.tree.SLDTreeTools#removeItem()}.
*/
@Test
public void testRemoveItem() {
SLDTreeTools treeTools = new SLDTreeTools();
TestRenderSymbolInterface renderSymbol = new TestRenderSymbolInterface();
List<RenderSymbolInterface> renderList = new ArrayList<RenderSymbolInterface>();
renderList.add(renderSymbol);
TestSLDTree sldTree = new TestSLDTree(renderList, treeTools);
StyleFactoryImpl styleFactory = (StyleFactoryImpl) CommonFactoryFinder.getStyleFactory();
// Start off with just a top level SLD and no structure below it
StyledLayerDescriptor sld = styleFactory.createStyledLayerDescriptor();
SelectedSymbol.getInstance().setSld(sld);
sldTree.populateSLD();
sldTree.selectFirstSymbol();
treeTools.addNewThing(NamedLayer.class); // Named layer
treeTools.addNewThing(null); // Style
treeTools.addNewThing(null); // Feature type style
treeTools.addNewThing(null); // Rule
DefaultMutableTreeNode rootNode = sldTree.getRootNode();
// Make sure we have a rule selected
DefaultMutableTreeNode rule = (DefaultMutableTreeNode) rootNode.getChildAt(0).getChildAt(0)
.getChildAt(0).getChildAt(0);
assertEquals(RuleImpl.class, rule.getUserObject().getClass());
assertEquals(0, rule.getChildCount());
treeTools.addNewText();
rule = (DefaultMutableTreeNode) rootNode.getChildAt(0).getChildAt(0).getChildAt(0)
.getChildAt(0);
assertEquals(RuleImpl.class, rule.getUserObject().getClass());
assertEquals(1, rule.getChildCount());
// The selected item (text symbolizer) is removed
treeTools.removeItem();
assertTrue(renderSymbol.hasRenderSymbolBeenCalled());
rule = (DefaultMutableTreeNode) rootNode.getChildAt(0).getChildAt(0).getChildAt(0)
.getChildAt(0);
assertEquals(RuleImpl.class, rule.getUserObject().getClass());
assertEquals(0, rule.getChildCount());
// The selected item (rule) is removed
treeTools.removeItem();
assertTrue(renderSymbol.hasRenderSymbolBeenCalled());
DefaultMutableTreeNode featureTypeStyle = (DefaultMutableTreeNode) rootNode.getChildAt(0)
.getChildAt(0).getChildAt(0);
assertEquals(FeatureTypeStyleImpl.class, featureTypeStyle.getUserObject().getClass());
assertEquals(0, featureTypeStyle.getChildCount());
// The selected item (style) is removed
treeTools.removeItem();
assertTrue(renderSymbol.hasRenderSymbolBeenCalled());
DefaultMutableTreeNode style = (DefaultMutableTreeNode) rootNode.getChildAt(0)
.getChildAt(0);
assertEquals(StyleImpl.class, style.getUserObject().getClass());
assertEquals(0, style.getChildCount());
// The selected item (named layer) is removed
treeTools.removeItem();
assertTrue(renderSymbol.hasRenderSymbolBeenCalled());
DefaultMutableTreeNode namedLayer = (DefaultMutableTreeNode) rootNode.getChildAt(0);
assertEquals(NamedLayerImpl.class, namedLayer.getUserObject().getClass());
assertEquals(0, namedLayer.getChildCount());
// The selected item (styled layer descriptor) is removed
treeTools.removeItem();
assertTrue(renderSymbol.hasRenderSymbolBeenCalled());
assertEquals(0, rootNode.getChildCount());
treeTools.removeItem();
assertEquals(0, rootNode.getChildCount());
assertFalse(renderSymbol.hasRenderSymbolBeenCalled());
}