root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / styling / AbstractTypeSymbolEditorPanel.java @ 11073
History | View | Annotate | Download (4.67 KB)
1 | 9745 | jaume | /* 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$
|
||
45 | * $Log$
|
||
46 | 11073 | jaume | * Revision 1.3 2007-04-05 16:08:34 jaume
|
47 | * Styled labeling stuff
|
||
48 | *
|
||
49 | * Revision 1.2 2007/03/09 11:25:00 jaume
|
||
50 | 10679 | jaume | * Advanced symbology (start committing)
|
51 | *
|
||
52 | * Revision 1.1.2.3 2007/02/21 07:35:14 jaume
|
||
53 | 9745 | jaume | * *** empty log message ***
|
54 | *
|
||
55 | 10679 | jaume | * Revision 1.1.2.2 2007/02/08 15:42:13 jaume
|
56 | * *** empty log message ***
|
||
57 | *
|
||
58 | * Revision 1.1.2.1 2007/01/26 13:49:03 jaume
|
||
59 | * *** empty log message ***
|
||
60 | *
|
||
61 | * Revision 1.1 2007/01/16 11:52:11 jaume
|
||
62 | * *** empty log message ***
|
||
63 | *
|
||
64 | 9745 | jaume | * Revision 1.6 2006/11/13 09:15:23 jaume
|
65 | * javadoc and some clean-up
|
||
66 | *
|
||
67 | * Revision 1.5 2006/11/06 16:06:52 jaume
|
||
68 | * *** empty log message ***
|
||
69 | *
|
||
70 | * Revision 1.4 2006/10/31 16:16:34 jaume
|
||
71 | * *** empty log message ***
|
||
72 | *
|
||
73 | * Revision 1.3 2006/10/30 19:30:35 jaume
|
||
74 | * *** empty log message ***
|
||
75 | *
|
||
76 | * Revision 1.2 2006/10/29 23:53:49 jaume
|
||
77 | * *** empty log message ***
|
||
78 | *
|
||
79 | * Revision 1.1 2006/10/27 12:41:09 jaume
|
||
80 | * GUI
|
||
81 | *
|
||
82 | *
|
||
83 | */
|
||
84 | package com.iver.cit.gvsig.gui.styling; |
||
85 | |||
86 | import javax.swing.JPanel; |
||
87 | |||
88 | 10679 | jaume | import com.iver.cit.gvsig.fmap.core.symbols.ISymbol; |
89 | 9745 | jaume | /**
|
90 | * Abstract class that all the Symbol settings interface must extend.
|
||
91 | *
|
||
92 | * @author jaume dominguez faus - jaume.dominguez@iver.es
|
||
93 | */
|
||
94 | public abstract class AbstractTypeSymbolEditorPanel { |
||
95 | protected SymbolEditor owner;
|
||
96 | |||
97 | /**
|
||
98 | 10679 | jaume | * Produces and returns the ISymbol according with the user settings.
|
99 | *
|
||
100 | 9745 | jaume | * @return XMLEntity defining the ISymbol.
|
101 | * @see getSymbolClass() method
|
||
102 | */
|
||
103 | 10679 | jaume | public abstract ISymbol getLayer(); |
104 | 9745 | jaume | |
105 | /**
|
||
106 | * Creates a new instance of this type symbol editor panel associated to
|
||
107 | * its parent SymbolEditor which will be notified of the changes in
|
||
108 | * order to keep the symbol preview in sync with the user settings.
|
||
109 | * @param owner, the SymbolEditor which created this.
|
||
110 | */
|
||
111 | public AbstractTypeSymbolEditorPanel(SymbolEditor owner) {
|
||
112 | this.owner = owner;
|
||
113 | } |
||
114 | |||
115 | /**
|
||
116 | * <p>Returns the name of the config tabs that will be shown in the selector combo box.
|
||
117 | * This is typically a human-readable (and also translatable) name for the symbol that
|
||
118 | * this TypeEditorPanel deals with, but maybe you prefer to use any other one.<br>
|
||
119 | * </p>
|
||
120 | * <p>
|
||
121 | * The order of the entries in the combo is alphabetically-based. So you can force a
|
||
122 | * position by defining a name that suits your needs.
|
||
123 | * </p>
|
||
124 | * @return A human-readable text naming this panel
|
||
125 | */
|
||
126 | public abstract String getName(); |
||
127 | |||
128 | /**
|
||
129 | * <p>Due to the complexity that many symbols settings can reach, the SymbolEditorPanel is
|
||
130 | * designed in a tabbed-based fashion. So, you can use as many of pages you want to put
|
||
131 | * your components. This pages are regular JPanels that will be automatically added to
|
||
132 | * the SymbolEditor dialog.<br>
|
||
133 | * </p>
|
||
134 | * <p>
|
||
135 | * In case you need only one page, just return a JPanel array with a length of 1.
|
||
136 | * </p>
|
||
137 | * @return An array of JPanel containing the setting's interface.
|
||
138 | */
|
||
139 | public abstract JPanel[] getTabs(); |
||
140 | |||
141 | /**
|
||
142 | * Invoked when the user selects or adds a new layer. This method fills up
|
||
143 | * the components on the right according on the layer properties
|
||
144 | 10679 | jaume | * @param <b>ISymbol</b> layer, the symbol
|
145 | 9745 | jaume | */
|
146 | 10679 | jaume | public abstract void refreshControls(ISymbol layer); |
147 | 9745 | jaume | |
148 | public final String toString() { |
||
149 | return getName();
|
||
150 | } |
||
151 | |||
152 | protected final void fireSymbolChangedEvent() { |
||
153 | 10679 | jaume | owner.setLayerToSymbol(getLayer()); |
154 | 9745 | jaume | owner.refresh(); |
155 | } |
||
156 | |||
157 | /**
|
||
158 | * Returns the symbol class that is handled by this configuration panel.
|
||
159 | * @return <b>Class</b> (of the concrete ISymbol that this configuration panel deals with)
|
||
160 | */
|
||
161 | public abstract Class getSymbolClass(); |
||
162 | 11073 | jaume | |
163 | public abstract EditorTool getEditorTool(); |
||
164 | |||
165 | |||
166 | 9745 | jaume | } |