Java Code Examples for org.geotools.styling.PolygonSymbolizer#getFill()

The following examples show how to use org.geotools.styling.PolygonSymbolizer#getFill() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectedSymbolTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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;
}
 
Example 2
Source File: SLDTreeLeafPolygon.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean hasFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) symbolizer;
        return (polygon.getFill() != null);
    }
    return false;
}
 
Example 3
Source File: SLDTreeLeafPolygon.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public Fill getFill(Symbolizer symbolizer) {
    Fill fill = null;

    if (symbolizer instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) symbolizer;

        fill = polygon.getFill();
    }
    return fill;
}
 
Example 4
Source File: FeatureLayer.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void visit(PolygonSymbolizer poly) {
    super.visit(poly);
    PolygonSymbolizer polyCopy = (PolygonSymbolizer) pages.peek();
    Fill polyFill = polyCopy.getFill();
    if (polyFill != null) {
        polyFill.setOpacity(polyFillExp);
    }

    Stroke polyStroke = polyCopy.getStroke();
    if (polyStroke != null) {
        polyStroke.setOpacity(polyStrokeExp);
    }
}
 
Example 5
Source File: SLDs.java    From gama with GNU General Public License v3.0 3 votes vote down vote up
public static Color polyFill(final PolygonSymbolizer symbolizer) {
	if (symbolizer == null) { return null; }

	final Fill fill = symbolizer.getFill();

	if (fill == null) { return null; }

	final Expression color = fill.getColor();
	return color(color);
}