[Schmitzm-commits] r1421 - in trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools: . gui selection

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 27 12:29:10 CET 2011


Author: mojays
Date: 2011-01-27 12:29:08 +0100 (Thu, 27 Jan 2011)
New Revision: 1421

Added:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/CrsLabel.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolBar.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolSelectedListener.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapView.java
Removed:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/CrsLabel.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolBar.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolSelectedListener.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapView.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource.20080424
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource_de.20080424
Modified:
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneStatusBar.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPaneTool.java
   trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/selection/FeatureMapLayerSelectionSynchronizer.java
Log:
moved some classes to schmitzm.geotools.gui

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/CrsLabel.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/CrsLabel.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/CrsLabel.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,51 +0,0 @@
-package de.schmitzm.geotools;
-
-import javax.swing.JLabel;
-
-import de.schmitzm.geotools.gui.GeotoolsGUIUtil;
-import de.schmitzm.geotools.gui.SelectableXMapPane;
-import de.schmitzm.geotools.gui.XMapPaneEvent;
-import de.schmitzm.geotools.map.event.JMapPaneListener;
-
-public class CrsLabel extends JLabel {
-
-	private JMapPaneListener listenForCrsChange = new JMapPaneListener() {
-
-		@Override
-		public void performMapPaneEvent(XMapPaneEvent e) {
-			updateCrs();
-		}
-	};
-
-	private final SelectableXMapPane mapPane;
-
-	public CrsLabel(SelectableXMapPane mapPane) {
-		super();
-		this.mapPane = mapPane;
-
-		mapPane.addMapPaneListener(listenForCrsChange);
-
-		updateCrs();
-
-		setToolTipText(GeotoolsGUIUtil.R("CRSLabel.TT"));
-	}
-
-	public void updateCrs() {
-		String crsName = "";
-		try {
-			crsName = mapPane.getMapContext().getCoordinateReferenceSystem()
-					.getName().toString();
-			setText(GeotoolsGUIUtil.R("CRSLabel", crsName));
-		} catch (Exception e) {
-			setText("");
-		}
-	}
-
-	@Override
-	protected void finalize() throws Throwable {
-		super.finalize();
-		if (mapPane != null)
-			mapPane.removeMapPaneListener(listenForCrsChange);
-	}
-
-}

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolBar.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolBar.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolBar.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,928 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Martin O. J. Schmitz.
- * 
- * This file is part of the SCHMITZM library - a collection of utility 
- * classes based on Java 1.6, focusing (not only) on Java Swing 
- * and the Geotools library.
- * 
- * The SCHMITZM project is hosted at:
- * http://wald.intevation.org/projects/schmitzm/
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License (license.txt)
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- * or try this link: http://www.gnu.org/licenses/lgpl.html
- * 
- * Contributors:
- *     Martin O. J. Schmitz - initial API and implementation
- *     Stefan A. Tzeggai - additional utility classes
- ******************************************************************************/
-package de.schmitzm.geotools;
-
-import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Set;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.Action;
-import javax.swing.Icon;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JToggleButton;
-import javax.swing.JToolBar;
-
-import org.apache.log4j.Logger;
-
-import com.vividsolutions.jts.geom.Envelope;
-
-import de.schmitzm.geotools.gui.GeotoolsGUIUtil;
-import de.schmitzm.geotools.gui.SelectableXMapPane;
-import de.schmitzm.geotools.gui.XMapPaneEvent;
-import de.schmitzm.geotools.gui.XMapPaneTool;
-import de.schmitzm.geotools.map.event.JMapPaneListener;
-import de.schmitzm.geotools.map.event.MapAreaChangedEvent;
-import de.schmitzm.swing.ButtonGroup;
-import de.schmitzm.swing.SmallButton;
-import de.schmitzm.swing.SmallToggleButton;
-
-/**
- * A toolbar to control an {@link SelectableXMapPane} (Atlas visualization).
- * This contains two types of buttons. A group of <i>tools</i> for the mouse
- * actions on the map represented by {@link JToggleButton JToggleButtons}, where
- * only one tool can be activated every time. And some (general) <i>actions</i>,
- * represented by normal {@link JButton JButtons}.
- * 
- * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
- *         (University of Bonn/Germany)
- * @version 1.2 Stefan Tzeggai
- */
-public class MapPaneToolBar extends JToolBar {
-	private static final Logger LOGGER = Logger.getLogger(MapPaneToolBar.class
-			.getName());
-
-	public static String R(String key, Object... values) {
-		return GeotoolsGUIUtil.R(key, values);
-	}
-
-	/** Constant for the tool "Panning" (10). */
-	public static final int TOOL_PAN = 10;
-	/** Constant for the tool "Info" (20). */
-	public static final int TOOL_INFO = 20;
-	public static final int SEPERATOR0 = 99;
-
-	/** Constant for the tool "Zoom In" (110). */
-	public static final int TOOL_ZOOMIN = 110;
-	public static final int ACTION_ZOOM_DEFAULT = 150;
-	/** Constant for the tool "Zoom Out" (120). */
-	public static final int TOOL_ZOOMOUT = 120;
-	/** Constant for the action "Zoom back" (130). */
-	public static final int ACTION_ZOOM_BACK = 130;
-	/** Constant for the action "Zoom forward" (140). */
-	public static final int ACTION_ZOOM_FORWARD = 140;
-	public static final int SEPERATOR1 = 199;
-
-	/**
-	 * Constant for the tool "Selection Reset" which clears the selection (240).
-	 */
-	public static final int TOOL_SELECTION_CLEAR = 240;
-
-	/**
-	 * Constant for the tool "Select" which sets the Selection to the selected
-	 * features (210).
-	 */
-	public static final int TOOL_SELECTION_SET = 210;
-	/**
-	 * Constant for the tool "Selection add" which adds the features to the
-	 * Selection (220).
-	 */
-	public static final int TOOL_SELECTION_ADD = 220;
-	/**
-	 * Constant for the tool "Selection subtract" which removes the selected
-	 * features from the selection (230).
-	 */
-	public static final int TOOL_SELECTION_REMOVE = 230;
-
-	public static final int ACTION_CHARTS = 401;
-
-	/** Tool currently selected */
-	protected int selectedTool = TOOL_ZOOMIN;
-
-	/** Holds the tool buttons of the tool bar. */
-	final protected SortedMap<Integer, JComponent> toolAndActionButtons = new TreeMap<Integer, JComponent>();
-	/** Controls that only one tool button is activated. */
-	protected ButtonGroup toolButtonGroup = null;
-
-	// SK: Musste ich ändern damit man Tools und Actions in der Reihenfolge
-	// mischen kann.
-	// /** Holds the action buttons of the bar. */
-	// protected SortedMap<Integer, JButton> actionButtons = null;
-
-	/** Holds the {@link SelectableXMapPane} this tool bar controls. */
-	protected SelectableXMapPane mapPane = null;
-
-	/**
-	 * A List to remember the last Envelopes that have been watched. Used for
-	 * the zoomBack- and zoomForwardButtons *
-	 */
-	protected ArrayList<Envelope> lastZooms = new ArrayList<Envelope>();
-	/** Holds the index to the current element in {@link #lastZooms}. */
-	protected int zoomBackIndex = 0;
-
-	/** Listener to sniff the zoom actions on the map. */
-	protected JMapPaneListener mapPaneListener = null;
-
-	protected boolean zoomBackForwardButtonInAction;
-
-	/** Listeners what want to be informed about a change of the selected tool **/
-	protected Set<MapPaneToolSelectedListener> toolSelectionListeners = new HashSet<MapPaneToolSelectedListener>();
-
-	/** This listener is added to all {@link JToggleButton} **/
-	private final ActionListener toolSelectedListener = new ActionListener() {
-
-		@Override
-		public void actionPerformed(ActionEvent e) {
-			JToggleButton tb = (JToggleButton) e.getSource();
-
-			// Inform the listeners about a newly selected tool
-			for (MapPaneToolSelectedListener l : toolSelectionListeners) {
-				l.toolSelected(Integer.valueOf(tb.getName()));
-			}
-		}
-
-	};
-
-	/**
-	 * Creates a new toolbar. Notice: This toolbar does nothing until
-	 * {@link #setMapPane(SelectableXMapPane)} is called!
-	 */
-	public MapPaneToolBar() {
-		this(null);
-	}
-
-	public void addButtonSelectedListener(MapPaneToolSelectedListener listener) {
-		toolSelectionListeners.add(listener);
-	}
-
-	public void removeButtonSelectedListener(
-			MapPaneToolSelectedListener listener) {
-		toolSelectionListeners.remove(listener);
-	}
-
-	/**
-	 * Creates a new tool bar.
-	 * 
-	 * @param mapPane
-	 *            {@link SelectableXMapPane} the tool bar controls
-	 */
-	public MapPaneToolBar(SelectableXMapPane mapPane) {
-		super("Control the map", JToolBar.HORIZONTAL);
-
-		// I want to see nothing on the background
-		setOpaque(false);
-		setBorder(null);
-
-		this.toolButtonGroup = new ButtonGroup();
-
-		// Create a Listener to listen to the zooms on the JMapPane
-		this.mapPaneListener = new JMapPaneListener() {
-			public void performMapPaneEvent(XMapPaneEvent e) {
-
-				if (!(e instanceof MapAreaChangedEvent))
-					return;
-
-				if (zoomBackForwardButtonInAction) {
-					zoomBackForwardButtonInAction = false;
-					return;
-				}
-
-				final MapAreaChangedEvent mapAreaChangedEvent = (MapAreaChangedEvent) e;
-				Envelope oldMapArea = mapAreaChangedEvent.getOldMapArea();
-
-				final Envelope mapArea = mapAreaChangedEvent.getNewMapArea();
-				if (mapArea == null || mapArea.equals(oldMapArea)
-						|| Double.isNaN(mapArea.getMinX())
-						|| Double.isNaN(mapArea.getMaxX())
-						|| Double.isNaN(mapArea.getMinY())
-						|| Double.isNaN(mapArea.getMaxY())) {
-					// If the MapArea didn't change... we don't want to register
-					// it as a zoom action.
-					return;
-				}
-
-				if (lastZooms.size() == 0
-						&& oldMapArea != null
-						&& !oldMapArea.isNull()
-						&& !(Double.isNaN(oldMapArea.getMinX())
-								|| Double.isNaN(oldMapArea.getMaxX())
-								|| Double.isNaN(oldMapArea.getMinY()) || Double
-								.isNaN(oldMapArea.getMaxY()))) {
-					lastZooms.add(oldMapArea);
-					zoomBackIndex = 1;
-				}
-				if (mapArea == null)
-					return;
-
-				if (lastZooms.size() > 0
-						&& mapArea.equals(lastZooms.get(lastZooms.size() - 1))) {
-					// LOGGER.debug("MapAreaChangedEvent ausgelassen bei der Zaehlung der Zoomschritt weil identisch");
-					return;
-				}
-
-				if (lastZooms.size() > 0)
-					while (zoomBackIndex < lastZooms.size())
-						lastZooms.remove(lastZooms.size() - 1);
-
-				lastZooms.add(mapArea);
-				zoomBackIndex = lastZooms.size();
-				setButtonEnabled(ACTION_ZOOM_BACK, lastZooms.size() > 1);
-				setButtonEnabled(ACTION_ZOOM_FORWARD, false);
-			}
-
-		};
-
-		setMapPane(mapPane);
-		setFloatable(false);
-		setRollover(true);
-
-		init();
-	}
-
-//	private CrsLabel getCrsComponent() {
-//		if (crsViewer == null) {
-//			crsViewer = new CrsLabel(this.mapPane);
-//		}
-//		return crsViewer;
-//	}
-
-	/**
-	 * Sets the {@link SelectableXMapPane} controlled by this tool bar.
-	 * 
-	 * @param mapPane
-	 *            {@link SelectableXMapPane} to control (if {@code null} this
-	 *            tool bar controls NOTHING!)
-	 */
-	public void setMapPane(SelectableXMapPane mapPane) {
-		// Remove listener from old MapPane
-		if (this.mapPane != null)
-			this.mapPane.removeMapPaneListener(mapPaneListener);
-		this.mapPane = mapPane;
-		if (this.mapPane != null && mapPaneListener != null)
-			this.mapPane.addMapPaneListener(mapPaneListener);
-	}
-
-	/**
-	 * Calls {@link #initToolsAndActions()} and {@link #initActions()} and then
-	 * puts all tool buttons and all actions buttons to the tool bar.
-	 */
-	protected void init() {
-
-		initToolsAndActions();
-
-		addSeparator(SEPERATOR0, new JToolBar.Separator());
-		addSeparator(SEPERATOR1, new JToolBar.Separator());
-
-		initToolBar();
-	}
-
-	/**
-	 * Creates the tool buttons and action buttons and seperators, adds them to
-	 * {@link #toolAndActionButtons} and finally creates a button group for all
-	 * tools. So sub-classes which override this method should FIRST add their
-	 * new tool buttons to {@link #toolAndActionButtons} before calling
-	 * {@code super.initTools()}.
-	 */
-	protected void initToolsAndActions() {
-		// Pan
-		addTool(new MapPaneToolBarAction(TOOL_PAN, this, XMapPaneTool.PAN),
-				false);
-
-		// Info
-		addTool(new MapPaneToolBarAction(TOOL_INFO, this, XMapPaneTool.INFO),
-				false);
-
-		// Zoom in
-		addTool(new MapPaneToolBarAction(TOOL_ZOOMIN, this,
-				XMapPaneTool.ZOOM_IN), false);
-
-		// Zoom out
-		addTool(new MapPaneToolBarAction(TOOL_ZOOMOUT, this,
-				XMapPaneTool.ZOOM_OUT), false);
-
-		// Action button to revert the last zoom
-		addAction(
-				new MapPaneToolBarAction(ACTION_ZOOM_BACK, this, "",
-						new ImageIcon(MapView.class
-								.getResource("resource/icons/zoom_back.png")),
-						R("MapPaneButtons.LastZoom.TT")), false);
-		setButtonEnabled(ACTION_ZOOM_BACK, false);
-
-		// Action button to redo the last zoom
-		addAction(
-				new MapPaneToolBarAction(
-						ACTION_ZOOM_FORWARD,
-						this,
-						"",
-						new ImageIcon(MapView.class
-								.getResource("resource/icons/zoom_forward.png")),
-						R("MapPaneButtons.NextZoom.TT")), false);
-		setButtonEnabled(ACTION_ZOOM_FORWARD, false);
-
-		// set the selected tool enabled
-		setSelectedTool(selectedTool);
-
-	}
-
-	@Override
-	public void paint(Graphics g) {
-		super.paint(g);
-	}
-
-	/**
-	 * Clears the GUI of all components and adds all tool and action buttons to
-	 * the tool bar.
-	 */
-	public void initToolBar() {
-		removeAll();
-
-		// // Separator to the left of the tool actions to start
-		// // the tool buttons with the map (not with the coordinate grid)
-		// Dimension dimension = new Dimension(49, 10);
-		// addSeparator(dimension);
-
-		// Tool buttons
-		for (Integer bKey : toolAndActionButtons.keySet()) {
-
-			JComponent b = toolAndActionButtons.get(bKey);
-
-			if (b instanceof JToggleButton) {
-				JToggleButton tb = (JToggleButton) b;
-				tb.setName(bKey.toString());
-				tb.addActionListener(toolSelectedListener);
-			}
-
-			add(b);
-		}
-
-		if (!toolAndActionButtons.containsKey(selectedTool)) {
-			/**
-			 * This might be a bit specific, but IF selection buttons are
-			 * available, select one of them.. if not, select the INFO tool.
-			 */
-
-			if (toolAndActionButtons.containsKey(TOOL_SELECTION_SET)) {
-				setSelectedTool(TOOL_SELECTION_SET);
-			} else if (toolAndActionButtons.containsKey(TOOL_INFO)) {
-				setSelectedTool(TOOL_INFO);
-			} else {
-				// TODO What to do now?!
-				setSelectedTool(null);
-			}
-
-		}
-
-		revalidate();
-		repaint();
-	}
-
-	/**
-	 * Performs the activation of a tool.
-	 * 
-	 * @param tool
-	 *            the tool to activate
-	 * @param e
-	 *            the event of the button
-	 */
-	public void performToolButton(int tool, ActionEvent e) {
-		if (mapPane == null)
-			return;
-
-		selectedTool = tool;
-
-		switch (tool) {
-		case TOOL_PAN:
-			mapPane.setTool(XMapPaneTool.PAN);
-			break;
-		case TOOL_INFO:
-			mapPane.setTool(XMapPaneTool.INFO);
-			break;
-		case TOOL_ZOOMIN:
-			mapPane.setTool(XMapPaneTool.ZOOM_IN);
-			break;
-		case TOOL_ZOOMOUT:
-			mapPane.setTool(XMapPaneTool.ZOOM_OUT);
-			break;
-		}
-	}
-
-	/**
-	 * @param id
-	 *            The ID of the Component to remove. The change will not be
-	 *            visible until {@link #initToolBar()} is called.
-	 * @return <code>null</code> or the component that has been removed.
-	 */
-	public JComponent removeId(int id) {
-		return toolAndActionButtons.remove(id);
-	}
-
-	/**
-	 * Performs the action of an action button.
-	 * 
-	 * @param tool
-	 *            the action
-	 * @param e
-	 *            the event of the button
-	 */
-	protected void performActionButton(int action, ActionEvent e) {
-		if (mapPane == null)
-			return;
-
-		// Perform the action "Zoom back": Revert the last zoom
-		if (action == ACTION_ZOOM_BACK) {
-			if (zoomBackIndex <= 1)
-				return;
-
-			zoomBackForwardButtonInAction = true;
-			zoomBackIndex--;
-			getButton(ACTION_ZOOM_FORWARD).setEnabled(true);
-			getButton(ACTION_ZOOM_BACK).setEnabled(zoomBackIndex > 1);
-
-			mapPane.setMapArea(lastZooms.get(zoomBackIndex - 1));
-			mapPane.refresh();
-		}
-
-		// Perform the action "Zoom forward": Re-do the last zoom
-		if (action == ACTION_ZOOM_FORWARD) {
-			if (zoomBackIndex < lastZooms.size()) {
-				zoomBackForwardButtonInAction = true;
-				zoomBackIndex++;
-				getButton(ACTION_ZOOM_BACK).setEnabled(true);
-				getButton(ACTION_ZOOM_FORWARD).setEnabled(
-						zoomBackIndex < lastZooms.size());
-
-				mapPane.setMapArea(lastZooms.get(zoomBackIndex - 1));
-				mapPane.refresh();
-			}
-		}
-	}
-
-	/**
-	 * Adds a tool to the tool bar. Does nothing if a tool or action with the
-	 * specified ID already exists!
-	 * 
-	 * @param buttonAction
-	 *            action for the toggle button
-	 * @param resetToolBar
-	 *            indicates whether the toolbar GUI is reset after adding the
-	 *            button (if adding several actions it useful only to reset the
-	 *            GUI for the last added tool)
-	 */
-	public void addTool(MapPaneToolBarAction buttonAction, boolean resetToolBar) {
-		if (isButtonIDUsed(buttonAction.getID())) {
-			LOGGER.warn("addTool(.) ignored because ID already used for tool or action: "
-					+ buttonAction.getID());
-			return;
-		}
-		JToggleButton button = new SmallToggleButton(buttonAction);
-
-		toolButtonGroup.add(button);
-		toolAndActionButtons.put(buttonAction.getID(), button);
-		if (resetToolBar)
-			initToolBar();
-	}
-
-	/**
-	 * Adds a tool to the tool bar and resets the toolbar GUI.
-	 * 
-	 * @param buttonAction
-	 *            action for the toggle button
-	 */
-	public void addTool(MapPaneToolBarAction buttonAction) {
-		addTool(buttonAction, true);
-	}
-
-	/**
-	 * Adds an action to the tool bar. Does nothing if a tool or action with the
-	 * specified ID already exists!
-	 * 
-	 * @param buttonAction
-	 *            action for the button
-	 * @param resetToolBar
-	 *            indicates whether the toolbar GUI is reset after adding the
-	 *            button (if adding several actions it useful only to reset the
-	 *            GUI for the last added tool)
-	 */
-	public void addAction(MapPaneToolBarAction buttonAction,
-			boolean resetToolBar) {
-		if (isButtonIDUsed(buttonAction.getID())) {
-			LOGGER.warn("addAction(.) ignored because ID already used for tool or action: "
-					+ buttonAction.getID());
-			return;
-		}
-		JButton button = new SmallButton(buttonAction);
-		toolAndActionButtons.put(buttonAction.getID(), button);
-		if (resetToolBar)
-			initToolBar();
-	}
-
-	/**
-	 * Adds any JComponent to the tool bar. Does nothing if a tool or action
-	 * with the specified ID already exists!
-	 * 
-	 * @param component
-	 *            A {@link JComponent} that shall be added
-	 * @param id
-	 *            The ID associaded with the {@link JComponent}
-	 * @param resetToolBar
-	 *            indicates whether the toolbar GUI is reset after adding the
-	 *            button (if adding several actions it useful only to reset the
-	 *            GUI for the last added tool)
-	 */
-	public void addJComponent(JComponent component, int id, boolean resetToolBar) {
-
-		if (isButtonIDUsed(id)) {
-			LOGGER.warn("addAction(.) ignored because ID already used for tool or action: "
-					+ id);
-			return;
-		}
-
-		toolAndActionButtons.put(id, component);
-		if (resetToolBar)
-			initToolBar();
-	}
-
-	public void addSeparator(int id, Separator separator) {
-		if (isButtonIDUsed(id)) {
-			LOGGER.warn("addSeparator(.) ignored because ID already used for tool or action. ");
-			return;
-		}
-		toolAndActionButtons.put(id, separator);
-	}
-
-	/**
-	 * Adds an action to the tool bar and resets the toolbar GUI.
-	 * 
-	 * @param buttonAction
-	 *            action for the toggle button
-	 */
-	public void addAction(MapPaneToolBarAction buttonAction) {
-		addAction(buttonAction, true);
-	}
-
-	/**
-	 * Returns the button for a specific tool or action.
-	 * 
-	 * @param id
-	 *            the constant for any button in the {@link MapPaneToolBar}
-	 * @return a {@link JButton} if {@code id} specifies an
-	 *         {@linkplain #getActionButton(int) action button} or
-	 *         {@link JToogleButton} if {@code id} specifies a
-	 *         {@linkplain #getToolButton(int) tool button}
-	 */
-	public AbstractButton getButton(int id) {
-
-		// ACHUTNG: Das ist ein SK QUICK FIX! TODO
-		if (!(toolAndActionButtons.get(id) instanceof AbstractButton))
-			return null;
-
-		AbstractButton button = (AbstractButton) toolAndActionButtons.get(id);
-		if (button == null)
-			LOGGER.warn("Unknown tool or action ID: " + id);
-		return button;
-	}
-
-	/**
-	 * Returns the button for a specific tool.
-	 * 
-	 * @param tool
-	 *            the constant for a tool
-	 */
-	public JToggleButton getToolButton(int tool) {
-		AbstractButton button = getButton(tool);
-		if (button != null && !(button instanceof JToggleButton)) {
-			LOGGER.warn("ID specifies no tool: " + tool);
-			button = null;
-		}
-		return (JToggleButton) button;
-	}
-
-	/**
-	 * Returns the button for a specific action.
-	 * 
-	 * @param action
-	 *            the constant an action
-	 */
-	public JButton getActionButton(int action) {
-		AbstractButton button = getButton(action);
-		if (button != null && !(button instanceof JButton)) {
-			LOGGER.warn("ID specifies no action: " + action);
-			button = null;
-		}
-		return (JButton) button;
-
-	}
-
-	/**
-	 * Sets the selected tool.
-	 * 
-	 * @param tool
-	 *            ID of the tool
-	 */
-	public void setSelectedTool(Integer tool) {
-		if (tool == null)
-			toolButtonGroup.setUnselected();
-
-		JToggleButton button = getToolButton(tool);
-		if (button == null)
-			return;
-		button.setSelected(true);
-		button.getAction().actionPerformed(null);
-
-		selectedTool = tool;
-	}
-
-	/**
-	 * Returns the selected tool.
-	 * 
-	 * @return -1 if no tool is active
-	 */
-	public int getSelectedTool() {
-		if (toolButtonGroup.getSelectedButton() == null)
-			return -1;
-		return selectedTool;
-	}
-
-	/**
-	 * Sets whether a tool or action is activated or not. The visible property
-	 * of the button is not affected.
-	 * 
-	 * @param id
-	 *            tool or actionID
-	 * @param enabled
-	 *            if {@code true} the tool becomes available
-	 */
-	public void setButtonEnabled(int id, boolean enabled) {
-		AbstractButton button = getButton(id);
-		if (button == null)
-			return;
-		button.setEnabled(enabled);
-	}
-
-	/**
-	 * Sets whether a tool or action is activated or not.
-	 * 
-	 * @param id
-	 *            tool or actionID
-	 * @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 setButtonEnabled(int id, boolean enabled, boolean hideOnDisable) {
-		AbstractButton button = getButton(id);
-		if (button == null)
-			return;
-		button.setEnabled(enabled);
-		// if button is enabled, it becomes visible anyway
-		// if button is disabled and the "hide" option is set, it is also hidden
-		if (enabled)
-			button.setVisible(true);
-		else
-			button.setVisible(!hideOnDisable);
-	}
-
-	/**
-	 * Checks whether a ID is already used for a tool or action.
-	 * 
-	 * @param tool
-	 *            tool ID
-	 */
-	public boolean isButtonIDUsed(int id) {
-		return toolAndActionButtons.get(id) != null;
-	}
-
-	/**
-	 * Checks whether a tool is activated.
-	 * 
-	 * @param tool
-	 *            tool ID
-	 * @return {@code false} if an unknown ID is specified
-	 */
-	public boolean isButtonEnabled(int id) {
-		AbstractButton button = getButton(id);
-		if (button != null)
-			return button.isEnabled();
-		return false;
-	}
-
-	/**
-	 * Sets the activation for all tools.
-	 * 
-	 * @param enabled
-	 *            if {@code true} all tools 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) {
-		for (int id : toolAndActionButtons.keySet()) {
-			if (toolAndActionButtons.get(id) instanceof JToggleButton) {
-				setButtonEnabled(id, enabled, hideOnDisable);
-			}
-		}
-	}
-
-	/**
-	 * Sets the activation for all actions.
-	 * 
-	 * @param enabled
-	 *            if {@code true} all actions becomes available
-	 * @param hideOnDisable
-	 *            if {@code true} the buttons are also hidden if {@code enabled}
-	 *            is {@code false}
-	 */
-	public void setAllActionsEnabled(boolean enabled, boolean hideOnDisable) {
-		for (int id : toolAndActionButtons.keySet()) {
-			if (toolAndActionButtons.get(id) instanceof JButton) {
-				setButtonEnabled(id, enabled, hideOnDisable);
-			}
-		}
-
-	}
-
-	/**
-	 * Returns the maximum ID of tools.
-	 */
-	public int getMaxToolID() {
-		return toolAndActionButtons.lastKey();
-	}
-
-	/**
-	 * Returns the minimum ID of tools.
-	 */
-	public int getMinToolID() {
-		return toolAndActionButtons.firstKey();
-	}
-
-	/**
-	 * Extends the {@link AbstractAction} with maintaining an ID and the
-	 * {@link MapPaneToolBar} the actions controls. Additionally this class
-	 * automatically calls
-	 * {@link MapPaneToolBar#performToolButton(int, ActionEvent)} or
-	 * {@link MapPaneToolBar#performActionButton(int, ActionEvent)} depending on
-	 * whether the action is added via
-	 * {@link MapPaneToolBar#addTool(MapPaneToolBarAction)} or
-	 * {@link MapPaneToolBar#addAction(MapPaneToolBarAction)}.
-	 * 
-	 * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
-	 *         (University of Bonn/Germany)
-	 */
-	public static class MapPaneToolBarAction extends AbstractAction {
-		/** The ID of the action */
-		protected int id = -1;
-		/** The tool bar, this action is made for. */
-		protected MapPaneToolBar toolBar = null;
-
-		/**
-		 * Creates a new action with a dummy description and no icon.
-		 * 
-		 * @param id
-		 *            unique ID for the action
-		 * @param toolBar
-		 *            toolbar this action is made for
-		 */
-		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar) {
-			this(id, toolBar, "" + id);
-		}
-
-		/**
-		 * Creates a new action without an icon.
-		 * 
-		 * @param id
-		 *            unique ID for the action
-		 * @param toolBar
-		 *            toolbar this action is made for
-		 * @param name
-		 *            description used for buttons or menus
-		 */
-		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, String name) {
-			this(id, toolBar, name, null);
-		}
-
-		/**
-		 * Creates a new action.
-		 * 
-		 * @param id
-		 *            unique ID for the action
-		 * @param toolBar
-		 *            toolbar this action is made for
-		 * @param name
-		 *            description used for buttons or menus
-		 * @param icon
-		 *            icon used for buttons or menus
-		 */
-		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
-				String name, Icon icon) {
-			this(id, toolBar, name, icon, null);
-		}
-
-		/**
-		 * Creates a new action.
-		 * 
-		 * @param id
-		 *            unique ID for the action
-		 * @param toolBar
-		 *            The {@link MapPaneToolBar} this action is made for
-		 * @param name
-		 *            description used for buttons or menus
-		 * @param icon
-		 *            icon used for buttons or menus
-		 * @param toolTip
-		 *            Tooltip to use for the button or menu
-		 */
-		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
-				String name, Icon icon, String toolTip) {
-			super(name, icon);
-
-			if (toolTip != null && !toolTip.trim().isEmpty()) {
-				putValue(Action.SHORT_DESCRIPTION, toolTip);
-			}
-
-			this.id = id;
-			this.toolBar = toolBar;
-		}
-
-		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
-				XMapPaneTool tool) {
-			this(id, toolBar, "", tool.getIcon(), tool.getToolTip());
-		}
-
-		/**
-		 * Calls {@link MapPaneToolBar#performToolButton(int, ActionEvent)} or
-		 * {@link MapPaneToolBar#performActionButton(int, ActionEvent)}
-		 * depending on whether the action is added to the toolbar via
-		 * {@link MapPaneToolBar#addTool(MapPaneToolBarAction)} or
-		 * {@link MapPaneToolBar#addAction(MapPaneToolBarAction)}.
-		 */
-		public void actionPerformed(ActionEvent e) {
-			if (toolBar.toolAndActionButtons.get(id) instanceof JToggleButton)
-				toolBar.performToolButton(id, e);
-			else if (toolBar.toolAndActionButtons.get(id) instanceof JButton)
-				toolBar.performActionButton(id, e);
-		}
-
-		/**
-		 * Returns the (unique) id of this action.
-		 * 
-		 * @return
-		 */
-		public int getID() {
-			return id;
-		}
-	}
-
-	/**
-	 * Nuetzlich wenn die Componente gedruckt (z.B. wenn ein Screenshot gemacht
-	 * wird) wird. Dann werden wird der Hintergrund auf WEISS gesetzt.
-	 * 
-	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
-	 */
-	@Override
-	public void print(Graphics g) {
-		Color orig = getBackground();
-		setBackground(Color.WHITE);
-		// wrap in try/finally so that we always restore the state
-		try {
-			super.print(g);
-		} finally {
-			setBackground(orig);
-		}
-	}
-
-	@Override
-	protected void finalize() throws Throwable {
-		super.finalize();
-
-		if (mapPane != null && mapPaneListener != null)
-			mapPane.removeMapPaneListener(mapPaneListener);
-	}
-
-}

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolSelectedListener.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolSelectedListener.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapPaneToolSelectedListener.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,7 +0,0 @@
-package de.schmitzm.geotools;
-
-public interface MapPaneToolSelectedListener {
-	
-	public void toolSelected( int toolId) ;
-	
-}

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapView.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapView.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/MapView.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,252 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Martin O. J. Schmitz.
- * 
- * This file is part of the SCHMITZM library - a collection of utility 
- * classes based on Java 1.6, focusing (not only) on Java Swing 
- * and the Geotools library.
- * 
- * The SCHMITZM project is hosted at:
- * http://wald.intevation.org/projects/schmitzm/
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public License (license.txt)
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
- * or try this link: http://www.gnu.org/licenses/lgpl.html
- * 
- * Contributors:
- *     Martin O. J. Schmitz - initial API and implementation
- *     Stefan A. Tzeggai - additional utility classes
- ******************************************************************************/
-package de.schmitzm.geotools;
-
-import java.awt.BorderLayout;
-import java.awt.Component;
-
-import javax.swing.BorderFactory;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import javax.swing.JSplitPane;
-
-import net.miginfocom.swing.MigLayout;
-
-import org.apache.log4j.Logger;
-
-import de.schmitzm.geotools.gui.GeoMapPane;
-import de.schmitzm.geotools.gui.MapContextControlPane;
-import de.schmitzm.geotools.gui.MapPaneStatusBar;
-import de.schmitzm.geotools.gui.SelectableXMapPane;
-import de.schmitzm.geotools.styling.ColorMapManager;
-
-/**
- * TODO Dokument
- */
-public class MapView extends JPanel {
-	private static final Logger LOGGER = Logger.getLogger(MapView.class);
-
-	private final JSplitPane splitPane = new JSplitPane(
-			JSplitPane.HORIZONTAL_SPLIT);
-
-	protected MapPaneStatusBar statusBar = null;
-	/**
-	 * Komponente, in der die Karten, der Massstab und das Koordinaten-Raster
-	 * dargestellt werden.
-	 */
-	protected final GeoMapPane geoMapPane = new GeoMapPane();
-
-	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 SelectableXMapPane}
-	 */
-	public MapView(Component parentGui, MapPaneToolBar toolBar) {
-		super(new BorderLayout());
-		// Call initialize() by yourself afterwards.
-		// Needed because variables for the overwritten methods
-		// are not yet set.
-		jToolBar = toolBar;
-
-		// By default the MapPane will render with antialiasing on
-		getGeoMapPane().getMapPane().setAntiAliasing(true);
-	}
-
-	/**
-	 * 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 SelectableXMapPane}
-	 */
-	public MapView(Component parentGui) {
-		this(parentGui, null);
-	}
-
-	/**
-	 * 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}
-	 * 
-	 * @see #adjustSizeOfGeoMapPane()
-	 */
-	public void initialize() {
-		// horizontales SplitPane initialisieren
-
-		// Status-Line to show Coordinates and Rastervalues.
-		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.
-		 * setDividerLocation(-1); has no effect here because the component is
-		 * not visible yet.
-		 */
-		getSplitPane().setDividerSize(5);
-
-		getSplitPane().setResizeWeight(0.0);
-		getSplitPane().add(getSidePane());
-
-		/***********************************************************************
-		 * To the right side we now add a JPanel that consists of a toolbar and
-		 * a gmp
-		 */
-		JPanel newRight = new JPanel(new MigLayout("center, wrap 1", "[grow]",
-				"[][grow]"));
-		newRight.add(getToolBar());
-//		/ crsName
-//		newRight.add(new CrsLabel(getGeoMapPane().getMapPane()), "align right");
-		newRight.add(getGeoMapPane(), "growx, growy");
-		getSplitPane().add(newRight);
-
-		this.add(getSplitPane(), BorderLayout.CENTER);
-
-	}
-
-	/**
-	 * Returns the tool bar which controls the active mouse actions on the map.
-	 * 
-	 * @return never <code>null</code>, will rather create a default
-	 */
-	public MapPaneToolBar getToolBar() {
-		if (jToolBar == null) {
-			jToolBar = new MapPaneToolBar(getMapPane());
-		}
-		return jToolBar;
-	}
-
-	/**
-	 * Returns the split pane which divides the layer list from the map panel.
-	 */
-	public JSplitPane getSplitPane() {
-		return splitPane;
-	}
-
-	/**
-	 * 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);
-	}
-
-	/**
-	 * 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);
-	}
-
-	/**
-	 * 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);
-	}
-
-	/**
-	 * called by initialize() to fill the left of the XULUMapView Supposed to be
-	 * overwritten by AtlasMapView or DesignMapView
-	 */
-	public JComponent getSidePane() {
-		return new MapContextControlPane(getGeoMapPane().getMapPane(),
-				new ColorMapManager());
-	}
-
-	/**
-	 * Liefert die Status-Zeile, in der die Koordinaten und Raster-Werte
-	 * angezeigt werden.
-	 */
-	public MapPaneStatusBar getStatusBar() {
-		return this.statusBar;
-	}
-
-	/**
-	 * Liefert den Karten-Bereich der Komponente.
-	 */
-	public final SelectableXMapPane getMapPane() {
-		return getGeoMapPane().getMapPane();
-	}
-
-	public GeoMapPane getGeoMapPane() {
-		return geoMapPane;
-	}
-
-	public int getSelectedTool() {
-		return jToolBar.getSelectedTool();
-	}
-
-	/**
-	 * Help the garbage collection
-	 */
-	public void dispose() {
-		if (geoMapPane != null)
-			geoMapPane.dispose();
-	}
-
-}

Added: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/CrsLabel.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/CrsLabel.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/CrsLabel.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -0,0 +1,51 @@
+package de.schmitzm.geotools.gui;
+
+import javax.swing.JLabel;
+
+import de.schmitzm.geotools.gui.GeotoolsGUIUtil;
+import de.schmitzm.geotools.gui.SelectableXMapPane;
+import de.schmitzm.geotools.gui.XMapPaneEvent;
+import de.schmitzm.geotools.map.event.JMapPaneListener;
+
+public class CrsLabel extends JLabel {
+
+	private JMapPaneListener listenForCrsChange = new JMapPaneListener() {
+
+		@Override
+		public void performMapPaneEvent(XMapPaneEvent e) {
+			updateCrs();
+		}
+	};
+
+	private final SelectableXMapPane mapPane;
+
+	public CrsLabel(SelectableXMapPane mapPane) {
+		super();
+		this.mapPane = mapPane;
+
+		mapPane.addMapPaneListener(listenForCrsChange);
+
+		updateCrs();
+
+		setToolTipText(GeotoolsGUIUtil.R("CRSLabel.TT"));
+	}
+
+	public void updateCrs() {
+		String crsName = "";
+		try {
+			crsName = mapPane.getMapContext().getCoordinateReferenceSystem()
+					.getName().toString();
+			setText(GeotoolsGUIUtil.R("CRSLabel", crsName));
+		} catch (Exception e) {
+			setText("");
+		}
+	}
+
+	@Override
+	protected void finalize() throws Throwable {
+		super.finalize();
+		if (mapPane != null)
+			mapPane.removeMapPaneListener(listenForCrsChange);
+	}
+
+}

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource.20080424
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource.20080424	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource.20080424	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,93 +0,0 @@
-/** XULU - This file is part of the eXtendable Unified Land Use Modelling Platform (XULU)
-
-    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
-    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
-    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
-
-    Diese Bibliothek ist freie Software; Sie dürfen sie unter den Bedingungen der GNU Lesser General Public License, wie von der Free Software Foundation veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß Version 2.1 der Lizenz oder (nach Ihrer Option) jeder späteren Version.
-    Diese Bibliothek wird in der Hoffnung weiterverbreitet, daß sie nützlich sein wird, jedoch OHNE IRGENDEINE GARANTIE, auch ohne die implizierte Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Mehr Details finden Sie in der GNU Lesser General Public License.
-    Sie sollten eine Kopie der GNU Lesser General Public License zusammen mit dieser Bibliothek erhalten haben; falls nicht, schreiben Sie an die Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
- **/
-
-package schmitzm.geotools.gui;
-
-import java.util.ResourceBundle;
-import schmitzm.lang.HashtableResourceBundle;
-
-// nur fuer Doku
-import java.util.Locale;
-
-/**
- * Dieses Standard-ResourceBundle stellt folgende Objekte fuer Geotools-Komponenten
- * zur Verfuegung.
- * <table align=center border=2 cellpadding=5><code>
- * <tr><th>Key</th><th>Ressource</th></tr>
- * <tr><td><code>Attributes</code></td><td>"Attributes"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.FeatureCollectionFilterPanel.testButton</code></td><td>"Test filter"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE</code></td><td>"Feature-Filter"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.INFO</code></td><td>"Info"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN</code></td><td>"Zoom in"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT</code></td><td>"Zoom out"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP</code></td><td>"Select from top layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.SELECT_ALL</code></td><td>"Select from all layers"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_UP</code></td><td>"Move layer UP"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_DOWN</code></td><td>"Move layer DOWN"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.ZOOM_TO</code></td><td>"Zoom to layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.FILTER</code></td><td>"Filter layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.RECOLOR</code></td><td>"Recolor layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.REMOVE</code></td><td>"Remove layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.SHOWALL</code></td><td>"Show all layers"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.HIDEALL</code></td><td>"Hide all layers"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.INVERTALL</code></td><td>"Invert all layers"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.CUSTOMIZE</code></td><td>"Customize..."</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.ColorMapDialog.TITLE</code></td><td>"Color map"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.TITLE</code></td><td>"New color map"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.QUESTION</code></td><td>"Enter a name for the new color map..."</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.QUANTITY</code></td><td>"Quantity"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.COLOR</code></td><td>"Color"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.LABEL</code></td><td>"Label"</td></tr>
- * </table>
- * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
- * @version 1.0
- */
-public class GTResource extends HashtableResourceBundle {
-  /**
-   * Enthaelt eine Referenz auf die Ressourcen in den Default-Locale
-   * @see Locale#setDefault(Locale)
-   */
-  public static final ResourceBundle DEFAULT = ResourceBundle.getBundle(GTResource.class.getName());
-
-  /**
-   * Liefert die (Key/Wert)-Paerchen. Die Keys (erste Dimension) muessen aus Strings
-   * bestehen.
-   */
-  public Object[][] getContents() {
-    return new Object[][] {
-        {"Attributes","Attributes"},
-        {"schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestButton","Test filter"},
-        {"schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE","Feature-Filter"},
-        {"schmitzm.geotools.gui.MapActionControlPane.INFO","Info"},
-        {"schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN","Zoom in"},
-        {"schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT","Zoom out"},
-        {"schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP","Select from top layer"},
-        {"schmitzm.geotools.gui.MapActionControlPane.SELECT_ALL","Select from all layers"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_UP","Move layer UP"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_DOWN","Move layer DOWN"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.ZOOM_TO","Zoom to layer"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.FILTER","Filter layer..."},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.RECOLOR","Recolor layer"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.REMOVE","Remove layer"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.SHOWALL","Show all layers"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.HIDEALL","Hide all layers"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.INVERTALL","Invert all layers"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.CUSTOMIZE","Customize..."},
-        {"schmitzm.geotools.gui.MapContextControlPane.ColorMapDialog.TITLE","Color map"},
-        {"schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.TITLE","New color map"},
-        {"schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.QUESTION","Enter a name for the new color map..."},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.QUANTITY","Quantity"},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.COLOR","Color"},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.LABEL","Label"}
-    };
-  }
-
-}

Deleted: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource_de.20080424
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource_de.20080424	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/GTResource_de.20080424	2011-01-27 11:29:08 UTC (rev 1421)
@@ -1,85 +0,0 @@
-/** XULU - This file is part of the eXtendable Unified Land Use Modelling Platform (XULU)
-
-    This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
-    This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
-    You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
-
-    Diese Bibliothek ist freie Software; Sie dürfen sie unter den Bedingungen der GNU Lesser General Public License, wie von der Free Software Foundation veröffentlicht, weiterverteilen und/oder modifizieren; entweder gemäß Version 2.1 der Lizenz oder (nach Ihrer Option) jeder späteren Version.
-    Diese Bibliothek wird in der Hoffnung weiterverbreitet, daß sie nützlich sein wird, jedoch OHNE IRGENDEINE GARANTIE, auch ohne die implizierte Garantie der MARKTREIFE oder der VERWENDBARKEIT FÜR EINEN BESTIMMTEN ZWECK. Mehr Details finden Sie in der GNU Lesser General Public License.
-    Sie sollten eine Kopie der GNU Lesser General Public License zusammen mit dieser Bibliothek erhalten haben; falls nicht, schreiben Sie an die Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA.
- **/
-
-package schmitzm.geotools.gui;
-
-import java.util.ResourceBundle;
-import schmitzm.lang.HashtableResourceBundle;
-
-// nur fuer Doku
-import java.util.Locale;
-
-/**
- * Dieses Standard-ResourceBundle stellt folgende Objekte fuer Swing-Komponenten
- * zur Verfuegung.
- * <table align=center border=2 cellpadding=5><code>
- * <tr><th>Key</th><th>Ressource</th></tr>
- * <tr><td><code>Attributes</code></td><td>"Attribute"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.FeatureCollectionFilterPanel.testButton</code></td><td>"Filter testen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE</code></td><td>"Feature-Filter"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN</code></td><td>"Heran zoomen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT</code></td><td>"Heraus zoomen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP</code></td><td>"Auswählen aus oberstem Layer"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapActionControlPane.SELECT_ALL</code></td><td>"Auswählen aus allen Layern"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_UP</code></td><td>"Nach OBEN schieben"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_DOWN</code></td><td>"Nach UNTEN schieben"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.ZOOM_TO</code></td><td>"Zu Layer zoomen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.FILTER</code></td><td>"Layer filtern..."</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.RECOLOR</code></td><td>"Färbung ändern"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.REMOVE</code></td><td>"Layer entfernen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.SHOWALL</code></td><td>"Alle layer anzeigen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.HIDEALL</code></td><td>"Alle layer verbergen"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.INVERTALL</code></td><td>"Alle layer invertieren"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.Menu.CUSTOMIZE</code></td><td>"Anpassen..."</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.ColorMapDialog.TITLE</code></td><td>"Farbpalette"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.TITLE</code></td><td>"Farbpalette speichern"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.QUESTION</code></td><td>"Name für neue Farbpalette..."</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.QUANTITY</code></td><td>"Raster-Wert"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.COLOR</code></td><td>"Farbe"</td></tr>
- * <tr><td><code>schmitzm.geotools.gui.ColorMapTable.Header.LABEL</code></td><td>"Label"</td></tr>
- * </table>
- * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a> (University of Bonn/Germany)
- * @version 1.0
- */
-public class GTResource_de extends GTResource {
-  /**
-   * Liefert die (Key/Wert)-Paerchen. Die Keys (erste Dimension) muessen aus Strings
-   * bestehen.
-   */
-  public Object[][] getContents() {
-    return new Object[][] {
-        {"Attributes","Attribute"},
-        {"schmitzm.geotools.gui.FeatureCollectionFilterPanel.TestButton","Filter testen"},
-        {"schmitzm.geotools.gui.FeatureLayerFilterDialog.TITLE","Feature-Filter"},
-        {"schmitzm.geotools.gui.MapActionControlPane.ZOOM_IN","Heran zoomen"},
-        {"schmitzm.geotools.gui.MapActionControlPane.ZOOM_OUT","Heraus zoomen"},
-        {"schmitzm.geotools.gui.MapActionControlPane.SELECT_TOP","Auswählen aus oberstem Layer"},
-        {"schmitzm.geotools.gui.MapActionControlPane.SELECT_ALL","Auswählen aus allen Layern"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_UP","Nach OBEN schieben"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.MOVE_DOWN","Nach UNTEN schieben"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.ZOOM_TO","Zu Layer zoomen"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.FILTER","Layer filtern..."},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.RECOLOR","Färbung ändern"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.REMOVE","Layer entfernen"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.SHOWALL","Alle Layer anzeigen"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.HIDEALL","Alle Layer verbergen"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.INVERTALL","Alle Layer invertieren"},
-        {"schmitzm.geotools.gui.MapContextControlPane.Menu.CUSTOMIZE","Anpassen..."},
-        {"schmitzm.geotools.gui.MapContextControlPane.ColorMapDialog.TITLE","Farbpalette"},
-        {"schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.TITLE","Farbpalette speichern"},
-        {"schmitzm.geotools.gui.MapContextControlPane.SaveColorMapDialog.QUESTION","Name für neue Farbpalette..."},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.QUANTITY","Raster-Wert"},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.COLOR","Farbe"},
-        {"schmitzm.geotools.gui.ColorMapTable.Header.LABEL","Label"}
-    };
-  }
-
-}

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneStatusBar.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneStatusBar.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneStatusBar.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -35,7 +35,7 @@
 import javax.swing.SwingConstants;
 
 import net.miginfocom.swing.MigLayout;
-import de.schmitzm.geotools.CrsLabel;
+import de.schmitzm.geotools.gui.CrsLabel;
 import de.schmitzm.swing.JPanel;
 
 /**

Added: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolBar.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolBar.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolBar.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -0,0 +1,928 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Martin O. J. Schmitz.
+ * 
+ * This file is part of the SCHMITZM library - a collection of utility 
+ * classes based on Java 1.6, focusing (not only) on Java Swing 
+ * and the Geotools library.
+ * 
+ * The SCHMITZM project is hosted at:
+ * http://wald.intevation.org/projects/schmitzm/
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License (license.txt)
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * or try this link: http://www.gnu.org/licenses/lgpl.html
+ * 
+ * Contributors:
+ *     Martin O. J. Schmitz - initial API and implementation
+ *     Stefan A. Tzeggai - additional utility classes
+ ******************************************************************************/
+package de.schmitzm.geotools.gui;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import javax.swing.AbstractAction;
+import javax.swing.AbstractButton;
+import javax.swing.Action;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JToggleButton;
+import javax.swing.JToolBar;
+
+import org.apache.log4j.Logger;
+
+import com.vividsolutions.jts.geom.Envelope;
+
+import de.schmitzm.geotools.gui.GeotoolsGUIUtil;
+import de.schmitzm.geotools.gui.SelectableXMapPane;
+import de.schmitzm.geotools.gui.XMapPaneEvent;
+import de.schmitzm.geotools.gui.XMapPaneTool;
+import de.schmitzm.geotools.map.event.JMapPaneListener;
+import de.schmitzm.geotools.map.event.MapAreaChangedEvent;
+import de.schmitzm.swing.ButtonGroup;
+import de.schmitzm.swing.SmallButton;
+import de.schmitzm.swing.SmallToggleButton;
+
+/**
+ * A toolbar to control an {@link SelectableXMapPane} (Atlas visualization).
+ * This contains two types of buttons. A group of <i>tools</i> for the mouse
+ * actions on the map represented by {@link JToggleButton JToggleButtons}, where
+ * only one tool can be activated every time. And some (general) <i>actions</i>,
+ * represented by normal {@link JButton JButtons}.
+ * 
+ * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
+ *         (University of Bonn/Germany)
+ * @version 1.2 Stefan Tzeggai
+ */
+public class MapPaneToolBar extends JToolBar {
+	private static final Logger LOGGER = Logger.getLogger(MapPaneToolBar.class
+			.getName());
+
+	public static String R(String key, Object... values) {
+		return GeotoolsGUIUtil.R(key, values);
+	}
+
+	/** Constant for the tool "Panning" (10). */
+	public static final int TOOL_PAN = 10;
+	/** Constant for the tool "Info" (20). */
+	public static final int TOOL_INFO = 20;
+	public static final int SEPERATOR0 = 99;
+
+	/** Constant for the tool "Zoom In" (110). */
+	public static final int TOOL_ZOOMIN = 110;
+	public static final int ACTION_ZOOM_DEFAULT = 150;
+	/** Constant for the tool "Zoom Out" (120). */
+	public static final int TOOL_ZOOMOUT = 120;
+	/** Constant for the action "Zoom back" (130). */
+	public static final int ACTION_ZOOM_BACK = 130;
+	/** Constant for the action "Zoom forward" (140). */
+	public static final int ACTION_ZOOM_FORWARD = 140;
+	public static final int SEPERATOR1 = 199;
+
+	/**
+	 * Constant for the tool "Selection Reset" which clears the selection (240).
+	 */
+	public static final int TOOL_SELECTION_CLEAR = 240;
+
+	/**
+	 * Constant for the tool "Select" which sets the Selection to the selected
+	 * features (210).
+	 */
+	public static final int TOOL_SELECTION_SET = 210;
+	/**
+	 * Constant for the tool "Selection add" which adds the features to the
+	 * Selection (220).
+	 */
+	public static final int TOOL_SELECTION_ADD = 220;
+	/**
+	 * Constant for the tool "Selection subtract" which removes the selected
+	 * features from the selection (230).
+	 */
+	public static final int TOOL_SELECTION_REMOVE = 230;
+
+	public static final int ACTION_CHARTS = 401;
+
+	/** Tool currently selected */
+	protected int selectedTool = TOOL_ZOOMIN;
+
+	/** Holds the tool buttons of the tool bar. */
+	final protected SortedMap<Integer, JComponent> toolAndActionButtons = new TreeMap<Integer, JComponent>();
+	/** Controls that only one tool button is activated. */
+	protected ButtonGroup toolButtonGroup = null;
+
+	// SK: Musste ich ändern damit man Tools und Actions in der Reihenfolge
+	// mischen kann.
+	// /** Holds the action buttons of the bar. */
+	// protected SortedMap<Integer, JButton> actionButtons = null;
+
+	/** Holds the {@link SelectableXMapPane} this tool bar controls. */
+	protected SelectableXMapPane mapPane = null;
+
+	/**
+	 * A List to remember the last Envelopes that have been watched. Used for
+	 * the zoomBack- and zoomForwardButtons *
+	 */
+	protected ArrayList<Envelope> lastZooms = new ArrayList<Envelope>();
+	/** Holds the index to the current element in {@link #lastZooms}. */
+	protected int zoomBackIndex = 0;
+
+	/** Listener to sniff the zoom actions on the map. */
+	protected JMapPaneListener mapPaneListener = null;
+
+	protected boolean zoomBackForwardButtonInAction;
+
+	/** Listeners what want to be informed about a change of the selected tool **/
+	protected Set<MapPaneToolSelectedListener> toolSelectionListeners = new HashSet<MapPaneToolSelectedListener>();
+
+	/** This listener is added to all {@link JToggleButton} **/
+	private final ActionListener toolSelectedListener = new ActionListener() {
+
+		@Override
+		public void actionPerformed(ActionEvent e) {
+			JToggleButton tb = (JToggleButton) e.getSource();
+
+			// Inform the listeners about a newly selected tool
+			for (MapPaneToolSelectedListener l : toolSelectionListeners) {
+				l.toolSelected(Integer.valueOf(tb.getName()));
+			}
+		}
+
+	};
+
+	/**
+	 * Creates a new toolbar. Notice: This toolbar does nothing until
+	 * {@link #setMapPane(SelectableXMapPane)} is called!
+	 */
+	public MapPaneToolBar() {
+		this(null);
+	}
+
+	public void addButtonSelectedListener(MapPaneToolSelectedListener listener) {
+		toolSelectionListeners.add(listener);
+	}
+
+	public void removeButtonSelectedListener(
+			MapPaneToolSelectedListener listener) {
+		toolSelectionListeners.remove(listener);
+	}
+
+	/**
+	 * Creates a new tool bar.
+	 * 
+	 * @param mapPane
+	 *            {@link SelectableXMapPane} the tool bar controls
+	 */
+	public MapPaneToolBar(SelectableXMapPane mapPane) {
+		super("Control the map", JToolBar.HORIZONTAL);
+
+		// I want to see nothing on the background
+		setOpaque(false);
+		setBorder(null);
+
+		this.toolButtonGroup = new ButtonGroup();
+
+		// Create a Listener to listen to the zooms on the JMapPane
+		this.mapPaneListener = new JMapPaneListener() {
+			public void performMapPaneEvent(XMapPaneEvent e) {
+
+				if (!(e instanceof MapAreaChangedEvent))
+					return;
+
+				if (zoomBackForwardButtonInAction) {
+					zoomBackForwardButtonInAction = false;
+					return;
+				}
+
+				final MapAreaChangedEvent mapAreaChangedEvent = (MapAreaChangedEvent) e;
+				Envelope oldMapArea = mapAreaChangedEvent.getOldMapArea();
+
+				final Envelope mapArea = mapAreaChangedEvent.getNewMapArea();
+				if (mapArea == null || mapArea.equals(oldMapArea)
+						|| Double.isNaN(mapArea.getMinX())
+						|| Double.isNaN(mapArea.getMaxX())
+						|| Double.isNaN(mapArea.getMinY())
+						|| Double.isNaN(mapArea.getMaxY())) {
+					// If the MapArea didn't change... we don't want to register
+					// it as a zoom action.
+					return;
+				}
+
+				if (lastZooms.size() == 0
+						&& oldMapArea != null
+						&& !oldMapArea.isNull()
+						&& !(Double.isNaN(oldMapArea.getMinX())
+								|| Double.isNaN(oldMapArea.getMaxX())
+								|| Double.isNaN(oldMapArea.getMinY()) || Double
+								.isNaN(oldMapArea.getMaxY()))) {
+					lastZooms.add(oldMapArea);
+					zoomBackIndex = 1;
+				}
+				if (mapArea == null)
+					return;
+
+				if (lastZooms.size() > 0
+						&& mapArea.equals(lastZooms.get(lastZooms.size() - 1))) {
+					// LOGGER.debug("MapAreaChangedEvent ausgelassen bei der Zaehlung der Zoomschritt weil identisch");
+					return;
+				}
+
+				if (lastZooms.size() > 0)
+					while (zoomBackIndex < lastZooms.size())
+						lastZooms.remove(lastZooms.size() - 1);
+
+				lastZooms.add(mapArea);
+				zoomBackIndex = lastZooms.size();
+				setButtonEnabled(ACTION_ZOOM_BACK, lastZooms.size() > 1);
+				setButtonEnabled(ACTION_ZOOM_FORWARD, false);
+			}
+
+		};
+
+		setMapPane(mapPane);
+		setFloatable(false);
+		setRollover(true);
+
+		init();
+	}
+
+//	private CrsLabel getCrsComponent() {
+//		if (crsViewer == null) {
+//			crsViewer = new CrsLabel(this.mapPane);
+//		}
+//		return crsViewer;
+//	}
+
+	/**
+	 * Sets the {@link SelectableXMapPane} controlled by this tool bar.
+	 * 
+	 * @param mapPane
+	 *            {@link SelectableXMapPane} to control (if {@code null} this
+	 *            tool bar controls NOTHING!)
+	 */
+	public void setMapPane(SelectableXMapPane mapPane) {
+		// Remove listener from old MapPane
+		if (this.mapPane != null)
+			this.mapPane.removeMapPaneListener(mapPaneListener);
+		this.mapPane = mapPane;
+		if (this.mapPane != null && mapPaneListener != null)
+			this.mapPane.addMapPaneListener(mapPaneListener);
+	}
+
+	/**
+	 * Calls {@link #initToolsAndActions()} and {@link #initActions()} and then
+	 * puts all tool buttons and all actions buttons to the tool bar.
+	 */
+	protected void init() {
+
+		initToolsAndActions();
+
+		addSeparator(SEPERATOR0, new JToolBar.Separator());
+		addSeparator(SEPERATOR1, new JToolBar.Separator());
+
+		initToolBar();
+	}
+
+	/**
+	 * Creates the tool buttons and action buttons and seperators, adds them to
+	 * {@link #toolAndActionButtons} and finally creates a button group for all
+	 * tools. So sub-classes which override this method should FIRST add their
+	 * new tool buttons to {@link #toolAndActionButtons} before calling
+	 * {@code super.initTools()}.
+	 */
+	protected void initToolsAndActions() {
+		// Pan
+		addTool(new MapPaneToolBarAction(TOOL_PAN, this, XMapPaneTool.PAN),
+				false);
+
+		// Info
+		addTool(new MapPaneToolBarAction(TOOL_INFO, this, XMapPaneTool.INFO),
+				false);
+
+		// Zoom in
+		addTool(new MapPaneToolBarAction(TOOL_ZOOMIN, this,
+				XMapPaneTool.ZOOM_IN), false);
+
+		// Zoom out
+		addTool(new MapPaneToolBarAction(TOOL_ZOOMOUT, this,
+				XMapPaneTool.ZOOM_OUT), false);
+
+		// Action button to revert the last zoom
+		addAction(
+				new MapPaneToolBarAction(ACTION_ZOOM_BACK, this, "",
+						new ImageIcon(MapView.class
+								.getResource("resource/icons/zoom_back.png")),
+						R("MapPaneButtons.LastZoom.TT")), false);
+		setButtonEnabled(ACTION_ZOOM_BACK, false);
+
+		// Action button to redo the last zoom
+		addAction(
+				new MapPaneToolBarAction(
+						ACTION_ZOOM_FORWARD,
+						this,
+						"",
+						new ImageIcon(MapView.class
+								.getResource("resource/icons/zoom_forward.png")),
+						R("MapPaneButtons.NextZoom.TT")), false);
+		setButtonEnabled(ACTION_ZOOM_FORWARD, false);
+
+		// set the selected tool enabled
+		setSelectedTool(selectedTool);
+
+	}
+
+	@Override
+	public void paint(Graphics g) {
+		super.paint(g);
+	}
+
+	/**
+	 * Clears the GUI of all components and adds all tool and action buttons to
+	 * the tool bar.
+	 */
+	public void initToolBar() {
+		removeAll();
+
+		// // Separator to the left of the tool actions to start
+		// // the tool buttons with the map (not with the coordinate grid)
+		// Dimension dimension = new Dimension(49, 10);
+		// addSeparator(dimension);
+
+		// Tool buttons
+		for (Integer bKey : toolAndActionButtons.keySet()) {
+
+			JComponent b = toolAndActionButtons.get(bKey);
+
+			if (b instanceof JToggleButton) {
+				JToggleButton tb = (JToggleButton) b;
+				tb.setName(bKey.toString());
+				tb.addActionListener(toolSelectedListener);
+			}
+
+			add(b);
+		}
+
+		if (!toolAndActionButtons.containsKey(selectedTool)) {
+			/**
+			 * This might be a bit specific, but IF selection buttons are
+			 * available, select one of them.. if not, select the INFO tool.
+			 */
+
+			if (toolAndActionButtons.containsKey(TOOL_SELECTION_SET)) {
+				setSelectedTool(TOOL_SELECTION_SET);
+			} else if (toolAndActionButtons.containsKey(TOOL_INFO)) {
+				setSelectedTool(TOOL_INFO);
+			} else {
+				// TODO What to do now?!
+				setSelectedTool(null);
+			}
+
+		}
+
+		revalidate();
+		repaint();
+	}
+
+	/**
+	 * Performs the activation of a tool.
+	 * 
+	 * @param tool
+	 *            the tool to activate
+	 * @param e
+	 *            the event of the button
+	 */
+	public void performToolButton(int tool, ActionEvent e) {
+		if (mapPane == null)
+			return;
+
+		selectedTool = tool;
+
+		switch (tool) {
+		case TOOL_PAN:
+			mapPane.setTool(XMapPaneTool.PAN);
+			break;
+		case TOOL_INFO:
+			mapPane.setTool(XMapPaneTool.INFO);
+			break;
+		case TOOL_ZOOMIN:
+			mapPane.setTool(XMapPaneTool.ZOOM_IN);
+			break;
+		case TOOL_ZOOMOUT:
+			mapPane.setTool(XMapPaneTool.ZOOM_OUT);
+			break;
+		}
+	}
+
+	/**
+	 * @param id
+	 *            The ID of the Component to remove. The change will not be
+	 *            visible until {@link #initToolBar()} is called.
+	 * @return <code>null</code> or the component that has been removed.
+	 */
+	public JComponent removeId(int id) {
+		return toolAndActionButtons.remove(id);
+	}
+
+	/**
+	 * Performs the action of an action button.
+	 * 
+	 * @param tool
+	 *            the action
+	 * @param e
+	 *            the event of the button
+	 */
+	protected void performActionButton(int action, ActionEvent e) {
+		if (mapPane == null)
+			return;
+
+		// Perform the action "Zoom back": Revert the last zoom
+		if (action == ACTION_ZOOM_BACK) {
+			if (zoomBackIndex <= 1)
+				return;
+
+			zoomBackForwardButtonInAction = true;
+			zoomBackIndex--;
+			getButton(ACTION_ZOOM_FORWARD).setEnabled(true);
+			getButton(ACTION_ZOOM_BACK).setEnabled(zoomBackIndex > 1);
+
+			mapPane.setMapArea(lastZooms.get(zoomBackIndex - 1));
+			mapPane.refresh();
+		}
+
+		// Perform the action "Zoom forward": Re-do the last zoom
+		if (action == ACTION_ZOOM_FORWARD) {
+			if (zoomBackIndex < lastZooms.size()) {
+				zoomBackForwardButtonInAction = true;
+				zoomBackIndex++;
+				getButton(ACTION_ZOOM_BACK).setEnabled(true);
+				getButton(ACTION_ZOOM_FORWARD).setEnabled(
+						zoomBackIndex < lastZooms.size());
+
+				mapPane.setMapArea(lastZooms.get(zoomBackIndex - 1));
+				mapPane.refresh();
+			}
+		}
+	}
+
+	/**
+	 * Adds a tool to the tool bar. Does nothing if a tool or action with the
+	 * specified ID already exists!
+	 * 
+	 * @param buttonAction
+	 *            action for the toggle button
+	 * @param resetToolBar
+	 *            indicates whether the toolbar GUI is reset after adding the
+	 *            button (if adding several actions it useful only to reset the
+	 *            GUI for the last added tool)
+	 */
+	public void addTool(MapPaneToolBarAction buttonAction, boolean resetToolBar) {
+		if (isButtonIDUsed(buttonAction.getID())) {
+			LOGGER.warn("addTool(.) ignored because ID already used for tool or action: "
+					+ buttonAction.getID());
+			return;
+		}
+		JToggleButton button = new SmallToggleButton(buttonAction);
+
+		toolButtonGroup.add(button);
+		toolAndActionButtons.put(buttonAction.getID(), button);
+		if (resetToolBar)
+			initToolBar();
+	}
+
+	/**
+	 * Adds a tool to the tool bar and resets the toolbar GUI.
+	 * 
+	 * @param buttonAction
+	 *            action for the toggle button
+	 */
+	public void addTool(MapPaneToolBarAction buttonAction) {
+		addTool(buttonAction, true);
+	}
+
+	/**
+	 * Adds an action to the tool bar. Does nothing if a tool or action with the
+	 * specified ID already exists!
+	 * 
+	 * @param buttonAction
+	 *            action for the button
+	 * @param resetToolBar
+	 *            indicates whether the toolbar GUI is reset after adding the
+	 *            button (if adding several actions it useful only to reset the
+	 *            GUI for the last added tool)
+	 */
+	public void addAction(MapPaneToolBarAction buttonAction,
+			boolean resetToolBar) {
+		if (isButtonIDUsed(buttonAction.getID())) {
+			LOGGER.warn("addAction(.) ignored because ID already used for tool or action: "
+					+ buttonAction.getID());
+			return;
+		}
+		JButton button = new SmallButton(buttonAction);
+		toolAndActionButtons.put(buttonAction.getID(), button);
+		if (resetToolBar)
+			initToolBar();
+	}
+
+	/**
+	 * Adds any JComponent to the tool bar. Does nothing if a tool or action
+	 * with the specified ID already exists!
+	 * 
+	 * @param component
+	 *            A {@link JComponent} that shall be added
+	 * @param id
+	 *            The ID associaded with the {@link JComponent}
+	 * @param resetToolBar
+	 *            indicates whether the toolbar GUI is reset after adding the
+	 *            button (if adding several actions it useful only to reset the
+	 *            GUI for the last added tool)
+	 */
+	public void addJComponent(JComponent component, int id, boolean resetToolBar) {
+
+		if (isButtonIDUsed(id)) {
+			LOGGER.warn("addAction(.) ignored because ID already used for tool or action: "
+					+ id);
+			return;
+		}
+
+		toolAndActionButtons.put(id, component);
+		if (resetToolBar)
+			initToolBar();
+	}
+
+	public void addSeparator(int id, Separator separator) {
+		if (isButtonIDUsed(id)) {
+			LOGGER.warn("addSeparator(.) ignored because ID already used for tool or action. ");
+			return;
+		}
+		toolAndActionButtons.put(id, separator);
+	}
+
+	/**
+	 * Adds an action to the tool bar and resets the toolbar GUI.
+	 * 
+	 * @param buttonAction
+	 *            action for the toggle button
+	 */
+	public void addAction(MapPaneToolBarAction buttonAction) {
+		addAction(buttonAction, true);
+	}
+
+	/**
+	 * Returns the button for a specific tool or action.
+	 * 
+	 * @param id
+	 *            the constant for any button in the {@link MapPaneToolBar}
+	 * @return a {@link JButton} if {@code id} specifies an
+	 *         {@linkplain #getActionButton(int) action button} or
+	 *         {@link JToogleButton} if {@code id} specifies a
+	 *         {@linkplain #getToolButton(int) tool button}
+	 */
+	public AbstractButton getButton(int id) {
+
+		// ACHUTNG: Das ist ein SK QUICK FIX! TODO
+		if (!(toolAndActionButtons.get(id) instanceof AbstractButton))
+			return null;
+
+		AbstractButton button = (AbstractButton) toolAndActionButtons.get(id);
+		if (button == null)
+			LOGGER.warn("Unknown tool or action ID: " + id);
+		return button;
+	}
+
+	/**
+	 * Returns the button for a specific tool.
+	 * 
+	 * @param tool
+	 *            the constant for a tool
+	 */
+	public JToggleButton getToolButton(int tool) {
+		AbstractButton button = getButton(tool);
+		if (button != null && !(button instanceof JToggleButton)) {
+			LOGGER.warn("ID specifies no tool: " + tool);
+			button = null;
+		}
+		return (JToggleButton) button;
+	}
+
+	/**
+	 * Returns the button for a specific action.
+	 * 
+	 * @param action
+	 *            the constant an action
+	 */
+	public JButton getActionButton(int action) {
+		AbstractButton button = getButton(action);
+		if (button != null && !(button instanceof JButton)) {
+			LOGGER.warn("ID specifies no action: " + action);
+			button = null;
+		}
+		return (JButton) button;
+
+	}
+
+	/**
+	 * Sets the selected tool.
+	 * 
+	 * @param tool
+	 *            ID of the tool
+	 */
+	public void setSelectedTool(Integer tool) {
+		if (tool == null)
+			toolButtonGroup.setUnselected();
+
+		JToggleButton button = getToolButton(tool);
+		if (button == null)
+			return;
+		button.setSelected(true);
+		button.getAction().actionPerformed(null);
+
+		selectedTool = tool;
+	}
+
+	/**
+	 * Returns the selected tool.
+	 * 
+	 * @return -1 if no tool is active
+	 */
+	public int getSelectedTool() {
+		if (toolButtonGroup.getSelectedButton() == null)
+			return -1;
+		return selectedTool;
+	}
+
+	/**
+	 * Sets whether a tool or action is activated or not. The visible property
+	 * of the button is not affected.
+	 * 
+	 * @param id
+	 *            tool or actionID
+	 * @param enabled
+	 *            if {@code true} the tool becomes available
+	 */
+	public void setButtonEnabled(int id, boolean enabled) {
+		AbstractButton button = getButton(id);
+		if (button == null)
+			return;
+		button.setEnabled(enabled);
+	}
+
+	/**
+	 * Sets whether a tool or action is activated or not.
+	 * 
+	 * @param id
+	 *            tool or actionID
+	 * @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 setButtonEnabled(int id, boolean enabled, boolean hideOnDisable) {
+		AbstractButton button = getButton(id);
+		if (button == null)
+			return;
+		button.setEnabled(enabled);
+		// if button is enabled, it becomes visible anyway
+		// if button is disabled and the "hide" option is set, it is also hidden
+		if (enabled)
+			button.setVisible(true);
+		else
+			button.setVisible(!hideOnDisable);
+	}
+
+	/**
+	 * Checks whether a ID is already used for a tool or action.
+	 * 
+	 * @param tool
+	 *            tool ID
+	 */
+	public boolean isButtonIDUsed(int id) {
+		return toolAndActionButtons.get(id) != null;
+	}
+
+	/**
+	 * Checks whether a tool is activated.
+	 * 
+	 * @param tool
+	 *            tool ID
+	 * @return {@code false} if an unknown ID is specified
+	 */
+	public boolean isButtonEnabled(int id) {
+		AbstractButton button = getButton(id);
+		if (button != null)
+			return button.isEnabled();
+		return false;
+	}
+
+	/**
+	 * Sets the activation for all tools.
+	 * 
+	 * @param enabled
+	 *            if {@code true} all tools 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) {
+		for (int id : toolAndActionButtons.keySet()) {
+			if (toolAndActionButtons.get(id) instanceof JToggleButton) {
+				setButtonEnabled(id, enabled, hideOnDisable);
+			}
+		}
+	}
+
+	/**
+	 * Sets the activation for all actions.
+	 * 
+	 * @param enabled
+	 *            if {@code true} all actions becomes available
+	 * @param hideOnDisable
+	 *            if {@code true} the buttons are also hidden if {@code enabled}
+	 *            is {@code false}
+	 */
+	public void setAllActionsEnabled(boolean enabled, boolean hideOnDisable) {
+		for (int id : toolAndActionButtons.keySet()) {
+			if (toolAndActionButtons.get(id) instanceof JButton) {
+				setButtonEnabled(id, enabled, hideOnDisable);
+			}
+		}
+
+	}
+
+	/**
+	 * Returns the maximum ID of tools.
+	 */
+	public int getMaxToolID() {
+		return toolAndActionButtons.lastKey();
+	}
+
+	/**
+	 * Returns the minimum ID of tools.
+	 */
+	public int getMinToolID() {
+		return toolAndActionButtons.firstKey();
+	}
+
+	/**
+	 * Extends the {@link AbstractAction} with maintaining an ID and the
+	 * {@link MapPaneToolBar} the actions controls. Additionally this class
+	 * automatically calls
+	 * {@link MapPaneToolBar#performToolButton(int, ActionEvent)} or
+	 * {@link MapPaneToolBar#performActionButton(int, ActionEvent)} depending on
+	 * whether the action is added via
+	 * {@link MapPaneToolBar#addTool(MapPaneToolBarAction)} or
+	 * {@link MapPaneToolBar#addAction(MapPaneToolBarAction)}.
+	 * 
+	 * @author <a href="mailto:martin.schmitz at koeln.de">Martin Schmitz</a>
+	 *         (University of Bonn/Germany)
+	 */
+	public static class MapPaneToolBarAction extends AbstractAction {
+		/** The ID of the action */
+		protected int id = -1;
+		/** The tool bar, this action is made for. */
+		protected MapPaneToolBar toolBar = null;
+
+		/**
+		 * Creates a new action with a dummy description and no icon.
+		 * 
+		 * @param id
+		 *            unique ID for the action
+		 * @param toolBar
+		 *            toolbar this action is made for
+		 */
+		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar) {
+			this(id, toolBar, "" + id);
+		}
+
+		/**
+		 * Creates a new action without an icon.
+		 * 
+		 * @param id
+		 *            unique ID for the action
+		 * @param toolBar
+		 *            toolbar this action is made for
+		 * @param name
+		 *            description used for buttons or menus
+		 */
+		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, String name) {
+			this(id, toolBar, name, null);
+		}
+
+		/**
+		 * Creates a new action.
+		 * 
+		 * @param id
+		 *            unique ID for the action
+		 * @param toolBar
+		 *            toolbar this action is made for
+		 * @param name
+		 *            description used for buttons or menus
+		 * @param icon
+		 *            icon used for buttons or menus
+		 */
+		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
+				String name, Icon icon) {
+			this(id, toolBar, name, icon, null);
+		}
+
+		/**
+		 * Creates a new action.
+		 * 
+		 * @param id
+		 *            unique ID for the action
+		 * @param toolBar
+		 *            The {@link MapPaneToolBar} this action is made for
+		 * @param name
+		 *            description used for buttons or menus
+		 * @param icon
+		 *            icon used for buttons or menus
+		 * @param toolTip
+		 *            Tooltip to use for the button or menu
+		 */
+		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
+				String name, Icon icon, String toolTip) {
+			super(name, icon);
+
+			if (toolTip != null && !toolTip.trim().isEmpty()) {
+				putValue(Action.SHORT_DESCRIPTION, toolTip);
+			}
+
+			this.id = id;
+			this.toolBar = toolBar;
+		}
+
+		public MapPaneToolBarAction(int id, MapPaneToolBar toolBar,
+				XMapPaneTool tool) {
+			this(id, toolBar, "", tool.getIcon(), tool.getToolTip());
+		}
+
+		/**
+		 * Calls {@link MapPaneToolBar#performToolButton(int, ActionEvent)} or
+		 * {@link MapPaneToolBar#performActionButton(int, ActionEvent)}
+		 * depending on whether the action is added to the toolbar via
+		 * {@link MapPaneToolBar#addTool(MapPaneToolBarAction)} or
+		 * {@link MapPaneToolBar#addAction(MapPaneToolBarAction)}.
+		 */
+		public void actionPerformed(ActionEvent e) {
+			if (toolBar.toolAndActionButtons.get(id) instanceof JToggleButton)
+				toolBar.performToolButton(id, e);
+			else if (toolBar.toolAndActionButtons.get(id) instanceof JButton)
+				toolBar.performActionButton(id, e);
+		}
+
+		/**
+		 * Returns the (unique) id of this action.
+		 * 
+		 * @return
+		 */
+		public int getID() {
+			return id;
+		}
+	}
+
+	/**
+	 * Nuetzlich wenn die Componente gedruckt (z.B. wenn ein Screenshot gemacht
+	 * wird) wird. Dann werden wird der Hintergrund auf WEISS gesetzt.
+	 * 
+	 * @author <a href="mailto:tzeggai at wikisquare.de">Stefan Alfons Tzeggai</a>
+	 */
+	@Override
+	public void print(Graphics g) {
+		Color orig = getBackground();
+		setBackground(Color.WHITE);
+		// wrap in try/finally so that we always restore the state
+		try {
+			super.print(g);
+		} finally {
+			setBackground(orig);
+		}
+	}
+
+	@Override
+	protected void finalize() throws Throwable {
+		super.finalize();
+
+		if (mapPane != null && mapPaneListener != null)
+			mapPane.removeMapPaneListener(mapPaneListener);
+	}
+
+}

Added: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolSelectedListener.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolSelectedListener.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapPaneToolSelectedListener.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -0,0 +1,7 @@
+package de.schmitzm.geotools.gui;
+
+public interface MapPaneToolSelectedListener {
+	
+	public void toolSelected( int toolId) ;
+	
+}

Added: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapView.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapView.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/MapView.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -0,0 +1,252 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Martin O. J. Schmitz.
+ * 
+ * This file is part of the SCHMITZM library - a collection of utility 
+ * classes based on Java 1.6, focusing (not only) on Java Swing 
+ * and the Geotools library.
+ * 
+ * The SCHMITZM project is hosted at:
+ * http://wald.intevation.org/projects/schmitzm/
+ * 
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License (license.txt)
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * or try this link: http://www.gnu.org/licenses/lgpl.html
+ * 
+ * Contributors:
+ *     Martin O. J. Schmitz - initial API and implementation
+ *     Stefan A. Tzeggai - additional utility classes
+ ******************************************************************************/
+package de.schmitzm.geotools.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+
+import net.miginfocom.swing.MigLayout;
+
+import org.apache.log4j.Logger;
+
+import de.schmitzm.geotools.gui.GeoMapPane;
+import de.schmitzm.geotools.gui.MapContextControlPane;
+import de.schmitzm.geotools.gui.MapPaneStatusBar;
+import de.schmitzm.geotools.gui.SelectableXMapPane;
+import de.schmitzm.geotools.styling.ColorMapManager;
+
+/**
+ * TODO Dokument
+ */
+public class MapView extends JPanel {
+	private static final Logger LOGGER = Logger.getLogger(MapView.class);
+
+	private final JSplitPane splitPane = new JSplitPane(
+			JSplitPane.HORIZONTAL_SPLIT);
+
+	protected MapPaneStatusBar statusBar = null;
+	/**
+	 * Komponente, in der die Karten, der Massstab und das Koordinaten-Raster
+	 * dargestellt werden.
+	 */
+	protected final GeoMapPane geoMapPane = new GeoMapPane();
+
+	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 SelectableXMapPane}
+	 */
+	public MapView(Component parentGui, MapPaneToolBar toolBar) {
+		super(new BorderLayout());
+		// Call initialize() by yourself afterwards.
+		// Needed because variables for the overwritten methods
+		// are not yet set.
+		jToolBar = toolBar;
+
+		// By default the MapPane will render with antialiasing on
+		getGeoMapPane().getMapPane().setAntiAliasing(true);
+	}
+
+	/**
+	 * 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 SelectableXMapPane}
+	 */
+	public MapView(Component parentGui) {
+		this(parentGui, null);
+	}
+
+	/**
+	 * 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}
+	 * 
+	 * @see #adjustSizeOfGeoMapPane()
+	 */
+	public void initialize() {
+		// horizontales SplitPane initialisieren
+
+		// Status-Line to show Coordinates and Rastervalues.
+		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.
+		 * setDividerLocation(-1); has no effect here because the component is
+		 * not visible yet.
+		 */
+		getSplitPane().setDividerSize(5);
+
+		getSplitPane().setResizeWeight(0.0);
+		getSplitPane().add(getSidePane());
+
+		/***********************************************************************
+		 * To the right side we now add a JPanel that consists of a toolbar and
+		 * a gmp
+		 */
+		JPanel newRight = new JPanel(new MigLayout("center, wrap 1", "[grow]",
+				"[][grow]"));
+		newRight.add(getToolBar());
+//		/ crsName
+//		newRight.add(new CrsLabel(getGeoMapPane().getMapPane()), "align right");
+		newRight.add(getGeoMapPane(), "growx, growy");
+		getSplitPane().add(newRight);
+
+		this.add(getSplitPane(), BorderLayout.CENTER);
+
+	}
+
+	/**
+	 * Returns the tool bar which controls the active mouse actions on the map.
+	 * 
+	 * @return never <code>null</code>, will rather create a default
+	 */
+	public MapPaneToolBar getToolBar() {
+		if (jToolBar == null) {
+			jToolBar = new MapPaneToolBar(getMapPane());
+		}
+		return jToolBar;
+	}
+
+	/**
+	 * Returns the split pane which divides the layer list from the map panel.
+	 */
+	public JSplitPane getSplitPane() {
+		return splitPane;
+	}
+
+	/**
+	 * 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);
+	}
+
+	/**
+	 * 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);
+	}
+
+	/**
+	 * 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);
+	}
+
+	/**
+	 * called by initialize() to fill the left of the XULUMapView Supposed to be
+	 * overwritten by AtlasMapView or DesignMapView
+	 */
+	public JComponent getSidePane() {
+		return new MapContextControlPane(getGeoMapPane().getMapPane(),
+				new ColorMapManager());
+	}
+
+	/**
+	 * Liefert die Status-Zeile, in der die Koordinaten und Raster-Werte
+	 * angezeigt werden.
+	 */
+	public MapPaneStatusBar getStatusBar() {
+		return this.statusBar;
+	}
+
+	/**
+	 * Liefert den Karten-Bereich der Komponente.
+	 */
+	public final SelectableXMapPane getMapPane() {
+		return getGeoMapPane().getMapPane();
+	}
+
+	public GeoMapPane getGeoMapPane() {
+		return geoMapPane;
+	}
+
+	public int getSelectedTool() {
+		return jToolBar.getSelectedTool();
+	}
+
+	/**
+	 * Help the garbage collection
+	 */
+	public void dispose() {
+		if (geoMapPane != null)
+			geoMapPane.dispose();
+	}
+
+}

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPaneTool.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPaneTool.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/gui/XMapPaneTool.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -11,7 +11,7 @@
 import javax.swing.KeyStroke;
 
 import de.schmitzm.data.Copyable;
-import de.schmitzm.geotools.MapPaneToolBar;
+import de.schmitzm.geotools.gui.MapPaneToolBar;
 import de.schmitzm.swing.SwingUtil;
 import de.schmitzm.swing.event.MouseInputType;
 

Modified: trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/selection/FeatureMapLayerSelectionSynchronizer.java
===================================================================
--- trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/selection/FeatureMapLayerSelectionSynchronizer.java	2011-01-27 11:17:24 UTC (rev 1420)
+++ trunk/schmitzm-gt/src/main/java/de/schmitzm/geotools/selection/FeatureMapLayerSelectionSynchronizer.java	2011-01-27 11:29:08 UTC (rev 1421)
@@ -68,7 +68,7 @@
 import org.opengis.filter.identity.FeatureId;
 
 import de.schmitzm.geotools.FilterUtil;
-import de.schmitzm.geotools.MapPaneToolBar;
+import de.schmitzm.geotools.gui.MapPaneToolBar;
 import de.schmitzm.geotools.StyledFeaturesInterface;
 import de.schmitzm.geotools.gui.SelectableXMapPane;
 import de.schmitzm.geotools.gui.XMapPaneEvent;



More information about the Schmitzm-commits mailing list