Package org.locationtech.udig.project.render.displayAdapter

Examples of org.locationtech.udig.project.render.displayAdapter.IMapDisplay


    protected void setTop( Rectangle rect ) {
        rect.y = LocationStyleContent.YPAD_TOP + rect.height;
    }

    protected boolean isMiddle( Rectangle rect ) {
        IMapDisplay display = getMapDisplay();

        int y = display.getHeight() / 2;
        y -= rect.height / 2;

        return rect.y == y;
    }
View Full Code Here


        return rect.y == y;
    }

    protected void setMiddle( Rectangle rect ) {
        IMapDisplay display = getMapDisplay();

        int y = display.getHeight() / 2;
        y -= rect.height / 2;

        rect.y = y;
    }
View Full Code Here

        rect.y = y;
    }

    protected boolean isBottom( Rectangle rect ) {
        IMapDisplay display = getMapDisplay();

        int y = display.getHeight() - LocationStyleContent.YPAD_BOTTOM - rect.height;

        return rect.y == y;
    }
View Full Code Here

        return rect.y == y;
    }

    protected void setBottom( Rectangle rect ) {
        IMapDisplay display = getMapDisplay();

        int y = display.getHeight() - LocationStyleContent.YPAD_BOTTOM - rect.height;

        rect.y = y;
    }
View Full Code Here

     * @return List of commands based on the current entry
     */
    @SuppressWarnings("unchecked")
    private List<UndoableMapCommand> processIntoCommands( EditToolHandler handler, ILayer layer,
            Entry<String, GeometryCreationUtil.Bag> entry ) {
        IMapDisplay display = handler.getContext().getMapDisplay();
        DrawCommandFactory drawfactory = handler.getContext().getDrawFactory();
        SimpleFeatureType schema = layer.getSchema();
        Class<Geometry> binding = (Class<Geometry>) schema.getGeometryDescriptor().getType()
                .getBinding();

View Full Code Here

     * Sets the map display to the new value.
     *
     * @generated
     */
    public void setDisplayGen(IMapDisplay newDisplay) {
        IMapDisplay oldDisplay = mapDisplay;
        mapDisplay = newDisplay;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    RenderPackage.RENDER_MANAGER__MAP_DISPLAY, oldDisplay,
                    mapDisplay));
View Full Code Here

            }
            Point upperLeft = currentContext.worldToPixel( new Coordinate( envelope.getMinX(), envelope.getMinY()) );
            Point bottomRight = currentContext.worldToPixel( new Coordinate( envelope.getMaxX(), envelope.getMaxY()) );
            Rectangle screenSize = new Rectangle( upperLeft );
            screenSize.add( bottomRight );
          IMapDisplay mapDisplay = currentContext.getMapDisplay();
           
          
             AbstractGridCoverage2DReader reader = (AbstractGridCoverage2DReader) geoResource.resolve( AbstractGridCoverage2DReader.class, monitor);
             if( reader == null ){
                 return; // unable to connect!
             }
             CoordinateReferenceSystem destinationCRS = currentContext.getCRS();
             ReferencedEnvelope bounds = (ReferencedEnvelope) currentContext.getImageBounds();
             bounds=bounds.transform(destinationCRS, true);
            
             ParameterValueGroup group = geoResource.resolve( ParameterValueGroup.class, monitor);
             if(group==null){
                 group=reader.getFormat().getReadParameters();
             }
             else{
                 // temporary fix for image-io (JG: what is the nature of this fix?)
                 try{
                     ParameterValue<?> jaiImageReaderParam = group.parameter(AbstractGridFormat.USE_JAI_IMAGEREAD.getName().toString());
                     if(jaiImageReaderParam!=null){
                         jaiImageReaderParam.setValue(false);
                     }
                 }catch (ParameterNotFoundException e) {
                     // do nothing
                 }
             }
             ParameterValue<?> readGridGeometry2DParam = group.parameter(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString());

//            GridEnvelope range = new GridEnvelope2D(0, 0, mapDisplay.getWidth(), mapDisplay.getHeight());
//            MathTransform displayToLayer = currentContext.worldToScreenMathTransform().inverse();
//            ReferencingFactoryFinder.getMathTransformFactory(null).createConcatenatedTransform(displayToLayer,
//                    currentContext.getLayer().mapToLayerTransform());
//            GridGeometry2D geom = new GridGeometry2D(range, displayToLayer, destinationCRS);
//            readGridGeometry2DParam.setValue(geom);

            GridEnvelope2D gridEnvelope = new GridEnvelope2D(0, 0, mapDisplay.getWidth(), mapDisplay.getHeight());
            org.opengis.geometry.Envelope env;
            double west= bounds.getMinX();
            double east= bounds.getMaxX();
            double south= bounds.getMinY();
            double north= bounds.getMaxY();
View Full Code Here

            }
            Point upperLeft = currentContext.worldToPixel( new Coordinate( envelope.getMinX(), envelope.getMinY()) );
            Point bottomRight = currentContext.worldToPixel( new Coordinate( envelope.getMaxX(), envelope.getMaxY()) );
            Rectangle screenSize = new Rectangle( upperLeft );
            screenSize.add( bottomRight );
          IMapDisplay mapDisplay = currentContext.getMapDisplay();
           
          CoordinateReferenceSystem destinationCRS = currentContext.getCRS();

            final IGeoResource geoResource = currentContext.getGeoResource();
            ReferencedEnvelope bounds = (ReferencedEnvelope) currentContext.getImageBounds();
            bounds=bounds.transform(destinationCRS, true);
           
            GridEnvelope range=new GridEnvelope2D(0,0, mapDisplay.getWidth(), mapDisplay.getHeight() );
           
            MathTransform displayToLayer=currentContext.worldToScreenMathTransform().inverse();
            ReferencingFactoryFinder.getMathTransformFactory(null).createConcatenatedTransform(displayToLayer, currentContext.getLayer().mapToLayerTransform());
            GridGeometry2D geom=new GridGeometry2D(range, displayToLayer, destinationCRS );
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.render.displayAdapter.IMapDisplay

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.