@ -14,11 +14,11 @@ import javax.swing.BorderFactory;
import javax.swing.Icon ;
import javax.swing.Icon ;
import javax.swing.JPanel ;
import javax.swing.JPanel ;
import javax.swing.SwingConstants ;
import javax.swing.SwingConstants ;
import javax.swing.event.ChangeEvent ;
import javax.swing.event.ChangeListener ;
import java.awt.Color ;
import java.awt.Color ;
import java.awt.Cursor ;
import java.awt.Cursor ;
import java.awt.GridLayout ;
import java.awt.GridLayout ;
import java.awt.event.ActionEvent ;
import java.awt.event.ActionListener ;
import java.awt.event.MouseEvent ;
import java.awt.event.MouseEvent ;
import java.util.List ;
import java.util.List ;
@ -49,31 +49,28 @@ public class ITReplaceWestPanel {
contentButton = new UIToggleButton ( Toolkit . i18nText ( "Fine-Design_Basic_Templates_Content" ) ) ;
contentButton = new UIToggleButton ( Toolkit . i18nText ( "Fine-Design_Basic_Templates_Content" ) ) ;
settingButton = new UIToggleButton ( Toolkit . i18nText ( "Fine-Design_Replace_Setting" ) ) ;
settingButton = new UIToggleButton ( Toolkit . i18nText ( "Fine-Design_Replace_Setting" ) ) ;
contentButton . setText ( CONTENT_TEXT ) ;
contentButton . setText ( CONTENT_TEXT ) ;
contentButton . addActionListener ( new Action Listener ( ) {
contentButton . addChangeListener ( new Change Listener ( ) {
@Override
@Override
public void actionPerformed ( Action Event e ) {
public void stateChanged ( Change Event e ) {
if ( ! contentButton . isSelected ( ) ) {
if ( contentButton . isSelected ( ) ) {
showSelectPanel ( ITReplaceNorthPanel . CARD_CONTENT , ITReplaceMainDialog . getSearchContentResultList ( ) ) ;
showSelectPanel ( ITReplaceNorthPanel . CARD_CONTENT , ITReplaceMainDialog . getSearchContentResultList ( ) ) ;
settingButton . setSelected ( ! contentButton . isSelected ( ) ) ;
changeColor4SelectContent ( ) ;
} else {
} else {
showSelectPanel ( ITReplaceNorthPanel . CARD_SETTING , ITReplaceMainDialog . getSearchSettingResultList ( ) ) ;
contentButton . setSelected ( true ) ;
}
}
changeColor4SelectContent ( ) ;
settingButton . setSelected ( contentButton . isSelected ( ) ) ;
}
}
} ) ;
} ) ;
settingButton . addChangeListener ( new ChangeListener ( ) {
settingButton . addActionListener ( new ActionListener ( ) {
@Override
@Override
public void actionPerformed ( Action Event e ) {
public void stateChanged ( Change Event e ) {
if ( ! settingButton . isSelected ( ) ) {
if ( settingButton . isSelected ( ) ) {
showSelectPanel ( ITReplaceNorthPanel . CARD_SETTING , ITReplaceMainDialog . getSearchSettingResultList ( ) ) ;
showSelectPanel ( ITReplaceNorthPanel . CARD_SETTING , ITReplaceMainDialog . getSearchSettingResultList ( ) ) ;
contentButton . setSelected ( ! settingButton . isSelected ( ) ) ;
changeColor4SelectContent ( ) ;
} else {
} else {
showSelectPanel ( ITReplaceNorthPanel . CARD_CONTENT , ITReplaceMainDialog . getSearchContentResultList ( ) ) ;
settingButton . setSelected ( true ) ;
}
}
changeColor4SelectContent ( ) ;
contentButton . setSelected ( settingButton . isSelected ( ) ) ;
}
}
} ) ;
} ) ;
leftPanel . setBackground ( Color . WHITE ) ;
leftPanel . setBackground ( Color . WHITE ) ;
@ -118,7 +115,7 @@ public class ITReplaceWestPanel {
* 切换面板时改变颜色
* 切换面板时改变颜色
* /
* /
public void changeColor4SelectContent ( ) {
public void changeColor4SelectContent ( ) {
if ( ! contentButton . isSelected ( ) ) {
if ( contentButton . isSelected ( ) ) {
contentButton . setText ( CONTENT_TEXT ) ;
contentButton . setText ( CONTENT_TEXT ) ;
settingButton . setText ( Toolkit . i18nText ( "Fine-Design_Replace_Setting" ) ) ;
settingButton . setText ( Toolkit . i18nText ( "Fine-Design_Replace_Setting" ) ) ;
} else {
} else {