Browse Source

Merge pull request #1231 in BA/design from ~MOMEAK/design9.0:release/9.0 to release/9.0

* commit 'd343aa4517d50b200055471098704e79c7bb64b1':
  REPORT-4047 [9.0一轮回归]单个单元格设置边框后,再对包含此单元格的一片单元格设置背景,边框消失
master
superman 7 years ago
parent
commit
4c87938ad7
  1. 5
      designer_base/src/com/fr/design/gui/style/BackgroundPane.java
  2. 23
      designer_base/src/com/fr/design/gui/style/BorderPane.java
  3. 7
      designer_base/src/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java

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

23
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<String> borderSet = new HashSet<String>(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;
}

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

Loading…
Cancel
Save