001    //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/branches/2.3_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: 20771 $, $Date: 2009-11-12 18:37:45 +0100 (Do, 12. Nov 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 selectedFor
068         * @param parent
069         * @param owner
070         */
071        public MapModelEntry( String identifier, String title, boolean hidden,
072                              LayerGroup parent, MapModel owner ) {
073            this.identifier = identifier;
074            this.title = title;
075            this.hidden = hidden;
076            this.selectedFor = new ArrayList<String>();
077            this.parent = parent;
078            this.owner = owner;
079        }
080    
081        /**
082         * @return the identifier
083         */
084        public String getIdentifier() {
085            return identifier;
086        }
087    
088        /**
089         * @return the title
090         */
091        public String getTitle() {
092            return title;
093        }
094    
095        /**
096         * @param title
097         *            the title to set
098         */
099        public void setTitle( String title ) {
100            this.title = title;
101        }
102    
103        /**
104         * @return the hidden
105         */
106        public boolean isHidden() {
107            return hidden;
108        }
109    
110        /**
111         * @param hidden
112         *            the hidden to set
113         */
114        public void setHidden( boolean hidden ) {
115            this.hidden = hidden;
116        }
117    
118        /**
119         * @return the selectedFor
120         */
121        public List<String> getSelectedFor() {
122            return selectedFor;
123        }
124    
125        /**
126         * @param selectedFor
127         *            the selectedFor to set
128         */
129        public void setSelectedFor( List<String> selectedFor ) {
130            this.selectedFor = selectedFor;
131        }
132    
133        /**
134         * @param selectedFor
135         *            the selectedFor to add
136         */
137        public void addSelectedFor( String selectedFor ) {
138            this.selectedFor.add( selectedFor );
139        }
140    
141        /**
142         * @param selectedFor
143         *            the selectedFor to remove
144         */
145        public void removeSelectedFor( String selectedFor ) {
146            this.selectedFor.remove( selectedFor );
147        }
148    
149        /**
150         * @return the parent
151         */
152        public LayerGroup getParent() {
153            return parent;
154        }
155    
156        /**
157         * @param parent
158         *            the parent to set
159         */
160        public void setParent( LayerGroup parent ) {
161            this.parent = parent;
162        }
163    
164        /**
165         * @return the owner
166         */
167        public MapModel getOwner() {
168            return owner;
169        }
170    
171        @Override
172        public String toString() {     
173            return getTitle();
174        }
175    }