Browse Source

Merge remote-tracking branch 'origin/fbp/master' into fbp/master

fbp/master
Destiny.Lin 4 weeks ago
parent
commit
cd2a706471
  1. 46
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java
  2. 2
      designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java

46
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -13,8 +13,10 @@ import com.fr.report.core.sort.header.SortHeader;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import javax.swing.*; import java.awt.event.ItemEvent;
import java.awt.*; import java.awt.event.ItemListener;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
@ -34,6 +36,7 @@ public class HeaderAreaPane extends JPanel {
SortColumnRowPane columnRowPane; SortColumnRowPane columnRowPane;
UIComboBox uiComboBox; UIComboBox uiComboBox;
JPanel sortColumnRowPanel; JPanel sortColumnRowPanel;
boolean showHeaderArea;
HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) { HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) {
this.headerAreaPaneWidth = headerAreaPaneWidth; this.headerAreaPaneWidth = headerAreaPaneWidth;
@ -57,12 +60,43 @@ public class HeaderAreaPane extends JPanel {
} }
private void initChangeListener() { private void initChangeListener() {
uiComboBox.addItemListener(e -> { uiComboBox.addItemListener(new ItemListener() {
sortColumnRowPanel.setVisible(uiComboBox.getSelectedIndex() == 1); @Override
public void itemStateChanged(ItemEvent e) {
boolean headerVisible = (uiComboBox.getSelectedIndex() == 1);
sortColumnRowPanel.setVisible(headerVisible);
// 仅在单元格状态改变时触发
if (showHeaderArea != headerVisible) {
showHeaderArea = headerVisible;
triggerItemChanged(headerVisible);
}
}
}); });
uiComboBox.setSelectedIndex(0); uiComboBox.setSelectedIndex(0);
} }
private void triggerItemChanged(boolean isHeaderVisible) {
if (isHeaderVisible) {
handleCustomHeader();
} else {
handleNoHeader();
}
}
private void handleCustomHeader() {
ColumnRow columnRow = columnRowPane.updateBean();
if (cellSelectionManager.isNotSelectables(columnRow)) {
columnRowPane.setColumnRow(ColumnRow.ERROR);
} else {
cellSelectionManager.addNotSelectables(columnRow);
}
}
private void handleNoHeader() {
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
columnRowPane.cancelSelectState();
}
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, TemplateCellElement cellElement) { public void populateBean(ColumnRow columnRow, boolean showHeaderArea, TemplateCellElement cellElement) {
this.cellElement = cellElement; this.cellElement = cellElement;
boolean enabled = true; boolean enabled = true;
@ -75,9 +109,11 @@ public class HeaderAreaPane extends JPanel {
private void populateColumnRowPane(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { private void populateColumnRowPane(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
cellSelectionManager.build(cellElement, columnRow); cellSelectionManager.build(cellElement, columnRow);
if(showHeaderArea){ if (showHeaderArea) {
columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow); columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow);
} }
// 更新当前单元格是否已配置自定义表头排序
this.showHeaderArea = showHeaderArea;
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);
uiComboBox.setEnabled(enabled); uiComboBox.setEnabled(enabled);

2
designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java

@ -64,7 +64,7 @@ public class CalculateAttrPane extends BasicBeanPane<CalculatorAttrMark> {
JPanel featureFlagPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel featureFlagPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
ActionLabel featureLabel = new ActionLabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Experimental_Feature")); ActionLabel featureLabel = new ActionLabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Experimental_Feature"));
featureLabel.setFont(new Font(null, Font.PLAIN, 10)); FineUIStyle.setStyle(featureLabel, FineUIStyle.HYPER_LINK_LABEL);
featureLabel.addActionListener(new ActionListener() { featureLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

Loading…
Cancel
Save