/[schmitzm]/trunk/src/skrueger/geotools/MapView.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/MapView.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/src/skrueger/geotools/MapView.java revision 244 by alfonx, Wed Jul 29 09:33:33 2009 UTC branches/1.0-gt2-2.6/src/skrueger/geotools/MapView.java revision 509 by alfonx, Thu Nov 5 08:51:33 2009 UTC
# Line 2  Line 2 
2   * Copyright (c) 2009 Martin O. J. Schmitz.   * Copyright (c) 2009 Martin O. J. Schmitz.
3   *   *
4   * This file is part of the SCHMITZM library - a collection of utility   * This file is part of the SCHMITZM library - a collection of utility
5   * classes based on Java 1.6, focussing (not only) on Java Swing   * classes based on Java 1.6, focusing (not only) on Java Swing
6   * and the Geotools library.   * and the Geotools library.
7   *   *
8   * The SCHMITZM project is hosted at:   * The SCHMITZM project is hosted at:
# Line 37  import javax.swing.JComponent; Line 37  import javax.swing.JComponent;
37  import javax.swing.JPanel;  import javax.swing.JPanel;
38  import javax.swing.JSplitPane;  import javax.swing.JSplitPane;
39    
40    import net.miginfocom.swing.MigLayout;
41    
42  import org.apache.log4j.Logger;  import org.apache.log4j.Logger;
 import org.geotools.renderer.lite.StreamingRenderer;  
 import org.geotools.renderer.shape.TransitionShapefileRenderer;  
43    
44  import schmitzm.geotools.gui.GeoMapPane;  import schmitzm.geotools.gui.GeoMapPane;
 import schmitzm.geotools.gui.JMapPane;  
45  import schmitzm.geotools.gui.MapContextControlPane;  import schmitzm.geotools.gui.MapContextControlPane;
46  import schmitzm.geotools.gui.MapPaneStatusBar;  import schmitzm.geotools.gui.MapPaneStatusBar;
47    import schmitzm.geotools.gui.SelectableXMapPane;
48  import schmitzm.geotools.styling.ColorMapManager;  import schmitzm.geotools.styling.ColorMapManager;
49    
50  /**  /**
# Line 71  public class MapView extends JPanel { Line 71  public class MapView extends JPanel {
71          /**          /**
72           * Creates a new {@link MapView}. A {@link MapView} is a combination of a           * Creates a new {@link MapView}. A {@link MapView} is a combination of a
73           * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and           * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and
74           * some buttons floating over the {@link JMapPane}           * some buttons floating over the {@link SelectableXMapPane}
75           */           */
76          public MapView(Component parentGui, MapPaneToolBar toolBar) {          public MapView(Component parentGui, MapPaneToolBar toolBar) {
77                  super(new BorderLayout());                  super(new BorderLayout());
78                  // Call initialize() by yourself afterwards.                  // Call initialize() by yourself afterwards.
79                  // Needed because variables for the overwritten methods                  // Needed because variables for the overwritten methods
80                  // are not yet set.                  // are not yet set.
                 getGeoMapPane().getMapPane().setWaitCursorComponent(parentGui);  
                 if (toolBar == null)  
                         toolBar = new MapPaneToolBar(getMapPane());  
81                  jToolBar = toolBar;                  jToolBar = toolBar;
82          }          }
83    
84          /**          /**
85           * Creates a new {@link MapView}. A {@link MapView} is a combination of a           * Creates a new {@link MapView}. A {@link MapView} is a combination of a
86           * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and           * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and
87           * some buttons floating over the {@link JMapPane}           * some buttons floating over the {@link SelectableXMapPane}
88           */           */
89          public MapView(Component parentGui) {          public MapView(Component parentGui) {
90                  this(parentGui, null);                  this(parentGui, null);
# Line 127  public class MapView extends JPanel { Line 124  public class MapView extends JPanel {
124                   * To the right side we now add a JPanel that consists of a toolbar and                   * To the right side we now add a JPanel that consists of a toolbar and
125                   * a gmp                   * a gmp
126                   */                   */
127                  JPanel newRight = new JPanel(new BorderLayout());                  JPanel newRight = new JPanel(new MigLayout("center, wrap 1","[grow]","[][grow]"));
128                  newRight.add(getToolBar(), BorderLayout.NORTH);                  newRight.add(getToolBar());
129                  newRight.add(getGeoMapPane(), BorderLayout.CENTER);                  newRight.add(getGeoMapPane(),"growx, growy");
130                  getSplitPane().add(newRight);                  getSplitPane().add(newRight);
131    
132                  this.add(getSplitPane(), BorderLayout.CENTER);                  this.add(getSplitPane(), BorderLayout.CENTER);
# Line 138  public class MapView extends JPanel { Line 135  public class MapView extends JPanel {
135          /**          /**
136           * Returns the tool bar which controls the active mouse actions on the map.           * Returns the tool bar which controls the active mouse actions on the map.
137           *           *
138           * @return           * @return never <code>null</code>, will rather create a default
139           */           */
140          public MapPaneToolBar getToolBar() {          public MapPaneToolBar getToolBar() {
141                    if (jToolBar == null) {
142                            jToolBar = new MapPaneToolBar(getMapPane());
143                    }
144                  return jToolBar;                  return jToolBar;
145          }          }
146    
# Line 225  public class MapView extends JPanel { Line 225  public class MapView extends JPanel {
225          /**          /**
226           * Liefert den Karten-Bereich der Komponente.           * Liefert den Karten-Bereich der Komponente.
227           */           */
228          public final JMapPane getMapPane() {          public final SelectableXMapPane getMapPane() {
229                  return getGeoMapPane().getMapPane();                  return getGeoMapPane().getMapPane();
230          }          }
231    

Legend:
Removed from v.244  
changed lines
  Added in v.509

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26