diff --git a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java index 124b72c796..719ecea4e5 100644 --- a/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java +++ b/designer/src/com/fr/design/widget/ui/btn/ButtonSytleDefinedPane.java @@ -1,12 +1,13 @@ package com.fr.design.widget.ui.btn; -import java.awt.BorderLayout; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.ImageIcon; + +import com.fr.base.background.ColorBackground; import com.fr.design.gui.ilable.UILabel; import javax.swing.JPanel; import javax.swing.SwingUtilities; @@ -18,7 +19,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.gui.frpane.ImgChoosePane; +import com.fr.design.style.background.BackgroundButtonPane; import com.fr.form.ui.FreeButton; import com.fr.general.Background; import com.fr.general.Inter; @@ -44,9 +45,9 @@ public class ButtonSytleDefinedPane extends BasicPane { JPanel buttonStylePane = new JPanel(); buttonStylePane.setLayout(new BorderLayout()); - initBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Initial") + ":", Inter.getLocText("The_initial_background_of_the_button")); - overBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Over") + ":", Inter.getLocText("Mouse_move-background")); - clickBackgroundPane = new BackgroundPane(Inter.getLocText("Background-Click") + ":", Inter.getLocText("Mouse_move-background")); + initBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Initial") + ":", Inter.getLocText("FR-Designer_Initial_Background_Tips")); + overBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Over") + ":", Inter.getLocText("FR-Designer_Mouse_Move_Tips")); + clickBackgroundPane = new BackgroundPane(Inter.getLocText("FR-Designer_Background-Click") + ":", Inter.getLocText("FR-Designer_Mouse_Click_Tips")); JPanel table = FRGUIPaneFactory.createYBoxEmptyBorderPane(); table.setBorder(new TitledBorder(Inter.getLocText(new String[]{"Custom", "Form-Button", "Style"}))); @@ -84,7 +85,7 @@ public class ButtonSytleDefinedPane extends BasicPane { class BackgroundPane extends JPanel { private UIButton editButton; - private ImgChoosePane choosePane; + private BackgroundButtonPane choosePane; private Background background; private UILabel ImagePreviewPane; @@ -101,13 +102,11 @@ public class ButtonSytleDefinedPane extends BasicPane { ImagePreviewPane.setPreferredSize(new Dimension(100, 20)); this.add(ImagePreviewPane); - editButton = new UIButton(Inter.getLocText("Edit")); + editButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); editButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - if (choosePane == null) { - choosePane = new ImgChoosePane(); - } + choosePane = new BackgroundButtonPane(); BasicDialog dlg = choosePane.showWindow(SwingUtilities .getWindowAncestor(ButtonSytleDefinedPane.this)); dlg.addDialogActionListener(new DialogActionAdapter() { @@ -116,7 +115,10 @@ public class ButtonSytleDefinedPane extends BasicPane { populate(choosePane.update()); } }); - choosePane.populate((ImageBackground) BackgroundPane.this.background); + if(BackgroundPane.this.background == null){ + BackgroundPane.this.background = new ColorBackground(); + } + choosePane.populate((Background) BackgroundPane.this.background); dlg.setVisible(true); } }); @@ -125,15 +127,22 @@ public class ButtonSytleDefinedPane extends BasicPane { public void populate(Background background) { this.background = background; + if (background instanceof ImageBackground && ((ImageBackground) background).getImage() != null) { ImagePreviewPane.setIcon(new ImageIcon(((ImageBackground) background).getImage())); - } else { + } else if(background instanceof ColorBackground && ((ColorBackground) background).getColor() != null){ + ImagePreviewPane.setIcon(null); + ImagePreviewPane.setOpaque(true); + ImagePreviewPane.setBackground(((ColorBackground) background).getColor()); + }else{ ImagePreviewPane.setIcon(null); + ImagePreviewPane.setOpaque(false); + ImagePreviewPane.setBackground(null); } } - public ImageBackground update() { - return (ImageBackground) background; + public Background update() { + return background; } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 41f3c8cdd8..5caabf6222 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -520,4 +520,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file 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 334e01ca8c..91668466a6 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 @@ -520,4 +520,7 @@ FR-Designer_Background_Clear=Clear FR-Designer_Background_Image_Select=Select Picture FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips=Initial background of the button +FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background +FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background \ 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 6312538cf7..2e0ca9c92a 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 @@ -499,4 +499,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file 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 87a1b893c8..b86f0d900e 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 @@ -494,4 +494,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file 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 10c53380d0..659fe3737d 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 @@ -524,4 +524,7 @@ FR-Designer_Background_Clear=\u6E05\u9664 FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 FR-Designer_Tab_carousel=tab\u8F6E\u64AD FR-Designer_setCarousel=\u5F00\u542F\u8F6E\u64AD -FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 \ No newline at end of file +FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 +FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F 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 96cb4260a9..5cff5b570c 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 @@ -512,4 +512,7 @@ FR-Designer_Background_Clear= FR-Designer_Background_Image_Select= FR-Designer_Tab_carousel= FR-Designer_setCarousel= -FR-Designer_carouselInterval= \ No newline at end of file +FR-Designer_carouselInterval= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java b/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java index 9d278d0482..9efdb92622 100644 --- a/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java +++ b/designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java @@ -31,6 +31,7 @@ public abstract class ButtonWithHotkeysDetailPane extends Butt } private void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Advanced")); advancedPane.setPreferredSize(new Dimension(600, 341)); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java index 8def747683..cbead62045 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java +++ b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleImgBackgroundEditor.java @@ -18,10 +18,8 @@ public class AccessibleImgBackgroundEditor extends UneditableAccessibleEditor { @Override protected void showEditorPane() { - if (choosePane == null) { - choosePane = new BackgroundButtonPane(); - choosePane.setPreferredSize(new Dimension(600, 400)); - } + choosePane = new BackgroundButtonPane(); + choosePane.setPreferredSize(new Dimension(600, 400)); BasicDialog dlg = choosePane.showWindow(SwingUtilities.getWindowAncestor(this)); dlg.addDialogActionListener(new DialogActionAdapter() {