svn-gvsig-desktop / branches / Mobile_Compatible_Hito_1 / libFMap_mapcontext / src / org / gvsig / fmap / mapcontext / rendering / legend / styling / AbstractLabelingMethod.java @ 22123
History | View | Annotate | Download (2.67 KB)
1 | 21200 | vcaballero | /* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2005 IVER T.I. and Generalitat Valenciana.
|
||
4 | *
|
||
5 | * This program is free software; you can redistribute it and/or
|
||
6 | * modify it under the terms of the GNU General Public License
|
||
7 | * as published by the Free Software Foundation; either version 2
|
||
8 | * of the License, or (at your option) any later version.
|
||
9 | *
|
||
10 | * This program is distributed in the hope that it will be useful,
|
||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
13 | * GNU General Public License for more details.
|
||
14 | *
|
||
15 | * You should have received a copy of the GNU General Public License
|
||
16 | * along with this program; if not, write to the Free Software
|
||
17 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
||
18 | *
|
||
19 | * For more information, contact:
|
||
20 | *
|
||
21 | * Generalitat Valenciana
|
||
22 | * Conselleria d'Infraestructures i Transport
|
||
23 | * Av. Blasco Ib??ez, 50
|
||
24 | * 46010 VALENCIA
|
||
25 | * SPAIN
|
||
26 | *
|
||
27 | * +34 963862235
|
||
28 | * gvsig@gva.es
|
||
29 | * www.gvsig.gva.es
|
||
30 | *
|
||
31 | * or
|
||
32 | *
|
||
33 | * IVER T.I. S.A
|
||
34 | * Salamanca 50
|
||
35 | * 46005 Valencia
|
||
36 | * Spain
|
||
37 | *
|
||
38 | * +34 963163400
|
||
39 | * dac@iver.es
|
||
40 | */
|
||
41 | |||
42 | /* CVS MESSAGES:
|
||
43 | *
|
||
44 | * $Id: AbstractLabelingMethod.java 13884 2007-09-19 16:26:04Z jaume $
|
||
45 | * $Log$
|
||
46 | * Revision 1.5 2007-09-19 16:25:39 jaume
|
||
47 | * ReadExpansionFileException removed from this context and removed unnecessary imports
|
||
48 | *
|
||
49 | * Revision 1.4 2007/09/17 14:16:11 jaume
|
||
50 | * multilayer symbols sizing bug fixed
|
||
51 | *
|
||
52 | * Revision 1.3 2007/03/21 11:01:28 jaume
|
||
53 | * javadoc
|
||
54 | *
|
||
55 | * Revision 1.2 2007/03/09 08:33:43 jaume
|
||
56 | * *** empty log message ***
|
||
57 | *
|
||
58 | * Revision 1.1.2.2 2007/02/15 16:23:44 jaume
|
||
59 | * *** empty log message ***
|
||
60 | *
|
||
61 | * Revision 1.1.2.1 2007/02/01 11:42:47 jaume
|
||
62 | * *** empty log message ***
|
||
63 | *
|
||
64 | *
|
||
65 | */
|
||
66 | package org.gvsig.fmap.mapcontext.rendering.legend.styling; |
||
67 | |||
68 | import java.util.ArrayList; |
||
69 | |||
70 | |||
71 | /**
|
||
72 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
73 | */
|
||
74 | public abstract class AbstractLabelingMethod implements ILabelingMethod{ |
||
75 | |||
76 | protected LabelClass defaultLabel;
|
||
77 | 22123 | csanchez | protected ArrayList classes = new ArrayList(); |
78 | 21200 | vcaballero | |
79 | public LabelClass getDefaultLabelClass() {
|
||
80 | if (defaultLabel == null) { |
||
81 | defaultLabel = new LabelClass();
|
||
82 | defaultLabel.setName("Default");
|
||
83 | } |
||
84 | return defaultLabel;
|
||
85 | } |
||
86 | |||
87 | public LabelClass[] getLabelClasses() { |
||
88 | if (!classes.contains(getDefaultLabelClass()))
|
||
89 | classes.add(0, getDefaultLabelClass());
|
||
90 | 22123 | csanchez | return (LabelClass[]) classes.toArray(new LabelClass[0]); |
91 | 21200 | vcaballero | } |
92 | |||
93 | public LabelClass getLabelClassByName(String name) { |
||
94 | for (int i = 0; i < classes.size(); i++) { |
||
95 | 22123 | csanchez | LabelClass c = (LabelClass) classes.get(i); |
96 | 21200 | vcaballero | if (c.getName().equals(name))
|
97 | return c;
|
||
98 | } |
||
99 | return null; |
||
100 | } |
||
101 | |||
102 | } |