view src/java/de/intevation/mxd/reader/MarkerLineSymbolReader.java @ 324:5e7e6d99f997

Make mapserver install location version independent * src/java/de/intevation/mxd/writer/MapScriptWriter.java, mxd/connections/SDE/sde_areas.txt, contrib/installer/bin/ms_6.1-dev/Readme.txt, contrib/installer/bin/MXD2map-Shell.bat, INSTALL.txt HowTo-Release.txt: Make mapserver install location version independent s/ms-6.1-dev/mapserver/g
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 15 Oct 2012 09:02:01 +0000
parents df4e0946ef02
children a46adb3697fa
line wrap: on
line source
/*
 * Copyright (c) 2011 by Intevation GmbH, Germany <info@intevation.de>
 *
 * This file is part of MXD2map.
 *
 * This program is free software under the LGPL (>=v2.1)
 * Read the file LICENCE.txt coming with the software for details
 * or visit http://www.gnu.org/licenses/ if it does not exist.
 *
 * MXD2map has been developed on behalf of the
 * Bundesamt fuer Seeschifffahrt und Hydrographie (BSH) in Hamburg
 * by Intevation GmbH.
 *
 * Authors:
 * Raimund Renkert <raimund.renkert@intevation.de>
 * Bjoern Schilberg <bjoern.schilberg@intevation.de>
 * Stephan Holl <stephan.holl@intevation.de>
 */

package de.intevation.mxd.reader;

import org.apache.log4j.Logger;

import com.esri.arcgis.display.ISymbol;
import com.esri.arcgis.display.ILineSymbol;
import com.esri.arcgis.display.IMarkerSymbol;
import com.esri.arcgis.display.MarkerLineSymbol;
import com.esri.arcgis.display.MultiLayerMarkerSymbol;

import org.w3c.dom.Element;

/**
 * Reads marker line symbol information.
 *
 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
 */
public class MarkerLineSymbolReader
extends AbstractSymbolReader {

    /**
     * The logger.
     */
    private static final Logger logger =
        Logger.getLogger(MarkerLineSymbolReader.class);

    /**
     * Private member.
     */
    private MarkerLineSymbol symbol;

    /**
     * Constructor with symbol.
     *
     * @param symbol The symbol used to display lines.
     */
    public MarkerLineSymbolReader(ISymbol symbol)
    throws Exception {
        logger.debug("contructor()");
        if(symbol instanceof MarkerLineSymbol) {
            this.symbol = (MarkerLineSymbol)symbol;
        }
        else {
            throw new Exception("Not a MarkerLineSymbol!");
        }
    }

    /**
     * Constructor with symbol.
     *
     * @param symbol The symbol used to display lines.
     */
    public MarkerLineSymbolReader(ILineSymbol symbol)
    throws Exception {
        logger.debug("contructor()");
        if(symbol instanceof MarkerLineSymbol) {
            this.symbol = (MarkerLineSymbol)symbol;
        }
        else {
            throw new Exception("Not a MarkerLineSymbol!");
        }
    }

    /**
     * Reads the symbol attributes.
     *
     * @return The XML node.
     */
    public Element read() {
        logger.debug("read()");
        try {
            IMarkerSymbol sym = symbol.getMarkerSymbol();
            if(sym instanceof MultiLayerMarkerSymbol) {
                ISymbolReader sreader = new MultiLayerMarkerSymbolReader(sym);
                sreader.setParent(parent);
                sreader.setUtil(util);
                sreader.read();
            }
            else {
                logger.debug("The type of " + sym.getClass().toString() +
                             " is not implemented!");
            }
        }
        catch(Exception e) {
            logger.error(
                "Could not read the symbol " +
                symbol.getClass().toString());
        }
        return parent;
    }
}
// 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)