view src/java/de/intevation/mxd/reader/FeatureLayerReader.java @ 26:3e24fffdf2bb

Moved reader components to reader folder.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 08 Apr 2011 12:26:17 +0200
parents src/java/de/intevation/mxd/FeatureLayerReader.java@cbd67b1100d8
children 77cfa8092611
line wrap: on
line source
//package de.intevation.mxd.reader;

import java.io.IOException;

import org.apache.log4j.Logger;

import com.esri.arcgis.carto.ILayer;
import com.esri.arcgis.carto.FeatureLayer;
import com.esri.arcgis.geometry.ISpatialReference;
import com.esri.arcgis.geometry.ProjectedCoordinateSystem;
import com.esri.arcgis.geometry.IProjection;
import com.esri.arcgis.geometry.Projection;
import com.esri.arcgis.display.ISymbol;
import com.esri.arcgis.display.SimpleMarkerSymbol;
/**
 * Reads Layer information..
 *
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class FeatureLayerReader implements ILayerReader{

    private static final Logger logger = Logger.getLogger(FeatureLayerReader.class);

    private ILayer layer;

    //Constructor
    public FeatureLayerReader(ILayer layer){
        this.layer = layer;
    }

    //Methods
    /**
     * Reads the Layer content.
     */
    public boolean read() throws IOException{
        logger.debug("read()");
        if(layer instanceof FeatureLayer){
            FeatureLayer fl = (FeatureLayer)layer;
            System.out.println("--------------------");
            System.out.println("Layer information:");
            System.out.println("Layername\t\t = " + fl.getName());
            System.out.println("Min-/Maxscale\t = " + fl.getMinimumScale() +
                               "/" + fl.getMaximumScale());
            ISymbol symbol = fl.getSelectionSymbol();
            if(symbol instanceof SimpleMarkerSymbol)
                System.out.println("Symboltype\t\t = " +
                                   ((SimpleMarkerSymbol)symbol).getNameString());

            System.out.println("Status\t\t = " + fl.isVisible());
            System.out.println("Definition Query\t = " + fl.getDefinitionExpression());
            System.out.println("");
            return true;
        }
        else{
            System.out.println("Layer type unknown! " + layer.getClass().toString());
        }

        return false;
    }

    public void getLayer() throws IOException{
        logger.debug("getLayer() -> not implemented jet.");
        return;
    }
}
// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)