From 8084401e67315f4b7e06ffd57f35616a26f0707d Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 17:13:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?MOBILE-27220=20=E5=9C=A8=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=B1=9E=E6=80=A7=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E2=80=9C=E9=BB=98=E8=AE=A4=E2=80=9D=E5=92=8C=E2=80=9C?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F=E2=80=9D=E5=BC=80?= =?UTF-8?q?=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleDefinePane.java | 39 ++++++++++++++++--- .../mobile/ui/MobileStyleFontConfigPane.java | 3 +- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 5f11e46db0..20d983e7a6 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -5,6 +5,7 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.icombobox.LineComboBox; +import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; @@ -17,6 +18,7 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.mobile.MobileStyle; import com.fr.general.FRFont; import com.fr.invoke.Reflect; +import com.fr.locale.InterProviderFactory; import com.fr.stable.Constants; import javax.swing.JPanel; @@ -29,6 +31,8 @@ import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; public class MobileStyleDefinePane extends BasicBeanPane { @@ -42,6 +46,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { private Widget widget; private MobileStyleCustomDefinePane customBeanPane; private Class mobileStyleClazz; + private UIComboBox customCombo; + private JPanel settingPane; private ColorSelectBox colorSelectBox; private Color titleColor = new Color(47, 142, 241); private JPanel commomPane; @@ -62,6 +68,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { @Override public void populateBean(MobileStyle ob) { this.customBeanPane.populateBean(ob); + + customCombo.setSelectedIndex(ob.isCommonCustom() ? 1 : 0); if(ob.getBackground() != null) { colorSelectBox.setSelectObject(((ColorBackground)ob.getBackground()).getColor()); } @@ -83,6 +91,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { MobileStyle mobileStyle = Reflect.on(mobileStyleClazz).create().get(); this.widget.setMobileStyle(mobileStyle); this.customBeanPane.updateBean(); + mobileStyle.setCommonCustom(customCombo.getSelectedIndex() == 1); mobileStyle.setBackground(ColorBackground.getInstance(colorSelectBox.getSelectObject())); mobileStyle.setBorderType(borderType.getSelectedLineStyle()); mobileStyle.setBorderColor(borderColor.getSelectObject()); @@ -126,6 +135,23 @@ public class MobileStyleDefinePane extends BasicBeanPane { commomPane.setBorder(titledBorder); this.add(commomPane, BorderLayout.NORTH); + + customCombo = new UIComboBox(new String[]{Toolkit.i18nText("Fine-Design_Mobile_Default"), Toolkit.i18nText("FIne-Design_Mobile_Custom")}); + customCombo.setSelectedIndex(0); + customCombo.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 15, 20)); + customCombo.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + boolean isCustom = customCombo.getSelectedIndex() == 1; + settingPane.setVisible(isCustom); + } + }); + commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_setting")), customCombo)); + + settingPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 10); + settingPane.setVisible(false); + commomPane.add(settingPane); + createBackgroundPane(); createBorderPane(); createIconSettingPane(); @@ -136,7 +162,7 @@ public class MobileStyleDefinePane extends BasicBeanPane { colorSelectBox = new ColorSelectBox(NORMAL_COMBO_WIDTH); JPanel backgroundPane = createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Background")), colorSelectBox); - commomPane.add(backgroundPane); + settingPane.add(backgroundPane); } private void createBorderPane() { @@ -146,19 +172,20 @@ public class MobileStyleDefinePane extends BasicBeanPane { borderColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); borderRadius = new UISpinner(0, Integer.MAX_VALUE, 1, 2); borderRadius.setPreferredSize(new Dimension(NORMAL_COMBO_WIDTH + 20, 20)); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderType")), borderType)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderColor")), borderColor)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_BorderRadius")), borderRadius)); } private void createIconSettingPane() { iconColor = new NewColorSelectBox(NORMAL_COMBO_WIDTH); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); + iconColor.setSelectObject(new Color(31,173,229)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Icon_Color")), iconColor)); } private void createFontPane() { fontConfigPane = new MobileStyleFontConfigPane(); - commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); + settingPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Widget_Font")), fontConfigPane)); } private void createCustomPane() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index f765e25845..14b8c346fb 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -31,7 +31,6 @@ public class MobileStyleFontConfigPane extends JPanel { public static Vector getFontSizes() { Vector FONT_SIZES = new Vector(); - FONT_SIZES.add(FONT_NONE); for (int i = MIN_FONT_SIZE; i <= MAX_FONT_SIZE; i++) { FONT_SIZES.add(i); } @@ -51,7 +50,7 @@ public class MobileStyleFontConfigPane extends JPanel { fontSizeComboBox = new UIComboBox(); fontSizeComboBox.setModel(new DefaultComboBoxModel(getFontSizes())); - fontSizeComboBox.setSelectedItem(0); + fontSizeComboBox.setSelectedItem(16); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); fontSizeComboBox.setRenderer(new LineCellRenderer()); underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); From 1789ed55ae20455879133f016f4348411a342d3c Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 17:28:00 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java index 20d983e7a6..e21af7c6b5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleDefinePane.java @@ -142,8 +142,8 @@ public class MobileStyleDefinePane extends BasicBeanPane { customCombo.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { - boolean isCustom = customCombo.getSelectedIndex() == 1; - settingPane.setVisible(isCustom); + boolean custom = customCombo.getSelectedIndex() == 1; + settingPane.setVisible(custom); } }); commomPane.add(createLeftRightComponentsPane(createConfigLabel(Toolkit.i18nText("Fine-Design_Mobile_Attribute_setting")), customCombo)); From 75356f6866f17b1287103713b98bc5f05237fa45 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 26 May 2020 20:55:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?MOBILE-27268=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=AD=97=E7=AC=A6=E6=98=AF?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E5=B1=9E=E6=80=A7=E4=B8=8D=E6=98=AF=E4=B8=8B?= =?UTF-8?q?=E5=88=92=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mobile/ui/MobileStyleFontConfigPane.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java index 14b8c346fb..3c756db09b 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileStyleFontConfigPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.mobile.ui; import com.fr.base.BaseUtils; import com.fr.design.constants.LayoutConstants; +import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; @@ -16,7 +17,6 @@ import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; @@ -38,7 +38,7 @@ public class MobileStyleFontConfigPane extends JPanel { } private UIComboBox fontSizeComboBox; - private UIToggleButton underline; + private UIColorButton color; private UIToggleButton italic; private UIToggleButton bold; @@ -53,7 +53,7 @@ public class MobileStyleFontConfigPane extends JPanel { fontSizeComboBox.setSelectedItem(16); fontSizeComboBox.setPreferredSize(new Dimension(60, 20)); fontSizeComboBox.setRenderer(new LineCellRenderer()); - underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); + color = new UIColorButton(); italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); @@ -61,7 +61,7 @@ public class MobileStyleFontConfigPane extends JPanel { this.setButtonsSize(BUTTON_SIZE); Component[] components_font = new Component[]{ - fontSizeComboBox, underline, italic, bold + fontSizeComboBox, color, italic, bold }; JPanel buttonPane = new JPanel(new BorderLayout()); @@ -72,13 +72,13 @@ public class MobileStyleFontConfigPane extends JPanel { } private void setButtonsTips() { - underline.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Underline")); + color.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Foreground")); italic.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Italic")); bold.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bold")); } private void setButtonsSize(Dimension size) { - underline.setPreferredSize(size); + color.setPreferredSize(size); italic.setPreferredSize(size); bold.setPreferredSize(size); } @@ -86,9 +86,9 @@ public class MobileStyleFontConfigPane extends JPanel { public void populateBean(FRFont frFont) { fontSizeComboBox.setSelectedItem(frFont.getSize()); + color.setColor(frFont.getForeground()); bold.setSelected(frFont.isBold()); italic.setSelected(frFont.isItalic()); - underline.setSelected(frFont.getUnderline() != Constants.LINE_NONE); } public FRFont updateBean() { @@ -99,8 +99,8 @@ public class MobileStyleFontConfigPane extends JPanel { FRFont.DEFAULT_FONTNAME, style, Float.parseFloat(fontSizeComboBox.getSelectedItem().toString()), - Color.BLACK, - underline.isSelected() ? Constants.LINE_THIN : Constants.LINE_NONE + color.getColor(), + Constants.LINE_NONE ); }