From f5f57da3254b946f5aba28ffdcf6aeb4f6f4acfb Mon Sep 17 00:00:00 2001 From: momeak Date: Thu, 14 Sep 2017 11:04:37 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4047=20[9.0=E4=B8=80=E8=BD=AE=E5=9B=9E?= =?UTF-8?q?=E5=BD=92]=E5=8D=95=E4=B8=AA=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=BE=B9=E6=A1=86=E5=90=8E=EF=BC=8C=E5=86=8D?= =?UTF-8?q?=E5=AF=B9=E5=8C=85=E5=90=AB=E6=AD=A4=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E7=9A=84=E4=B8=80=E7=89=87=E5=8D=95=E5=85=83=E6=A0=BC=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E8=83=8C=E6=99=AF=EF=BC=8C=E8=BE=B9=E6=A1=86=E6=B6=88?= =?UTF-8?q?=E5=A4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/style/BackgroundPane.java | 5 ++++ .../com/fr/design/gui/style/BorderPane.java | 23 +++++++++++++++---- .../ColorBackgroundQuickPane.java | 7 ++++++ 3 files changed, 30 insertions(+), 5 deletions(-) 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 ced48d50d..a1841a954 100644 --- a/designer_base/src/com/fr/design/gui/style/BackgroundPane.java +++ b/designer_base/src/com/fr/design/gui/style/BackgroundPane.java @@ -33,6 +33,10 @@ public class BackgroundPane extends AbstractBasicStylePane { protected BackgroundQuickPane[] paneList; + //获取当前面板 + protected JPanel currentPane = null; + + public BackgroundPane() { this.initComponents(); } @@ -141,6 +145,7 @@ public class BackgroundPane extends AbstractBasicStylePane { if (pane.accept(background)) { pane.populateBean(background); typeComboBox.setSelectedIndex(i); + currentPane = paneList[i]; return; } } diff --git a/designer_base/src/com/fr/design/gui/style/BorderPane.java b/designer_base/src/com/fr/design/gui/style/BorderPane.java index 861df6aaa..d5a3bd914 100644 --- a/designer_base/src/com/fr/design/gui/style/BorderPane.java +++ b/designer_base/src/com/fr/design/gui/style/BorderPane.java @@ -16,6 +16,7 @@ import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -202,12 +203,24 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse CellBorderStyle cellBorderStyle = this.update(); HashSet borderSet = new HashSet(Arrays.asList(BORDERARRAY)); - if (borderSet.contains(globalNameListener.getGlobalName())) { - style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), - cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); - } else { - style = style.deriveBackground(backgroundPane.update()); + if (backgroundPane.currentPane != backgroundPane.paneList[1]){ + if (borderSet.contains(globalNameListener.getGlobalName())) { + style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), + cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); + style = style.deriveBackground(backgroundPane.update()); + } else { + style = style.deriveBackground(backgroundPane.update()); + } + }else { + if (borderSet.contains(globalNameListener.getGlobalName()) && !((ColorBackgroundQuickPane) backgroundPane.currentPane).isBackGroundColor()){ + style = style.deriveBorder(cellBorderStyle.getTopStyle(), cellBorderStyle.getTopColor(), cellBorderStyle.getBottomStyle(), cellBorderStyle.getBottomColor(), + cellBorderStyle.getLeftStyle(), cellBorderStyle.getLeftColor(), cellBorderStyle.getRightStyle(), cellBorderStyle.getRightColor()); + style = style.deriveBackground(backgroundPane.update()); + } else { + style = style.deriveBackground(backgroundPane.update()); + } } + return style; } 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 f08b0a89b..7839d0cdb 100644 --- a/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -18,6 +18,7 @@ import java.awt.*; public class ColorBackgroundQuickPane extends BackgroundQuickPane { private NewColorSelectPane detailColorSelectPane; + private boolean isBackGroundColor; public ColorBackgroundQuickPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -28,6 +29,7 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { public void populateBean(Background background) { ColorBackground colorBackgroud = (ColorBackground) background; + isBackGroundColor = false; this.detailColorSelectPane.setColor(colorBackgroud.getColor()); } @@ -36,6 +38,10 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { return ColorBackground.getInstance(this.detailColorSelectPane.getNotNoneColor()); } + public boolean isBackGroundColor(){ + return isBackGroundColor; + } + /** * 给组件登记一个观察者监听事件 * @@ -45,6 +51,7 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { detailColorSelectPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { listener.doChange(); + isBackGroundColor = true; } }); }