[Schmitzm-commits] r74 - in trunk/src/schmitzm: geotools/gui geotools/gui/resource/icons geotools/gui/resource/locales swing swing/table

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 21 20:09:40 CEST 2009


Author: alfonx
Date: 2009-04-21 20:09:39 +0200 (Tue, 21 Apr 2009)
New Revision: 74

Modified:
   trunk/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java
   trunk/src/schmitzm/geotools/gui/FeatureTablePane.java
   trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
   trunk/src/schmitzm/geotools/gui/resource/icons/mActionInvertSelection.png
   trunk/src/schmitzm/geotools/gui/resource/icons/mActionSelectedToTop.png
   trunk/src/schmitzm/geotools/gui/resource/icons/mActionUnselectAttributes.png
   trunk/src/schmitzm/geotools/gui/resource/icons/mActionZoomToSelected.png
   trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
   trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
   trunk/src/schmitzm/swing/SwingUtil.java
   trunk/src/schmitzm/swing/table/SelectionTableModel.java
Log:
* Added i8n for the SelectableFeatureTablePane to GTResourceBundle
* Switched from MultiSplitPane to JSplitPane to have the nice "OneTuchButtons".
* Resized the icons for SelectableFeatureTablePane to 16x16
* Set the width of SortableJTable's first column to 16 which (i check) is a resonable width for the standard L'n'Fs

Modified: trunk/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/geotools/gui/FeatureCollectionTableModel.java	2009-04-21 18:09:39 UTC (rev 74)
@@ -53,7 +53,7 @@
   /** Spaltennamen. Wird nur beim Aufruf von {@link #reorganize} befuellt. */
   protected String[] colNames = null;
   /** Spalten-Typen. Wird nur beim Aufruf von {@link #reorganize} befuellt. */
-  protected Class[] colClass = null;
+  protected Class<?>[] colClass = null;
   /** Bestimmt die angezeigten Features */
   protected AttributeTypeFilter attrFilter = AttributeTypeFilter.ALL;
 

Modified: trunk/src/schmitzm/geotools/gui/FeatureTablePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/geotools/gui/FeatureTablePane.java	2009-04-21 18:09:39 UTC (rev 74)
@@ -80,7 +80,7 @@
   protected Style featureStyle = null;
   /** Splitpane, das die Karten-Vorschau von der Tabelle trennt ({@code null}
    *  wenn Karten-Vorschau deaktiviert ist). */
-  protected MultiSplitPane splitPane = null;
+  protected JSplitPane splitPane = null;
 
   /**
    * Erzeugt einen neue Komponente mit Preview-Bereich.
@@ -150,11 +150,12 @@
 
     // Komponenten dem Pane hinzufuegen
     if ( mapPane != null ) {
-      splitPane = new MultiSplitPane(2,JSplitPane.HORIZONTAL_SPLIT);
-      splitPane.setInnerBorder(null);
-      splitPane.setContainer(0,mapPane);
-      splitPane.setContainer(1,featuresTableScrollPane);
-      splitPane.setResizeWeigth( new double[] {0.2,0.8} );
+      splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+//      splitPane.setInnerBorder(null);
+      splitPane.setLeftComponent(mapPane);
+      splitPane.setRightComponent(featuresTableScrollPane);
+      splitPane.setDividerLocation(0.5); 
+      splitPane.setOneTouchExpandable(true);
       add(splitPane);
     } else {
       add(featuresTableScrollPane);

Modified: trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/geotools/gui/SelectableFeatureTablePane.java	2009-04-21 18:09:39 UTC (rev 74)
@@ -1,3 +1,13 @@
+/** SCHMITZM - This file is part of the java library of Martin O.J. Schmitz (SCHMITZM)
+
+    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.awt.BorderLayout;
@@ -4,6 +14,7 @@
 import java.awt.Component;
 import java.awt.event.ActionEvent;
 import java.net.URL;
+import java.util.Locale;
 
 import javax.swing.AbstractAction;
 import javax.swing.Action;
@@ -14,16 +25,20 @@
 
 import org.geotools.feature.FeatureCollection;
 
+import schmitzm.lang.LangUtil;
+import schmitzm.lang.ResourceProvider;
 
+
 /**
  * Extends the {@link FeatureTablePane} with buttons and functionality to select
  * lines
  * 
- * @author stefan
+ * @author Stefan A. Krüger
  * 
  */
 public class SelectableFeatureTablePane extends FeatureTablePane {
 
+
 	public static final ImageIcon ICON_SELECTION_INVERT = new ImageIcon(
 			SelectableFeatureTablePane.class
 					.getResource("resource/icons/mActionInvertSelection.png"));
@@ -45,8 +60,9 @@
 		
 		
 		if (splitPane != null) {
-			newPanelArroundTable.add(splitPane.getContainer(1), BorderLayout.CENTER);
-			splitPane.setContainer(1, newPanelArroundTable);
+			newPanelArroundTable.add(splitPane.getRightComponent(), BorderLayout.CENTER);
+			splitPane.setRightComponent(newPanelArroundTable);
+			splitPane.setDividerLocation(0.33);
 		} else {
 			newPanelArroundTable.add(getComponent(0), BorderLayout.CENTER);
 			removeAll();
@@ -59,7 +75,7 @@
 	
 
 	private Component getSearchBar() {
-		return new JLabel("Search here one day");
+		return new JLabel(""); // TODO Add ability to search here!
 	}
 
 	
@@ -79,7 +95,7 @@
 			}
 			
 		};
-		clearSelectionAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+		clearSelectionAction.putValue(Action.SHORT_DESCRIPTION, GeotoolsGUIUtil.R("schmitzm.geotools.gui.SelectableFeatureTablePane.button.clearSelection.tt")); 
 		toolBar.add(clearSelectionAction);
 		
 
@@ -93,7 +109,7 @@
 			}
 			
 		};
-		selectionToTopAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+		selectionToTopAction.putValue(Action.SHORT_DESCRIPTION, GeotoolsGUIUtil.R("schmitzm.geotools.gui.SelectableFeatureTablePane.button.selectionToTop.tt")); 
 		toolBar.add(selectionToTopAction);
 		
 		/**
@@ -106,7 +122,7 @@
 			}
 			
 		};
-		selectionInverseAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+		selectionInverseAction.putValue(Action.SHORT_DESCRIPTION, GeotoolsGUIUtil.R("schmitzm.geotools.gui.SelectableFeatureTablePane.button.invertSelection.tt"));
 		toolBar.add(selectionInverseAction);
 		
 		
@@ -120,24 +136,11 @@
 			}
 			
 		};
-		zoomToselectionAction.putValue(Action.SHORT_DESCRIPTION, "tt");
+		zoomToselectionAction.putValue(Action.SHORT_DESCRIPTION, GeotoolsGUIUtil.R("schmitzm.geotools.gui.SelectableFeatureTablePane.button.zoomToSelection.tt")); 
 		toolBar.add(zoomToselectionAction);
 		
 		return toolBar;
 	}
  
-//
-//	/**
-//	 * Zeigt die aktuell in der Tabelle selektierten Features im Preview-Bereich
-//	 * an.
-//	 */
-//	@Override
-//	protected void performListSelection() {
-//		FeatureCollection subCollection = getSelectedFeatures();
-//		// Wenn keine Auswahl getaetigt ist, alle Features anzeigen
-//		if (subCollection == null || subCollection.isEmpty())
-//			subCollection = getFeatureCollection();
-//		showFeaturesInMap(subCollection);
-//	}
 
 }

Modified: trunk/src/schmitzm/geotools/gui/resource/icons/mActionInvertSelection.png
===================================================================
(Binary files differ)

Modified: trunk/src/schmitzm/geotools/gui/resource/icons/mActionSelectedToTop.png
===================================================================
(Binary files differ)

Modified: trunk/src/schmitzm/geotools/gui/resource/icons/mActionUnselectAttributes.png
===================================================================
(Binary files differ)

Modified: trunk/src/schmitzm/geotools/gui/resource/icons/mActionZoomToSelected.png
===================================================================
(Binary files differ)

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties	2009-04-21 18:09:39 UTC (rev 74)
@@ -98,3 +98,7 @@
 schmitzm.geotools.gui.FeatureTypeBuilderTableModel.DefValue=Default
 schmitzm.geotools.gui.FeatureTypeBuilderTableModel.NewAttr=Attribute_${0}
 
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.clearSelection.tt=Clear selection
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.selectionToTop.tt=Move selected to the top of the table
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.invertSelection.tt=Invert selection
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.zoomToSelection.tt=Zoom to selected features
\ No newline at end of file

Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties	2009-04-21 18:09:39 UTC (rev 74)
@@ -94,4 +94,7 @@
 schmitzm.geotools.gui.FeatureTypeBuilderTableModel.DefValue=Default
 schmitzm.geotools.gui.FeatureTypeBuilderTableModel.NewAttr=Attribut_${0}
 
-
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.clearSelection.tt=Auswahl aufheben
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.selectionToTop.tt=Ausgewählte Zeilen in der Tabelle nach oben verschieben 
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.invertSelection.tt=Auswahl umkehren
+schmitzm.geotools.gui.SelectableFeatureTablePane.button.zoomToSelection.tt=Zoomt zu den ausgewählten Geoobjekten 

Modified: trunk/src/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/src/schmitzm/swing/SwingUtil.java	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/swing/SwingUtil.java	2009-04-21 18:09:39 UTC (rev 74)
@@ -62,12 +62,29 @@
 public class SwingUtil {
   private static final Logger LOGGER = Logger.getLogger( SwingUtil.class.getClass().getName() );
 
-  /** {@link ResourceProvider}, der die Lokalisation fuer GUI-Komponenten
-   *  des Package {@code schmitzm.swing} zur Verfuegung stellt. Diese sind
-   *  in properties-Dateien unter {@code schmitzm.swing.resource.locales}
-   *  hinterlegt. */
-  public static ResourceProvider RESOURCE = new ResourceProvider( LangUtil.extendPackagePath(SwingUtil.class,"resource.locales.SwingResourceBundle"), Locale.ENGLISH );
+  /**
+	 * {@link ResourceProvider}, der die Lokalisation fuer GUI-Komponenten des
+	 * Package {@code schmitzm.swing} zur Verfuegung stellt. Diese sind in
+	 * properties-Dateien unter {@code schmitzm.swing.resource.locales}
+	 * hinterlegt.
+	 */
+	public static ResourceProvider RESOURCE = new ResourceProvider(LangUtil
+			.extendPackagePath(SwingUtil.class,
+					"resource.locales.SwingResourceBundle"), Locale.ENGLISH);
 
+	/**
+	 * Convenience method to access the {@link AtlasCreator}s translation
+	 * resources.
+	 * 
+	 * @param key
+	 *            the key for the AtlasCreatorTranslation.properties file
+	 * @param values
+	 *            optional values
+	 */
+	public static String R(String key, Object... values) {
+		return RESOURCE.getString(key, values);
+	}
+
   //****************************************************************************
   // Diese Icons sind auf Basis der Icons von Gimp erstellt
   // Eine Sammlung aller Gimp-Icons liegt im svn: gimp-tool-cursors.xcf

Modified: trunk/src/schmitzm/swing/table/SelectionTableModel.java
===================================================================
--- trunk/src/schmitzm/swing/table/SelectionTableModel.java	2009-04-21 17:26:39 UTC (rev 73)
+++ trunk/src/schmitzm/swing/table/SelectionTableModel.java	2009-04-21 18:09:39 UTC (rev 74)
@@ -102,7 +102,7 @@
    * @return {@code Boolean.class} for column 0
    */
   @Override
-  public Class getColumnClass(int col) {
+  public Class<?> getColumnClass(int col) {
     if ( col == 0 )
       return Boolean.class;
    return model.getColumnClass(col - 1); 



More information about the Schmitzm-commits mailing list