Browse Source

Pull request #8861: REPORT-69846 夹在中间的单元格,与其他单元格框选配置边框时,单元格背景颜色会变化

Merge in DESIGN/design from ~HADES/design:feature/x to feature/x

* commit 'cd8ff843ec4d9f7f38f69bf968cfc45660fe74a6':
  REPORT-69846 夹在中间的单元格,与其他单元格框选配置边框时,单元格背景颜色会变化
feature/x
Hades 3 years ago
parent
commit
cb0914ab23
  1. 10
      designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java
  2. 5
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java

10
designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java

@ -34,6 +34,11 @@ public class BackgroundPane extends AbstractBasicStylePane {
//获取当前面板 //获取当前面板
protected BackgroundQuickPane currentPane = null; protected BackgroundQuickPane currentPane = null;
/**
* 记录上次选中的面板
*/
protected BackgroundQuickPane lastSelectedPane = null;
public BackgroundPane() { public BackgroundPane() {
this.initComponents(); this.initComponents();
@ -62,6 +67,9 @@ public class BackgroundPane extends AbstractBasicStylePane {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem()); cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem());
if (e.getStateChange() == ItemEvent.DESELECTED) {
lastSelectedPane = currentPane;
}
currentPane = paneList[typeComboBox.getSelectedIndex()]; currentPane = paneList[typeComboBox.getSelectedIndex()];
fireStateChanged(); fireStateChanged();
} }
@ -144,6 +152,8 @@ public class BackgroundPane extends AbstractBasicStylePane {
pane.populateBean(background); pane.populateBean(background);
typeComboBox.setSelectedIndex(i); typeComboBox.setSelectedIndex(i);
currentPane = paneList[i]; currentPane = paneList[i];
// 填充 初始化
lastSelectedPane = currentPane;
return; return;
} }
} }

5
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane;
import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.style.color.NewColorSelectBox;
import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
@ -246,7 +247,9 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
style = AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); style = AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE);
} }
if (backgroundPane.currentPane.isBackgroundChange()) { boolean isSetNullBackground = backgroundPane.currentPane instanceof NullBackgroundQuickPane
&& !(backgroundPane.lastSelectedPane instanceof NullBackgroundQuickPane);
if (backgroundPane.currentPane.isBackgroundChange() || isSetNullBackground) {
style = style.deriveBackground(backgroundPane.update()); style = style.deriveBackground(backgroundPane.update());
} }
if (BORDER_SET.contains(globalNameListener.getGlobalName())) { if (BORDER_SET.contains(globalNameListener.getGlobalName())) {

2
designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java

@ -35,7 +35,7 @@ public class NullBackgroundQuickPane extends BackgroundQuickPane {
@Override @Override
public boolean isBackgroundChange() { public boolean isBackgroundChange() {
return true; return false;
} }
/** /**

Loading…
Cancel
Save