From a98db3ce166ba130981fd12165bc235300e1f895 Mon Sep 17 00:00:00 2001 From: kerry Date: Sun, 6 Aug 2017 19:28:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 10 +++ .../design/locale/designer_en_US.properties | 5 ++ .../design/locale/designer_ja_JP.properties | 5 ++ .../design/locale/designer_ko_KR.properties | 5 ++ .../design/locale/designer_zh_CN.properties | 10 +++ .../design/locale/designer_zh_TW.properties | 7 +- .../component/BackgroundCompPane.java | 82 +++++++++++++++++++ 7 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 9aa8f6a2e..d6f90cadb 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2106,3 +2106,13 @@ FR-Designer_Double=Double FR-Designer_Add_Event=Add Event FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit FR-Designer_Remove_Item=Remove Item +FR-Designer_Widget_Position=widget Position +FR-Designer_Widget_Field=field +FR-Designer_Widget_Formula=formula +FR-Designer_Widget_String=String +FR-Designer_Widget_Display_Report_Tool=display report tool +FR-Designer_Widget_No_Repeat=no repeat +FR-Designer_Widget_Error_Tip=error tip +FR-Designer_Widget_Return_Leaf=return leaf +FR-Designer_Widget_Return_Path=return path +FR-Designer_Widget_Display_Position=Display Position diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index c4fecf6de..0d44c3036 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2107,3 +2107,8 @@ FR-Designer_Scale_Grade=Scale_Grade FR-Designer_Add_Event=Add Event FR-Designer_Not_Support_Authority_Edit=this element does not support authority edit FR-Designer_Remove_Item=Remove Item +FR-Designer_Widget_No_Repeat=no repeat +FR-Designer_Widget_Error_Tip=error tip +FR-Designer_Widget_Return_Leaf=return leaf +FR-Designer_Widget_Return_Path=return path +FR-Designer_Widget_Display_Position=Display Position \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index 7fada9bf1..f456a229b 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2110,3 +2110,8 @@ FR-Designer_Label_Name= FR-Designer_Insert_Formula= FR-Designer_Not_Support_Authority_Edit=\u3053\u306E\u8981\u7D20\u306F\u6A29\u9650\u5236\u5FA1\u3092\u30B5\u30DD\u30FC\u30C8\u3057\u3066\u3044\u307E\u305B\u3093 FR-Designer_Remove_Item= +FR-Designer_Widget_No_Repeat= +FR-Designer_Widget_Error_Tip= +FR-Designer_Widget_Return_Leaf= +FR-Designer_Widget_Return_Path= +FR-Designer_Widget_Display_Position= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 4e100cdae..444d54824 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2110,3 +2110,8 @@ FR-Designer_Label_Name= FR-Designer_Add_Event= FR-Designer_Not_Support_Authority_Edit=\uD574\uB2F9\uC694\uC18C\uB294\uAD8C\uD55C\uCEE8\uD2B8\uB864\uC744\uC9C0\uC6D0\uD558\uC9C0\uC54A\uC2B5\uB2C8\uB2E4. FR-Designer_Remove_Item= +FR-Designer_Widget_No_Repeat= +FR-Designer_Widget_Error_Tip= +FR-Designer_Widget_Return_Leaf= +FR-Designer_Widget_Return_Path= +FR-Designer_Widget_Display_Position= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 1116ff64a..0ec66bd02 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2113,3 +2113,13 @@ FR-Designer_Scale_Slider=\u7F29\u653E\u6ED1\u5757 FR-Designer_Scale_Grade=\u7F29\u653E\u7EA7\u522B\uFF0C\u5355\u51FB\u540E\u8C03\u8282\u663E\u793A\u6BD4\u4F8B\u3002 FR-Designer_Not_Support_Authority_Edit=\u8BE5\u5143\u7D20\u4E0D\u652F\u6301\u6743\u9650\u63A7\u5236 FR-Designer_Remove_Item=\u5220\u9664\u9009\u4E2D +FR-Designer_Widget_Position=\u63A7\u4EF6\u4F4D\u7F6E +FR-Designer_Widget_Field=\u5B57\u6BB5 +FR-Designer_Widget_Formula=\u516C\u5F0F +FR-Designer_Widget_String=\u5B57\u7B26\u4E32 +FR-Designer_Widget_Display_Report_Tool=\u663E\u793A\u62A5\u8868\u5757\u5DE5\u5177\u680F +FR-Designer_Widget_No_Repeat=\u53BB\u9664\u91CD\u590D\u9879 +FR-Designer_Widget_Error_Tip=\u9519\u8BEF\u63D0\u793A +FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9 +FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84 +FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index c54432580..23af4dafa 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2109,4 +2109,9 @@ FR-Designer_Use_Params_Template= FR-Designer_Label_Name= FR-Designer_Add_Event= FR-Designer_Not_Support_Authority_Edit=\u8A72\u5143\u7D20\u4E0D\u652F\u63F4\u8A31\u53EF\u6B0A\u63A7\u5236 -FR-Designer_Remove_Item= \ No newline at end of file +FR-Designer_Remove_Item= +FR-Designer_Widget_No_Repeat= +FR-Designer_Widget_Error_Tip= +FR-Designer_Widget_Return_Leaf= +FR-Designer_Widget_Return_Path= +FR-Designer_Widget_Display_Position= \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java new file mode 100644 index 000000000..67ed2bab0 --- /dev/null +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/BackgroundCompPane.java @@ -0,0 +1,82 @@ +package com.fr.design.widget.ui.designer.component; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ibutton.UIHeadGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; +import com.fr.form.ui.*; +import com.fr.form.ui.Button; +import com.fr.general.Background; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by ibm on 2017/8/6. + */ +public class BackgroundCompPane extends BasicPane { + private UIHeadGroup backgroundHead; + private AccessibleBackgroundEditor initalBackgroundEditor; + private AccessibleBackgroundEditor overBackgroundEditor; + private AccessibleBackgroundEditor clickBackgroundEditor; + + + public BackgroundCompPane() { + initComponent(); + } + + public void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + initalBackgroundEditor = new AccessibleBackgroundEditor(); + overBackgroundEditor = new AccessibleBackgroundEditor(); + clickBackgroundEditor = new AccessibleBackgroundEditor(); + String [] titles = new String[]{"默认", "自定义"}; + + double f = TableLayout.FILL; + final double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1},{1, 1},{1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Initial")), initalBackgroundEditor}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Over")), overBackgroundEditor}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background-Click")), clickBackgroundEditor}, + }; + final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 7, 7); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + backgroundHead = new UIHeadGroup(titles){ + @Override + public void tabChanged(int index) { + //todo + if (index == 1) { + panel.setVisible(true); + }else{ + panel.setVisible(false); + } + } + }; + this.add(backgroundHead, BorderLayout.NORTH); + this.add(panel, BorderLayout.CENTER); + + } + + public void update(FreeButton btn) { + btn.setInitialBackground((Background) initalBackgroundEditor.getValue()); + btn.setOverBackground((Background) overBackgroundEditor.getValue()); + btn.setClickBackground((Background) clickBackgroundEditor.getValue()); + } + + protected String title4PopupWindow() { + return ""; + } + + public void populate(FreeButton btn) { + initalBackgroundEditor.setValue(btn.getInitialBackground()); + overBackgroundEditor.setValue(btn.getOverBackground()); + clickBackgroundEditor.setValue(btn.getClickBackground()); + } +}