[vassalengine-svn] SF.net SVN: vassalengine:[3876] VASSAL-src/trunk/src/VASSAL
Brought to you by:
rodneykinney,
uckelman
From: <uck...@us...> - 2008-07-27 12:59:09
|
Revision: 3876 http://vassalengine.svn.sourceforge.net/vassalengine/?rev=3876&view=rev Author: uckelman Date: 2008-07-27 12:59:18 +0000 (Sun, 27 Jul 2008) Log Message: ----------- Cleanup. Modified Paths: -------------- VASSAL-src/trunk/src/VASSAL/build/module/DiceButton.java VASSAL-src/trunk/src/VASSAL/tools/LaunchButton.java Modified: VASSAL-src/trunk/src/VASSAL/build/module/DiceButton.java =================================================================== --- VASSAL-src/trunk/src/VASSAL/build/module/DiceButton.java 2008-07-27 12:48:44 UTC (rev 3875) +++ VASSAL-src/trunk/src/VASSAL/build/module/DiceButton.java 2008-07-27 12:59:18 UTC (rev 3876) @@ -86,29 +86,34 @@ } protected void initLaunchButton() { - ActionListener rollAction = new ActionListener() { + final ActionListener rollAction = new ActionListener() { public void actionPerformed(ActionEvent e) { if (promptAlways) { - DiceButton delegate = new DiceButton() { + final DiceButton delegate = new DiceButton() { protected void initLaunchButton() { launch = new LaunchButton(null,BUTTON_TEXT,HOTKEY,null); } }; - List<String> keepAttributes = Arrays.asList(new String[]{N_DICE, N_SIDES, PLUS, ADD_TO_TOTAL}); + + final List<String> keepAttributes = + Arrays.asList(new String[]{N_DICE, N_SIDES, PLUS, ADD_TO_TOTAL}); + for (String key : keepAttributes) { delegate.setAttribute(key, getAttributeValueString(key)); } - AutoConfigurer ac = new AutoConfigurer(delegate); - ConfigurerWindow w = new ConfigurerWindow(ac, true); + + final AutoConfigurer ac = new AutoConfigurer(delegate); + final ConfigurerWindow w = new ConfigurerWindow(ac, true); for (String key : getAttributeNames()) { if (!keepAttributes.contains(key)) { - Component controls = ac.getConfigurer(key).getControls(); + final Component controls = ac.getConfigurer(key).getControls(); controls.getParent().remove(controls); } } w.pack(); w.setLocationRelativeTo(launch.getTopLevelAncestor()); w.setVisible(true); + for (String key : keepAttributes) { setAttribute(key, delegate.getAttributeValueString(key)); } Modified: VASSAL-src/trunk/src/VASSAL/tools/LaunchButton.java =================================================================== --- VASSAL-src/trunk/src/VASSAL/tools/LaunchButton.java 2008-07-27 12:48:44 UTC (rev 3875) +++ VASSAL-src/trunk/src/VASSAL/tools/LaunchButton.java 2008-07-27 12:59:18 UTC (rev 3876) @@ -33,8 +33,9 @@ import VASSAL.i18n.Resources; /** - * A JButton for placing into a VASSAL component's toolbar. Handles configuration of a hotkey shortcut, maintains - * appropriate tooltip text, etc. + * A JButton for placing into a VASSAL component's toolbar. + * Handles configuration of a hotkey shortcut, maintains appropriate + * tooltip text, etc. */ public class LaunchButton extends JButton { private static final long serialVersionUID = 1L; @@ -48,11 +49,14 @@ protected KeyStrokeListener keyListener; protected Configurer nameConfig, keyConfig; - public LaunchButton(String text, String textAttribute, String hotkeyAttribute, ActionListener al) { + public LaunchButton(String text, String textAttribute, + String hotkeyAttribute, ActionListener al) { this(text, textAttribute, hotkeyAttribute, null, al); } - public LaunchButton(String text, String tooltipAttribute, String textAttribute, String hotkeyAttribute, String iconAttribute, final ActionListener al) { + public LaunchButton(String text, String tooltipAttribute, + String textAttribute, String hotkeyAttribute, + String iconAttribute, final ActionListener al) { this(text, textAttribute, hotkeyAttribute, iconAttribute, al); tooltipAtt = tooltipAttribute; } @@ -162,6 +166,7 @@ } protected void checkVisibility() { - setVisible((getText() != null && getText().length() > 0) || getIcon() != null); + setVisible((getText() != null && getText().length() > 0) || + getIcon() != null); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |