Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.IBlackboard


     *
     * @param geometry The geometry to use as the AOI must be type Polygon or Multy Polygon
     */
    public void setGeometry( Geometry geometry ) {
        ILayer victim = getActiveLayer();
        IBlackboard mapBlackboard;
        if( victim != null ){
            IBlackboard blackboard = victim.getBlackboard();
            if( geometry != null ){
                blackboard.put(AOI_GEOMETRY, geometry );           
            }
            else {
                blackboard.remove(AOI_GEOMETRY);
            }
            mapBlackboard = victim.getMap().getBlackboard();
        }
        else {
            IMap activeMap = ApplicationGIS.getActiveMap();
View Full Code Here


    public Geometry getGeometry() {
        ILayer victim = getActiveLayer();
        if( victim == null ){
            return null;
        }
        IBlackboard blackboard = victim.getBlackboard();
        Geometry geometry = (Geometry) blackboard.get(AOI_GEOMETRY );
        return geometry;
    }
View Full Code Here

        if( layerId != null ){
            for( ILayer layer : map.getMapLayers() ){
                if( layerId.equals( layer.getID().toExternalForm())){
                    // we found a match!
                    // test if it has a geometry already
                    IBlackboard blackboard = layer.getBlackboard();
                    if( blackboard.get(AOI_GEOMETRY) == null ){
                        // try and restore from WKT
                        String wkt = map.getBlackboard().getString(AOI_GEOMETRY);
                        if( wkt != null ){
                            // we got one!
                            GeometryFactory gf = JTSFactoryFinder.getGeometryFactory(null);
                            WKTReader reader = new WKTReader(gf);
                            try {
                                Geometry geometry = reader.read(wkt);
                                blackboard.put(AOI_GEOMETRY, geometry );
                            } catch (ParseException e) {
                                // no can do!
                            }
                        }
                    }
View Full Code Here

    private CircleAnimation animation;

    public void draw(MapGraphicContext context) {
        if (this.animation == null) {
            ILayer layer = context.getLayer();
            IBlackboard blackboard = layer.getBlackboard();
            blackboard.putInteger("x", 0);
            blackboard.putInteger("y", 50);
            this.animation = new CircleAnimation(layer, context);
            AnimationUpdater.runTimer(context.getMapDisplay(), animation);
        }

    }
View Full Code Here

        public boolean hasNext() {
            return true;
        }

        public void nextFrame() {
            IBlackboard blackboard = layer.getBlackboard();
            int x = blackboard.getInteger("x");
            x += 30;
            if (x > display.getWidth()) {
                x = 0;
            }
            blackboard.putInteger("x", x);
        }
View Full Code Here

        }

        public void run(IProgressMonitor monitor) throws Exception {
            // only draw if layer is visible
            if( layer.isVisible() ){
                IBlackboard blackboard = layer.getBlackboard();
                int x = blackboard.getInteger("x");
                int y = blackboard.getInteger("y");
   
                graphics.drawOval(x, y, 30, 30);
            }

        }
View Full Code Here

     */
    public void cancelHideSelection( ILayer selectedLayer ){
        if( selectedLayer==null )
            return;

        IBlackboard properties = selectedLayer.getBlackboard();
        if( !PreferenceUtil.instance().hideSelectedLayers() ){
            properties.put(ProjectBlackboardConstants.MAP__RENDERING_FILTER, null);
            ((ViewportPane) selectedLayer.getMap().getRenderManager().getMapDisplay()).repaint();
            return;
        }


        Filter filter = (Filter) properties.get(ProjectBlackboardConstants.MAP__RENDERING_FILTER);
        if( filter==null )
            return;
        properties.put(ProjectBlackboardConstants.MAP__RENDERING_FILTER, null);
       
        Envelope env=(Envelope) properties.get(EDIT_FEATURE_BOUNDS);
        properties.put(EDIT_FEATURE_BOUNDS, null);
        selectedLayer.refresh(env);
    }
View Full Code Here

     * @param hidefeature if true then the features are hidden otherwise they will be shown again.
     */
    public void refreshLayer( ILayer selectedLayer, Set<String> fids, Envelope refreshBounds, boolean forceRefresh, boolean hidefeature ) {
        if( selectedLayer==null )
            return;
        IBlackboard properties = selectedLayer.getBlackboard();
        if( !PreferenceUtil.instance().hideSelectedLayers() ){
            properties.put(ProjectBlackboardConstants.MAP__RENDERING_FILTER, null);
            if(forceRefresh || !refreshBounds.isNull()){
              selectedLayer.refresh(refreshBounds);
            }
            ((ViewportPane) selectedLayer.getMap().getRenderManager().getMapDisplay()).repaint();
            return;
View Full Code Here

        if( graph == null ){
            // prompt or otherwise anny user?  
            System.out.println("Could not create a graph from the current selection");
            return;
        }
        IBlackboard blackboard = layer.getMap().getBlackboard();
        blackboard.put("graph", graph );
       
        try {
            makeGraphVisible( layer.getMap() );
        }
        catch (IOException notAvailable){           
View Full Code Here

   
    public PathMapGraphic() {
    }

    public void draw( MapGraphicContext context ) {
        IBlackboard mapboard = context.getMap().getBlackboard();
        List<Node> waypoints = (List<Node>) mapboard.get("waypoints");
        if( waypoints == null ){
            waypoints = Collections.emptyList();
        }
        List<Edge> path = (List<Edge>) mapboard.get("path");
        if( path == null ){
            path = Collections.emptyList();
        }       
        ViewportGraphics graphics = context.getGraphics();
        graphics.setColor( Color.BLACK);
View Full Code Here

TOP

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

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.