Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.StyleContent


            throw new NullPointerException("Layer is required to create default styles");
        }
        this.theLayer = theLayer;
    }
    public void process( IExtension extension, IConfigurationElement element ) throws Exception {
        StyleContent styleContent = (StyleContent) element.createExecutableExtension("class"); //$NON-NLS-1$
        Color defaultColor = theLayer.getDefaultColor();
        Object style = styleContent.createDefaultStyle(theResource, defaultColor, null);

        if (style != null) {
            theLayer.getStyleBlackboard().put(styleContent.getId(), style);
        }
    }
View Full Code Here


         */
        public void process(IExtension extension, IConfigurationElement element) throws Exception {
            if (found)
                return;

            StyleContent styleContent = (StyleContent) element.createExecutableExtension("class"); //$NON-NLS-1$
            style = styleContent.load(url, monitor);
            if (style != null) {
                id = styleContent.getId();
                id2content.put(styleContent.getId(), styleContent);
                found = true;
            }
        }
View Full Code Here

        try {
            for (Iterator seItr = getContent().iterator(); seItr.hasNext();) {
                StyleEntry se = (StyleEntry) seItr.next();
                try {
                    if (se.getStyleClass() == null) {
                        StyleContent styleContent = getStyleContent(se.getID());
                        if (styleContent != null) {
                            Class<?> type = styleContent.getStyleClass();
                            if (type == null) {
                                se.getStyle(); // force the load
                                type = styleContent.getStyleClass();
                                if (type == null) {
                                    continue;
                                }
                            }
                            se.setStyleClass(type);
View Full Code Here

     */
    protected Object getObject(StyleEntry styleEntry) {
        // reload style state if necessary
        if (styleEntry.getStyle() == null) {
            try {
                StyleContent styleContent = getStyleContent(styleEntry.getID());
                String mementoString = styleEntry.getMemento();
                if (mementoString != null) {
                    XMLMemento memento = XMLMemento.createReadRoot(new StringReader(mementoString));
                    Object style = styleContent.load(memento);
                    styleEntry.setStyle(style);
                    if (style != null) {
                        styleEntry.setStyleClass(style.getClass());
                    }
                }
View Full Code Here

        se.setID(styleId);
        se.setStyle(style);

        content.add(se);

        StyleContent styleContent = getStyleContent(styleId);

        if (styleContent == null) {

            return;
        }
        try {
            // save the state of the style
            XMLMemento memento = XMLMemento.createWriteRoot("styleEntry"); //$NON-NLS-1$
            styleContent.save(memento, style);

            StringWriter writer = new StringWriter();
            memento.save(writer);
            se.setMemento(writer.getBuffer().toString());
View Full Code Here

    /**
     * @generated NOT
     */
    private StyleContent getStyleContent(String styleId) {
        // look in local cache first
        StyleContent styleContent = id2content.get(styleId);
        if (styleContent == null) {
            loadStyleContent(styleId);
            styleContent = id2content.get(styleId);
        }
        return styleContent;
View Full Code Here

            public void process(IExtension extension, IConfigurationElement element)
                    throws Exception {
                if (!found && element.getAttribute("id").equals(styleId)) { //$NON-NLS-1$
                    found = true;
                    StyleContent styleContent = (StyleContent) element
                            .createExecutableExtension("class");
                    id2content.put(styleId, styleContent);
                }
            }
        };
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.StyleContent

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.