@ -5,7 +5,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.i18n.Toolkit ;
import com.fr.design.layout.TableLayou t ;
import com.fr.design.mainframe.chart.mode.ChartEditContex t ;
import com.fr.design.style.color.ColorSelectBox ;
import com.fr.van.chart.designer.TableLayout4VanChartHelper ;
@ -39,18 +39,16 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
}
private void initContent ( ) {
double f = TableLayout . FILL ;
double e = TableLayout4VanChartHelper . EDIT_AREA_WIDTH ;
double [ ] columnSize = { f , e } ;
double p = TableLayout . PREFERRED ;
double [ ] rowSize = { p , p , p } ;
UILabel text = new UILabel ( Toolkit . i18nText ( "Fine-Design_Chart_Color" ) , SwingConstants . LEFT ) ;
Component [ ] [ ] components = {
Component [ ] [ ] components = ChartEditContext . supportTheme ( ) ? new Component [ ] [ ] {
new Component [ ] { text , preButton } ,
new Component [ ] { null , colorSelectBox } ,
} : new Component [ ] [ ] {
new Component [ ] { text , colorSelectBox }
} ;
JPanel gapTableLayoutPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( components , rowSize , columnSize ) ;
JPanel gapTableLayoutPane = TableLayout4VanChartHelper . createGapTableLayoutPane ( components ) ;
this . setLayout ( new BorderLayout ( ) ) ;
this . add ( gapTableLayoutPane , BorderLayout . CENTER ) ;
}
@ -66,7 +64,7 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
private void checkPreButton ( ) {
colorSelectBox . setVisible ( preButton . getSelectedIndex ( ) = = CUSTOM ) ;
this . setPreferredSize ( preButton . getSelectedIndex ( ) = = CUSTOM ? new Dimension ( 0 , 55 ) : new Dimension ( 0 , 23 ) ) ;
this . setPreferredSize ( ChartEditContext . supportTheme ( ) & & preButton . getSelectedIndex ( ) = = CUSTOM ? new Dimension ( 0 , 55 ) : new Dimension ( 0 , 23 ) ) ;
}
public String title4PopupWindow ( ) {
@ -74,14 +72,14 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
}
public void populate ( ColorWithThemeStyle colorWithPreStyle ) {
preButton . setSelectedIndex ( colorWithPreStyle . isThemed ( ) ? PREDEFINED_STYLE : CUSTOM ) ;
preButton . setSelectedIndex ( ChartEditContext . supportTheme ( ) & & colorWithPreStyle . isThemed ( ) ? PREDEFINED_STYLE : CUSTOM ) ;
colorSelectBox . setSelectObject ( colorWithPreStyle . getColor ( ) ) ;
checkPreButton ( ) ;
}
public ColorWithThemeStyle update ( ) {
ColorWithThemeStyle colorWithPreStyle = new ColorWithThemeStyle ( ) ;
colorWithPreStyle . setThemed ( preButton . getSelectedIndex ( ) = = PREDEFINED_STYLE ) ;
colorWithPreStyle . setThemed ( ChartEditContext . supportTheme ( ) & & preButton . getSelectedIndex ( ) = = PREDEFINED_STYLE ) ;
colorWithPreStyle . setColor ( colorSelectBox . getSelectObject ( ) ) ;
return colorWithPreStyle ;
}