[Schmitzm-commits] r2332 - in trunk/schmitzm-core/src/main/java/de/schmitzm/swing: . event

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Jun 7 18:18:47 CEST 2013


Author: mojays
Date: 2013-06-07 18:18:47 +0200 (Fri, 07 Jun 2013)
New Revision: 2332

Modified:
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SelectableJTable.java
   trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/FontZoomListener.java
Log:
fontZoomListener: new constructor

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SelectableJTable.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SelectableJTable.java	2013-06-07 16:12:23 UTC (rev 2331)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/SelectableJTable.java	2013-06-07 16:18:47 UTC (rev 2332)
@@ -142,8 +142,8 @@
   protected void initTable() {
     setRowHeight(DEFAULT_ROW_HEIGHT);
     SwingUtil.setAutoStopTableCellEditing(this, true);
-    // enable text zoom by +/- key and mouse wheel
-    fontZoomListener = new FontZoomListener(this, false, false);
+    // enable text zoom by +/- key and mouse wheel (combined with ALT)
+    fontZoomListener = new FontZoomListener(this);
     fontZoomListener.initComponent();
   }
   

Modified: trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/FontZoomListener.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/FontZoomListener.java	2013-06-07 16:12:23 UTC (rev 2331)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/swing/event/FontZoomListener.java	2013-06-07 16:18:47 UTC (rev 2332)
@@ -32,6 +32,17 @@
   protected boolean reactOnPlainWheel = false;
   
   /**
+   * Creates new listener which only reacts on +/- key and mouse wheel in compination
+   * with ALT key. Usually the listener has to be added as {@link KeyListener} and/or
+   * {@link MouseWheelListener} to this component. This is not done automatically by this constructor!
+   * The {@link #initComponent()} method can be called to add the listeners to component.
+   * @param comp component to zoom the font for.
+   */
+  public FontZoomListener(Component comp) {
+    this(comp,false,false);
+  }
+  
+  /**
    * Creates new listener. Usually the listener has to be added as
    * {@link KeyListener} and/or {@link MouseWheelListener} to this component.
    * This is not done automatically by this constructor! The {@link #initComponent()}



More information about the Schmitzm-commits mailing list