From 79db43c1a6a662d5499b959c5920c6192a430f71 Mon Sep 17 00:00:00 2001 From: obo Date: Wed, 21 Aug 2024 15:24:57 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-119602=20fix:=E9=9F=A9=E8=AF=AD=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=BC=A0=E6=A0=87=E5=A4=B1=E7=84=A6=EF=BC=8C?= =?UTF-8?q?=E9=80=89=E4=B8=8D=E5=88=B0=E6=95=B0=E6=8D=AE=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/DesensitizationCellPane.java | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java index 818a26205d..c65a7eee73 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/DesensitizationCellPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model; -import com.fr.base.operator.org.OrganizationOperator; import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; @@ -10,27 +9,19 @@ import com.fr.design.data.datapane.preview.desensitization.view.rule.Desensitiza import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.event.UIObserverListener; -import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombocheckbox.UIComboCheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.layout.VerticalFlowLayout; -import com.fr.design.mainframe.JTemplate; -import com.fr.design.mainframe.JTemplateActionListener; import com.fr.report.cell.desensitization.CellDesensitizationBean; import com.fr.stable.StringUtils; import com.fr.third.org.apache.commons.collections4.map.HashedMap; -import com.fr.workspace.WorkContext; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.SwingUtilities; -import javax.swing.SwingWorker; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -43,7 +34,10 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; -import java.util.concurrent.ExecutionException; + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.row; /** * 单元格脱敏规则设置面板 @@ -78,12 +72,10 @@ public class DesensitizationCellPane extends BasicBeanPane { } private void initComponent() { - editPanel = new JPanel(); - editPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true)); + editPanel = new JPanel(new BorderLayout()); label = new UILabel(); label.setEnabled(false); - editPanel.add(label); ruleButton = new UIButton(APOSTROPHE); @@ -102,25 +94,25 @@ public class DesensitizationCellPane extends BasicBeanPane { emptyTextField.setEnabled(false); emptyTextField.setOpaque(false); - editPanel.add(initTableCellPanel()); + editPanel.add( + column( + row(cell(label)), + cell(initTableCellPanel()).weight(2) + ).weight(1).getComponent() + ); + } /** * 初始化单元格中的panel */ - private JPanel initTableCellPanel() { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - - double[] rowSize = new double[]{f, f}; - double[] columnSize = new double[]{p, f}; - - Component[][] components = new Component[][]{ - new Component[]{ruleButton, ruleTextField}, - new Component[]{emptyTextField, rolesComboBox} - }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 0); + private Component initTableCellPanel() { + + return column( + row(cell(ruleButton).weight(1), cell(ruleTextField).weight(4)), + row(cell(emptyTextField).weight(1), cell(rolesComboBox).weight(4)) + ).getComponent(); } private void addListener() {