teichmann@5863: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5863: * Software engineering by Intevation GmbH teichmann@5863: * teichmann@5994: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5863: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5994: * documentation coming with Dive4Elements River for details. teichmann@5863: */ teichmann@5863: teichmann@5831: package org.dive4elements.river.themes; ingo@340: ingo@340: import org.w3c.dom.Document; ingo@340: import org.w3c.dom.Node; ingo@340: ingo@340: ingo@340: /** ingo@340: * @author Ingo Weinzierl ingo@340: */ ingo@340: public interface Theme { ingo@340: ingo@340: /** ingo@340: * Method to initialize the theme. ingo@340: * ingo@340: * @param config The configuration node. ingo@340: */ ingo@340: void init(Node config); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the name of the theme. ingo@340: * ingo@340: * @return the name of the theme. ingo@340: */ ingo@340: String getName(); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the description of the theme. ingo@340: * ingo@340: * @return the description of the theme. ingo@340: */ ingo@340: String getDescription(); ingo@340: ingo@340: ingo@1668: String getFacet(); ingo@1668: ingo@1668: void setFacet(String facet); ingo@1668: ingo@1668: int getIndex(); ingo@1668: ingo@1668: void setIndex(int index); ingo@1668: ingo@1668: ingo@340: /** ingo@340: * Adds a new attribute. ingo@340: * ingo@340: * @param name The name of the attribute. ingo@340: * @param value The value of the attribute. ingo@340: */ ingo@340: void addAttribute(String name, String value); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the value of a specific attribute. ingo@340: * ingo@340: * @param name the name of the attribute. ingo@340: * ingo@340: * @return the value of the attribute name. ingo@340: */ ingo@340: String getAttribute(String name); ingo@340: ingo@340: ingo@340: /** ingo@340: * Adds a new field to the theme. ingo@340: * ingo@340: * @param name The name of the field. ingo@340: * @param field The field. ingo@340: */ ingo@340: void addField(String name, ThemeField field); ingo@340: ingo@340: ingo@340: /** ingo@340: * Sets the value of an field. ingo@340: * ingo@340: * @param name The name of the field. ingo@340: * @param value The new value of the field. ingo@340: */ ingo@340: void setFieldValue(String name, Object value); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the field specified by name. ingo@340: * ingo@340: * @param name The name of the desired field. ingo@340: * ingo@340: * @return an field. ingo@340: */ ingo@340: ThemeField getField(String name); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the typename of a field. ingo@340: * ingo@340: * @param name the name of the field. ingo@340: * ingo@340: * @return the typename of a field. ingo@340: */ ingo@340: String getFieldType(String name); ingo@340: ingo@340: ingo@340: /** ingo@340: * Returns the value of a field. ingo@340: * ingo@340: * @param name The name of the field. ingo@340: * ingo@340: * @return the value of a field. ingo@340: */ ingo@340: Object getFieldValue(String name); ingo@340: ingo@340: ingo@340: /** ingo@340: * Dumps the theme to XML. ingo@340: * ingo@340: * @return a document. ingo@340: */ ingo@340: Document toXML(); ingo@340: } ingo@340: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :