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

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


        addButton.setToolTipText(Messages.PointPropertiesEditor_6);
        addButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                FeatureTypeStyleWrapper selectedFtsw = getSelectedFtsw();
                if (selectedFtsw == null) {
                    RuleWrapper selectedRule = getSelectedRule();
                    if (selectedRule != null) {
                        selectedFtsw = selectedRule.getParent();
                    }
                }
                if (selectedFtsw == null) {
                    MessageDialog.openWarning(addButton.getShell(), Messages.PointPropertiesEditor_7,
                            Messages.PointPropertiesEditor_8);
                    return;
                }
                RuleWrapper addedRuleWrapper = selectedFtsw.addRule(null, PointSymbolizerWrapper.class);
                String tmpName = Messages.PointPropertiesEditor_9;
                tmpName = Utilities.checkSameNameRule(addedRuleWrapper.getParent().getRulesWrapperList(), tmpName);
                addedRuleWrapper.setName(tmpName);

                reloadGroupsAndRules();
                refreshPreviewCanvasOnStyle();
                setRuleToSelected(addedRuleWrapper);
            }
        });

        Button deleteButton = new Button(rulesGroup, SWT.PUSH);
        deleteButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        deleteButton.setImage(delImg);
        deleteButton.setToolTipText(Messages.PointPropertiesEditor_10);
        deleteButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                FeatureTypeStyleWrapper selectedFtsw = getSelectedFtsw();
                RuleWrapper selectedRule = getSelectedRule();
                if (selectedFtsw != null) {
                    styleWrapper.removeFeatureTypeStyle(selectedFtsw);
                } else if (selectedRule != null) {
                    selectedRule.getParent().removeRule(selectedRule);
                } else {
                    MessageDialog.openWarning(addButton.getShell(), Messages.PointPropertiesEditor_11, Messages.PointPropertiesEditor_12);
                    return;
                }
View Full Code Here


        propertiesComposite.setLayout(propertiesStackLayout);
        GridData propertiesCompositeGD = new GridData(SWT.FILL, SWT.FILL, true, true);
        // propertiesCompositeGD.horizontalSpan = 2;
        propertiesComposite.setLayoutData(propertiesCompositeGD);

        RuleWrapper ruleWrapper = styleWrapper.getFirstRule();
        if (ruleWrapper != null) {
            setRuleToSelected(ruleWrapper);
        } else {
            // if it came here, nothing to select
            Label l = new Label(propertiesComposite, SWT.SHADOW_ETCHED_IN);
View Full Code Here

                if (selectedItem instanceof FeatureTypeStyleWrapper) {
                    showEmptyLabel();
                }

                if (selectedItem instanceof RuleWrapper) {
                    RuleWrapper currentSelectedRule = (RuleWrapper) selectedItem;
                    if (propertiesComposite != null) {
                        if (polygonPropertieComposite == null) {
                            polygonPropertieComposite = new PolygonPropertiesComposite(PolygonPropertiesEditor.this,
                                    propertiesComposite);
                        }
View Full Code Here

        addButton.setToolTipText(Messages.PolygonPropertiesEditor_6);
        addButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                FeatureTypeStyleWrapper selectedFtsw = getSelectedFtsw();
                if (selectedFtsw == null) {
                    RuleWrapper selectedRule = getSelectedRule();
                    if (selectedRule != null) {
                        selectedFtsw = selectedRule.getParent();
                    }
                }
                if (selectedFtsw == null) {
                    MessageDialog.openWarning(addButton.getShell(), Messages.PolygonPropertiesEditor_7,
                            Messages.PolygonPropertiesEditor_8);
                    return;
                }
                RuleWrapper addedRuleWrapper = selectedFtsw.addRule(null, PolygonSymbolizerWrapper.class);
                String tmpName = Messages.PolygonPropertiesEditor_9;
                tmpName = Utilities.checkSameNameRule(addedRuleWrapper.getParent().getRulesWrapperList(), tmpName);
                addedRuleWrapper.setName(tmpName);

                reloadGroupsAndRules();
                refreshPreviewCanvasOnStyle();
                setRuleToSelected(addedRuleWrapper);
            }
        });

        Button deleteButton = new Button(rulesGroup, SWT.PUSH);
        deleteButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        deleteButton.setImage(delImg);
        deleteButton.setToolTipText(Messages.PolygonPropertiesEditor_10);
        deleteButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                FeatureTypeStyleWrapper selectedFtsw = getSelectedFtsw();
                RuleWrapper selectedRule = getSelectedRule();
                if (selectedFtsw != null) {
                    styleWrapper.removeFeatureTypeStyle(selectedFtsw);
                } else if (selectedRule != null) {
                    selectedRule.getParent().removeRule(selectedRule);
                } else {
                    MessageDialog.openWarning(addButton.getShell(), Messages.PolygonPropertiesEditor_11, Messages.PolygonPropertiesEditor_12);
                    return;
                }
View Full Code Here

        saveButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        saveButton.setImage(saveImg);
        saveButton.setToolTipText(Messages.PointPropertiesEditor_16);
        saveButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                RuleWrapper selectedRule = getSelectedRule();

                FeatureTypeStyle featureTypeStyle = Utilities.sf.createFeatureTypeStyle();
                featureTypeStyle.rules().add(selectedRule.getRule());
                Style namedStyle = Utilities.sf.createStyle();
                namedStyle.featureTypeStyles().add(featureTypeStyle);
                namedStyle.setName(selectedRule.getName());

                try {
                    pointStyleManager.addStyle(new StyleWrapper(namedStyle));
                } catch (Exception e1) {
                    e1.printStackTrace();
View Full Code Here

        saveButton.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
        saveButton.setImage(saveImg);
        saveButton.setToolTipText(Messages.PolygonPropertiesEditor_16);
        saveButton.addSelectionListener(new SelectionAdapter(){
            public void widgetSelected( SelectionEvent e ) {
                RuleWrapper selectedRule = getSelectedRule();

                FeatureTypeStyle featureTypeStyle = Utilities.sf.createFeatureTypeStyle();
                featureTypeStyle.rules().add(selectedRule.getRule());
                Style namedStyle = Utilities.sf.createStyle();
                namedStyle.featureTypeStyles().add(featureTypeStyle);
                namedStyle.setName(selectedRule.getName());

                try {
                    polygonStyleManager.addStyle(new StyleWrapper(namedStyle));
                } catch (Exception e1) {
                    e1.printStackTrace();
View Full Code Here

    }

   
    public Object getParent( Object element ) {
        if (element instanceof RuleWrapper) {
            RuleWrapper ruleWrapper = (RuleWrapper) element;
            return ruleWrapper.getParent();
        }
        return null;
    }
View Full Code Here

        if (element instanceof FeatureTypeStyleWrapper) {
            FeatureTypeStyleWrapper ftsW = (FeatureTypeStyleWrapper) element;
            List<RuleWrapper> rulesWrapperList = ftsW.getRulesWrapperList();
            image = rulesWrapperToImage(rulesWrapperList, 16, 16, type);
        } else if (element instanceof RuleWrapper) {
            RuleWrapper ruleWrapper = (RuleWrapper) element;
            image = rulesWrapperToImage(ruleWrapper, 16, 16, type);
        }
        if (image != null) {
            Image convertToSWTImage = AWTSWTImageUtils.convertToSWTImage(image);
            return convertToSWTImage;
View Full Code Here

                name = checkSameNameFeatureTypeStyle(ftsW.getParent().getFeatureTypeStylesWrapperList(), name);
                ftsW.setName(name);
            }
            return name;
        } else if (element instanceof RuleWrapper) {
            RuleWrapper ruleWrapper = (RuleWrapper) element;
            String name = ruleWrapper.getName();
            if (name == null || name.length() == 0) {
                name = Messages.GroupRulesTreeLabelProvider_1;
                name = checkSameNameRule(ruleWrapper.getParent().getRulesWrapperList(), name);
                ruleWrapper.setName(name);
            }
            return name;
        }
        return null;
    }
View Full Code Here

TOP

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

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.