svn-gvsig-desktop / tags / v2_0_0_Build_2038 / applications / appgvSIG / src / org / gvsig / app / project / documents / view / gui / DefaultViewPanel.java @ 36884
History | View | Annotate | Download (18.9 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 |
* 2004-2009 IVER TI
|
26 |
*
|
27 |
*/
|
28 |
package org.gvsig.app.project.documents.view.gui; |
29 |
|
30 |
import java.awt.BorderLayout; |
31 |
import java.awt.Color; |
32 |
import java.awt.Dimension; |
33 |
import java.beans.PropertyChangeEvent; |
34 |
import java.beans.PropertyChangeListener; |
35 |
import java.util.HashMap; |
36 |
import java.util.Iterator; |
37 |
|
38 |
import javax.swing.JSplitPane; |
39 |
|
40 |
import org.cresques.cts.IProjection; |
41 |
|
42 |
import org.gvsig.andami.PluginServices; |
43 |
import org.gvsig.andami.messages.NotificationManager; |
44 |
import org.gvsig.andami.ui.mdiFrame.NewStatusBar; |
45 |
import org.gvsig.andami.ui.mdiManager.WindowInfo; |
46 |
import org.gvsig.app.project.DefaultProject; |
47 |
import org.gvsig.app.project.documents.Document; |
48 |
import org.gvsig.app.project.documents.view.MapOverview; |
49 |
import org.gvsig.app.project.documents.view.ViewDocument; |
50 |
import org.gvsig.app.project.documents.view.toc.gui.TOC; |
51 |
import org.gvsig.app.project.documents.view.toolListeners.AreaListener; |
52 |
import org.gvsig.app.project.documents.view.toolListeners.InfoListener; |
53 |
import org.gvsig.app.project.documents.view.toolListeners.LinkListener; |
54 |
import org.gvsig.app.project.documents.view.toolListeners.MeasureListener; |
55 |
import org.gvsig.app.project.documents.view.toolListeners.PanListener; |
56 |
import org.gvsig.app.project.documents.view.toolListeners.PointSelectListener; |
57 |
import org.gvsig.app.project.documents.view.toolListeners.PolygonSelectListener; |
58 |
import org.gvsig.app.project.documents.view.toolListeners.RectangleSelectListener; |
59 |
import org.gvsig.app.project.documents.view.toolListeners.SelectImageListener; |
60 |
import org.gvsig.app.project.documents.view.toolListeners.StatusBarListener; |
61 |
import org.gvsig.app.project.documents.view.toolListeners.ZoomInListener; |
62 |
import org.gvsig.app.project.documents.view.toolListeners.ZoomOutListener; |
63 |
import org.gvsig.fmap.mapcontext.MapContext; |
64 |
import org.gvsig.fmap.mapcontext.events.ColorEvent; |
65 |
import org.gvsig.fmap.mapcontext.events.ExtentEvent; |
66 |
import org.gvsig.fmap.mapcontext.events.ProjectionEvent; |
67 |
import org.gvsig.fmap.mapcontext.events.listeners.ViewPortListener; |
68 |
import org.gvsig.fmap.mapcontext.layers.FLayer; |
69 |
import org.gvsig.fmap.mapcontext.layers.FLayers; |
70 |
import org.gvsig.fmap.mapcontext.layers.vectorial.FLyrVect; |
71 |
import org.gvsig.fmap.mapcontrol.MapControl; |
72 |
import org.gvsig.fmap.mapcontrol.MapControlCreationException; |
73 |
import org.gvsig.fmap.mapcontrol.MapControlLocator; |
74 |
import org.gvsig.fmap.mapcontrol.MapControlManager; |
75 |
import org.gvsig.fmap.mapcontrol.tools.ZoomOutRightButtonListener; |
76 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior; |
77 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseMovementBehavior; |
78 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MouseWheelBehavior; |
79 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.MoveBehavior; |
80 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PointBehavior; |
81 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PolygonBehavior; |
82 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior; |
83 |
import org.gvsig.fmap.mapcontrol.tools.Behavior.RectangleBehavior; |
84 |
import org.gvsig.utils.console.JConsole; |
85 |
import org.gvsig.utils.console.JDockPanel; |
86 |
import org.gvsig.utils.console.ResponseListener; |
87 |
import org.gvsig.utils.console.jedit.JEditTextArea; |
88 |
|
89 |
/**
|
90 |
* <p>
|
91 |
* <b>Class View</b>. This class represents the gvSIG specific internal window
|
92 |
* where the maps are displayed and where the events coming from the user are
|
93 |
* captured.
|
94 |
* </p>
|
95 |
* <p>
|
96 |
* It is composed by three main visual areas:
|
97 |
* </p>
|
98 |
* <ol>
|
99 |
* <li>
|
100 |
* <b>Map control</b>: the map area located in the right area of the window. It
|
101 |
* takes up the biggest part of the window.</li>
|
102 |
* <li>
|
103 |
* <b>Table of contents (TOC)</b>: is a list of layers displayed in the view.
|
104 |
* The TOC is located on the left-top corner of the View and is the place where
|
105 |
* the user can modify the order, the legends, the visibility and other
|
106 |
* properties of the layers.</li>
|
107 |
* <li>
|
108 |
* <b>Map overview</b>: is a small MapControl located in the left-bottom corner
|
109 |
* of the View where the user can put some layers which summarizes the view. It
|
110 |
* is used to make the navigation easier and faster.</li>
|
111 |
* </ol>
|
112 |
*
|
113 |
* @author 2005- Vicente Caballero
|
114 |
* @author 2009- Joaquin del Cerro
|
115 |
*
|
116 |
*/
|
117 |
public class DefaultViewPanel extends AbstractViewPanel { |
118 |
/**
|
119 |
*
|
120 |
*/
|
121 |
private static final long serialVersionUID = -4044661458841786519L; |
122 |
|
123 |
private JConsole console;
|
124 |
private JDockPanel dockConsole = null; |
125 |
protected ResponseAdapter consoleResponseAdapter = new ResponseAdapter(); |
126 |
protected boolean isShowConsole = false; |
127 |
private ViewPortListener viewPortListener;
|
128 |
private static MapControlManager mapControlManager = MapControlLocator |
129 |
.getMapControlManager(); |
130 |
|
131 |
/**
|
132 |
* Creates a new View object. Before being used, the object must be
|
133 |
* initialized.
|
134 |
*
|
135 |
* @see initialize()
|
136 |
*/
|
137 |
public DefaultViewPanel() {
|
138 |
super();
|
139 |
this.setName("View"); |
140 |
// TODO Remove this when the system lo load libraries is finished
|
141 |
if (mapControlManager == null) { |
142 |
mapControlManager = MapControlLocator.getMapControlManager(); |
143 |
} |
144 |
} |
145 |
|
146 |
public DefaultViewPanel(Document document) { |
147 |
this();
|
148 |
this.initialize();
|
149 |
this.setDocument(document);
|
150 |
} |
151 |
|
152 |
/**
|
153 |
* Create the internal componentes and populate the window with them.
|
154 |
* If the layout properties were set using the
|
155 |
* <code>setWindowData(WindowData)</code> method, the window will be
|
156 |
* populated according to this properties.
|
157 |
*/
|
158 |
protected void initialize() { |
159 |
super.initialize();
|
160 |
initComponents(); |
161 |
hideConsole(); |
162 |
getConsolePanel().addResponseListener(consoleResponseAdapter); |
163 |
} |
164 |
|
165 |
public void setDocument(Document document) { |
166 |
setModel((ViewDocument) document); |
167 |
} |
168 |
|
169 |
public Document getDocument() { |
170 |
return this.modelo; |
171 |
} |
172 |
|
173 |
public void setModel(ViewDocument model) { |
174 |
this.modelo = model;
|
175 |
// Se registra como listener de cambios en FMap
|
176 |
MapContext fmap = modelo.getMapContext(); |
177 |
|
178 |
FLayers layers = fmap.getLayers(); |
179 |
for (int i = 0; i < layers.getLayersCount(); i++) { |
180 |
if (layers.getLayer(i).isEditing()
|
181 |
&& layers.getLayer(i) instanceof FLyrVect) {
|
182 |
this.showConsole();
|
183 |
} |
184 |
} |
185 |
|
186 |
// Se configura el mapControl
|
187 |
m_MapControl.setMapContext(fmap); |
188 |
m_TOC.setMapContext(fmap); |
189 |
m_MapControl.getMapContext().getLayers().addLegendListener(m_TOC); |
190 |
|
191 |
m_MapControl.setBackground(new Color(255, 255, 255)); |
192 |
if (modelo.getMapOverViewContext() != null) { |
193 |
m_MapLoc.setModel(modelo.getMapOverViewContext()); |
194 |
} |
195 |
model.addPropertyChangeListener(new PropertyChangeListener() { |
196 |
public void propertyChange(PropertyChangeEvent evt) { |
197 |
if (evt.getPropertyName().equals("name")) { |
198 |
PluginServices.getMDIManager() |
199 |
.getWindowInfo(DefaultViewPanel.this) |
200 |
.setTitle( |
201 |
PluginServices.getText(this, "Vista") + ": " |
202 |
+ (String) evt.getNewValue());
|
203 |
} |
204 |
} |
205 |
}); |
206 |
if (m_MapControl.getViewPort() != null) { |
207 |
viewPortListener = new ViewPortListener() {
|
208 |
public void extentChanged(ExtentEvent e) { |
209 |
if (PluginServices.getMainFrame() != null) { |
210 |
PluginServices |
211 |
.getMainFrame() |
212 |
.getStatusBar() |
213 |
.setControlValue( |
214 |
"scale",
|
215 |
String.valueOf(m_MapControl
|
216 |
.getMapContext().getScaleView())); |
217 |
PluginServices |
218 |
.getMainFrame() |
219 |
.getStatusBar() |
220 |
.setMessage( |
221 |
"projection",
|
222 |
getMapControl().getViewPort() |
223 |
.getProjection().getAbrev()); |
224 |
} |
225 |
} |
226 |
|
227 |
public void backColorChanged(ColorEvent e) { |
228 |
// Do nothing
|
229 |
} |
230 |
|
231 |
public void projectionChanged(ProjectionEvent e) { |
232 |
m_MapLoc.setProjection(e.getNewProjection()); |
233 |
} |
234 |
}; |
235 |
m_MapControl.getViewPort().addViewPortListener(viewPortListener); |
236 |
} |
237 |
} |
238 |
|
239 |
public JConsole getConsolePanel() {
|
240 |
if (console == null) { |
241 |
console = new JConsole();
|
242 |
// Para distinguir cuando se est? escribiendo sobre la consola y
|
243 |
// cuando no.
|
244 |
console.setJTextName("CADConsole");
|
245 |
} |
246 |
return console;
|
247 |
} |
248 |
|
249 |
private JDockPanel getDockConsole() {
|
250 |
if (dockConsole == null) { |
251 |
dockConsole = new JDockPanel(getConsolePanel());
|
252 |
} |
253 |
return dockConsole;
|
254 |
} |
255 |
|
256 |
public void addConsoleListener(String prefix, ResponseListener listener) { |
257 |
consoleResponseAdapter.putSpaceListener(prefix, listener); |
258 |
|
259 |
} |
260 |
|
261 |
public void removeConsoleListener(ResponseListener listener) { |
262 |
consoleResponseAdapter.deleteListener(listener); |
263 |
|
264 |
} |
265 |
|
266 |
public void focusConsole(String text) { |
267 |
getConsolePanel().addResponseText(text); |
268 |
|
269 |
JEditTextArea jeta = getConsolePanel().getTxt(); |
270 |
jeta.requestFocusInWindow(); |
271 |
jeta.setCaretPosition(jeta.getText().length()); |
272 |
|
273 |
} |
274 |
|
275 |
public void hideConsole() { |
276 |
isShowConsole = false;
|
277 |
getDockConsole().setVisible(false);
|
278 |
|
279 |
} |
280 |
|
281 |
public void showConsole() { |
282 |
if (isShowConsole) {
|
283 |
return;
|
284 |
} |
285 |
isShowConsole = true;
|
286 |
getMapControl().remove(getDockConsole()); |
287 |
getMapControl().setLayout(new BorderLayout()); |
288 |
getMapControl().add(getDockConsole(), BorderLayout.SOUTH);
|
289 |
getDockConsole().setVisible(true);
|
290 |
|
291 |
} |
292 |
|
293 |
static class ResponseAdapter implements ResponseListener { |
294 |
|
295 |
private HashMap<String, ResponseListener> spaceListener = |
296 |
new HashMap<String, ResponseListener>(); |
297 |
|
298 |
public void putSpaceListener(String namespace, ResponseListener listener) { |
299 |
spaceListener.put(namespace, listener); |
300 |
} |
301 |
|
302 |
public void acceptResponse(String response) { |
303 |
boolean nameSpace = false; |
304 |
int n = -1; |
305 |
if (response != null) { |
306 |
if ((n = response.indexOf(':')) != -1) { |
307 |
nameSpace = true;
|
308 |
} |
309 |
} |
310 |
|
311 |
if (nameSpace) {
|
312 |
ResponseListener listener = |
313 |
spaceListener.get(response.substring(0, n));
|
314 |
if (listener != null) { |
315 |
listener.acceptResponse(response.substring(n + 1));
|
316 |
} |
317 |
} else {
|
318 |
Iterator<ResponseListener> i =
|
319 |
spaceListener.values().iterator(); |
320 |
while (i.hasNext()) {
|
321 |
ResponseListener listener = i.next(); |
322 |
listener.acceptResponse(response); |
323 |
} |
324 |
} |
325 |
} |
326 |
|
327 |
/**
|
328 |
* @param listener
|
329 |
*/
|
330 |
public void deleteListener(ResponseListener listener) { |
331 |
Iterator<String> i = spaceListener.keySet().iterator(); |
332 |
while (i.hasNext()) {
|
333 |
String namespace = i.next();
|
334 |
ResponseListener l = spaceListener.get(namespace); |
335 |
if (l == listener) {
|
336 |
spaceListener.remove(namespace); |
337 |
} |
338 |
} |
339 |
} |
340 |
|
341 |
} |
342 |
|
343 |
protected void initComponents() { // GEN-BEGIN:initComponents |
344 |
m_MapControl = new MapControl(); // Default is paintEnabled = false. |
345 |
// Remember to activate it
|
346 |
try {
|
347 |
m_MapControl.setMapControlDrawer(mapControlManager |
348 |
.createDefaultMapControlDrawer()); |
349 |
} catch (MapControlCreationException e) {
|
350 |
NotificationManager.addError(e); |
351 |
} |
352 |
|
353 |
m_MapControl.addExceptionListener(mapControlExceptionListener); |
354 |
m_TOC = new TOC();
|
355 |
|
356 |
// Ponemos el localizador
|
357 |
m_MapLoc = new MapOverview(m_MapControl);
|
358 |
try {
|
359 |
m_MapLoc.setMapControlDrawer(mapControlManager |
360 |
.createDefaultMapControlDrawer()); |
361 |
} catch (MapControlCreationException e) {
|
362 |
NotificationManager.addError(e); |
363 |
} |
364 |
removeAll(); |
365 |
tempMainSplit = new ViewSplitPane(JSplitPane.HORIZONTAL_SPLIT); |
366 |
|
367 |
if (windowLayout == null) { |
368 |
m_MapLoc.setPreferredSize(new Dimension(150, 200)); |
369 |
tempMainSplit.setPreferredSize(new Dimension(500, 300)); |
370 |
} |
371 |
|
372 |
if (!isPalette()) {
|
373 |
tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT); |
374 |
tempSplitToc.setTopComponent(m_TOC); |
375 |
tempSplitToc.setBottomComponent(m_MapLoc); |
376 |
tempSplitToc.setResizeWeight(0.7);
|
377 |
tempMainSplit.setLeftComponent(tempSplitToc); |
378 |
} else {
|
379 |
tempMainSplit.setLeftComponent(m_TOC); |
380 |
} |
381 |
m_TOC.setVisible(true);
|
382 |
tempMainSplit.setRightComponent(m_MapControl); |
383 |
this.setLayout(new BorderLayout()); |
384 |
this.add(tempMainSplit, BorderLayout.CENTER); |
385 |
|
386 |
if (windowLayout != null) { |
387 |
try {
|
388 |
tempMainSplit.setDividerLocation(Integer.valueOf(
|
389 |
windowLayout.get("MainDivider.Location")).intValue());
|
390 |
if (windowLayout.get("TOCDivider.Location") != null) { |
391 |
tempSplitToc.setDividerLocation(Integer.valueOf(
|
392 |
windowLayout.get("TOCDivider.Location")).intValue());
|
393 |
} |
394 |
} catch (NumberFormatException ex) { |
395 |
PluginServices.getLogger().error( |
396 |
"Error restoring View properties");
|
397 |
} |
398 |
} |
399 |
|
400 |
// Listener de eventos de movimiento que pone las coordenadas del rat?n
|
401 |
// en la barra de estado
|
402 |
StatusBarListener sbl = new StatusBarListener(m_MapControl);
|
403 |
|
404 |
// Zoom out (pinchas y el mapa se centra y te muestra m?s).
|
405 |
// No es dibujando un rect?ngulo, es solo pinchando.
|
406 |
|
407 |
ZoomOutListener zol = new ZoomOutListener(m_MapControl);
|
408 |
|
409 |
m_MapControl.addBehavior("zoomOut", new Behavior[] { |
410 |
new PointBehavior(zol), new MouseMovementBehavior(sbl) }); |
411 |
|
412 |
// pan
|
413 |
|
414 |
PanListener pl = new PanListener(m_MapControl);
|
415 |
m_MapControl.addBehavior("pan", new Behavior[] { new MoveBehavior(pl), |
416 |
new MouseMovementBehavior(sbl) });
|
417 |
|
418 |
// Medir
|
419 |
|
420 |
MeasureListener mli = new MeasureListener(m_MapControl);
|
421 |
m_MapControl.addBehavior("medicion", new Behavior[] { |
422 |
new PolylineBehavior(mli), new MouseMovementBehavior(sbl) }); |
423 |
|
424 |
// Area
|
425 |
|
426 |
AreaListener ali = new AreaListener(m_MapControl);
|
427 |
m_MapControl.addBehavior("area", new Behavior[] { |
428 |
new PolygonBehavior(ali), new MouseMovementBehavior(sbl) }); |
429 |
|
430 |
// Seleccion por punto
|
431 |
PointSelectListener psl = new PointSelectListener(m_MapControl);
|
432 |
m_MapControl.addBehavior("pointSelection", new Behavior[] { |
433 |
new PointBehavior(psl), new MouseMovementBehavior(sbl) }); |
434 |
|
435 |
// Info por punto
|
436 |
InfoListener il = new InfoListener(m_MapControl);
|
437 |
m_MapControl.addBehavior("info", new Behavior[] { |
438 |
new PointBehavior(il), new MouseMovementBehavior(sbl) }); |
439 |
|
440 |
// Link por punto
|
441 |
LinkListener ll = new LinkListener(m_MapControl);
|
442 |
m_MapControl.addBehavior("link", new Behavior[] { |
443 |
new PointBehavior(ll), new MouseMovementBehavior(sbl) }); |
444 |
|
445 |
// Selecci?n por rect?ngulo
|
446 |
RectangleSelectListener rsl = new RectangleSelectListener(m_MapControl);
|
447 |
m_MapControl.addBehavior("rectSelection", new Behavior[] { |
448 |
new RectangleBehavior(rsl), new MouseMovementBehavior(sbl) }); |
449 |
|
450 |
// Selecci?n por pol?gono
|
451 |
PolygonSelectListener poligSel = |
452 |
new PolygonSelectListener(m_MapControl);
|
453 |
m_MapControl.addBehavior("polSelection", new Behavior[] { |
454 |
new PolygonBehavior(poligSel), new MouseMovementBehavior(sbl) }); |
455 |
|
456 |
// Zoom por rect?ngulo
|
457 |
ZoomOutRightButtonListener zoil = |
458 |
new ZoomOutRightButtonListener(m_MapControl);
|
459 |
ZoomInListener zil = new ZoomInListener(m_MapControl);
|
460 |
m_MapControl.addBehavior("zoomIn", new Behavior[] { |
461 |
new RectangleBehavior(zil), new PointBehavior(zoil), |
462 |
new MouseMovementBehavior(sbl) });
|
463 |
|
464 |
SelectImageListener sil = new SelectImageListener(m_MapControl);
|
465 |
m_MapControl.addBehavior("selectImage", new Behavior[] { |
466 |
new PointBehavior(sil), new MouseMovementBehavior(sbl) }); |
467 |
|
468 |
m_MapControl.setTool("zoomIn"); // Por defecto |
469 |
m_MapControl.addCombinedBehavior(new MouseWheelBehavior());
|
470 |
} |
471 |
|
472 |
public void windowActivated() { |
473 |
NewStatusBar statusbar = PluginServices.getMainFrame().getStatusBar(); |
474 |
MapContext mapContext = this.getMapControl().getMapContext();
|
475 |
|
476 |
statusbar.setMessage("units",
|
477 |
PluginServices.getText(this, mapContext.getDistanceName()));
|
478 |
statusbar.setControlValue("scale",
|
479 |
String.valueOf(mapContext.getScaleView()));
|
480 |
IProjection proj = getMapControl().getViewPort().getProjection(); |
481 |
if (proj != null) { |
482 |
statusbar.setMessage("projection", proj.getAbrev());
|
483 |
} else {
|
484 |
statusbar.setMessage("projection", ""); |
485 |
} |
486 |
} |
487 |
|
488 |
public void windowClosed() { |
489 |
super.windowClosed();
|
490 |
if (viewPortListener != null) { |
491 |
getMapControl().getViewPort().removeViewPortListener( |
492 |
viewPortListener); |
493 |
} |
494 |
if (getMapOverview() != null) { |
495 |
getMapOverview().getViewPort().removeViewPortListener( |
496 |
getMapOverview()); |
497 |
} |
498 |
|
499 |
} |
500 |
|
501 |
public void toPalette() { |
502 |
isPalette = true;
|
503 |
m_MapLoc.setPreferredSize(new Dimension(200, 150)); |
504 |
m_MapLoc.setSize(new Dimension(200, 150)); |
505 |
movp = new MapOverViewPalette(m_MapLoc, this); |
506 |
PluginServices.getMDIManager().addWindow(movp); |
507 |
FLayer[] layers =
|
508 |
getViewDocument().getMapContext().getLayers().getActives(); |
509 |
if (layers.length > 0 && layers[0] instanceof FLyrVect) { |
510 |
if (((FLyrVect) layers[0]).isEditing()) { |
511 |
showConsole(); |
512 |
return;
|
513 |
} |
514 |
} |
515 |
hideConsole(); |
516 |
|
517 |
} |
518 |
|
519 |
public void restore() { |
520 |
isPalette = false;
|
521 |
PluginServices.getMDIManager().closeWindow(movp); |
522 |
FLayer[] layers =
|
523 |
getViewDocument().getMapContext().getLayers().getActives(); |
524 |
if (layers.length > 0 && layers[0] instanceof FLyrVect) { |
525 |
if (((FLyrVect) layers[0]).isEditing()) { |
526 |
showConsole(); |
527 |
return;
|
528 |
} |
529 |
} |
530 |
hideConsole(); |
531 |
JSplitPane tempSplitToc = new JSplitPane(JSplitPane.VERTICAL_SPLIT); |
532 |
tempSplitToc.setTopComponent(m_TOC); |
533 |
tempSplitToc.setBottomComponent(m_MapLoc); |
534 |
tempSplitToc.setResizeWeight(0.7);
|
535 |
tempMainSplit.setLeftComponent(tempSplitToc); |
536 |
} |
537 |
|
538 |
/**
|
539 |
* Sets the default map overview background color that will be used in
|
540 |
* subsequent projects.
|
541 |
*
|
542 |
* @param color
|
543 |
* @deprecated use instead
|
544 |
* Project.getPreferences().setDefaultMapoverViewBackColor
|
545 |
*/
|
546 |
public static void setDefaultMapOverViewBackColor(Color color) { |
547 |
DefaultProject.getPreferences().setDefaultOverviewBackColor(color); |
548 |
} |
549 |
|
550 |
/**
|
551 |
* Returns the current default map overview background color defined which
|
552 |
* is the color defined when the user does not define any other one
|
553 |
*
|
554 |
* @return java.awt.Color
|
555 |
* @deprecated use instead
|
556 |
* Project.getPreferences().setDefaultMapoverViewBackColor
|
557 |
*/
|
558 |
public static Color getDefaultMapOverViewBackColor() { |
559 |
return DefaultProject.getPreferences().getDefaultOverviewBackColor();
|
560 |
} |
561 |
|
562 |
/**
|
563 |
* Returns the current default view background color defined which is the
|
564 |
* color defined when the user does not define any other one
|
565 |
*
|
566 |
* @return java.awt.Color
|
567 |
* @deprecated use instead Project.getPreferences().getDefaultViewBackColor
|
568 |
*/
|
569 |
public static Color getDefaultBackColor() { |
570 |
return DefaultProject.getPreferences().getDefaultViewBackColor();
|
571 |
} |
572 |
|
573 |
/**
|
574 |
* @deprecated use instead Project.getPreferences().setDefaultViewBackColor
|
575 |
*/
|
576 |
public static void setDefaultBackColor(Color color) { |
577 |
DefaultProject.getPreferences().setDefaultViewBackColor(color); |
578 |
} |
579 |
|
580 |
public Object getWindowProfile() { |
581 |
return WindowInfo.EDITOR_PROFILE;
|
582 |
} |
583 |
|
584 |
} |