Author: tchemit Date: 2009-03-03 16:38:42 +0000 (Tue, 03 Mar 2009) New Revision: 1255 Modified: jaxx/trunk/jaxx-example/src/main/java/jaxx/demo/BoxedDecoratorDemo.jaxx Log: in BlockingLayerUI, add a new state 'useIcon' to enable/disable use of the action icon Modified: jaxx/trunk/jaxx-example/src/main/java/jaxx/demo/BoxedDecoratorDemo.jaxx =================================================================== --- jaxx/trunk/jaxx-example/src/main/java/jaxx/demo/BoxedDecoratorDemo.jaxx 2009-03-03 16:38:17 UTC (rev 1254) +++ jaxx/trunk/jaxx-example/src/main/java/jaxx/demo/BoxedDecoratorDemo.jaxx 2009-03-03 16:38:42 UTC (rev 1255) @@ -3,6 +3,7 @@ <jaxx.runtime.swing.BlockingLayerUI id='layerUI' blockIcon='{SwingUtil.createImageIcon("action-block.png")}' acceptIcon='{SwingUtil.createImageIcon("action-accept.png")}' + useIcon='true' acceptAction='{new AbstractAction() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { @@ -15,6 +16,9 @@ public void setLayer(boolean active) { for (JComponent boxed : SwingUtil.getLayeredComponents(this)) { jaxx.runtime.swing.BlockingLayerUI ui = active ? layerUI.clone() : null; + if ( ui != null && boxed == c) { + ui.setUseIcon(false); + } SwingUtil.getLayer(boxed).setUI(ui); } } @@ -41,7 +45,7 @@ onActionPerformed='accept(event, "from button (no layer)")'/> <JButton text='button B' decorator='boxed' _clickedText='"button B was clicked"' onActionPerformed='accept(event, "from button (no layer)")'/> - <JButton text='button C' decorator='boxed' _clickedText='"button C was clicked"' + <JButton id='c' text='button C (full block)' decorator='boxed' _clickedText='"button C was clicked"' onActionPerformed='accept(event, "from button (no layer)");'/> </JPanel> </cell>
participants (1)
-
tchemit@users.labs.libre-entreprise.org