Browse Source

Merge pull request #1479 in DESIGN/design from ~QINGHUI.LIU/design:release/10.0 to release/10.0

* commit 'f24b41b4409a523f9b59646092fe4033044b5cb8':
  简化传参
  简化本地变量
  CHART-9435 使用枚举类型来判断字符自动类型
  CHART-9435 多指针仪表盘坐标轴字符大小自动
  删除多余的构造函数
  CHART-9435 修改仪表盘默认属性
feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
6a06de7a89
  1. 31
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java
  2. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  3. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

31
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java

@ -4,6 +4,7 @@ import com.fr.chart.base.ChartConstants;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.gui.ibutton.UIColorButtonWithAuto;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
@ -11,9 +12,9 @@ import com.fr.general.GeneralUtils;
public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto");
private boolean isFontSizeAuto = false; private FontAutoType type;
private boolean isColorAuto = false;
public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2];
static { static {
FONT_SIZES_WITH_AUTO[0] = AUTO; FONT_SIZES_WITH_AUTO[0] = AUTO;
@ -22,28 +23,30 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
} }
} }
public ChartTextAttrPaneWithAuto() { public ChartTextAttrPaneWithAuto(FontAutoType type) {
super(); this.type = type;
initState();
initComponents();
} }
public ChartTextAttrPaneWithAuto(boolean isFontSizeAuto, boolean isColorAuto) { private boolean isFontSizeAuto() {
this.isFontSizeAuto = isFontSizeAuto; return type == FontAutoType.SIZE || type == FontAutoType.SIZE_AND_COLOR;
this.isColorAuto = isColorAuto; }
initState(); private boolean isFontColorAuto() {
initComponents(); return type == FontAutoType.COLOR || type == FontAutoType.SIZE_AND_COLOR;
} }
protected void initFontColorState() { protected void initFontColorState() {
setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton()); setFontColor(isFontColorAuto() ? new UIColorButtonWithAuto() : new UIColorButton());
} }
protected Object[] getFontSizeComboBoxModel() { protected Object[] getFontSizeComboBoxModel() {
return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES; return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES;
} }
protected float updateFontSize() { protected float updateFontSize() {
if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) { if (isFontSizeAuto() && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) {
return ChartConstants.AUTO_FONT_SIZE; return ChartConstants.AUTO_FONT_SIZE;
} }
@ -51,7 +54,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
} }
protected void populateFontSize(FRFont frFont) { protected void populateFontSize(FRFont frFont) {
if (getFontSizeComboBox() != null && isFontSizeAuto) { if (getFontSizeComboBox() != null && isFontSizeAuto()) {
if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) { if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) {
getFontSizeComboBox().setSelectedItem(AUTO); getFontSizeComboBox().setSelectedItem(AUTO);
} else { } else {
@ -59,7 +62,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
} }
} }
if (getFontSizeComboBox() != null && !isFontSizeAuto) { if (getFontSizeComboBox() != null && !isFontSizeAuto()) {
getFontSizeComboBox().setSelectedItem(frFont.getSize()); getFontSizeComboBox().setSelectedItem(frFont.getSize());
} }
} }

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -13,6 +13,7 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis; import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -101,7 +102,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
protected ChartTextAttrPane getChartTextAttrPane() { protected ChartTextAttrPane getChartTextAttrPane() {
if (isMulti(gaugeStyle)) { if (isMulti(gaugeStyle)) {
return new ChartTextAttrPaneWithAuto(false, true); return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR);
} else { } else {
return new ChartTextAttrPane(); return new ChartTextAttrPane();
} }

17
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -13,6 +13,7 @@ import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -69,9 +70,21 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
return false; return false;
} }
protected ChartTextAttrPane initTextFontPane() { private FontAutoType getFontAutoType() {
if (isFontSizeAuto() && isFontColorAuto()) {
return FontAutoType.SIZE_AND_COLOR;
}
if (isFontSizeAuto()) {
return FontAutoType.SIZE;
}
if (isFontColorAuto()) {
return FontAutoType.COLOR;
}
return FontAutoType.NONE;
}
return new ChartTextAttrPaneWithAuto(isFontSizeAuto(), isFontColorAuto()) { protected ChartTextAttrPane initTextFontPane() {
return new ChartTextAttrPaneWithAuto(getFontAutoType()) {
protected double[] getRowSize() { protected double[] getRowSize() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
return new double[]{p, p}; return new double[]{p, p};

Loading…
Cancel
Save