@ -3,6 +3,8 @@ package com.fr.design.gui.ibutton;
import com.fr.design.constants.UIConstants ;
import com.fr.design.constants.UIConstants ;
import com.fr.design.event.GlobalNameListener ;
import com.fr.design.event.GlobalNameListener ;
import com.fr.design.event.GlobalNameObserver ;
import com.fr.design.event.GlobalNameObserver ;
import com.fr.design.event.UIObserver ;
import com.fr.design.event.UIObserverListener ;
import com.fr.design.utils.gui.UIComponentUtils ;
import com.fr.design.utils.gui.UIComponentUtils ;
import com.fr.stable.ArrayUtils ;
import com.fr.stable.ArrayUtils ;
import com.fr.stable.StringUtils ;
import com.fr.stable.StringUtils ;
@ -24,7 +26,7 @@ import java.util.ArrayList;
import java.util.Arrays ;
import java.util.Arrays ;
import java.util.List ;
import java.util.List ;
public class UIButtonGroup < T > extends JPanel implements GlobalNameObserver {
public class UIButtonGroup < T > extends JPanel implements GlobalNameObserver , UIObserver {
private static final long serialVersionUID = 1L ;
private static final long serialVersionUID = 1L ;
private static final int TEXT_LENGTH = 3 ;
private static final int TEXT_LENGTH = 3 ;
private static final int BUTTON_SIZE = 2 ;
private static final int BUTTON_SIZE = 2 ;
@ -37,6 +39,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
private boolean isToolBarComponent = false ;
private boolean isToolBarComponent = false ;
private boolean isClick ;
private boolean isClick ;
private UIObserverListener uiObserverListener ;
private boolean autoFireStateChanged = true ;
private boolean autoFireStateChanged = true ;
public UIButtonGroup ( String [ ] textArray ) {
public UIButtonGroup ( String [ ] textArray ) {
@ -326,6 +329,9 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
( ( ChangeListener ) listeners [ i + 1 ] ) . stateChanged ( e ) ;
( ( ChangeListener ) listeners [ i + 1 ] ) . stateChanged ( e ) ;
}
}
}
}
if ( uiObserverListener ! = null ) {
uiObserverListener . doChange ( ) ;
}
}
}
/ * *
/ * *
@ -368,6 +374,16 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
return true ;
return true ;
}
}
@Override
public void registerChangeListener ( UIObserverListener listener ) {
this . uiObserverListener = listener ;
}
@Override
public boolean shouldResponseChangeListener ( ) {
return true ;
}
/ * *
/ * *
* @param l
* @param l