[Schmitzm-commits] r297 - in trunk/src: schmitzm/jfree/resource/locales skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Aug 11 00:10:07 CEST 2009


Author: alfonx
Date: 2009-08-11 00:10:07 +0200 (Tue, 11 Aug 2009)
New Revision: 297

Modified:
   trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties
   trunk/src/skrueger/geotools/MapPaneToolBar.java
Log:
* GP-Feature: The chart features hit the AtlasMapView! :-) A new button in the map's tool bar allows to directly access any chart available for the map.


Modified: trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties	2009-08-10 22:08:23 UTC (rev 296)
+++ trunk/src/schmitzm/jfree/resource/locales/JFreeResourceBundle_de.properties	2009-08-10 22:10:07 UTC (rev 297)
@@ -50,6 +50,3 @@
 ChartType_LINE.Object.Title=Linie
 ChartType_POINT.Title=Punktdiagramm
 ChartType_POINT.Object.Title=Punkte
-
-
-

Modified: trunk/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-08-10 22:08:23 UTC (rev 296)
+++ trunk/src/skrueger/geotools/MapPaneToolBar.java	2009-08-10 22:10:07 UTC (rev 297)
@@ -122,6 +122,8 @@
 	 */
 	public static final int TOOL_SELECTION_REMOVE = 230;
 
+	public static final int ACTION_CHARTS = 401;
+
 	/** Tool currently selected */
 	protected int selectedTool = TOOL_ZOOMIN;
 
@@ -472,6 +474,8 @@
 			initToolBar();
 	}
 
+
+
 	/**
 	 * Adds a tool to the tool bar and resets the toolbar GUI.
 	 * 
@@ -507,7 +511,33 @@
 		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



More information about the Schmitzm-commits mailing list