r1691 - in trunk/jaxx-widgets/src/main: java/jaxx/runtime/swing resources/i18n resources/icons
Author: tchemit Date: 2009-12-21 21:11:01 +0100 (Mon, 21 Dec 2009) New Revision: 1691 Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx trunk/jaxx-widgets/src/main/resources/icons/action-font-size-down.png trunk/jaxx-widgets/src/main/resources/icons/action-font-size-up.png trunk/jaxx-widgets/src/main/resources/icons/action-font-size.png Modified: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties Log: add FontSizor widget + ExtremeDatabinding demo + use FontSizor on sources Added: trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx =================================================================== --- trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx (rev 0) +++ trunk/jaxx-widgets/src/main/java/jaxx/runtime/swing/FontSizor.jaxx 2009-12-21 20:11:01 UTC (rev 1691) @@ -0,0 +1,82 @@ +<!-- + +/** + * *##% jaxx-runtime-swing-widget + * Copyright (C) 2008 - 2009 CodeLutin + * + * This program 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 3 of the + * License, or (at your option) any later version. + * + * This program 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 General Lesser Public License for more details. + * + * You should have received a copy of the GNU General Lesser Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/lgpl-3.0.html>. ##%* + */ + +--> + +<JPanel layout='{new BorderLayout()}'> + + <!-- default size of font --> + <Float id='defaultFontSize' javaBean='12f'/> + + <!-- size of font --> + <Float id='fontSize' javaBean='null'/> + + <Boolean id='showDefaultFontSize' javaBean='true'/> + + <Boolean id='showFontSize' javaBean='false'/> + + <script><![CDATA[ +public void init() { + setFontSize(defaultFontSize); +} + +boolean updateDefaultSizeEnabled(Float fontSize, Float defaultFontSize, boolean enabled) { + if (fontSize==null || defaultFontSize==null) { + return false; + } + return !fontSize.equals(defaultFontSize) && enabled; +} + ]]> + </script> + <JToolBar floatable='false' + borderPainted='false' + opaque='{isOpaque()}' + constraints='BorderLayout.CENTER'> + + <JButton id='downSize' + actionIcon='font-size-down' + toolTipText='fontsize.action.down.tip' + focusable='false' + focusPainted='false' + enabled='{isEnabled()}' + onActionPerformed='setFontSize(fontSize - 1)'/> + + <JButton id='defaultSize' + actionIcon='font-size' + toolTipText='fontsize.action.default.tip' + focusable='false' + focusPainted='false' + visible='{isShowDefaultFontSize()}' + enabled='{updateDefaultSizeEnabled(getFontSize(), getDefaultFontSize(), isEnabled())}' + onActionPerformed='setFontSize(defaultFontSize)'/> + <JButton id='upSize' + actionIcon='font-size-up' + toolTipText='fontsize.action.up.tip' + focusable='false' + focusPainted='false' + enabled='{isEnabled()}' + onActionPerformed='setFontSize(fontSize + 1)'/> + + <JLabel visible='{isShowFontSize()}' + text='{"" + getFontSize()}'/> + </JToolBar> + +</JPanel> Modified: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties =================================================================== --- trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties 2009-12-21 20:09:52 UTC (rev 1690) +++ trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-en_GB.properties 2009-12-21 20:11:01 UTC (rev 1691) @@ -46,6 +46,9 @@ errorUI.action.close=Close errorUI.message=An error wad detected... errorUI.title=Error... +fontsize.action.default.tip= +fontsize.action.down.tip= +fontsize.action.up.tip= hidor.hideTip=Hide hidor.showTip=Show i18neditor.empty.locales=< No locale to select > @@ -71,4 +74,5 @@ numbereditor.clearAll=C numbereditor.clearOne=CE numbereditor.toggleSign=+/- +size\ \:\ = timeeditor.H=H Modified: trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties =================================================================== --- trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-12-21 20:09:52 UTC (rev 1690) +++ trunk/jaxx-widgets/src/main/resources/i18n/jaxx-widgets-fr_FR.properties 2009-12-21 20:11:01 UTC (rev 1691) @@ -46,6 +46,9 @@ errorUI.action.close=Fermer errorUI.message=Une erreur est survenue \! errorUI.title=Erreur... +fontsize.action.default.tip= +fontsize.action.down.tip= +fontsize.action.up.tip= hidor.hideTip=Cacher hidor.showTip=Voir i18neditor.empty.locales=< Aucune locale \u00E0 s\u00E9lectionner > @@ -71,4 +74,5 @@ numbereditor.clearAll=C numbereditor.clearOne=CE numbereditor.toggleSign=+/- +size\ \:\ = timeeditor.H=H Added: trunk/jaxx-widgets/src/main/resources/icons/action-font-size-down.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-widgets/src/main/resources/icons/action-font-size-down.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-widgets/src/main/resources/icons/action-font-size-up.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-widgets/src/main/resources/icons/action-font-size-up.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/jaxx-widgets/src/main/resources/icons/action-font-size.png =================================================================== (Binary files differ) Property changes on: trunk/jaxx-widgets/src/main/resources/icons/action-font-size.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream
participants (1)
-
tchemit@users.nuiton.org