Examples of IStyleBlackboard


Examples of org.locationtech.udig.project.IStyleBlackboard

     * @param metrics
     * @return A rating for a given metric.  The lower the rating the better fit the metric is.
     */
    private double rate( InternalRenderMetrics metrics ) {
        ILayer layer = metrics.getRenderContext().getLayer();
        final IStyleBlackboard style = layer.getStyleBlackboard();
       
        //render metrics -
        //guarenteed to be between 0 & 1 - higher better so we subtract one to get make lower better
        double renderAppearanceMetric = 1 - metrics.getUserAppearanceMetric(style);
        double userAppearanceMetric = 1 - metrics.getRenderAppearanceMetric(style);
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

                Coordinate c2 = context.getMap().getViewportModel().pixelToWorld(end.x, end.y);

                Envelope newRegionBounds = new Envelope(c1, c2);

                ILayer processingRegionLayer = OmsBoxPlugin.getDefault().getProcessingRegionMapGraphic();
                IStyleBlackboard blackboard = processingRegionLayer.getStyleBlackboard();
                ProcessingRegionStyle style = (ProcessingRegionStyle) blackboard.get(ProcessingRegionStyleContent.ID);
                if (style == null) {
                    style = ProcessingRegionStyleContent.createDefault();
                }
                ProcessingRegion processinRegion = new ProcessingRegion(style.west, style.east, style.south, style.north,
                        style.rows, style.cols);
                ProcessingRegion newProcessingRegion = ProcessingRegion.adaptActiveRegionToEnvelope(newRegionBounds,
                        processinRegion);

                style.north = newProcessingRegion.getNorth();
                style.south = newProcessingRegion.getSouth();
                style.east = newProcessingRegion.getEast();
                style.west = newProcessingRegion.getWest();
                style.rows = newProcessingRegion.getRows();
                style.cols = newProcessingRegion.getCols();

                blackboard.put(ProcessingRegionStyleContent.ID, style);

                processingRegionLayer.refresh(null);

                newRegionBounds = newProcessingRegion.getEnvelope();
                sendSelectionCommand(e, newRegionBounds);
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

   
    @Override
    public ReferencedEnvelope getExtent() {
        ILayer processingRegionLayer = OmsBoxPlugin.getDefault().getProcessingRegionMapGraphic();
        if (processingRegionLayer != null) {
            IStyleBlackboard blackboard = processingRegionLayer.getStyleBlackboard();
            ProcessingRegionStyle style = (ProcessingRegionStyle) blackboard.get(ProcessingRegionStyleContent.ID);
            if (style == null) {
                style = ProcessingRegionStyleContent.createDefault();
            }
            ProcessingRegion processinRegion = new ProcessingRegion(style.west, style.east, style.south, style.north, style.rows,
                    style.cols);
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

                    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( GeoTools.getDefaultHints() );
                    Filter cut= ff.not( ff.within( ff.property( targetGeomName ), ff.literal(hole) ) );
                   
                    //put it on style blackboard
                    //Key:  ProjectBlackboardConstants    String LAYER__DATA_QUERY = "org.locationtech.udig.project.view"; //$NON-NLS-1$
                    IStyleBlackboard styleBlackboard = layer.getStyleBlackboard();
                    styleBlackboard.put(ProjectBlackboardConstants.LAYER__DATA_QUERY, cut);
                }
            }

            public Command copy() {
                return this;
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

     * @param metrics
     * @return A rating for a given metric. The lower the rating the better fit the metric is.
     */
    private double rate( AbstractRenderMetrics metrics ) {
        ILayer layer = metrics.getRenderContext().getLayer();
        final IStyleBlackboard style = layer.getStyleBlackboard();

        // render metrics -
        // guarenteed to be between 0 & 1 - higher better so we subtract one to get make lower
        // better
        double renderAppearanceMetric = 1 - metrics.getUserAppearanceMetric(style);
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

        }

        Dimension screen = context.getMapDisplay().getDisplaySize();

        // get the active region
        IStyleBlackboard blackboard = context.getLayer().getStyleBlackboard();
        ProcessingRegionStyle style = (ProcessingRegionStyle) blackboard.get(ProcessingRegionStyleContent.ID);
        if (style == null) {
            style = ProcessingRegionStyleContent.createDefault();
            blackboard.put(ProcessingRegionStyleContent.ID, style);
        }

        Coordinate ul = new Coordinate(style.west, style.north);
        Coordinate ur = new Coordinate(style.east, style.north);
        Coordinate ll = new Coordinate(style.west, style.south);
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

        }

    }

    private Rectangle getGraphicLocation( MapGraphicContext context ) {
        IStyleBlackboard styleBlackboard = context.getLayer().getStyleBlackboard();
        Rectangle location = (Rectangle) styleBlackboard.get(
                LocationStyleContent.ID);
        if (location == null) {
            location = LocationStyleContent.createDefaultStyle();
            styleBlackboard.put(LocationStyleContent.ID, location);
        }
        return location;
    }
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

        }
        return location;
    }

    private FontStyle getFontStyle( MapGraphicContext context ) {
        IStyleBlackboard styleBlackboard = context.getLayer().getStyleBlackboard();
        FontStyle style = (FontStyle) styleBlackboard.get(FontStyleContent.ID);
        if (style == null) {
            style = new FontStyle();
            styleBlackboard.put(FontStyleContent.ID, style);
        }
        return style;
    }
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

        }
        return style;
    }

    private BarStyle getBarStyle( MapGraphicContext context ) {
        IStyleBlackboard styleBlackboard = context.getLayer().getStyleBlackboard();
        BarStyle style = (BarStyle) styleBlackboard.get(BarStyleContent.ID);
        if (style == null) {
            style = new BarStyle();
            styleBlackboard.put(BarStyleContent.ID, style);
        }
        return style;

    }
View Full Code Here

Examples of org.locationtech.udig.project.IStyleBlackboard

     *
     * @param layer {@link ILayer}
     * @return {@link FontStyle}
     */
    public static FontStyle getFontStyle(MapGraphicContext context) {
        IStyleBlackboard styleBlackboard = context.getLayer().getStyleBlackboard();
        FontStyle style = (FontStyle) styleBlackboard.get(FontStyleContent.ID);
        if (style == null) {
            style = new FontStyle();
            styleBlackboard.put(FontStyleContent.ID, style);
        }
        return style;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.