Package org.locationtech.udig.project

Examples of org.locationtech.udig.project.IMap


    // valid button = left click.
    if (!(e.button == MapMouseEvent.BUTTON1)) {
      return;
    }

    IMap map = ApplicationGIS.getActiveMap();
    Point point = e.getPoint();
    Coordinate newCoord = map.getViewportModel().pixelToWorld(point.x, point.y);
    broadcastCoordinate(newCoord);
  }
View Full Code Here


     * @param attributeName
     * @param obj
     */
    private boolean set(final String attributeName, final Object obj, IProgressMonitor monitor) {
        final FeatureId fid = feature.getIdentifier();
        final IMap map = ApplicationGIS.getActiveMap();
        if (map != null) {
            return setOnMap(map, fid, attributeName, obj);
        } else {
            return setOnGeoResource(fid, attributeName, obj, monitor);
        }
View Full Code Here

                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
                g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
                g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
                g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
               
                IMap map = getContext().getMap();
                Object object = map.getBlackboard().get(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR);
                if( object==null ){
                    IPreferenceStore store = ProjectPlugin.getPlugin().getPreferenceStore();
                    RGB background = PreferenceConverter.getColor(store, PreferenceConstants.P_BACKGROUND);
                    map.getBlackboard().put(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR, new Color(background.red, background.green, background.blue ));
                    object = map.getBlackboard().get(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR);
                }
                g.setBackground((Color) object);
                g.clearRect(0,0,copy.getWidth(), copy.getHeight());
               
                SortedSet<RenderExecutor> executors;
View Full Code Here

                g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
                g.setRenderingHint(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE);
                g.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_OFF);
                g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
               
                IMap map = getContext().getMap();
                Object object = map.getBlackboard().get(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR);
                if( object==null ){
                    IPreferenceStore store = ProjectPlugin.getPlugin().getPreferenceStore();
                    RGB background = PreferenceConverter.getColor(store, PreferenceConstants.P_BACKGROUND);
                    map.getBlackboard().put(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR, new Color(background.red, background.green, background.blue ));
                    object = map.getBlackboard().get(ProjectBlackboardConstants.MAP__BACKGROUND_COLOR);
                }
                g.setBackground((Color) object);
                g.clearRect(0,0,copy.getWidth(), copy.getHeight());
               
                SortedSet<RenderExecutor> executors;
View Full Code Here

* @since 1.1.0
*/
public class CurrentShapeTypePropertyValue implements PropertyValue {

    public boolean isTrue( Object object, String value ) {
        IMap map = ApplicationGIS.getActiveMap();
        if( map==ApplicationGIS.NO_MAP || map.getMapLayers().size()==0 )
            return false;
        PrimitiveShape shape = (PrimitiveShape) map.getBlackboard().get(EditToolHandler.CURRENT_SHAPE);
        if( shape==null )
            return false;
       
        return shape.getEditGeom()!=null && shape.getEditGeom().getShapeType().toString().equalsIgnoreCase(value.trim());
    }
View Full Code Here

public class SplitLineOp implements IOp {

    public void op( Display display, Object target, IProgressMonitor monitor ) throws Exception {
        Point[] points=(Point[]) target;
       
        IMap map = ApplicationGIS.getActiveMap();
       
        EditBlackboard editBlackboard = EditBlackboardUtil.getEditBlackboard(ApplicationGIS.createContext(map),
                map.getEditManager().getSelectedLayer());
       
        ShapeProvider shapeProvider=new ShapeProvider(map);
       
         map.sendCommandASync(new SplitLineCommand(editBlackboard, shapeProvider,
                 new EditFeatureProvider(map), new EditLayerProvider(map),
                 new HashSet<Point>(Arrays.asList(points))));
    }
View Full Code Here

        assertEquals(IssueChangeType.RESOLUTION, l.change);
    }
   
    @Test
    public void testPersistence() throws Exception {
        IMap map=MapTests.createDefaultMap("name", 1, true, new Dimension(10,10)); //$NON-NLS-1$
        ILayer layer=map.getMapLayers().get(0);
        FeatureCollection<SimpleFeatureType, SimpleFeature> collection = layer.getResource(FeatureSource.class, null).getFeatures();
        SimpleFeature feature=collection.features().next();
       
        IIssue original=new FeatureIssue(Priority.WARNING, "test description", layer, feature, "groupID"); //$NON-NLS-1$ //$NON-NLS-2$
        XMLMemento memento=XMLMemento.createWriteRoot("memento"); //$NON-NLS-1$
View Full Code Here

        ViewportGraphics g = context.getGraphics();
        g.setColor(Color.RED);
        g.setStroke(ViewportGraphics.LINE_SOLID, 2);

        // get the map blackboard
        IMap map = context.getLayer().getMap();
        IBlackboard blackboard = context.getLayer().getMap().getBlackboard();

        List<Coordinate> coordinates = (List<Coordinate>) blackboard.get("locations");

        if (coordinates == null) {
View Full Code Here

            }
        }
    }

    private void getCoverageResources() throws IOException {
        IMap activeMap = ApplicationGIS.getActiveMap();
        List<ILayer> mapLayers = activeMap.getMapLayers();
        itemsMap.clear();
        for( ILayer layer : mapLayers ) {
            IGeoResource geoResource = layer.getGeoResource();
            if (geoResource.canResolve(GridCoverage.class)) {
                itemsMap.put(geoResource.getTitle(), geoResource);
View Full Code Here

     * @see org.locationtech.udig.ui.operations.IOp#op(org.eclipse.swt.widgets.Display,
     *      java.lang.Object, org.eclipse.core.runtime.IProgressMonitor)
     */
    public void op( final Display display, Object target, IProgressMonitor monitor )
            throws Exception {
        IMap map = (IMap) target;

        Exception e = null;

        int featureCount = 0;
        for( ILayer layer : map.getMapLayers() ) {
            if (layer.isType(FeatureSource.class) && layer.isVisible()) {
                try {
                    FeatureSource<SimpleFeatureType, SimpleFeature> source = layer.getResource(FeatureSource.class, monitor);
                    Filter filter = layer.createBBoxFilter(map.getViewportModel().getBounds(),
                            monitor);
                    FeatureCollection<SimpleFeatureType, SimpleFeature>  results = source.getFeatures(new DefaultQuery(layer.getSchema()
                            .getName().getLocalPart(), filter));
                    int count = results.size();
                    // FeatureReader<SimpleFeatureType, SimpleFeature> reader=results.reader()
View Full Code Here

TOP

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

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.