view src/java/de/intevation/mxd/reader/ClassBreakRendererReader.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/ClassBreakRendererReader.java@cbd67b1100d8
children 40c0b4e5f91a
line wrap: on
line source
//package de.intevation.mxd.reader;

import java.io.IOException;

import org.apache.log4j.Logger;

import com.esri.arcgis.carto.IFeatureRenderer;
import com.esri.arcgis.carto.ClassBreaksRenderer;

/**
 * Reads the ClassBreaksRender Object Attributes.
 *
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class ClassBreakRendererReader implements IRendererReader{

    //Member
    private static final Logger logger =
        Logger.getLogger(ClassBreakRendererReader.class);

    private ClassBreaksRenderer renderer;

    //Constructor
    public ClassBreakRendererReader(IFeatureRenderer renderer) throws Exception{
        logger.debug("contructor()");
        if(renderer instanceof ClassBreaksRenderer)
            this.renderer = (ClassBreaksRenderer)renderer;
        else
            throw new Exception("Not a ClassBreaksRenderer!");
    }


    //Methods
    public boolean read() throws IOException{
        logger.debug("read()");
        System.out.println("--------------------");
        System.out.println("Renderer information:");
        System.out.println("Ramp\t\t = " + renderer.getColorRamp());
        System.out.println("Class count\t\t = " + renderer.getClassCount());

        for(int i = 0; i < renderer.getClassCount(); i++){
            System.out.println("Class " + i + "\t\t = " + renderer.esri_getClass(i));
        }
        System.out.println("Break count\t\t = " + renderer.getBreakCount());
        for(int i = 0; i < renderer.getBreakCount(); i++){
            System.out.println("Break " + i + "\t\t = " + renderer.getBreak(i));
        }
        System.out.println("");
        return true;
    }

    public void getRenderer() throws IOException{
        logger.debug("getRenderer() -> not implemented jet.");
    }
}
// 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)