root / branches / v2_0_0_prep / libraries / libFMap_controls / src / org / gvsig / fmap / mapcontrol / MapControlManager.java @ 30327
History | View | Annotate | Download (5.28 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
|
23 |
/*
|
24 |
* AUTHORS (In addition to CIT):
|
25 |
* 2009 {Iver T.I.} {Task}
|
26 |
*/
|
27 |
|
28 |
package org.gvsig.fmap.mapcontrol; |
29 |
|
30 |
import java.util.prefs.Preferences; |
31 |
|
32 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
33 |
import org.gvsig.fmap.mapcontrol.tools.snapping.snappers.ISnapper; |
34 |
|
35 |
/**
|
36 |
* <p>
|
37 |
* This class is the manager of the MapControl library. It is used to
|
38 |
* manage all the properties related with the drawing of objects
|
39 |
* in a map, including default symbols used to draw objects
|
40 |
* in a map, the tolerance used by the selection or edition tools...
|
41 |
* </p>
|
42 |
* <p>
|
43 |
* It also holds the implementations of the {@link MapControlDrawer}'s,
|
44 |
* that is the responsible to draw graphical objects in a map.
|
45 |
* </p>
|
46 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
47 |
*/
|
48 |
public interface MapControlManager { |
49 |
|
50 |
/**
|
51 |
* Register a <code>MapControlDrawer</code> by name.
|
52 |
* @param name
|
53 |
* Name of the <code>MapControlDrawer</code>.
|
54 |
* @param mapControolDrawerClass
|
55 |
* Class used to draw graphical objects on a map.
|
56 |
*/
|
57 |
public void registerMapControlDrawer(String name, Class mapControolDrawerClass); |
58 |
|
59 |
/**
|
60 |
* Creates a <code>MapControlDrawer</code> from a name.
|
61 |
* @param name
|
62 |
* Name of the <code>MapControlDrawer</code>.
|
63 |
* @return
|
64 |
* A <code>MapControlDrawer</code>.
|
65 |
* @throws MapControlCreationException
|
66 |
*/
|
67 |
public MapControlDrawer createMapControlDrawer(String name) throws MapControlCreationException; |
68 |
|
69 |
/**
|
70 |
* It registers the default implementation for the <code>MapControlDrawer</code>.
|
71 |
* @param mapControlDrawerClass
|
72 |
* A <code>MapControlDrawer</code>.
|
73 |
*/
|
74 |
public void registerDefaultMapControlDrawer(Class mapControlDrawerClass); |
75 |
|
76 |
/**
|
77 |
* It returns the default implementation for the <code>MapControlDrawer</code>.
|
78 |
* @return
|
79 |
* The default <code>MapControlDrawer</code>.
|
80 |
* @throws MapControlCreationException
|
81 |
*/
|
82 |
public MapControlDrawer createDefaultMapControlDrawer() throws MapControlCreationException; |
83 |
|
84 |
/**
|
85 |
* Returns a snapper in a concrete position;
|
86 |
* @param index
|
87 |
* Snapper position.
|
88 |
* @return
|
89 |
* A snapper.
|
90 |
*/
|
91 |
public ISnapper getSnapperAt(int index); |
92 |
|
93 |
/**
|
94 |
* Returns the number of registered snappers.
|
95 |
* @return
|
96 |
* The number of registered snappers.
|
97 |
*/
|
98 |
public int getSnapperCount(); |
99 |
|
100 |
/**
|
101 |
* Clear all the snappers.
|
102 |
*/
|
103 |
public void clearSnappers(); |
104 |
|
105 |
/**
|
106 |
* Add a snapper.
|
107 |
* @param snapper
|
108 |
*/
|
109 |
public void registerSnapper(String name, Class snapperClass); |
110 |
|
111 |
/**
|
112 |
* Enables the snapping.
|
113 |
*/
|
114 |
public void enableSnapping(); |
115 |
|
116 |
/**
|
117 |
* Disables the snapping.
|
118 |
*/
|
119 |
public void disableSnapping(); |
120 |
|
121 |
|
122 |
public Preferences getEditionPreferences(); |
123 |
|
124 |
/**
|
125 |
* Tolerance (in pixels) that has to be used by the tools
|
126 |
* that use snapping.
|
127 |
* @return
|
128 |
* The distance in pixels.
|
129 |
*/
|
130 |
public int getTolerance(); |
131 |
|
132 |
/**
|
133 |
* Sets the tolerance (in pixels) that has to be used by the
|
134 |
* tools that use snapping.
|
135 |
* @param tolerance
|
136 |
* The tolerance to apply
|
137 |
*/
|
138 |
public void setTolerance(int tolerance); |
139 |
|
140 |
/**
|
141 |
* Sets the symbol that has to be used to draw a geometry when
|
142 |
* it is selected.
|
143 |
* @param selectionSymbol
|
144 |
* The symbol to apply.
|
145 |
*/
|
146 |
public void setSelectionSymbol(ISymbol selectionSymbol); |
147 |
|
148 |
/**
|
149 |
* Gets the symbol used to draw the selected geometries.
|
150 |
* @return
|
151 |
* The symbol used to draw the selected geometries.
|
152 |
*/
|
153 |
public ISymbol getSelectionSymbol();
|
154 |
|
155 |
/**
|
156 |
* Sets the symbol that has to be used to draw a geometry that
|
157 |
* represent the axis of a geometry.
|
158 |
* @param axisReferencesSymbol
|
159 |
* The symbol to apply.
|
160 |
*/
|
161 |
public void setAxisReferenceSymbol(ISymbol axisReferencesSymbol); |
162 |
|
163 |
/**
|
164 |
* Gets the symbol used to draw the axis of a geometry.
|
165 |
* @return
|
166 |
* The symbol used to draw the axis of a geometry.
|
167 |
*/
|
168 |
public ISymbol getAxisReferenceSymbol();
|
169 |
|
170 |
/**
|
171 |
* Sets the symbol that has to be used to draw a geometry when
|
172 |
* it is selected.
|
173 |
* @param geometrySelectionSymbol
|
174 |
* The symbol to apply.
|
175 |
*/
|
176 |
public void setGeometrySelectionSymbol(ISymbol geometrySelectionSymbol); |
177 |
|
178 |
/**
|
179 |
* Gets the symbol used to draw the selected geometries.
|
180 |
* @return
|
181 |
* The symbol used to draw the selected geometries.
|
182 |
*/
|
183 |
public ISymbol getGeometrySelectionSymbol();
|
184 |
|
185 |
/**
|
186 |
* Sets the symbol that has to be used to draw the handlers.
|
187 |
* @param handlerSymbol
|
188 |
* The symbol to apply.
|
189 |
*/
|
190 |
public void setHandlerSymbol(ISymbol handlerSymbol); |
191 |
|
192 |
/**
|
193 |
* Gets the symbol used to draw the handlers.
|
194 |
* @return
|
195 |
* The symbol used to draw the handlers.
|
196 |
*/
|
197 |
public ISymbol getHandlerSymbol();
|
198 |
} |
199 |
|