diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index f486e50b1b..6760474e93 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -27,11 +27,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected void initFontColorState() { - if (isColorAuto) { - setFontColor(new UIColorButtonWithAuto()); - } else { - setFontColor(new UIColorButton()); - } + setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); } protected Object[] getFontSizeComboBoxModel() { @@ -45,9 +41,9 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } return fontSizes; - } else { - return super.getFontSizeComboBoxModel(); } + + return super.getFontSizeComboBoxModel(); } protected float getFontSize() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index e67e19accf..64187f89b9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java @@ -1,7 +1,6 @@ package com.fr.van.chart.designer.style.label; import com.fr.chart.chartattr.Plot; -import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; @@ -46,11 +45,11 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } - protected boolean getFontColorAuto() { + protected boolean isFontColorAuto() { return getGaugeStyle() == GaugeStyle.RING || getGaugeStyle() == GaugeStyle.SLOT; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 750b0119a6..31e329845f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -38,7 +38,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super(plot, parent); } - protected void initLabelDetailPane (Plot plot) { + protected void initLabelDetailPane(Plot plot) { setGaugeStyle(((VanChartGaugePlot) plot).getGaugeStyle()); super.initLabelDetailPane(plot); } @@ -61,17 +61,17 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return false; } - protected boolean getFontColorAuto() { + protected boolean isFontColorAuto() { return false; } protected ChartTextAttrPane initTextFontPane() { - return new ChartTextAttrPaneWithAuto(getFontSizeAuto(), getFontColorAuto()) { + return new ChartTextAttrPaneWithAuto(isFontSizeAuto(), isFontColorAuto()) { protected double[] getRowSize() { double p = TableLayout.PREFERRED; return new double[]{p, p}; @@ -205,10 +205,12 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { super.update(detail); detail.setCustom(true); - if (align != null && align.getSelectedItem() != null) { - detail.setAlign(align.getSelectedItem()); - } else if (align != null) { - align.setSelectedItem(detail.getAlign()); + if (align != null) { + if (align.getSelectedItem() != null) { + detail.setAlign(align.getSelectedItem()); + } else { + align.setSelectedItem(detail.getAlign()); + } } } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java index 5872014ff1..01a21d3823 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeValueLabelDetailPane.java @@ -60,7 +60,7 @@ public class VanChartGaugeValueLabelDetailPane extends VanChartGaugeLabelDetailP } } - protected boolean getFontSizeAuto() { + protected boolean isFontSizeAuto() { return getGaugeStyle() != GaugeStyle.THERMOMETER; }