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 4 years ago
parent
commit
6a06de7a89
  1. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java
  2. 33
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java
  3. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  4. 17
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java

@ -35,4 +35,4 @@ public class UIColorButtonWithAuto extends UIColorButton {
return getPopupWin();
}
}
}

33
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.UIColorButtonWithAuto;
import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
@ -11,9 +12,9 @@ import com.fr.general.GeneralUtils;
public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto");
private boolean isFontSizeAuto = false;
private boolean isColorAuto = false;
private FontAutoType type;
public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2];
static {
FONT_SIZES_WITH_AUTO[0] = AUTO;
@ -22,28 +23,30 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
}
}
public ChartTextAttrPaneWithAuto() {
super();
public ChartTextAttrPaneWithAuto(FontAutoType type) {
this.type = type;
initState();
initComponents();
}
public ChartTextAttrPaneWithAuto(boolean isFontSizeAuto, boolean isColorAuto) {
this.isFontSizeAuto = isFontSizeAuto;
this.isColorAuto = isColorAuto;
private boolean isFontSizeAuto() {
return type == FontAutoType.SIZE || type == FontAutoType.SIZE_AND_COLOR;
}
initState();
initComponents();
private boolean isFontColorAuto() {
return type == FontAutoType.COLOR || type == FontAutoType.SIZE_AND_COLOR;
}
protected void initFontColorState() {
setFontColor(isColorAuto ? new UIColorButtonWithAuto() : new UIColorButton());
setFontColor(isFontColorAuto() ? new UIColorButtonWithAuto() : new UIColorButton());
}
protected Object[] getFontSizeComboBoxModel() {
return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES;
return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES;
}
protected float updateFontSize() {
if (isFontSizeAuto && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) {
if (isFontSizeAuto() && ComparatorUtils.equals(getFontSizeComboBox().getSelectedItem(), AUTO)) {
return ChartConstants.AUTO_FONT_SIZE;
}
@ -51,7 +54,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
}
protected void populateFontSize(FRFont frFont) {
if (getFontSizeComboBox() != null && isFontSizeAuto) {
if (getFontSizeComboBox() != null && isFontSizeAuto()) {
if (frFont.getSize() == ChartConstants.AUTO_FONT_SIZE) {
getFontSizeComboBox().setSelectedItem(AUTO);
} else {
@ -59,8 +62,8 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
}
}
if (getFontSizeComboBox() != null && !isFontSizeAuto) {
if (getFontSizeComboBox() != null && !isFontSizeAuto()) {
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.VanChartGaugeAxis;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
@ -101,7 +102,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
protected ChartTextAttrPane getChartTextAttrPane() {
if (isMulti(gaugeStyle)) {
return new ChartTextAttrPaneWithAuto(false, true);
return new ChartTextAttrPaneWithAuto(FontAutoType.SIZE_AND_COLOR);
} else {
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.plugin.chart.base.AttrLabelDetail;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -69,9 +70,21 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
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() {
double p = TableLayout.PREFERRED;
return new double[]{p, p};

Loading…
Cancel
Save