    001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.4_testing/src/org/deegree/portal/context/MapModelEntry.java $
    002    /*----------------------------------------------------------------------------
    003     This file is part of deegree, http://deegree.org/
    004     Copyright (C) 2001-2009 by:
    005     - Department of Geography, University of Bonn -
    006     and
    007     - lat/lon GmbH -
    008
    009     This library is free software; you can redistribute it and/or modify it under
    010     the terms of the GNU Lesser General Public License as published by the Free
    011     Software Foundation; either version 2.1 of the License, or (at your option)
    012     any later version.
    013     This library is distributed in the hope that it will be useful, but WITHOUT
    014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
    015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
    016     details.
    017     You should have received a copy of the GNU Lesser General Public License
    018     along with this library; if not, write to the Free Software Foundation, Inc.,
    019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    020
    021     Contact information:
    022
    023     lat/lon GmbH
    024     Aennchenstr. 19, 53177 Bonn
    025     Germany
    026     http://lat-lon.de/
    027
    028     Department of Geography, University of Bonn
    029     Prof. Dr. Klaus Greve
    030     Postfach 1147, 53001 Bonn
    031     Germany
    032     http://www.geographie.uni-bonn.de/deegree/
    033
    034     e-mail: info@deegree.org
    035     ----------------------------------------------------------------------------*/
    036    package org.deegree.portal.context;
    037
    038    import java.util.ArrayList;
    039    import java.util.List;
    040
    041    /**
    042     * TODO add class documentation here
    043     *
    044     * @author <a href="mailto:name@deegree.org">Andreas Poth</a>
    045     * @author last edited by: $Author: apoth $
    046     *
    047     * @version $Revision: 21671 $, $Date: 2009-12-29 09:43:44 +0100 (Di, 29. Dez 2009) $
    048     */
    049    public class MapModelEntry {
    050
    051        private String identifier;
    052
    053        private String title;
    054
    055        private boolean hidden;
    056
    057        protected List<String> selectedFor;
    058
    059        protected LayerGroup parent;
    060
    061        protected MapModel owner;
    062
    063        /**
    064         * @param identifier
    065         * @param title
    066         * @param hidden
    067         * @param parent
    068         * @param owner
    069         */
    070        public MapModelEntry( String identifier, String title, boolean hidden, LayerGroup parent, MapModel owner ) {
    071            this.identifier = identifier;
    072            this.title = title;
    073            this.hidden = hidden;
    074            this.selectedFor = new ArrayList<String>();
    075            this.parent = parent;
    076            this.owner = owner;
    077        }
    078
    079        /**
    080         * @return the identifier
    081         */
    082        public String getIdentifier() {
    083            return identifier;
    084        }
    085
    086        /**
    087         * @return the title
    088         */
    089        public String getTitle() {
    090            return title;
    091        }
    092
    093        /**
    094         * @param title
    095         *            the title to set
    096         */
    097        public void setTitle( String title ) {
    098            this.title = title;
    099        }
    100
    101        /**
    102         * @return the hidden
    103         */
    104        public boolean isHidden() {
    105            return hidden;
    106        }
    107
    108        /**
    109         * @param hidden
    110         *            the hidden to set
    111         */
    112        public void setHidden( boolean hidden ) {
    113            this.hidden = hidden;
    114        }
    115
    116        /**
    117         * @return the selectedFor
    118         */
    119        public List<String> getSelectedFor() {
    120            return selectedFor;
    121        }
    122
    123        /**
    124         * @param selectedFor
    125         *            the selectedFor to set
    126         */
    127        public void setSelectedFor( List<String> selectedFor ) {
    128            this.selectedFor = selectedFor;
    129        }
    130
    131        /**
    132         * @param selectedFor
    133         *            the selectedFor to add
    134         */
    135        public void addSelectedFor( String selectedFor ) {
    136            this.selectedFor.add( selectedFor );
    137        }
    138
    139        /**
    140         * @param selectedFor
    141         *            the selectedFor to remove
    142         */
    143        public void removeSelectedFor( String selectedFor ) {
    144            this.selectedFor.remove( selectedFor );
    145        }
    146
    147        /**
    148         * @return the parent
    149         */
    150        public LayerGroup getParent() {
    151            return parent;
    152        }
    153
    154        /**
    155         * @param parent
    156         *            the parent to set
    157         */
    158        public void setParent( LayerGroup parent ) {
    159            this.parent = parent;
    160        }
    161
    162        /**
    163         * @return the owner
    164         */
    165        public MapModel getOwner() {
    166            return owner;
    167        }
    168
    169        @Override
    170        public String toString() {
    171            return getTitle();
    172        }
    173
    174        /*
    175         * (non-Javadoc)
    176         *
    177         * @see java.lang.Object#equals(java.lang.Object)
    178         */
    179        @Override
    180        public boolean equals( Object obj ) {
    181            if ( obj instanceof MapModelEntry ) {
    182                return getIdentifier().equals( ( (MapModelEntry) obj ).getIdentifier() );
    183            }
    184            return false;
    185        }
    186    }