From c515500b2da8603d04b31fb5358667ba49b8fe2d Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 20 Sep 2017 17:36:51 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4714=20=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E9=80=89=E6=8B=A9=E5=9B=BE=E7=89=87=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/style/BackgroundPane.java | 7 +++++++ .../backgroundpane/BackgroundQuickPane.java | 2 ++ .../backgroundpane/ColorBackgroundQuickPane.java | 5 +++++ .../GradientBackgroundQuickPane.java | 15 +++++++++++++++ .../backgroundpane/ImageBackgroundQuickPane.java | 6 ++++++ .../backgroundpane/NullBackgroundQuickPane.java | 5 +++++ .../PatternBackgroundQuickPane.java | 7 +++++++ .../TextureBackgroundQuickPane.java | 6 ++++++ 8 files changed, 53 insertions(+) diff --git a/designer_base/src/com/fr/design/gui/style/BackgroundPane.java b/designer_base/src/com/fr/design/gui/style/BackgroundPane.java index a1841a9544..6e7ffd28da 100644 --- a/designer_base/src/com/fr/design/gui/style/BackgroundPane.java +++ b/designer_base/src/com/fr/design/gui/style/BackgroundPane.java @@ -140,6 +140,7 @@ public class BackgroundPane extends AbstractBasicStylePane { * Populate background. */ public void populateBean(Background background) { + resetPaneList(); for (int i = 0; i < paneList.length; i++) { BackgroundQuickPane pane = paneList[i]; if (pane.accept(background)) { @@ -151,6 +152,12 @@ public class BackgroundPane extends AbstractBasicStylePane { } } + private void resetPaneList() { + for (BackgroundQuickPane pane : paneList) { + pane.reset(); + } + } + /** * Update background. */ diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/BackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/BackgroundQuickPane.java index 1b796c438b..850132d863 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/BackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/BackgroundQuickPane.java @@ -21,6 +21,8 @@ public abstract class BackgroundQuickPane extends BasicBeanPane impl @Override public abstract String title4PopupWindow(); + public abstract void reset(); + /** * 组件是否需要响应添加的观察者事件 * diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 7839d0cdb1..818ac8c3bb 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -76,4 +76,9 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { public String title4PopupWindow() { return Inter.getLocText("Color"); } + + @Override + public void reset() { + this.detailColorSelectPane.setColor(null); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java index 97ba9cbe7c..dc7fd94167 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/GradientBackgroundQuickPane.java @@ -119,4 +119,19 @@ public class GradientBackgroundQuickPane extends BackgroundQuickPane { return Inter.getLocText("Gradient-Color"); } + @Override + public void reset() { + this.gradientBar.getSelectColorPointBtnP1().setColorInner(Color.WHITE); + this.gradientBar.getSelectColorPointBtnP2().setColorInner(Color.BLACK); + directionPane.setSelectedItem(0); + int startValue = 4; + int endValue = this.gradientBarWidth; + gradientBar.setStartValue(startValue); + gradientBar.setEndValue(endValue); + if(this.gradientBar.getSelectColorPointBtnP1() != null && this.gradientBar.getSelectColorPointBtnP2() != null){ + this.gradientBar.getSelectColorPointBtnP1().setX(startValue); + this.gradientBar.getSelectColorPointBtnP2().setX(endValue); + } + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java index 4dafe476a4..22fa2c1e28 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/ImageBackgroundQuickPane.java @@ -179,4 +179,10 @@ public class ImageBackgroundQuickPane extends BackgroundQuickPane { public String title4PopupWindow() { return Inter.getLocText("FR-Background_Image"); } + + @Override + public void reset() { + imageLayoutPane.setSelectedIndex(0); + previewPane.setImage(null); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java index 60d39ed2d6..ff4b0b590f 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java @@ -51,4 +51,9 @@ public class NullBackgroundQuickPane extends BackgroundQuickPane { return Inter.getLocText("Background-Null"); } + @Override + public void reset() { + // do nothing + } + } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 86a96a2cbf..4b51108bde 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -215,4 +215,11 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { public String title4PopupWindow() { return Inter.getLocText("FR-Designer_Background-Pattern"); } + + @Override + public void reset() { + patternButtonArray[0].setSelected(true); + foregroundColorPane.setSelectObject(null); + backgroundColorPane.setSelectObject(null); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java b/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java index 33e09057b6..fc0ae8f8a2 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/TextureBackgroundQuickPane.java @@ -169,4 +169,10 @@ public class TextureBackgroundQuickPane extends BackgroundQuickPane { public String title4PopupWindow() { return Inter.getLocText("Background-Texture"); } + + @Override + public void reset() { + this.texturePaint = null; + textureButtonArray[0].setSelected(true); + } } \ No newline at end of file