Package org.locationtech.udig.style.advanced.common.styleattributeclasses

Examples of org.locationtech.udig.style.advanced.common.styleattributeclasses.StyleWrapper


        });

        stylesViewer.setLabelProvider(new LabelProvider(){
            public Image getImage( Object element ) {
                if (element instanceof StyleWrapper) {
                    StyleWrapper styleWrapper = (StyleWrapper) element;
                    List<FeatureTypeStyleWrapper> featureTypeStyles = styleWrapper.getFeatureTypeStylesWrapperList();
                    int iconSize = 48;
                    BufferedImage image = new BufferedImage(iconSize, iconSize, BufferedImage.TYPE_INT_ARGB);
                    Graphics2D g2d = image.createGraphics();
                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                    for( FeatureTypeStyleWrapper featureTypeStyle : featureTypeStyles ) {
                        List<RuleWrapper> rulesWrapperList = featureTypeStyle.getRulesWrapperList();
                        BufferedImage tmpImage = Utilities.pointRulesWrapperToImage(rulesWrapperList, iconSize, iconSize);
                        g2d.drawImage(tmpImage, 0, 0, null);
                    }
                    g2d.dispose();
                    Image convertToSWTImage = AWTSWTImageUtils.convertToSWTImage(image);
                    return convertToSWTImage;
                }
                return null;
            }

            public String getText( Object element ) {
                if (element instanceof StyleWrapper) {
                    StyleWrapper styleWrapper = (StyleWrapper) element;
                    String styleName = styleWrapper.getName();
                    if (styleName == null || styleName.length() == 0) {
                        styleName = Utilities.DEFAULT_STYLENAME;
                        styleName = Utilities.checkSameNameStyle(getStyles(), styleName);
                        styleWrapper.setName(styleName);
                    }
                    return styleName;
                }
                return ""; //$NON-NLS-1$
            }
View Full Code Here


        for( File file : files ) {
            String name = file.getName();
            File newFile = new File(styleFolderFile, name);
            FileUtils.copyFile(file, newFile);
            StyleWrapper style = Utilities.createStyleFromGraphic(newFile);
            styles.add(style);
            styleToDisk(style);
        }
        stylesViewer.refresh(false, true);
    }
View Full Code Here

        });

        stylesViewer.setLabelProvider(new LabelProvider(){
            public Image getImage( Object element ) {
                if (element instanceof StyleWrapper) {
                    StyleWrapper styleWrapper = (StyleWrapper) element;
                    List<FeatureTypeStyleWrapper> featureTypeStyles = styleWrapper.getFeatureTypeStylesWrapperList();
                    int iconSize = 48;
                    BufferedImage image = new BufferedImage(iconSize, iconSize, BufferedImage.TYPE_INT_ARGB);
                    Graphics2D g2d = image.createGraphics();
                    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                    for( FeatureTypeStyleWrapper featureTypeStyle : featureTypeStyles ) {
                        List<RuleWrapper> rules = featureTypeStyle.getRulesWrapperList();
                        BufferedImage tmpImage = Utilities.polygonRulesWrapperToImage(rules, iconSize, iconSize);
                        g2d.drawImage(tmpImage, 0, 0, null);
                    }
                    g2d.dispose();
                    Image convertToSWTImage = AWTSWTImageUtils.convertToSWTImage(image);
                    return convertToSWTImage;
                }
                return null;
            }

            public String getText( Object element ) {
                if (element instanceof StyleWrapper) {
                    StyleWrapper styleWrapper = (StyleWrapper) element;
                    String styleName = styleWrapper.getName();
                    if (styleName == null || styleName.length() == 0) {
                        styleName = Utilities.DEFAULT_STYLENAME;
                        styleName = Utilities.checkSameNameStyle(getStyles(), styleName);
                        styleWrapper.setName(styleName);
                    }
                    return styleName;
                }
                return ""; //$NON-NLS-1$
            }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.style.advanced.common.styleattributeclasses.StyleWrapper

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.