当前位置: 首页>>代码示例>>Java>>正文


Java Symbolizer类代码示例

本文整理汇总了Java中org.geotools.styling.Symbolizer的典型用法代码示例。如果您正苦于以下问题:Java Symbolizer类的具体用法?Java Symbolizer怎么用?Java Symbolizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Symbolizer类属于org.geotools.styling包,在下文中一共展示了Symbolizer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public void convert(Rule rule, JsonElement element, String layerName, int transparency) {
    if(element == null) return;
    if(rule == null) return;

    JsonObject obj = element.getAsJsonObject();
    @SuppressWarnings("unused")
    int style = getInt(obj, CommonSymbolKeys.STYLE);

    List<Symbolizer> symbolizerList = rule.symbolizers();

    List<Stroke> strokeList = convert(obj);

    Stroke stroke = null;

    if(!strokeList.isEmpty())
    {
        stroke = strokeList.get(0);
    }

    LineSymbolizer lineSymbolizer = styleFactory.createLineSymbolizer(stroke, null);

    symbolizerList.add(lineSymbolizer);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:SimpleLineSymbol.java

示例2: convertToFill

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public List<Symbolizer> convertToFill(String layerName, JsonElement element, int transparency) {
    if(element == null) return null;

    JsonObject obj = element.getAsJsonObject();

    List<Symbolizer> symbolizerList = new ArrayList<Symbolizer>();

    Fill fill = getFill(layerName, obj, transparency);

    PolygonSymbolizer polygon = styleFactory.createPolygonSymbolizer();
    polygon.setStroke(null);
    polygon.setFill(fill);
    symbolizerList.add(polygon);

    return symbolizerList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:18,代码来源:PictureFillSymbol.java

示例3: convert

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Convert.
 *
 * @param rule the rule
 * @param element the element
 * @param layerName the layer name
 * @param transparency the transparency
 */
@Override
public void convert(Rule rule, JsonElement element, String layerName, int transparency) {
    if(rule == null) return;
    if(element == null) return;

    JsonObject obj = element.getAsJsonObject();

    List<Symbolizer> symbolizerList = rule.symbolizers();

    List<Stroke> strokeList = convert(obj);

    Stroke stroke = null;

    if(!strokeList.isEmpty())
    {
        stroke = strokeList.get(0);
    }

    LineSymbolizer lineSymbolizer = styleFactory.createLineSymbolizer(stroke, null);

    symbolizerList.add(lineSymbolizer);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:31,代码来源:CartographicLineSymbol.java

示例4: convertToFill

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public List<Symbolizer> convertToFill(String layerName, JsonElement element, int transparency) {
    if(element == null) return null;

    JsonObject obj = element.getAsJsonObject();

    List<Symbolizer> symbolizerList = new ArrayList<Symbolizer>();
    Expression fillColour = getColour(obj.get(SimpleFillSymbolKeys.FILL_COLOUR));
    Expression transparencyExpression = getTransparency(transparency);
    Fill fill = null;

    if(fillColour != null)
    {
        fill = styleFactory.createFill(fillColour, transparencyExpression);
    }

    PolygonSymbolizer polygon = styleFactory.createPolygonSymbolizer();
    polygon.setStroke(null);
    polygon.setFill(fill);
    symbolizerList.add(polygon);

    return symbolizerList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:24,代码来源:SimpleFillSymbol.java

示例5: convert

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public void convert(Rule rule, JsonElement element, String layerName, int transparency) {
    if(element == null) return;
    if(rule == null) return;

    List<Symbolizer> symbolizerList = rule.symbolizers();

    List<Graphic> markerList = convert(element);

    if(markerList != null)
    {
        for(Graphic marker : markerList)
        {
            PointSymbolizer pointSymbolizer = styleFactory.createPointSymbolizer(marker, null);

            symbolizerList.add(pointSymbolizer);
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:SimpleMarkerSymbol.java

示例6: convertToFill

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public List<Symbolizer> convertToFill(String layerName, JsonElement element, int transparency) {
    if(element == null) return null;

    List<Symbolizer> symbolizerList = null;

    JsonArray layerList = element.getAsJsonArray();
    if(layerList.size() > 0)
    {
        symbolizerList = new ArrayList<Symbolizer>();

        for(int index = 0; index < layerList.size(); index ++)
        {
            JsonElement layerElement = layerList.get(index);

            symbolizerList.addAll(SymbolManager.getInstance().getFillSymbol(layerName, layerElement, transparency));
        }
    }
    return symbolizerList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:MultiLayerLineSymbol.java

示例7: getFillSymbol

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Gets the fill.
 *
 * @param layerName the layer name
 * @param element the element
 * @param transparency the transparency
 * @return the fill
 */
public List<Symbolizer> getFillSymbol(String layerName, JsonElement element, int transparency) {

    if (element == null) return null;

    JsonObject fillObj = element.getAsJsonObject();
    List<Symbolizer> symbolizerList = null;

    for(String fillSymbolType : fillSymbolMap.keySet())
    {
        JsonElement obj = fillObj.get(fillSymbolType);

        if(obj != null)
        {
            EsriFillSymbolInterface esriFillSymbol = fillSymbolMap.get(fillSymbolType);
            symbolizerList = esriFillSymbol.convertToFill(layerName, obj, transparency);
            break;
        }
    }

    return symbolizerList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:30,代码来源:SymbolManager.java

示例8: convertToFill

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
@Override
public List<Symbolizer> convertToFill(String layerName, JsonElement element, int transparency) {
    if (element == null)
        return null;

    List<Symbolizer> symbolizerList = null;

    JsonArray layerList = element.getAsJsonArray();
    if (layerList.size() > 0) {
        symbolizerList = new ArrayList<Symbolizer>();

        for (int index = 0; index < layerList.size(); index++) {
            JsonElement layerElement = layerList.get(index);

            symbolizerList.addAll(SymbolManager.getInstance().getFillSymbol(layerName,
                    layerElement, transparency));
        }
    }
    return symbolizerList;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:MultiLayerMarkerSymbol.java

示例9: getSampleFeatureForRule

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Returns a sample feature for the given rule, with the following criteria: - if a sample is
 * given in input is returned in output - if a sample is not given in input, scan the rule
 * symbolizers to find the one with the max dimensionality, and return a sample for that
 * dimensionality.
 * 
 * @param featureType featureType used to create a sample, if none is given as input
 * @param sample feature sample to be returned as is in output, if defined
 * @param rule rule containing symbolizers to scan for max dimensionality
 *
 */
private Feature getSampleFeatureForRule(FeatureType featureType, Feature sample,
        final Rule rule) {
    Symbolizer[] symbolizers = rule.getSymbolizers();
    // if we don't have a sample as input, we need to create a sampleFeature
    // looking at the requested symbolizers (we chose the one with the max
    // dimensionality and create a congruent sample)
    if (sample == null) {
        int dimensionality = 1;
        for (int sIdx = 0; sIdx < symbolizers.length; sIdx++) {
            final Symbolizer symbolizer = symbolizers[sIdx];
            if (LineSymbolizer.class.isAssignableFrom(symbolizer.getClass())) {
                dimensionality = 2;
            }
            if (PolygonSymbolizer.class.isAssignableFrom(symbolizer.getClass())) {
                dimensionality = 3;
            }
        }
        return createSampleFeature(featureType, dimensionality);
    } else {
        return sample;
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:34,代码来源:SLDEditorBufferedImageLegendGraphicBuilder.java

示例10: isCellEditable

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
public boolean isCellEditable(EventObject event) {
    boolean returnValue = false;
    if (event instanceof MouseEvent) {
        MouseEvent mouseEvent = (MouseEvent) event;
        TreePath path = tree.getPathForLocation(mouseEvent.getX(), mouseEvent.getY());
        if (path != null) {
            Object node = path.getLastPathComponent();
            if ((node != null) && (node instanceof DefaultMutableTreeNode)) {
                DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;

                if (treeNode.getParent() != null) {
                    Object parentUserObject = ((DefaultMutableTreeNode) treeNode.getParent())
                            .getUserObject();

                    if (parentUserObject instanceof PolygonSymbolizer) {
                        symbolizer = (Symbolizer) parentUserObject;
                        userObject = treeNode.getUserObject();
                        returnValue = treeNode.isLeaf();
                    }
                }
            }
        }
    }
    return returnValue;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:26,代码来源:CheckBoxNodeEditor.java

示例11: getTreeString

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Gets the tree string.
 * 
 * <p>Code just returns image outline prefix regardless of symbolizer type,
 *  doesn't just restrict to line and polygon
 *
 * @param node the node
 * @param nodeObject the node object
 * @return the tree string
 */
/*
 * (non-Javadoc)
 * 
 * @see com.sldeditor.ui.tree.item.SLDTreeItemInterface#getTreeString(javax.swing.tree.DefaultMutableTreeNode, java.lang.Object)
 */
@Override
public String getTreeString(DefaultMutableTreeNode node, Object nodeObject) {
    Symbolizer symbol = (Symbolizer) nodeObject;

    String name = null;

    if (symbol != null) {
        name = symbol.getName();

        if ((name == null) || name.isEmpty()) {
            name = defaultString(symbol);
        }

        if (imageOutline(node)) {
            name = String.format("%s - %s", OUTLINE_NAME, name);
        }
    }

    return name;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:36,代码来源:SymbolizerTreeItem.java

示例12: defaultString

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Default string.
 *
 * @param symbol the symbol
 * @return the string
 */
private String defaultString(Symbolizer symbol) {
    String name = "";

    if (symbol instanceof PointSymbolizer) {
        name = DEFAULT_MARKER_NAME;
    } else if (symbol instanceof TextSymbolizer) {
        name = DEFAULT_TEXT_NAME;
    } else if (symbol instanceof LineSymbolizer) {
        name = DEFAULT_LINE_NAME;
    } else if (symbol instanceof PolygonSymbolizer) {
        name = DEFAULT_POLYGON_NAME;
    } else if (symbol instanceof RasterSymbolizer) {
        name = DEFAULT_RASTER_NAME;
    }
    return name;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SymbolizerTreeItem.java

示例13: getRuleTreeNode

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Gets the rule tree node.
 *
 * @return the rule tree node
 */
private DefaultMutableTreeNode getRuleTreeNode() {
    if (symbolTree != null) {
        TreePath path = symbolTree.getSelectionPath();

        DefaultMutableTreeNode lastNode = (DefaultMutableTreeNode) path.getLastPathComponent();
        Object obj = lastNode.getUserObject();

        if (obj instanceof Symbolizer) {
            return (DefaultMutableTreeNode) lastNode.getParent();
        } else if (obj instanceof Rule) {
            return (DefaultMutableTreeNode) lastNode;
        }
    }
    return rootNode;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:21,代码来源:SLDTreeTools.java

示例14: updateSymbol

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Update symbol.
 */
private void updateSymbol() {
    if (!Controller.getInstance().isPopulating()) {
        StandardData standardData = getStandardData();

        boolean isDefault = fieldConfigVisitor.getBoolean(FieldIdEnum.DEFAULT_STYLE);

        Style existingStyle = SelectedSymbol.getInstance().getStyle();
        if (existingStyle != null) {
            List<org.opengis.style.FeatureTypeStyle> newFTSList =
                    new ArrayList<org.opengis.style.FeatureTypeStyle>();
            for (org.opengis.style.FeatureTypeStyle fts : existingStyle.featureTypeStyles()) {
                newFTSList.add(fts);
            }

            Symbolizer defaultSymbolizer = null;
            Style newStyle = (Style) getStyleFactory().style(standardData.name,
                    standardData.description, isDefault, newFTSList, defaultSymbolizer);

            SelectedSymbol.getInstance().replaceStyle(newStyle);

            this.fireUpdateSymbol();
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:28,代码来源:StyleDetails.java

示例15: removeSymbolizer

import org.geotools.styling.Symbolizer; //导入依赖的package包/类
/**
 * Removes the symbolizer.
 *
 * @param symbolizerToDelete the symbolizer to delete
 */
public void removeSymbolizer(Symbolizer symbolizerToDelete) {
    List<Symbolizer> symbolizerList = (List<Symbolizer>) this.symbolData.getRule()
            .symbolizers();

    int indexFound = -1;
    int index = 0;
    for (Symbolizer symbolizer : symbolizerList) {
        if (symbolizer == symbolizerToDelete) {
            indexFound = index;
            break;
        } else {
            index++;
        }
    }

    if (indexFound > -1) {
        symbolizerList.remove(indexFound);
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:25,代码来源:SelectedSymbol.java


注:本文中的org.geotools.styling.Symbolizer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。