001: //$HeadURL: https://svn.wald.intevation.org/svn/deegree/base/trunk/src/org/deegree/portal/context/JSPFrontend.java $
002: /*---------------- FILE HEADER ------------------------------------------
003:
004: This file is part of deegree.
005: Copyright (C) 2001-2008 by:
006: EXSE, Department of Geography, University of Bonn
007: http://www.giub.uni-bonn.de/deegree/
008: lat/lon GmbH
009: http://www.lat-lon.de
010:
011: This library is free software; you can redistribute it and/or
012: modify it under the terms of the GNU Lesser General Public
013: License as published by the Free Software Foundation; either
014: version 2.1 of the License, or (at your option) any later version.
015:
016: This library is distributed in the hope that it will be useful,
017: but WITHOUT ANY WARRANTY; without even the implied warranty of
018: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
019: Lesser General Public License for more details.
020:
021: You should have received a copy of the GNU Lesser General Public
022: License along with this library; if not, write to the Free Software
023: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
024:
025: Contact:
026:
027: Andreas Poth
028: lat/lon GmbH
029: Aennchenstr. 19
030: 53115 Bonn
031: Germany
032: E-Mail: poth@lat-lon.de
033:
034: Prof. Dr. Klaus Greve
035: Department of Geography
036: University of Bonn
037: Meckenheimer Allee 166
038: 53115 Bonn
039: Germany
040: E-Mail: greve@giub.uni-bonn.de
041:
042:
043: ---------------------------------------------------------------------------*/
044: package org.deegree.portal.context;
045:
046: import java.util.ArrayList;
047:
048: /**
049: * this class encapsulates the description of the front end of a GUI setting up on a web map
050: * context. this is a deegree specific form of description. beside the general elements inherited
051: * from AbstractFrontend three additional elements are offered:
052: * <ul>
053: * <li>commonJS: a list of javascript files containing objects and methods to be used by more than
054: * one module of the GUI
055: * <li>buttons: a javascript file containing a associative array (Map) for the used buttons
056: * <li>style: css-style file
057: * </ul>
058: *
059: * @version $Revision: 9346 $
060: * @author <a href="mailto:poth@lat-lon.de">Andreas Poth</a>
061: */
062: public class JSPFrontend extends AbstractFrontend {
063: private ArrayList<String> commonJS = new ArrayList<String>();
064:
065: private String buttons = null;
066:
067: private String style = null;
068:
069: private String header = null;
070:
071: private String footer = null;
072:
073: /**
074: * Creates a new Frontend object.
075: *
076: * @param controller
077: * name of the controlle JSP file
078: * @param style
079: * name of the css style file
080: * @param buttons
081: * name of the js-file containing a llist (Map) of the used buttons (images)
082: * @param commonJS
083: * list of js-files with common used object and methods
084: * @param west
085: * gui description for west area
086: * @param east
087: * gui description for east area
088: * @param south
089: * gui description for south area
090: * @param north
091: * gui description for north area
092: * @param center
093: * gui description for central area
094: * @param header
095: * JSP header page/file
096: * @param footer
097: * JSP footer page/file
098: */
099: public JSPFrontend(String controller, GUIArea west, GUIArea east,
100: GUIArea south, GUIArea north, GUIArea center, String style,
101: String buttons, String[] commonJS, String header,
102: String footer) {
103: super (controller, west, east, south, north, center);
104: setStyle(style);
105: setButtons(buttons);
106: setCommonJS(commonJS);
107: setHeader(header);
108: setFooter(footer);
109: }
110:
111: /**
112: * returns the name of the css style file to be used by the gui
113: *
114: * @return the name of the css style file to be used by the gui
115: */
116: public String getStyle() {
117: return style;
118: }
119:
120: /**
121: * returns the name of a javascript file containing a associative array (Map) for the used
122: * buttons (images). If this is <tt>null</tt> HTML standard buttons shall be used in the gui
123: *
124: * @return name of a javascript file containing a associative array for the used buttons
125: */
126: public String getButtons() {
127: return buttons;
128: }
129:
130: /**
131: * returns a list of javascript files containing objects and methods to be used by more than one
132: * module of the GUI
133: *
134: * @return list of javascript files common for all modules
135: */
136: public String[] getCommonJS() {
137: return commonJS.toArray(new String[commonJS.size()]);
138: }
139:
140: /**
141: * sets the name of the css style file to be used by the gui
142: *
143: * @param style
144: */
145: public void setStyle(String style) {
146: this .style = style;
147: }
148:
149: /**
150: * sets the name of a javascript file containing a associative array (Map) for the used buttons
151: * (images). If this is <tt>null</tt> HTML standard buttons shall be used in the gui
152: *
153: * @param buttons
154: */
155: public void setButtons(String buttons) {
156: this .buttons = buttons;
157: }
158:
159: /**
160: * sets a list of javascript files containing objects and methods to be used by more than one
161: * module of the GUI
162: *
163: * @param commonJS
164: */
165: public void setCommonJS(String[] commonJS) {
166: if (commonJS != null) {
167: for (int i = 0; i < commonJS.length; i++) {
168: this .commonJS.add(commonJS[i]);
169: }
170: }
171: }
172:
173: /**
174: * adds the name of a javascript file containing objects and methods to be used by more than one
175: * module of the GUI
176: *
177: * @param commonJS
178: */
179: public void addCommonJS(String commonJS) {
180: this .commonJS.add(commonJS);
181: }
182:
183: /**
184: * removes the name of a javascript file containing objects and methods to be used by more than
185: * one module of the GUI
186: *
187: * @param commonJS
188: */
189: public void removeCommonJS(String commonJS) {
190: this .commonJS.remove(commonJS);
191: }
192:
193: /**
194: * returns the name of the header JSP page/file. If the returned value is null, no header shall
195: * be used
196: *
197: * @return name of the header JSP page/file
198: */
199: public String getHeader() {
200: return header;
201: }
202:
203: /**
204: * sets the name of the header JSP page/file
205: *
206: * @param header
207: */
208: public void setHeader(String header) {
209: this .header = header;
210: }
211:
212: /**
213: * returns the name of the footer JSP page/file. If the returned value is null, no footer shall
214: * be used
215: *
216: * @return name of the footer JSP page/file
217: */
218: public String getFooter() {
219: return footer;
220: }
221:
222: /**
223: * sets the name of the footer JSP page/file
224: *
225: * @param footer
226: */
227: public void setFooter(String footer) {
228: this.footer = footer;
229: }
230:
231: }
|