[Schmitzm-commits] r1894 - in trunk/schmitzm-core/src/main/java/de/schmitzm: lang swing

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Sun Mar 11 14:27:01 CET 2012


Author: mojays
Date: 2012-03-11 14:27:01 +0100 (Sun, 11 Mar 2012)
New Revision: 1894

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooser.java
Log:
WebFilesChooser: center frame position relative to parent frame
SwingUtil: new method to create JRadioButtonMenuItem
LangUtil: splitList(.) parameter changed from untyped List<?> to typed List<E>

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2012-03-10 13:46:38 UTC (rev 1893)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/lang/LangUtil.java	2012-03-11 13:27:01 UTC (rev 1894)
@@ -2273,8 +2273,8 @@
 	/**
 	 * Zerlegt eine Liste in mehrere Listen mit einer maximalen Größe.
 	 */
-	public static List<List<?>> splitList(List<?> list, int maxListSize) {
-		List<List<?>> splittedList = new ArrayList<List<?>>();
+	public static <E> List<List<E>> splitList(List<E> list, int maxListSize) {
+		List<List<E>> splittedList = new ArrayList<List<E>>();
 		int itemsRemaining = list.size();
 		int start = 0;
 

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-03-10 13:46:38 UTC (rev 1893)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SwingUtil.java	2012-03-11 13:27:01 UTC (rev 1894)
@@ -1839,6 +1839,16 @@
     }
 
     /**
+     * Creates a radio button menu item for an action.
+     */
+    public static JRadioButtonMenuItem createRadioMenuItem(Action action, ButtonGroup group, boolean selected) {
+      action.putValue(AbstractAction.SELECTED_KEY, selected);
+      JRadioButtonMenuItem menuItem = new JRadioButtonMenuItem(action);
+      group.add(menuItem);
+      return menuItem;
+    }
+
+    /**
      * Creates a {@link JToggleButton} for the use in a {@link JToolBar}.
      * Regardless of the {@linkplain AbstractAction#NAME action name},
      * the button will only show the icon.

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooser.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooser.java	2012-03-10 13:46:38 UTC (rev 1893)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/WebFilesChooser.java	2012-03-11 13:27:01 UTC (rev 1894)
@@ -120,6 +120,7 @@
   protected void init() {
     super.init();
     setPreferredSize( new Dimension(500,300) );
+    SwingUtil.setRelativeFramePosition(this, getOwner(), 0.5, 0.5);
 
     this.filesChooserPanel = new WebFilesChooserPanel();
 



More information about the Schmitzm-commits mailing list