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; } }); }