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


Java PointSymbolizer类代码示例

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


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

示例1: convert

import org.geotools.styling.PointSymbolizer; //导入依赖的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

示例2: visit

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * (non-Javadoc)
 * 
 * @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PointSymbolizer)
 */
public void visit(PointSymbolizer ps) {
    PointSymbolizer copy = sf.getDefaultPointSymbolizer();

    copy.setGeometry(copy(Point.class, ps.getGeometry()));

    copy.setUnitOfMeasure(ps.getUnitOfMeasure());
    copy.setGraphic(copy(ps.getGraphic()));
    copy.getOptions().putAll(ps.getOptions());

    if (STRICT) {
        if (!copy.equals(ps)) {
            throw new IllegalStateException("Was unable to duplicate provided Graphic:" + ps);
        }
    }
    pages.push(copy);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:ExtractAttributes.java

示例3: visit

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * (non-Javadoc)
 * 
 * @see org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PointSymbolizer)
 */
public void visit(PointSymbolizer ps) {
    PointSymbolizer copy = sf.getDefaultPointSymbolizer();

    copy.setGeometry(copy(ps.getGeometry()));

    copy.setUnitOfMeasure(ps.getUnitOfMeasure());
    copy.setGraphic(copy(ps.getGraphic()));
    copy.getOptions().putAll(ps.getOptions());

    if (STRICT) {
        if (!copy.equals(ps)) {
            throw new IllegalStateException("Was unable to duplicate provided Graphic:" + ps);
        }
    }
    pages.push(copy);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:RuleRenderVisitor.java

示例4: defaultString

import org.geotools.styling.PointSymbolizer; //导入依赖的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

示例5: updateSymbol

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

        if (symbolizer instanceof PointSymbolizer) {
            PointSymbolizerImpl newPointSymbolizer = (PointSymbolizerImpl) symbolizer;

            Graphic graphic = getGraphic();

            newPointSymbolizer.setGraphic(graphic);
        }

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

示例6: updateSymbol

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

        Expression geometryField = ExtractGeometryField.getGeometryField(fieldConfigVisitor);

        PointSymbolizer pointSymbolizer = (PointSymbolizer) SelectedSymbol.getInstance()
                .getSymbolizer();

        if (pointSymbolizer != null) {
            pointSymbolizer.setName(standardData.name);
            pointSymbolizer.setDescription(standardData.description);
            pointSymbolizer.setUnitOfMeasure(standardData.unit);
            pointSymbolizer.setGeometry(geometryField);

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

示例7: createDefaultPointSymbolizer

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Creates the default point symbolizer.
 *
 * @return the point symbolizer
 */
public static PointSymbolizer createDefaultPointSymbolizer() {
    String geometryFieldName = null;
    Expression geometryField = ff.property(geometryFieldName);

    List<GraphicalSymbol> symbolList = new ArrayList<GraphicalSymbol>();

    Stroke stroke = null;
    AnchorPoint anchorPoint = null;
    Displacement displacement = null;
    Fill fill = styleFactory.createFill(ff.literal(DEFAULT_MARKER_COLOUR));
    GraphicalSymbol symbol = styleFactory.mark(ff.literal(DEFAULT_MARKER_SYMBOL), fill, stroke);

    symbolList.add(symbol);
    Graphic graphic = styleFactory.graphic(symbolList, ff.literal(DEFAULT_COLOUR_OPACITY),
            ff.literal(DEFAULT_MARKER_SYMBOL_SIZE), ff.literal(0.0), anchorPoint, displacement);
    PointSymbolizer newPointSymbolizer = (PointSymbolizer) styleFactory.pointSymbolizer(
            Localisation.getString(SLDTreeTools.class, "TreeItem.newMarker"), geometryField,
            null, null, graphic);

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

示例8: getFill

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
@Override
public Fill getFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;
        if (point != null) {
            Graphic graphic = point.getGraphic();

            if (graphic != null) {
                List<GraphicalSymbol> symbolList = graphic.graphicalSymbols();

                if ((symbolList != null) && !symbolList.isEmpty()) {
                    GraphicalSymbol obj = symbolList.get(0);

                    if (obj != null) {
                        if (obj instanceof MarkImpl) {
                            MarkImpl mark = (MarkImpl) obj;

                            return mark.getFill();
                        }
                    }
                }
            }
        }
    }
    return null;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:27,代码来源:SLDTreeLeafPoint.java

示例9: createFill

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
@Override
public void createFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;

        if (point != null) {
            Graphic graphic = point.getGraphic();
            if (graphic == null) {
                graphic = styleFactory.createDefaultGraphic();
                point.setGraphic(graphic);
            }

            if (graphic != null) {
                if (graphic.graphicalSymbols().isEmpty()) {
                    Mark mark = styleFactory.getDefaultMark();

                    graphic.graphicalSymbols().add(mark);
                }
            }
        }
    }
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:23,代码来源:SLDTreeLeafPoint.java

示例10: testHasFill

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasFill() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(null));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(polygonSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().hasFill(pointSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(lineSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasFill(textSymbolizer));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:SLDTreeLeafFactoryTest.java

示例11: testHasStroke

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#hasStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testHasStroke() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(null));
    assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(polygonSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(pointSymbolizer));
    assertTrue(SLDTreeLeafFactory.getInstance().hasStroke(lineSymbolizer));
    assertFalse(SLDTreeLeafFactory.getInstance().hasStroke(textSymbolizer));
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:20,代码来源:SLDTreeLeafFactoryTest.java

示例12: testGetFill

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getFill(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetFill() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    //CHECKSTYLE:OFF
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertNull(SLDTreeLeafFactory.getInstance().getFill(null));
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(polygonSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(pointSymbolizer) != null);

    // Returns default fill
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(lineSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getFill(textSymbolizer) != null);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:SLDTreeLeafFactoryTest.java

示例13: testGetStroke

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Test method for
 * {@link com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#getStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetStroke() {
    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    //CHECKSTYLE:OFF
    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    //CHECKSTYLE:ON

    assertNull(SLDTreeLeafFactory.getInstance().getStroke(null));
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(polygonSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(lineSymbolizer) != null);

    // Returns default stroke
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(pointSymbolizer) != null);
    assertTrue(SLDTreeLeafFactory.getInstance().getStroke(textSymbolizer) != null);
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:22,代码来源:SLDTreeLeafFactoryTest.java

示例14: getGraphic

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
/**
 * Gets the graphic.
 *
 * @param symbolizer the symbolizer
 * @return the graphic
 */
private Graphic getGraphic(Symbolizer symbolizer) {
    Graphic graphic = null;

    if (symbolizer instanceof PointSymbolizerImpl) {
        PointSymbolizer pointSymbolizer = (PointSymbolizer) symbolizer;
        graphic = pointSymbolizer.getGraphic();
    } else if (symbolizer instanceof PolygonSymbolizerImpl) {
        PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) symbolizer;
        if (polygonSymbolizer != null) {
            Fill fill = polygonSymbolizer.getFill();

            if (fill != null) {
                graphic = fill.getGraphicFill();
            }
        }
    }

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

示例15: initEndPointSymbolizers

import org.geotools.styling.PointSymbolizer; //导入依赖的package包/类
private void initEndPointSymbolizers() {
    for (Symbolizer x : super.getParent().getRule().getSymbolizers()) {
        if (x instanceof PointSymbolizer) {
            PointSymbolizer pnt = (PointSymbolizer) x;
            Expression ex = pnt.getGeometry();
            boolean endpnt = ex instanceof FilterFunction_endPoint;
            boolean startpnt = ex instanceof FilterFunction_startPoint;
            if (endpnt || startpnt) {
                GraphicalSymbol gs = pnt.getGraphic().graphicalSymbols().get(0);
                if (gs instanceof Mark) {
                    String name = ((Mark) gs).getWellKnownName().evaluate(null, String.class);
                    if (Utilities.lineEndStyles.values().contains(name)) {
                        if (endpnt) {
                            endPointStyle = new PointSymbolizerWrapper(pnt, super.getParent());
                        } else if (startpnt) {
                            startPointStyle = new PointSymbolizerWrapper(pnt, super.getParent());
                        }
                    }
                }
            }
        }
    }
}
 
开发者ID:TheHortonMachine,项目名称:hortonmachine,代码行数:24,代码来源:LineSymbolizerWrapper.java


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