classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Patch for DefaultButtonModel and JToggleButton


From: Anthony Balkissoon
Subject: [cp-patches] FYI: Patch for DefaultButtonModel and JToggleButton
Date: Wed, 13 Jul 2005 11:34:12 -0400

As discussed on IRC, this patch improves the design by moving
Toggle-specific code to JToggleButton.ToggleButtonModel and by
eliminating the ugly helper method in DefaultButtonModel and instead
putting code in the proper place so that it can more easily adapted by
child classes.

Patch caused no regressions in javax/swing.

Patch is attached.

2005-07-13  Anthony Balkissoon  <address@hidden>

* javax/swing/DefaultButtonModel.java:
(changeState): Removed this helper method.
(setArmed): Replaced call to changeState by code specific to setArmed.
(setEnabled): Likewise, for setEnabled.
(setPressed): Likewise, for setPressed.
(setRollover): Likewise, for setRollover.
(setSelected): Likewise, for setSelected.
* javax/swing/JToggleButton.java:
(ToggleButtonModel.setPressed): Replaced call to super.setPressed with
Toggle-specific code.
(ToggleButtonModel.setSelected): New method.  Fire an ActionEvent in
addition to calling super.setSelected.

-Tony

Attachment: DefaultVsToggleButtonModel.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]