[Schmitzm-commits] r486 - in branches/1.0-gt2-2.6/src: schmitzm/jfree/chart skrueger/geotools skrueger/geotools/resource/icons skrueger/i8n skrueger/swing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 20 18:25:27 CEST 2009


Author: alfonx
Date: 2009-10-20 18:25:26 +0200 (Tue, 20 Oct 2009)
New Revision: 486

Added:
   branches/1.0-gt2-2.6/src/skrueger/geotools/resource/icons/zoom_full_extend.png
   branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java
Modified:
   branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/SelectableChartPanel.java
   branches/1.0-gt2-2.6/src/skrueger/geotools/MapPaneToolBar.java
   branches/1.0-gt2-2.6/src/skrueger/i8n/Translation.java
   branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java
   branches/1.0-gt2-2.6/src/skrueger/swing/TranslationJTextField.java
Log:
* Chart has a new button to zoom to full chart extend

Modified: branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/SelectableChartPanel.java
===================================================================
--- branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/SelectableChartPanel.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/schmitzm/jfree/chart/SelectableChartPanel.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -82,7 +82,7 @@
 	private static Logger LOGGER = LangUtil.createLogger(SelectableChartPanel.class);
 	
 	public static final ImageIcon ICON_ZOOM_TO_SELECTED = SwingUtil.createImageIconFromResourcePath(
-	    JFreeChartUtil.class, "resource/icons/chartActionZoomToSelected.png", null ); 
+	    JFreeChartUtil.class, "chart/resource/icons/chartActionZoomToSelected.png", null ); 
 
 	/**
 	 * Types of window selection on chart panel.

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/MapPaneToolBar.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/MapPaneToolBar.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/MapPaneToolBar.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -43,7 +43,6 @@
 import javax.swing.AbstractAction;
 import javax.swing.AbstractButton;
 import javax.swing.Action;
-import javax.swing.BorderFactory;
 import javax.swing.Icon;
 import javax.swing.ImageIcon;
 import javax.swing.JButton;
@@ -61,6 +60,8 @@
 import schmitzm.lang.ResourceProvider;
 import schmitzm.swing.ButtonGroup;
 import schmitzm.swing.SwingUtil;
+import skrueger.swing.SmallButton;
+import skrueger.swing.SmallToggleButton;
 
 import com.vividsolutions.jts.geom.Envelope;
 
@@ -529,8 +530,9 @@
 							+ buttonAction.getID());
 			return;
 		}
-		JToggleButton button = new JToggleButton(buttonAction);
-		button.setBorder(BorderFactory.createRaisedBevelBorder());
+		JToggleButton button = new SmallToggleButton(buttonAction);
+		
+//		button.setBorder(BorderFactory.createRaisedBevelBorder());
 		toolButtonGroup.add(button);
 		toolAndActionButtons.put(buttonAction.getID(), button);
 		if (resetToolBar)
@@ -566,8 +568,8 @@
 							+ buttonAction.getID());
 			return;
 		}
-		JButton button = new JButton(buttonAction);
-		button.setBorder(BorderFactory.createRaisedBevelBorder());
+		JButton button = new SmallButton(buttonAction);
+//		button.setBorder(BorderFactory.createRaisedBevelBorder());
 		toolAndActionButtons.put(buttonAction.getID(), button);
 		if (resetToolBar)
 			initToolBar();

Added: branches/1.0-gt2-2.6/src/skrueger/geotools/resource/icons/zoom_full_extend.png
===================================================================
(Binary files differ)


Property changes on: branches/1.0-gt2-2.6/src/skrueger/geotools/resource/icons/zoom_full_extend.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: branches/1.0-gt2-2.6/src/skrueger/i8n/Translation.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/i8n/Translation.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/skrueger/i8n/Translation.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -61,7 +61,7 @@
 	public static final String LOCALECHANGE_PROPERTY = "localechange";
 	public static final String NO_TRANSLATION = "NO TRANSLATION";
 	public static final String DEFAULT_KEY = "default";
-	static final Logger log = Logger.getLogger(Translation.class);
+	static final Logger LOGGER = Logger.getLogger(Translation.class);
 	static String activeLang = Locale.getDefault().getLanguage();
 
 	static protected List<PropertyChangeListener> listeners = new ArrayList<PropertyChangeListener>();
@@ -143,7 +143,7 @@
 
 		fireLocaleChangeEvents();
 
-		log.info("skrueger.i8n.Translation switched ActiveLang to " + newLang);
+		LOGGER.info("skrueger.i8n.Translation switched ActiveLang to " + newLang);
 	}
 
 	/**
@@ -228,9 +228,9 @@
 				eatUp = eatUp.substring(eatUp.indexOf("}") + 1);
 			}
 		} catch (Exception e) {
-			log.warn("Error while reading the oneLineCode '" + oneLineCoded
+			LOGGER.warn("Error while reading the oneLineCode '" + oneLineCoded
 					+ "'", e);
-			log.warn("Translation will be empty!");
+			LOGGER.warn("Translation will be empty!");
 		}
 	}
 
@@ -312,7 +312,9 @@
 	 * reference as long as you need the listener.
 	 */
 	public void addTranslationChangeListener(ActionListener actionListener) {
-		actionListeners.add(actionListener);
+		if (actionListeners.add(actionListener)) {
+			LOGGER.debug("registering a new translationChangeActionListener in the WeakHashSet");
+		}
 	}
 
 	/**

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/SmallButton.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -5,6 +5,10 @@
 import javax.swing.JButton;
 
 public class SmallButton extends JButton {
+	
+	public SmallButton() {
+		setBorder(BorderFactory.createEtchedBorder());
+	}
 
 	public SmallButton(Action action, String tooltip) {
 		this (action);

Added: branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -0,0 +1,25 @@
+package skrueger.swing;
+
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JToggleButton;
+
+public class SmallToggleButton extends JToggleButton{
+	
+	public SmallToggleButton() {
+		setBorder(BorderFactory.createEtchedBorder());
+	}
+
+	public SmallToggleButton(Action action, String tooltip) {
+		this (action);
+		if (tooltip != null)
+			setToolTipText(tooltip);
+	}
+
+	public SmallToggleButton(Action action) {
+		super(action);
+		setBorder(BorderFactory.createEtchedBorder());
+	}
+
+}


Property changes on: branches/1.0-gt2-2.6/src/skrueger/swing/SmallToggleButton.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:keywords
   + Id URL
Name: svn:eol-style
   + native

Modified: branches/1.0-gt2-2.6/src/skrueger/swing/TranslationJTextField.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/swing/TranslationJTextField.java	2009-10-20 16:22:47 UTC (rev 485)
+++ branches/1.0-gt2-2.6/src/skrueger/swing/TranslationJTextField.java	2009-10-20 16:25:26 UTC (rev 486)
@@ -141,7 +141,6 @@
 
 		};
 
-		LOGGER.debug("registering translationChangeActionListener");
 		trans.addTranslationChangeListener(translationChangeActionListener);
 	}
 



More information about the Schmitzm-commits mailing list