From 583b8846935c690b3d2b745e8b071c9e2a024768 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 24 Oct 2024 11:11:29 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-138421=20fix:=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8=E5=A4=B4=E5=AF=BC=E8=87=B4=E4=B8=8A?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E8=A1=A8=E5=A4=B4=E9=85=8D=E7=BD=AE=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/sort/header/HeaderAreaPane.java | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java index cd9c616d26..9984c4c97e 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java +++ b/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.stable.ColumnRow; -import javax.swing.*; -import java.awt.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Iterator; @@ -34,6 +36,7 @@ public class HeaderAreaPane extends JPanel { SortColumnRowPane columnRowPane; UIComboBox uiComboBox; JPanel sortColumnRowPanel; + boolean showHeaderArea; HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) { this.headerAreaPaneWidth = headerAreaPaneWidth; @@ -57,12 +60,43 @@ public class HeaderAreaPane extends JPanel { } private void initChangeListener() { - uiComboBox.addItemListener(e -> { - sortColumnRowPanel.setVisible(uiComboBox.getSelectedIndex() == 1); + uiComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + boolean headerVisible = (uiComboBox.getSelectedIndex() == 1); + sortColumnRowPanel.setVisible(headerVisible); + // 仅在单元格状态改变时触发 + if (showHeaderArea != headerVisible) { + showHeaderArea = headerVisible; + triggerItemChanged(headerVisible); + } + } }); 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) { this.cellElement = cellElement; boolean enabled = true; @@ -75,9 +109,11 @@ public class HeaderAreaPane extends JPanel { private void populateColumnRowPane(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { cellSelectionManager.build(cellElement, columnRow); - if(showHeaderArea){ + if (showHeaderArea) { columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow); } + // 更新当前单元格是否已配置自定义排序表头排序 + this.showHeaderArea = showHeaderArea; columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); uiComboBox.setEnabled(enabled); From 6423b82643110254ad7f8a74a60aa6556329ff7d Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Thu, 24 Oct 2024 11:11:29 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-138421=20fix:=E8=BF=9E=E7=BB=AD?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=A1=A8=E5=A4=B4=E5=AF=BC=E8=87=B4=E4=B8=8A?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E8=A1=A8=E5=A4=B4=E9=85=8D=E7=BD=AE=E4=B8=A2?= =?UTF-8?q?=E5=A4=B1=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/sort/header/HeaderAreaPane.java | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java index cd9c616d26..ea6cbe2425 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java +++ b/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.stable.ColumnRow; -import javax.swing.*; -import java.awt.*; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import javax.swing.JPanel; +import java.awt.BorderLayout; import java.util.ArrayList; import java.util.Iterator; @@ -34,6 +36,7 @@ public class HeaderAreaPane extends JPanel { SortColumnRowPane columnRowPane; UIComboBox uiComboBox; JPanel sortColumnRowPanel; + boolean showHeaderArea; HeaderAreaPane(int headerAreaPaneWidth, int headerAreaPaneRightWidth) { this.headerAreaPaneWidth = headerAreaPaneWidth; @@ -57,12 +60,43 @@ public class HeaderAreaPane extends JPanel { } private void initChangeListener() { - uiComboBox.addItemListener(e -> { - sortColumnRowPanel.setVisible(uiComboBox.getSelectedIndex() == 1); + uiComboBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + boolean headerVisible = (uiComboBox.getSelectedIndex() == 1); + sortColumnRowPanel.setVisible(headerVisible); + // 仅在单元格状态改变时触发 + if (showHeaderArea != headerVisible) { + showHeaderArea = headerVisible; + triggerItemChanged(headerVisible); + } + } }); 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) { this.cellElement = cellElement; boolean enabled = true; @@ -75,9 +109,11 @@ public class HeaderAreaPane extends JPanel { private void populateColumnRowPane(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { cellSelectionManager.build(cellElement, columnRow); - if(showHeaderArea){ + if (showHeaderArea) { columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow); } + // 更新当前单元格是否已配置自定义表头排序 + this.showHeaderArea = showHeaderArea; columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); uiComboBox.setEnabled(enabled); From eb76f2348777bfbace045a9aef72f1b43c3cdadd Mon Sep 17 00:00:00 2001 From: lemon Date: Thu, 24 Oct 2024 14:43:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-138440=20=20fix:=20=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E5=A4=A7=E5=B0=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/nx/app/designer/menu/CalculateAttrPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java index cf720b37b0..280ec9d06b 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/CalculateAttrPane.java @@ -64,7 +64,7 @@ public class CalculateAttrPane extends BasicBeanPane { JPanel featureFlagPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); 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() { @Override public void actionPerformed(ActionEvent e) {