org.geotools.styling.PolygonSymbolizer Java Examples

The following examples show how to use org.geotools.styling.PolygonSymbolizer. 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: ShapefileLoader.java    From snap-desktop with GNU General Public License v3.0 6 votes vote down vote up
private static Style createPolygonStyle() {
    PolygonSymbolizer symbolizer = styleFactory.createPolygonSymbolizer();
    Fill fill = styleFactory.createFill(
            filterFactory.literal("#FFAA00"),
            filterFactory.literal(0.5)
    );
    final Stroke stroke = styleFactory.createStroke(filterFactory.literal(Color.BLACK),
                                                    filterFactory.literal(1));
    symbolizer.setFill(fill);
    symbolizer.setStroke(stroke);
    Rule rule = styleFactory.createRule();
    rule.symbolizers().add(symbolizer);
    FeatureTypeStyle fts = styleFactory.createFeatureTypeStyle();
    fts.rules().add(rule);

    Style style = styleFactory.createStyle();
    style.featureTypeStyles().add(fts);
    return style;
}
 
Example #2
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 #3
Source File: PolygonSymbolizerDetails.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void populate(SelectedSymbol selectedSymbol) {

    if (selectedSymbol != null) {
        PolygonSymbolizer polygonSymbolizer =
                (PolygonSymbolizer) selectedSymbol.getSymbolizer();
        if (polygonSymbolizer != null) {
            populateStandardData(polygonSymbolizer);

            fieldConfigVisitor.populateField(
                    FieldIdEnum.PERPENDICULAR_OFFSET,
                    polygonSymbolizer.getPerpendicularOffset());

            fieldConfigVisitor.populateField(
                    FieldIdEnum.GEOMETRY, polygonSymbolizer.getGeometry());
        }
    }
}
 
Example #4
Source File: VOGeoServerRandomFill.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void getMinimumVersion(
        Object parentObj, Object sldObj, List<VendorOptionPresent> vendorOptionsPresentList) {

    if (parentObj instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) parentObj;
        Map<String, String> options = polygon.getOptions();

        for (Entry<FieldIdEnum, String> entry : fieldMap.entrySet()) {
            String vendorOptionAttributeKey = entry.getValue();

            if (options.containsKey(vendorOptionAttributeKey)) {
                VendorOptionPresent voPresent =
                        new VendorOptionPresent(sldObj, getVendorOptionInfo());

                if (vendorOptionsPresentList != null) {
                    vendorOptionsPresentList.add(voPresent);
                }
            }
        }
    }
}
 
Example #5
Source File: SymbolizerFilterVisitor.java    From geomajas-project-server with GNU Affero General Public License v3.0 6 votes vote down vote up
protected boolean skipSymbolizer(Symbolizer symbolizer) {
	if (symbolizer instanceof TextSymbolizer) {
		if (!isIncludeText()) {
			return true;
		}
	} else if (symbolizer instanceof LineSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof PointSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof PolygonSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	} else if (symbolizer instanceof RasterSymbolizer) {
		if (!isIncludeGeometry()) {
			return true;
		}
	}
	return false;
}
 
Example #6
Source File: SLDTreeLeafFactoryTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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));
}
 
Example #7
Source File: SLDTreeLeafFactoryTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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));
}
 
Example #8
Source File: SLDTree.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Populate symbolizer.
 *
 * @param ruleTreeNode the rule tree node
 * @param symbolizer the symbolizer
 */
private void populateSymbolizer(DefaultMutableTreeNode ruleTreeNode, Symbolizer symbolizer) {
    DefaultMutableTreeNode symbolizerTreeNode = addObject(ruleTreeNode, symbolizer, true);

    if ((symbolizer instanceof PointSymbolizer) || (symbolizer instanceof PolygonSymbolizer)) {
        addObject(
                symbolizerTreeNode, SLDTreeLeafFactory.getInstance().getFill(symbolizer), true);
    }

    if ((symbolizer instanceof PolygonSymbolizer) || (symbolizer instanceof LineSymbolizer)) {
        addObject(
                symbolizerTreeNode,
                SLDTreeLeafFactory.getInstance().getStroke(symbolizer),
                true);
    }

    if (symbolizer instanceof RasterSymbolizer) {
        handleRasterSymbolizer(symbolizer, symbolizerTreeNode);
    }
}
 
Example #9
Source File: RuleRenderVisitor.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * (non-Javadoc)
 *
 * @see
 *     org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PolygonSymbolizer)
 */
public void visit(PolygonSymbolizer poly) {
    PolygonSymbolizer copy = sf.createPolygonSymbolizer();
    copy.setFill(copy(poly.getFill()));

    copy.setGeometry(copy(poly.getGeometry()));

    copy.setUnitOfMeasure(poly.getUnitOfMeasure());
    copy.setStroke(copy(poly.getStroke()));
    copy.getOptions().putAll(poly.getOptions());

    if (STRICT && !copy.equals(poly)) {
        throw new IllegalStateException(
                "Was unable to duplicate provided PolygonSymbolizer:" + poly);
    }
    pages.push(copy);
}
 
Example #10
Source File: ExtractAttributes.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * (non-Javadoc)
 *
 * @see
 *     org.geotools.styling.visitor.DuplicatingStyleVisitor#visit(org.geotools.styling.PolygonSymbolizer)
 */
@Override
public void visit(PolygonSymbolizer poly) {
    PolygonSymbolizer copy = sf.createPolygonSymbolizer();
    copy.setFill(copy(poly.getFill()));

    copy.setGeometry(copy(MultiPolygon.class, poly.getGeometry()));

    copy.setUnitOfMeasure(poly.getUnitOfMeasure());
    copy.setStroke(copy(poly.getStroke()));
    copy.getOptions().putAll(poly.getOptions());

    if (STRICT && !copy.equals(poly)) {
        throw new IllegalStateException(
                "Was unable to duplicate provided PolygonSymbolizer:" + poly);
    }
    pages.push(copy);
}
 
Example #11
Source File: SLDEditorBufferedImageLegendGraphicBuilder.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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;
    }
}
 
Example #12
Source File: NewPolygonSLDTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/** Test new polygon sld. */
@Test
public void testNewPolygonSLD() {
    NewPolygonSLD newData = new NewPolygonSLD();

    StyledLayerDescriptor sld = newData.create();

    assertTrue(sld.layers().size() == 1);

    StyledLayer styledLayer = sld.layers().get(0);

    NamedLayer namedLayer = (NamedLayer) styledLayer;

    Symbolizer symbolizer =
            namedLayer
                    .styles()
                    .get(0)
                    .featureTypeStyles()
                    .get(0)
                    .rules()
                    .get(0)
                    .symbolizers()
                    .get(0);

    assertTrue(symbolizer instanceof PolygonSymbolizer);
}
 
Example #13
Source File: SLDTreeLeafFactoryTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #14
Source File: SLDTreeLeafFactoryTest.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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);
}
 
Example #15
Source File: PictureFillSymbol.java    From sldeditor with GNU General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #16
Source File: FeatureLayerConfigurationPersistencyTest.java    From snap-desktop with GNU General Public License v3.0 6 votes vote down vote up
@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;
}
 
Example #17
Source File: SLDTreeLeafPolygon.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void removeFill(Symbolizer symbolizer) {
    if (symbolizer instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) symbolizer;

        polygon.setFill(null);
    }
}
 
Example #18
Source File: SLDExternalImages.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Process symbolizer.
 *
 * @param resourceLocator the resource locator
 * @param externalImageList the external image list
 * @param process the process
 * @param symbolizer the symbolizer
 */
private static void processSymbolizer(
        URL resourceLocator,
        List<String> externalImageList,
        ProcessGraphicSymbolInterface process,
        Symbolizer symbolizer) {
    if (process == null) {
        return;
    }

    if (symbolizer instanceof PointSymbolizer) {
        PointSymbolizer point = (PointSymbolizer) symbolizer;

        if (point.getGraphic() != null) {
            process.processGraphicalSymbol(
                    resourceLocator, point.getGraphic().graphicalSymbols(), externalImageList);
        }
    } else if (symbolizer instanceof LineSymbolizer) {
        LineSymbolizer line = (LineSymbolizer) symbolizer;

        updateStroke(resourceLocator, line.getStroke(), externalImageList, process);
    } else if (symbolizer instanceof PolygonSymbolizer) {
        PolygonSymbolizer polygon = (PolygonSymbolizer) symbolizer;

        updateStroke(resourceLocator, polygon.getStroke(), externalImageList, process);
        updateFill(resourceLocator, polygon.getFill(), externalImageList, process);
    }
}
 
Example #19
Source File: SLDTreeLeafFactoryTest.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Test method for {@link
 * com.sldeditor.common.tree.leaf.SLDTreeLeafFactory#isItemSelected(java.lang.Object,
 * org.geotools.styling.Symbolizer)}.
 */
@Test
public void testIsItemSelected() {
    assertFalse(SLDTreeLeafFactory.getInstance().isItemSelected(null, null));

    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    assertTrue(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultFill(), polygonSymbolizer));
    assertTrue(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultStroke(), polygonSymbolizer));

    PointSymbolizer pointSymbolizer = DefaultSymbols.createDefaultPointSymbolizer();
    assertTrue(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultFill(), pointSymbolizer));
    assertFalse(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultStroke(), pointSymbolizer));

    LineSymbolizer lineSymbolizer = DefaultSymbols.createDefaultLineSymbolizer();
    assertFalse(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultFill(), lineSymbolizer));
    assertTrue(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultStroke(), lineSymbolizer));

    TextSymbolizer textSymbolizer = DefaultSymbols.createDefaultTextSymbolizer();
    assertFalse(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultFill(), textSymbolizer));
    assertFalse(
            SLDTreeLeafFactory.getInstance()
                    .isItemSelected(styleFactory.getDefaultStroke(), textSymbolizer));
}
 
Example #20
Source File: SLDUtils.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Process symbolizer.
 *
 * @param symbolizer the symbolizer
 * @param traverseSymbolizersInterface the traverse symbolizers interface
 */
private static void processSymbolizer(
        org.opengis.style.Symbolizer symbolizer,
        TraverseSymbolizersInterface traverseSymbolizersInterface) {
    if (symbolizer instanceof PointSymbolizer) {
        traverseSymbolizersInterface.pointSymbolizerCallback((PointSymbolizer) symbolizer);
    } else if (symbolizer instanceof LineSymbolizer) {
        traverseSymbolizersInterface.lineSymbolizerCallback((LineSymbolizer) symbolizer);
    } else if (symbolizer instanceof PolygonSymbolizer) {
        traverseSymbolizersInterface.polygonSymbolizerCallback((PolygonSymbolizer) symbolizer);
    } else if (symbolizer instanceof RasterSymbolizer) {
        traverseSymbolizersInterface.rasterSymbolizerCallback((RasterSymbolizer) symbolizer);
    }
}
 
Example #21
Source File: PolygonSymbolizerWrapper.java    From hortonmachine with GNU General Public License v3.0 5 votes vote down vote up
protected void checkStrokeExists() {
    if (stroke == null) {
        if (strokeColor == null) {
            strokeColor = DEFAULT_COLOR;
        }
        if (strokeWidth == null) {
            strokeWidth = DEFAULT_WIDTH;
        }
        stroke = sf.createStroke(ff.literal(strokeColor), ff.literal(strokeWidth));
        PolygonSymbolizer polygonSymbolizer = (PolygonSymbolizer) getSymbolizer();
        polygonSymbolizer.setStroke(stroke);
        strokeGraphicStroke = stroke.getGraphicStroke();
    }
}
 
Example #22
Source File: VOGeoServerTextSpacing.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Update symbol.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
/*
 * (non-Javadoc)
 *
 * @see
 * com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#updateSymbol(org.geotools.
 * styling.PolygonSymbolizer)
 */
@Override
public void updateSymbol(PolygonSymbolizer polygonSymbolizer) {
    // Do nothing
}
 
Example #23
Source File: VendorOptionFillFactory.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Update symbol but only if allowed to by the vendor options configuration.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
public void updateSymbol(PolygonSymbolizer polygonSymbolizer) {
    for (VendorOptionInterface extension : vendorOptionList) {
        boolean displayVendorOption =
                VendorOptionManager.getInstance()
                        .isAllowed(vendorOptionVersionList, extension.getVendorOption());

        if (displayVendorOption) {
            extension.updateSymbol(polygonSymbolizer);
        }
    }
}
 
Example #24
Source File: SLDTreeLeafPolygonTest.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Test method for {@link
 * com.sldeditor.common.tree.leaf.SLDTreeLeafPolygon#getStroke(org.opengis.style.Symbolizer)}.
 */
@Test
public void testGetStroke() {
    SLDTreeLeafPolygon leaf = new SLDTreeLeafPolygon();
    assertNull(leaf.getStroke(null));
    assertNull(leaf.getStroke(DefaultSymbols.createDefaultPointSymbolizer()));

    PolygonSymbolizer polygonSymbolizer = DefaultSymbols.createDefaultPolygonSymbolizer();
    assertEquals(polygonSymbolizer.getStroke(), leaf.getStroke(polygonSymbolizer));
}
 
Example #25
Source File: VOGeoServerLabellingTest.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Test method for {@link
 * com.sldeditor.ui.detail.vendor.geoserver.text.VOGeoServerLabelling#populate(org.geotools.styling.PolygonSymbolizer)}.
 */
@Test
void testPopulatePolygonSymbolizer() {
    VOGeoServerLabelling testObj = new VOGeoServerLabelling(TextSymbolizerDetails.class);
    PolygonSymbolizer symbolizer = null;
    testObj.populate(symbolizer);
}
 
Example #26
Source File: VOGeoServerRandomFill.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Update symbol.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
@Override
public void updateSymbol(PolygonSymbolizer polygonSymbolizer) {
    if (polygonSymbolizer != null) {
        Map<String, String> options = polygonSymbolizer.getOptions();

        options.clear();

        for (Entry<FieldIdEnum, String> entry : fieldMap.entrySet()) {
            internalUpdateSymbol(options, entry.getKey(), entry.getValue());
        }
    }
}
 
Example #27
Source File: VOGeoServerRandomFill.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Populate.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
@Override
public void populate(PolygonSymbolizer polygonSymbolizer) {
    Map<String, String> options = null;

    if (polygonSymbolizer != null) {
        options = polygonSymbolizer.getOptions();
    }

    for (Entry<FieldIdEnum, String> entry : fieldMap.entrySet()) {
        internalPopulate(options, entry.getKey(), entry.getValue());
    }

    handleFieldState();
}
 
Example #28
Source File: VOChannelNameExpression.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Update symbol.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
/*
 * (non-Javadoc)
 *
 * @see
 * com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#updateSymbol(org.geotools.
 * styling.PolygonSymbolizer)
 */
@Override
public void updateSymbol(PolygonSymbolizer polygonSymbolizer) {
    // Do nothing
}
 
Example #29
Source File: VOChannelNameNoExpression.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Populate.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
/*
 * (non-Javadoc)
 *
 * @see
 * com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#populate(org.geotools.styling.
 * PolygonSymbolizer)
 */
@Override
public void populate(PolygonSymbolizer polygonSymbolizer) {
    // Do nothing
}
 
Example #30
Source File: VOGeoServerContrastEnhancementNormalize.java    From sldeditor with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Populate.
 *
 * @param polygonSymbolizer the polygon symbolizer
 */
/*
 * (non-Javadoc)
 *
 * @see com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#populate(org.geotools.styling. PolygonSymbolizer)
 */
@Override
public void populate(PolygonSymbolizer polygonSymbolizer) {
    // Do nothing
}