1 |
package skrueger.geotools; |
package skrueger.geotools; |
2 |
|
|
3 |
import java.awt.BorderLayout; |
import java.awt.BorderLayout; |
4 |
|
import java.awt.Window; |
5 |
|
|
6 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
7 |
import javax.swing.JComponent; |
import javax.swing.JComponent; |
15 |
import schmitzm.geotools.gui.MapContextControlPane; |
import schmitzm.geotools.gui.MapContextControlPane; |
16 |
import schmitzm.geotools.gui.MapPaneStatusBar; |
import schmitzm.geotools.gui.MapPaneStatusBar; |
17 |
import schmitzm.geotools.styling.ColorMapManager; |
import schmitzm.geotools.styling.ColorMapManager; |
|
import schmitzm.swing.SwingUtil; |
|
18 |
|
|
19 |
/** |
/** |
20 |
* Achtung! Dieser code ist verwuestet |
* Achtung! Dieser code ist verwuestet |
|
*/ |
|
|
|
|
|
/** |
|
21 |
* TODO DOKU und initialize schöner machen. SK |
* TODO DOKU und initialize schöner machen. SK |
22 |
*/ |
*/ |
23 |
public class MapView extends JPanel { |
public class MapView extends JPanel { |
24 |
private static final Logger LOGGER = Logger.getLogger(MapView.class); |
private static final Logger LOGGER = Logger.getLogger(MapView.class); |
25 |
|
|
26 |
private final JSplitPane splitPane = new JSplitPane( |
public final JSplitPane splitPane = new JSplitPane( |
27 |
JSplitPane.HORIZONTAL_SPLIT); |
JSplitPane.HORIZONTAL_SPLIT); |
28 |
|
|
29 |
protected MapPaneStatusBar statusBar = null; |
protected MapPaneStatusBar statusBar = null; |
41 |
* {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, |
* {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, |
42 |
* and some buttons floating over the {@link JMapPane} |
* and some buttons floating over the {@link JMapPane} |
43 |
*/ |
*/ |
44 |
public MapView(MapPaneToolBar toolBar) { |
public MapView(Window parentGui, MapPaneToolBar toolBar) { |
45 |
super(new BorderLayout()); |
super(new BorderLayout()); |
46 |
// Call initialize() by yourself afterwards. |
// Call initialize() by yourself afterwards. |
47 |
// Needed because variables for the overwritten methods |
// Needed because variables for the overwritten methods |
48 |
// are not yet set. |
// are not yet set. |
49 |
getGeoMapPane().getMapPane().setWaitCursorComponent(SwingUtil.getParentWindow(this)); |
getGeoMapPane().getMapPane().setWaitCursorComponent(parentGui); |
50 |
if ( toolBar == null ) |
if ( toolBar == null ) |
51 |
toolBar = new MapPaneToolBar(getMapPane()); |
toolBar = new MapPaneToolBar(getMapPane()); |
52 |
jToolBar = toolBar; |
jToolBar = toolBar; |
57 |
* {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, |
* {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, |
58 |
* and some buttons floating over the {@link JMapPane} |
* and some buttons floating over the {@link JMapPane} |
59 |
*/ |
*/ |
60 |
public MapView() { |
public MapView(Window parentGui) { |
61 |
this(null); |
this(parentGui, null); |
62 |
} |
} |
63 |
|
|
64 |
/** |
/** |
68 |
*/ |
*/ |
69 |
public void initialize() { |
public void initialize() { |
70 |
// horizontales SplitPane initialisieren |
// horizontales SplitPane initialisieren |
71 |
|
// SK 19.6.09: Removed because we are not using it. Probably a test. |
72 |
|
// // Status-Zeile |
73 |
|
// statusBar = new MapPaneStatusBar(getGeoMapPane() |
74 |
|
// .getMapPane()); |
75 |
|
// statusBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory |
76 |
|
// .createLoweredBevelBorder(), BorderFactory.createEmptyBorder(2, |
77 |
|
// 5, 2, 5))); |
78 |
|
// this.add(statusBar, BorderLayout.SOUTH); |
79 |
|
|
80 |
// Status-Zeile |
splitPane.setDividerLocation(-1); |
|
statusBar = new MapPaneStatusBar(getGeoMapPane() |
|
|
.getMapPane()); |
|
|
statusBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory |
|
|
.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(2, |
|
|
5, 2, 5))); |
|
|
this.add(statusBar, BorderLayout.SOUTH); |
|
|
|
|
|
splitPane.setDividerLocation(0.4); |
|
81 |
splitPane.setDividerSize(5); |
splitPane.setDividerSize(5); |
82 |
|
|
83 |
|
splitPane.setResizeWeight(0.0); |
84 |
splitPane.add(getSidePane()); |
splitPane.add(getSidePane()); |
85 |
|
|
86 |
/*********************************************************************** |
/*********************************************************************** |