Package org.locationtech.udig.project.internal

Examples of org.locationtech.udig.project.internal.StyleBlackboard


    }

    @Override
    protected void refresh() {
        try {
            StyleBlackboard blackboard = getLayer().getStyleBlackboard();

            style = (ProcessingRegionStyle) blackboard.get(ProcessingRegionStyleContent.ID);

            if (style == null) {
                style = ProcessingRegionStyleContent.createDefault();
                blackboard.put(ProcessingRegionStyleContent.ID, style);
                // ((StyleBlackboard) styleBlackboard).setSelected(new
                // String[]{ActiveregionStyleContent.ID});
            }

            ProcessingRegion tmp = new ProcessingRegion(style.west, style.east, style.south, style.north, style.rows, style.cols);
View Full Code Here


                    + textVerticalOffset, ViewportGraphics.ALIGN_LEFT, ViewportGraphics.ALIGN_LEFT);
        }
    }

    private FeatureTypeStyle[] locateStyle( ILayer layer ) {
        StyleBlackboard blackboard = (StyleBlackboard) layer.getStyleBlackboard();
        if (blackboard == null) {
            return null;
        }

        Style sld = (Style) blackboard.lookup(Style.class);
        if (sld == null) {
            return null;
        }

        List<FeatureTypeStyle> styles = new ArrayList<FeatureTypeStyle>();
View Full Code Here

     * </p>
     *
     * @return gernated layer
     */
    public BufferedImage generateIcon( Layer layer, int width, int height ) {
        StyleBlackboard style = layer.getStyleBlackboard();

        if (style != null && !style.getContent().isEmpty()) {
            BufferedImage icon = generateStyledIcon(layer);
            if (icon != null)
                return icon;
        }
        // ImageDescriptor icon = generateDefaultIcon(layer);
View Full Code Here

     *
     * @param layer
     * @return ImageDecriptor for layer, or null in style could not be indicated
     */
    public BufferedImage 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

        layer.setName("Layer1"); //$NON-NLS-1$
        IService createService = DummyService.createService(new URL("http://dummy77"), Collections.emptyList(), //$NON-NLS-1$
                        Collections.singletonList(Arrays.asList(new Object[]{new RendererCreatorTestObjForMulitRenderer()})));
        layer.getGeoResources().add(createService.resources(null).get(0));
       
        StyleBlackboard bb = layer.getStyleBlackboard();
       
        bb.put(SingleRendererStyleContent.ID, new SingleRendererStyleContent());
       
        RendererCreatorImpl creator = MapTests.createRendererCreator(layer.getMapInternal());
       
        NotificationImpl notificationImpl = new ENotificationImpl((InternalEObject) layer.getContextModel(), Notification.ADD,
                ProjectPackage.CONTEXT_MODEL__LAYERS, null, layer);
        creator.changed(notificationImpl);
       
        sameRenderer(creator, SingleRenderer.class, 1);

        bb.clear();
        bb.put(MultiRendererStyleContent.ID, new MultiRendererStyleContent());
       
        sameRenderer(creator, MultiLayerRenderer.class, 1);
       
        bb.put(SingleRendererStyleContent.ID, new SingleRendererStyleContent());
        bb.setSelected(new String[]{SingleRendererStyleContent.ID});

        sameRenderer(creator, SingleRenderer.class, 1);

        bb.setSelected(new String[]{MultiRendererStyleContent.ID});

        sameRenderer(creator, MultiLayerRenderer.class, 1);
    }
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case ProjectPackage.STYLE_BLACKBOARD: {
            StyleBlackboard styleBlackboard = (StyleBlackboard) theEObject;
            T result = caseStyleBlackboard(styleBlackboard);
            if (result == null)
                result = caseIStyleBlackboard(styleBlackboard);
            if (result == null)
                result = caseCloneable(styleBlackboard);
View Full Code Here

        return aLayer.hasResource(VectorLegendGraphic.class);
    }

    @Override
    protected void refresh() {
        StyleBlackboard styleBlackboard = getLayer().getStyleBlackboard();
        style = (VectorLegendStyle) styleBlackboard.get(VectorLegendStyleContent.ID);

        if (style == null) {
            style = VectorLegendStyleContent.createDefault();
            styleBlackboard.put(VectorLegendStyleContent.ID, style);
            styleBlackboard.setSelected(new String[]{VectorLegendStyleContent.ID});
        }

        fontColour.setColorValue(new RGB(style.fontColor.getRed(), style.fontColor.getGreen(),
                style.fontColor.getBlue()));
        foregroundColor.setColorValue(new RGB(style.foregroundColor.getRed(), style.foregroundColor
View Full Code Here

    public void preApply() {
        updateBlackboard();
    }

    private void updateBlackboard() {
        StyleBlackboard styleBlackboard = getLayer().getStyleBlackboard();
        style = (VectorLegendStyle) styleBlackboard.get(VectorLegendStyleContent.ID);

        if (style == null) {
            style = VectorLegendStyleContent.createDefault();
            styleBlackboard.put(VectorLegendStyleContent.ID, style);
            styleBlackboard.setSelected(new String[]{VectorLegendStyleContent.ID});
        }

        RGB bg = backgroundColour.getColorValue();
        try {
            int bAlpha = Integer.parseInt(backgroundAlphaText.getText());
            style.backgroundColor = new Color(bg.red, bg.green, bg.blue, bAlpha);
        } catch (Exception e) {
            style.backgroundColor = new Color(bg.red, bg.green, bg.blue);
        }
        bg = foregroundColor.getColorValue();
        try {
            int fAlpha = Integer.parseInt(forgroundAlphaText.getText());
            style.foregroundColor = new Color(bg.red, bg.green, bg.blue, fAlpha);
        } catch (Exception e) {
            style.foregroundColor = new Color(bg.red, bg.green, bg.blue);
        }
        bg = fontColour.getColorValue();
        style.fontColor = new Color(bg.red, bg.green, bg.blue);

        style.xPos = Integer.parseInt(xposText.getText());
        style.yPos = Integer.parseInt(yposText.getText());
        style.legendHeight = Integer.parseInt(legHeightText.getText());
        style.legendWidth = Integer.parseInt(legWidthText.getText());
        style.boxWidth = Integer.parseInt(boxWidthText.getText());
        style.isRoundedRectangle = isroundedButton.getSelection();

        styleBlackboard.put(VectorLegendStyleContent.ID, style);
    }
View Full Code Here

        public void widgetSelected(SelectionEvent e) {
          int i = styleCombo.getSelectionIndex();
          if (i > -1) {
                        StyleImpl wmsStyle =
                            (StyleImpl) styles.get(i);
            StyleBlackboard bb = getLayer().getStyleBlackboard();
            bb.put(WMSStyleContent.WMSSTYLE, wmsStyle);
                        bb.setSelected(new String[]{WMSStyleContent.WMSSTYLE});
                        setDetails(wmsStyle);
          }
        }

        public void widgetDefaultSelected(SelectionEvent e) {
View Full Code Here

        layer.setStyleBlackboard(tmp.getStyleBlackboard());
        layer.setDefaultColor(tmp.getDefaultColor());
        layer.setName(tmp.getName());

        if( style!=null ){
            StyleBlackboard styleBlackboard = layer.getStyleBlackboard();
            styleBlackboard.put(SLDContent.ID, style);
        }
    map.getLayersInternal().add(layer);
        if( createRenderManager){
        map.setRenderManagerInternal(new RenderManagerImpl(){
               
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.internal.StyleBlackboard

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.