Browse Source

方法重命名

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
0b3fd78b10
  1. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  2. 24
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java

11
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -34,11 +34,10 @@ public class ChartTextAttrPane extends BasicPane {
private UIToggleButton bold; private UIToggleButton bold;
private UIToggleButton italic; private UIToggleButton italic;
private UIColorButton fontColor; private UIColorButton fontColor;
public static Integer[] Font_Sizes = new Integer[FONT_END - FONT_START + 1]; public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1];
static { static {
for (int i = FONT_START; i <= FONT_END; i++) { for (int i = FONT_START; i <= FONT_END; i++) {
Font_Sizes[i - FONT_START] = i; FONT_SIZES[i - FONT_START] = i;
} }
} }
@ -114,7 +113,7 @@ public class ChartTextAttrPane extends BasicPane {
fontNameComboBox.setSelectedItem(frFont.getFamily()); fontNameComboBox.setSelectedItem(frFont.getFamily());
bold.setSelected(frFont.isBold()); bold.setSelected(frFont.isBold());
italic.setSelected(frFont.isItalic()); italic.setSelected(frFont.isItalic());
setFontSize(frFont); populateFontSize(frFont);
if (fontColor != null) { if (fontColor != null) {
fontColor.setColor(frFont.getForeground()); fontColor.setColor(frFont.getForeground());
} }
@ -124,7 +123,7 @@ public class ChartTextAttrPane extends BasicPane {
registerAllComboBoxListener(listener); registerAllComboBoxListener(listener);
} }
protected void setFontSize(FRFont frFont) { protected void populateFontSize(FRFont frFont) {
if (fontSizeComboBox != null) { if (fontSizeComboBox != null) {
fontSizeComboBox.setSelectedItem(frFont.getSize()); fontSizeComboBox.setSelectedItem(frFont.getSize());
} }
@ -177,7 +176,7 @@ public class ChartTextAttrPane extends BasicPane {
} }
protected Object[] getFontSizeComboBoxModel() { protected Object[] getFontSizeComboBoxModel() {
return Font_Sizes; return FONT_SIZES;
} }
protected void initState() { protected void initState() {

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

@ -13,6 +13,14 @@ 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 boolean isFontSizeAuto = false;
private boolean isColorAuto = false; private boolean isColorAuto = false;
public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2];
static {
FONT_SIZES_WITH_AUTO[0] = AUTO;
for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) {
FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + "";
}
}
public ChartTextAttrPaneWithAuto() { public ChartTextAttrPaneWithAuto() {
super(); super();
@ -31,19 +39,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
} }
protected Object[] getFontSizeComboBoxModel() { protected Object[] getFontSizeComboBoxModel() {
if (isFontSizeAuto) { return isFontSizeAuto ? FONT_SIZES_WITH_AUTO : FONT_SIZES;
String[] fontSizes = new String[FONT_END - FONT_START + 2];
fontSizes[0] = AUTO;
for (int i = 1; i < fontSizes.length; i++) {
fontSizes[i] = FONT_START + i + "";
}
return fontSizes;
}
return super.getFontSizeComboBoxModel();
} }
protected float getFontSize() { protected float getFontSize() {
@ -54,7 +50,7 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane {
return Float.parseFloat(GeneralUtils.objectToString(getFontSizeComboBox().getSelectedItem())); return Float.parseFloat(GeneralUtils.objectToString(getFontSizeComboBox().getSelectedItem()));
} }
protected void setFontSize(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);

Loading…
Cancel
Save