[Schmitzm-commits] r165 - trunk/src/skrueger/geotools
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Jun 23 18:31:32 CEST 2009
Author: alfonx
Date: 2009-06-23 18:31:32 +0200 (Tue, 23 Jun 2009)
New Revision: 165
Modified:
trunk/src/skrueger/geotools/MapView.java
Log:
* GP's MapComposer has a new button to reset the legend width
* i8n for it
Modified: trunk/src/skrueger/geotools/MapView.java
===================================================================
--- trunk/src/skrueger/geotools/MapView.java 2009-06-23 16:06:23 UTC (rev 164)
+++ trunk/src/skrueger/geotools/MapView.java 2009-06-23 16:31:32 UTC (rev 165)
@@ -18,8 +18,8 @@
import schmitzm.geotools.styling.ColorMapManager;
/**
- * Achtung! Dieser code ist verwuestet
- * TODO DOKU und initialize schöner machen. SK
+ * Achtung! Dieser code ist verwuestet TODO DOKU und initialize schöner machen.
+ * SK
*/
public class MapView extends JPanel {
private static final Logger LOGGER = Logger.getLogger(MapView.class);
@@ -28,29 +28,29 @@
JSplitPane.HORIZONTAL_SPLIT);
protected MapPaneStatusBar statusBar = null;
-
+
/**
* Komponente, in der die Karten, der Massstab und das Koordinaten-Raster
- * dargestellt werden.
+ * dargestellt werden.
*/
-
+
/**
* SK: 21.6.09: ShapeFileRenderer is supposed to be about 5x faster on
- * ShapeFiles. The ShapeFileRenderer falls back to the
- * StreamingRenderer.
+ * ShapeFiles. The ShapeFileRenderer falls back to the StreamingRenderer.
*/
// Old code:
- // protected final GeoMapPane geoMapPane = new GeoMapPane(null,null,null,null, new StreamingRenderer());
-
+ // protected final GeoMapPane geoMapPane = new
+ // GeoMapPane(null,null,null,null, new StreamingRenderer());
// New Code uses Streaming renderer.
- protected final GeoMapPane geoMapPane = new GeoMapPane(null,null,null,null, new StreamingRenderer());
+ protected final GeoMapPane geoMapPane = new GeoMapPane(null, null, null,
+ null, new StreamingRenderer());
private MapPaneToolBar jToolBar;
/**
* Creates a new {@link MapView}. A {@link MapView} is a combination of a
- * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left,
- * and some buttons floating over the {@link JMapPane}
+ * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and
+ * some buttons floating over the {@link JMapPane}
*/
public MapView(Window parentGui, MapPaneToolBar toolBar) {
super(new BorderLayout());
@@ -58,46 +58,47 @@
// Needed because variables for the overwritten methods
// are not yet set.
getGeoMapPane().getMapPane().setWaitCursorComponent(parentGui);
- if ( toolBar == null )
- toolBar = new MapPaneToolBar(getMapPane());
- jToolBar = toolBar;
+ if (toolBar == null)
+ toolBar = new MapPaneToolBar(getMapPane());
+ jToolBar = toolBar;
}
- /**
- * Creates a new {@link MapView}. A {@link MapView} is a combination of a
- * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left,
- * and some buttons floating over the {@link JMapPane}
- */
- public MapView(Window parentGui) {
- this(parentGui, null);
- }
+ /**
+ * Creates a new {@link MapView}. A {@link MapView} is a combination of a
+ * {@link GeoMapPane}, a {@link MapContextManagerInterface} on the left, and
+ * some buttons floating over the {@link JMapPane}
+ */
+ public MapView(Window parentGui) {
+ this(parentGui, null);
+ }
/**
- * This routine creates the main components of the GUI: The left Side and the map on the right side.<br/>
+ * This routine creates the main components of the GUI: The left Side and
+ * the map on the right side.<br/>
* Calls #getSidePanel() which can be overwritten (call super!).<br/>
*
- * This method initialized the variables {@link #statusBar} and {@link #splitPane}
+ * This method initialized the variables {@link #statusBar} and
+ * {@link #splitPane}
*
* @see #adjustSizeOfGeoMapPane()
*/
public void initialize() {
// horizontales SplitPane initialisieren
-
+
// Status-Line to show Coordinates and Rastervalues.
- statusBar = new MapPaneStatusBar(getGeoMapPane()
- .getMapPane());
+ statusBar = new MapPaneStatusBar(getGeoMapPane().getMapPane());
statusBar.setBorder(BorderFactory.createCompoundBorder(BorderFactory
.createLoweredBevelBorder(), BorderFactory.createEmptyBorder(2,
5, 2, 5)));
this.add(statusBar, BorderLayout.SOUTH);
-
/**
- * The layout of the split pane can be configured in the atlas.
+ * The layout of the split pane can be configured in the atlas.
+ * setDividerLocation(-1); has no effect here because the component is
+ * not visible yet.
*/
getSplitPane().setDividerSize(5);
- getSplitPane().setDividerLocation(-1);
-
+
getSplitPane().setResizeWeight(0.0);
getSplitPane().add(getSidePane());
@@ -115,10 +116,11 @@
/**
* Returns the tool bar which controls the active mouse actions on the map.
+ *
* @return
*/
public MapPaneToolBar getToolBar() {
- return jToolBar;
+ return jToolBar;
}
/**
@@ -128,48 +130,58 @@
return splitPane;
}
-
/**
- * Sets the active tool.
- * Simply calls {@link MapPaneToolBar#setSelectedTool(Integer)}.
+ * Sets the active tool. Simply calls
+ * {@link MapPaneToolBar#setSelectedTool(Integer)}.
+ *
* @param tool
* One of {@link #TOOL_INFO}, {@link #TOOL_PAN} .. constants
*/
public void setSelectedTool(Integer tool) {
- jToolBar.setSelectedTool(tool);
+ jToolBar.setSelectedTool(tool);
}
-
- /**
- * Sets whether a tool is activated or not.
- * Simply calls {@link MapPaneToolBar#setButtonEnabled(int, boolean, boolean)}.
- * @param tool tool ID
- * @param enabled if {@code true} the tool becomes available
- * @param hideOnDisable if {@code true} the button is also hidden if
- * {@code enabled} is {@code false}
- */
- public void setToolEnabled(Integer tool, boolean enabled, boolean hideOnDisable) {
- jToolBar.setButtonEnabled(tool,enabled,hideOnDisable);
+
+ /**
+ * Sets whether a tool is activated or not. Simply calls
+ * {@link MapPaneToolBar#setButtonEnabled(int, boolean, boolean)}.
+ *
+ * @param tool
+ * tool ID
+ * @param enabled
+ * if {@code true} the tool becomes available
+ * @param hideOnDisable
+ * if {@code true} the button is also hidden if {@code enabled}
+ * is {@code false}
+ */
+ public void setToolEnabled(Integer tool, boolean enabled,
+ boolean hideOnDisable) {
+ jToolBar.setButtonEnabled(tool, enabled, hideOnDisable);
}
- /**
- * Sets the activation for all tools.
- * Simply calls {@link MapPaneToolBar#setAllToolsEnabled(boolean, boolean)}.
- * @param enabled if {@code true} all tool becomes available
- * @param hideOnDisable if {@code true} the buttons are also hidden if
- * {@code enabled} is {@code false}
- */
- public void setAllToolsEnabled(boolean enabled, boolean hideOnDisable) {
- jToolBar.setAllToolsEnabled(enabled, hideOnDisable);
- }
+ /**
+ * Sets the activation for all tools. Simply calls
+ * {@link MapPaneToolBar#setAllToolsEnabled(boolean, boolean)}.
+ *
+ * @param enabled
+ * if {@code true} all tool becomes available
+ * @param hideOnDisable
+ * if {@code true} the buttons are also hidden if {@code enabled}
+ * is {@code false}
+ */
+ public void setAllToolsEnabled(boolean enabled, boolean hideOnDisable) {
+ jToolBar.setAllToolsEnabled(enabled, hideOnDisable);
+ }
- /**
- * Checks whether a tool is activated.
- * Simply calls {@link MapPaneToolBar#isButtonEnabled(Integer)}.
- * @param tool tool ID
+ /**
+ * Checks whether a tool is activated. Simply calls
+ * {@link MapPaneToolBar#isButtonEnabled(Integer)}.
+ *
+ * @param tool
+ * tool ID
* @return {@code false} if an unknown ID is specified
*/
public boolean isToolEnabled(Integer tool) {
- return jToolBar.isButtonEnabled(tool);
+ return jToolBar.isButtonEnabled(tool);
}
/**
@@ -183,12 +195,12 @@
/**
* Liefert die Status-Zeile, in der die Koordinaten und Raster-Werte
- * angezeigt werden.
+ * angezeigt werden.
*/
public MapPaneStatusBar getStatusBar() {
- return this.statusBar;
+ return this.statusBar;
}
-
+
/**
* Liefert den Karten-Bereich der Komponente.
*/
More information about the Schmitzm-commits
mailing list