01: /*---------------- FILE HEADER ------------------------------------------
02:
03: This file is part of deegree.
04: Copyright (C) 2001 by:
05: EXSE, Department of Geography, University of Bonn
06: http://www.giub.uni-bonn.de/exse/
07: lat/lon Fitzke/Fretter/Poth GbR
08: http://www.lat-lon.de
09:
10: This library is free software; you can redistribute it and/or
11: modify it under the terms of the GNU Lesser General Public
12: License as published by the Free Software Foundation; either
13: version 2.1 of the License, or (at your option) any later version.
14:
15: This library is distributed in the hope that it will be useful,
16: but WITHOUT ANY WARRANTY; without even the implied warranty of
17: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18: Lesser General Public License for more details.
19:
20: You should have received a copy of the GNU Lesser General Public
21: License along with this library; if not, write to the Free Software
22: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23:
24: Contact:
25:
26: Andreas Poth
27: lat/lon Fitzke/Fretter/Poth GbR
28: Meckenheimer Allee 176
29: 53115 Bonn
30: Germany
31: E-Mail: poth@lat-lon.de
32:
33: Jens Fitzke
34: Department of Geography
35: University of Bonn
36: Meckenheimer Allee 166
37: 53115 Bonn
38: Germany
39: E-Mail: jens.fitzke@uni-bonn.de
40:
41:
42: ---------------------------------------------------------------------------*/
43: package de.latlon.deejump.plugin.style;
44:
45: import com.vividsolutions.jump.workbench.ui.renderer.style.SquareVertexStyle;
46: import com.vividsolutions.jump.workbench.ui.renderer.style.VertexStyle;
47:
48: /**
49: * ...
50: *
51: * @author <a href="mailto:taddei@lat-lon.de">Ugo Taddei</a>
52: *
53: */
54: public class VertexStylesFactory {
55:
56: public static final String SQUARE_STYLE = "SQUARE";
57:
58: public static final String CIRCLE_STYLE = "CIRCLE";
59:
60: public static final String TRIANGLE_STYLE = "TRIANGLE";
61:
62: public static final String STAR_STYLE = "STAR";
63:
64: public static final String CROSS_STYLE = "CROSS";
65:
66: public static final String BITMAP_STYLE = "BITMAP";
67:
68: private VertexStylesFactory() {
69: //prevents init
70: }
71:
72: public static final VertexStyle createVertexStyle(
73: String wellKnowName) {
74:
75: VertexStyle vStyle = null;
76:
77: if (SQUARE_STYLE.equals(wellKnowName)) {
78: vStyle = new SquareVertexStyle();
79: } else if (CIRCLE_STYLE.equals(wellKnowName)) {
80: vStyle = new CircleVertexStyle();
81: } else if (TRIANGLE_STYLE.equals(wellKnowName)) {
82: vStyle = new TriangleVertexStyle();
83: } else if (STAR_STYLE.equals(wellKnowName)) {
84: vStyle = new StarVertexStyle();
85: } else if (CROSS_STYLE.equals(wellKnowName)) {
86: vStyle = new CrossVertexStyle();
87: } else {
88: vStyle = new BitmapVertexStyle(wellKnowName);
89: }
90: //FIXME if none of the above? or wrong URL?
91:
92: return vStyle;
93: }
94: }
|