Package org.geotools.styling

Examples of org.geotools.styling.Style


        Cursor waitCursor = new Cursor(Display.getCurrent(), SWT.CURSOR_WAIT);
        setDisplayCursor(waitCursor);

        //generate the SLD
        StyledLayerDescriptor sld = null;
        Style style = null;
        String xml = sldTextBox.getText();
        if (xml == null) {
            resetCursor(waitCursor);
            return false;
        }
View Full Code Here


     * @param fill The color of the fills
     * @return a simple style to use in default cases.
     */
    public static Style createPolyStyle( String typeName, Color line, Color fill ) {
        StyleBuilder sb = new StyleBuilder();
        Style polystyle = sb.createStyle();

        PolygonSymbolizer poly = sb.createPolygonSymbolizer(fill, line, 1);
        polystyle.addFeatureTypeStyle(sb.createFeatureTypeStyle(poly));

        polystyle.getFeatureTypeStyles()[0].setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        return polystyle;
    }
View Full Code Here

     * @param typeName the TypeName of the feature type the style will style.
     * @return a simple style to use in default cases.
     */
    public static Style createPointStyle( String typeName ) {
        StyleBuilder sb = new StyleBuilder();
        Style pointstyle = sb.createStyle();
        PointSymbolizer point = sb.createPointSymbolizer(sb.createGraphic());

        pointstyle.addFeatureTypeStyle(sb.createFeatureTypeStyle(point));

        pointstyle.getFeatureTypeStyles()[0].setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        return pointstyle;
    }
View Full Code Here

     * @param typeName the TypeName of the feature type the style will style.
     * @return as simple style to use in default cases.
     */
    public static Style createRasterStyle( String typeName ) {
        StyleBuilder sb = new StyleBuilder();
        Style rasterstyle = sb.createStyle();
        RasterSymbolizer raster = sb.createRasterSymbolizer();

        rasterstyle.addFeatureTypeStyle(sb.createFeatureTypeStyle(raster));
        rasterstyle.getFeatureTypeStyles()[0].setFeatureTypeName(SLDs.GENERIC_FEATURE_TYPENAME);
        return rasterstyle;
    }
View Full Code Here

    public static ImageDescriptor generateStyledIcon( Layer layer ) {
        StyleBlackboard blackboard = layer.getStyleBlackboard();
        if (blackboard == null)
            return null;

        Style sld = (Style) blackboard.lookup(Style.class); // or
        // blackboard.get(
        // "org.locationtech.udig.style.sld"
        // );
        if (sld != null) {
            Rule rule = getRule(sld);
View Full Code Here

    public Object[] getChildren( Object parentElement ) {
        if (parentElement == null)
            return EMPTY_ARRAY;
        if (parentElement instanceof Style) {
            Style style = (Style) parentElement;
            Rule[] rule = SLDs.rules(style);
            return rule; // return rules
        } else if (parentElement instanceof FeatureTypeStyle) {
            FeatureTypeStyle fts = (FeatureTypeStyle) parentElement;
            List<Rule> rules = fts.rules();
View Full Code Here

        }
        return null;
    }

    public StyledLayerDescriptor getSLD() {
        Style style = getStyle();
        return getSLD(style);
    }
View Full Code Here

           
    public void refresh() {       
        IStyleEditorPageContainer container = getContainer();
        // StyleLayer layer = container.getSelectedLayer();
        // SimpleFeatureType schema = layer.getSchema();
        Style style = container.getStyle();
        LineSymbolizer lineSymbolizer = SLDs.lineSymbolizer(style);
       
        try {
            listen( false ); // do not issue events while controls being updated by hand
            if( lineSymbolizer == null ){
View Full Code Here

    }

    public String getText( Object element ) {
        if (element instanceof Style) {
            // shouldn't be called, as the root object is hidden
            Style style = (Style) element;
            return style.getTitle();
        } else if (element instanceof Rule) {
            Rule rule = (Rule) element;
            if (rule.getName().startsWith("rule")) //$NON-NLS-1$
                return StyleGenerator.toStyleExpression(rule.getFilter());
            else
View Full Code Here

            }
        }
    }
  }
    private boolean removeRule(Rule rule) {
        Style style = getStyle();
        FeatureTypeStyle[] featureTypeStyles = style.getFeatureTypeStyles();
        if( featureTypeStyles == null ){
            return false;
        }
        for( int i=0; i<featureTypeStyles.length; i++ ){
            FeatureTypeStyle featureTypeStyle = featureTypeStyles[i];
View Full Code Here

TOP

Related Classes of org.geotools.styling.Style

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.