@ -2,6 +2,8 @@ package com.fr.design.chartx.component.combobox;
import com.fr.base.ChartColorMatching ;
import com.fr.base.ChartColorMatching ;
import com.fr.base.ChartPreStyleConfig ;
import com.fr.base.ChartPreStyleConfig ;
import com.fr.cert.token.lang.Collections ;
import com.fr.chart.base.ChartConstants ;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.gui.icombobox.UIComboBox ;
import com.fr.design.gui.icombobox.UIComboBoxRenderer ;
import com.fr.design.gui.icombobox.UIComboBoxRenderer ;
import com.fr.design.i18n.Toolkit ;
import com.fr.design.i18n.Toolkit ;
@ -60,13 +62,20 @@ public class ColorSchemeComboBox extends UIComboBox {
//添加默认的方案和第一个方案
//添加默认的方案和第一个方案
String defaultName = config . getCurrentStyle ( ) ;
String defaultName = config . getCurrentStyle ( ) ;
ChartColorMatching defaultStyle = ( ChartColorMatching ) config . getPreStyle ( defaultName ) ;
ChartColorMatching defaultStyle = ( ChartColorMatching ) config . getPreStyle ( defaultName ) ;
Object firstName = names . next ( ) ;
if ( names . hasNext ( ) ) {
ChartColorMatching firstStyle = ( ChartColorMatching ) config . getPreStyle ( firstName ) ;
Object firstName = names . next ( ) ;
if ( defaultStyle = = null ) {
ChartColorMatching firstStyle = ( ChartColorMatching ) config . getPreStyle ( firstName ) ;
defaultStyle = firstStyle ;
if ( defaultStyle = = null ) {
defaultStyle = firstStyle ;
}
colorSchemes . put ( Toolkit . i18nText ( "Fine-Design_Report_Default" ) , colorMatchingToColorInfo ( defaultStyle ) ) ;
colorSchemes . put ( firstStyle . getId ( ) , colorMatchingToColorInfo ( firstStyle ) ) ;
} else {
ColorInfo colorInfo = new ColorInfo ( ) ;
colorInfo . setGradient ( false ) ;
colorInfo . setColors ( Collections . arrayToList ( ChartConstants . CHART_COLOR_ARRAY ) ) ;
colorSchemes . put ( Toolkit . i18nText ( "Fine-Design_Report_Default" ) , colorInfo ) ;
}
}
colorSchemes . put ( Toolkit . i18nText ( "Fine-Design_Report_Default" ) , colorMatchingToColorInfo ( defaultStyle ) ) ;
colorSchemes . put ( firstStyle . getId ( ) , colorMatchingToColorInfo ( firstStyle ) ) ;
//添加其他的配色方案
//添加其他的配色方案
while ( names . hasNext ( ) ) {
while ( names . hasNext ( ) ) {