diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java index 73dfe5ca9..758c673fa 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java @@ -95,7 +95,7 @@ public class ColorSelectDetailPane extends BasicPane { public void stateChanged(ChangeEvent e) { ColorSelectionModel model = (ColorSelectionModel) e.getSource(); colorChooserPreview.setMyColor(model.getSelectedColor()); - colorChooserPreview.paint(colorChooserPreview.getGraphics()); + colorChooserPreview.repaint(); } }); previewPanel.add(colorChooserPreview); diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 32e656479..35b57d09d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -2,8 +2,8 @@ package com.fr.design.mainframe.chart.gui.style.axis; import com.fr.base.BaseFormula; import com.fr.base.Utils; +import com.fr.chart.base.AxisUnitType; import com.fr.chart.base.ChartBaseUtils; -import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.NumberAxis; @@ -78,7 +78,7 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane = new ChartAxisLineStylePane(); zeroPane = aliagnZero4Second(); axisReversed = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")); - unitCombox = new UIComboBox(ChartConstants.UNIT_I18N_VALUES); + unitCombox = new UIComboBox(AxisUnitType.getI18NValues()); formatPane = new FormatPaneWithOutFont(); axisLabelPane = new ChartAxisLabelPane(); dataPane = createDataDefinePane(); @@ -257,10 +257,10 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane.update(axis); axis.setAxisReversed(this.axisReversed.isSelected()); String unitValue = Utils.objectToString(unitCombox.getSelectedItem()); - if(ComparatorUtils.equals(unitValue, ChartConstants.UNIT_I18N_VALUES[0])) { + if(ComparatorUtils.equals(unitValue, AxisUnitType.UNIT_NONE.toLocaleString())) { unitValue = null; } - numberAxis.setShowUnit(ChartConstants.getUnitValueFromKey(unitValue)); + numberAxis.setShowUnit(AxisUnitType.parse(unitValue)); if(numberAxis.isSurpportAxisTitle()) { updateAxisTitle(numberAxis); } @@ -378,11 +378,13 @@ public class ChartValuePane extends ChartAxisUsePane{ axisLineStylePane.populate(axis); axisReversed.setSelected(axis.hasAxisReversed()); - String unitKey = numberAxis.getShowUnit(); - if(StringUtils.isBlank(unitKey)) { - unitKey = ChartConstants.UNIT_I18N_KEYS[0]; + String unitKey; + if(numberAxis.getShowUnit() != null) { + unitKey = numberAxis.getShowUnit().getStringType(); + }else{ + unitKey = AxisUnitType.UNIT_NONE.getStringType(); } - unitCombox.setSelectedItem(ChartConstants.getUnitKey2Value(unitKey)); + unitCombox.setSelectedItem(AxisUnitType.parse(unitKey).toLocaleString()); if(numberAxis.isSurpportAxisTitle()) { populateAxisTitle(axis);