diff --git a/build.gradle b/build.gradle index 5e9743fd1f..d2d0d1506a 100644 --- a/build.gradle +++ b/build.gradle @@ -110,6 +110,7 @@ allprojects { implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion implementation 'com.fr.datasource:fine-datasource-web:' + fdlVersion implementation 'com.fr.decision:decision-i18n:' + frVersion + implementation 'com.fr.decision:decision-report:' + frVersion implementation 'com.fr.report:engine-report:' + frDevVersion implementation 'com.fr.report:engine-x:' + frDevVersion implementation 'com.fr.report:engine-chart:' + frDevVersion diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java index b410afc207..90bec71856 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineComboBoxUI.java @@ -88,7 +88,7 @@ public class FineComboBoxUI extends FlatComboBoxUI { // 限制最大宽度,如超出则高度预留展示横向滚动条所需宽度 int comboWidth = comboBox.getWidth(); if (fitRectangle.width > comboWidth) { - return new Rectangle(px, py, comboWidth, fitRectangle.height + FlatUIUtils.getUIInt("ScrollBar.width", 10)); + return new Rectangle(px, py, comboWidth, fitRectangle.height + FineUIUtils.getAndScaleInt("ScrollBar.width", 10)); } return fitRectangle; } diff --git a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java index 89a5e738ab..da6a4c9c5e 100644 --- a/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java +++ b/designer-base/src/main/java/com/fine/theme/light/ui/FineTableHeaderUI.java @@ -84,6 +84,16 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { setHorizontalAlignment(SwingConstants.LEFT); } + /** + * 是否选中修改背景 + * @param isSelected 被选中 + * @param columnClass 列类型 + * @return 是否修改 + */ + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected && columnClass != Boolean.class; + } + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Class columnClass = table.getColumnClass(0); @@ -95,7 +105,7 @@ public class FineTableHeaderUI extends FlatTableHeaderUI { border = BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")), UIManager.getBorder("Table.cellNoFocusBorder")); } - if (isSelected && columnClass != Boolean.class) { + if (checkSelected(isSelected, columnClass)) { selectionBackground = UIManager.getColor( "Table.selectionBackground"); } else { selectionBackground = UIManager.getColor("Table.background"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java index 1d31b1a5ab..12b173779e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SshPane.java @@ -1,6 +1,5 @@ package com.fr.design.data.datapane.connect; -import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIUtils; import com.fr.data.impl.JDBCDatabaseConnection; @@ -14,7 +13,7 @@ import com.fr.data.security.ssl.SslUtils; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; import com.fr.design.editor.editor.NotNegativeIntegerEditor; -import com.fr.design.gui.core.ReactiveCardPane; +import com.fr.design.gui.core.SimpleCardPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -28,6 +27,7 @@ import com.fr.file.filter.ChooseFileFilter; import com.fr.stable.StringUtils; import com.fr.third.guava.collect.HashBiMap; +import javax.swing.JPanel; import javax.swing.JPasswordField; import java.awt.BorderLayout; import java.awt.event.KeyAdapter; @@ -35,9 +35,10 @@ import java.awt.event.KeyEvent; import java.util.regex.Matcher; import java.util.regex.Pattern; -import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.flex; 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.flex; +import static com.fine.swing.ui.layout.Layouts.row; import static com.fr.design.i18n.Toolkit.i18nText; /** @@ -62,12 +63,10 @@ public class SshPane extends BasicPane { private final JPasswordField password = new UIPasswordFieldWithFixedLength(20); private final JPasswordField secret = new UIPasswordFieldWithFixedLength(20); private final KeyFileUITextField keyPath = new KeyFileUITextField(18); - private ReactiveCardPane coreCardPane; - private ReactiveCardPane verifyCardPane; + private JPanel sshSettingPane; + private SimpleCardPane verifyCardPane; private final UIButton fileChooserButton = new UIButton(); - private static final String USE_SSH = "useSSH"; - private static final String NOT_USE_SSH = "notUseSSH"; private static final String USE_PASSWORD = "usePassword"; private static final String USE_KEY = "useKey"; @@ -82,13 +81,14 @@ public class SshPane extends BasicPane { type.setSelectedItem(Toolkit.i18nText("Fine-Design_Basic_Ssh_Private_Key")); initVerifyCardPane(); - initCoreCardPane(); + initSshSettingPane(); initListeners(); - this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, + this.add(column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssh_Settings"))).with(FineUIUtils::wrapBoldLabelWithUnderline), - cell(coreCardPane) + row(cell(usingSsh)), + cell(sshSettingPane) ).getComponent()); } @@ -112,10 +112,8 @@ public class SshPane extends BasicPane { }); } - private void initCoreCardPane() { - coreCardPane = ReactiveCardPane.create() - .addSupplier(NOT_USE_SSH, () -> cell(usingSsh).getComponent()) - .addSupplier(USE_SSH, () -> Layouts.column(LayoutConstants.VERTICAL_GAP, + private void initSshSettingPane() { + sshSettingPane = column(LayoutConstants.VERTICAL_GAP, row(cell(usingSsh)), row( cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Host"))).weight(1), @@ -138,47 +136,46 @@ public class SshPane extends BasicPane { flex(6) ), cell(verifyCardPane) - ).getComponent()); - coreCardPane.select(USE_SSH).populate(); + ).getComponent(); } private void initVerifyCardPane() { - verifyCardPane = ReactiveCardPane.create() - .addSupplier(USE_PASSWORD, () -> Layouts.row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password"))).weight(1), - cell(password).weight(5), + verifyCardPane = new SimpleCardPane(); + verifyCardPane.add(USE_PASSWORD, row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Password"))).weight(1), + cell(password).weight(5), + flex(6) + ).getComponent()); + verifyCardPane.add(USE_KEY, column(LayoutConstants.VERTICAL_GAP, + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssh_Private_Key"))).weight(1), + cell(keyPath).weight(4.5), + flex(0.1), + cell(fileChooserButton).weight(0.4), flex(6) - ).getComponent()) - .addSupplier(USE_KEY, () -> Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssh_Private_Key"))).weight(1), - cell(keyPath).weight(4.5), - flex(0.1), - cell(fileChooserButton).weight(0.4), - flex(6) - ), - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssh_Secret"))).weight(1), - cell(secret).weight(5), - flex(6) - ) - ).getComponent()); + ), + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssh_Secret"))).weight(1), + cell(secret).weight(5), + flex(6) + ) + ).getComponent()); - verifyCardPane.select(USE_KEY).populate(); + verifyCardPane.show(USE_KEY); } private void changePane() { - coreCardPane.select(usingSsh.isSelected() ? USE_SSH: NOT_USE_SSH).populate(); + sshSettingPane.setVisible(usingSsh.isSelected()); } private void changePaneForType() { switch (typeMap.get(type.getSelectedItem())) { case NORMAL: - verifyCardPane.select(USE_PASSWORD).populate(); + verifyCardPane.show(USE_PASSWORD); break; case KEY: - verifyCardPane.select(USE_KEY).populate(); + verifyCardPane.show(USE_KEY); break; default: throw new SshException("un support ssh type"); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java index 62e6666acd..8fc59ba7a0 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/SslPane.java @@ -1,18 +1,15 @@ package com.fr.design.data.datapane.connect; -import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIUtils; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.security.ssl.Ssl; import com.fr.data.security.ssl.SslException; import com.fr.data.security.ssl.SslType; -import com.fr.data.security.ssl.SslUtils; import com.fr.data.security.ssl.impl.NormalSsl; import com.fr.design.constants.LayoutConstants; import com.fr.design.data.datapane.connect.SshPane.KeyFileUITextField; import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.core.ReactiveCardPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; @@ -23,14 +20,16 @@ import com.fr.file.FILEChooserPane; import com.fr.file.filter.ChooseFileFilter; import com.fr.stable.StringUtils; +import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.flex; 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.flex; +import static com.fine.swing.ui.layout.Layouts.row; import static com.fr.design.i18n.Toolkit.i18nText; /** @@ -47,45 +46,44 @@ public class SslPane extends BasicPane { private final KeyFileUITextField keyPathClientKey = new KeyFileUITextField(18); private final UIButton fileChooserButtonClientKey = new UIButton(); private final UICheckBox verifyCa = new UICheckBox(i18nText("Fine-Design_Basic_Ssl_Verify_Ca")); - private final ReactiveCardPane cardPane; + private final JPanel sslSettingPane; public SslPane() { initDotButtons(); this.setLayout(new BorderLayout()); usingSsl.setSelected(true); - cardPane = ReactiveCardPane.create() - .addSupplier("notUseSSL", () -> cell(usingSsl).getComponent()) - .addSupplier("useSSL", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, - cell(usingSsl), - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Ca"), SwingConstants.LEFT)).weight(1), - cell(keyPathCa).weight(1.3), - flex(0.05), - cell(fileChooserButtonCa).weight(0.15), - flex(2) - ), - cell(verifyCa), - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Key"), SwingConstants.LEFT)).weight(1), - cell(keyPathClientKey).weight(1.3), - flex(0.05), - cell(fileChooserButtonClientKey).weight(0.15), - flex(2) - ), - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Cert"), SwingConstants.LEFT)).weight(1), - cell(keyPathClientCert).weight(1.3), - flex(0.05), - cell(fileChooserButtonClientCert).weight(0.15), - flex(2) - ) - ).getComponent() - ); - cardPane.select("useSSL").populate(); - this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, + sslSettingPane = column(10, + cell(usingSsl), + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Ca"), SwingConstants.LEFT)).weight(1), + cell(keyPathCa).weight(1.3), + flex(0.05), + cell(fileChooserButtonCa).weight(0.15), + flex(2) + ), + cell(verifyCa), + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Key"), SwingConstants.LEFT)).weight(1), + cell(keyPathClientKey).weight(1.3), + flex(0.05), + cell(fileChooserButtonClientKey).weight(0.15), + flex(2) + ), + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Client_Cert"), SwingConstants.LEFT)).weight(1), + cell(keyPathClientCert).weight(1.3), + flex(0.05), + cell(fileChooserButtonClientCert).weight(0.15), + flex(2) + ) + ).getComponent(); + + this.add(column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Ssl_Settings"))).with(FineUIUtils::wrapBoldLabelWithUnderline), - cell(cardPane) + cell(usingSsl), + cell(sslSettingPane) ).getComponent()); + usingSsl.addActionListener(e -> changePane()); } @@ -99,7 +97,7 @@ public class SslPane extends BasicPane { } private void changePane() { - cardPane.select(usingSsl.isSelected() ? "useSSL" : "notUseSSL").populate(); + sslSettingPane.setVisible(usingSsl.isSelected()); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java index 6884df268d..5efe1c8908 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/TableDataBeanHelper.java @@ -156,7 +156,12 @@ public class TableDataBeanHelper { if (dataSet.getDatabase() instanceof NameDatabaseConnection) { bean.setDatabase(((NameDatabaseConnection) dataSet.getDatabase()).getName()); } - bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery())); + if (dataSet.getQuery() != null) { + bean.setQuery(DataEncryptionHelper.encrypt(dataSet.getQuery())); + } + if (dataSet.getPageQuerySql() != null) { + bean.setPageQuery(DataEncryptionHelper.encrypt(dataSet.getPageQuerySql())); + } List parameterBeans = new ArrayList<>(); ParameterProvider[] parameters = dataSet.getParameters(Calculator.createCalculator()); for (ParameterProvider parameter : parameters) { @@ -186,7 +191,12 @@ public class TableDataBeanHelper { private static TableData deserialize4SQL(Map connectionMap, DBTableData oldDataSet, JSONObject object) { DBTableData tableData = new DBTableData(); SQLDataSetBean bean = object.mapTo(SQLDataSetBean.class); - tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery())); + if (bean.getQuery() != null) { + tableData.setQuery(DataEncryptionHelper.decrypt(bean.getQuery())); + } + if (bean.getPageQuery() != null) { + tableData.setPageQuerySql(DataEncryptionHelper.decrypt(bean.getPageQuery())); + } Connection connection = connectionMap.get(bean.getDatabase()); if (connection != null) { tableData.setDatabase(new NameDatabaseConnection(bean.getDatabase())); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java index 870dc7ff5b..622693263b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTablePane.java @@ -12,8 +12,11 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.log.FineLoggerFactory; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.SwingWorker; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -89,7 +92,8 @@ public class TableDataDesensitizationTablePane extends JPanel { // 获取当前所有用户组 roleMap.putAll(RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization()); // 获取当前最新的所有规则 - latestRules.putAll(DesensitizationRuleManager.getInstance().getAllRules()); + latestRules.put(DesensitizationRuleSource.SERVER, RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap().get(DesensitizationRuleSource.SERVER)); + latestRules.put(DesensitizationRuleSource.CUSTOM, DesensitizationRuleManager.getInstance().getRulesBySource(DesensitizationRuleSource.CUSTOM)); return null; } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java index c0849032d3..c188b363eb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/sqlpane/SQLEditPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.sqlpane; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; import com.fr.design.actions.UpdateAction; @@ -10,7 +11,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import javax.swing.Icon; import javax.swing.JPopupMenu; import javax.swing.text.BadLocationException; import javax.swing.text.Document; @@ -57,8 +57,7 @@ public class SQLEditPane extends RSyntaxTextArea { if (requestDroptarget) { new SQLPaneDropTarget(this); } - setBorder(null); - + setBorder(new ScaledEmptyBorder(2, 2, 2, 2)); } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java index 6146e30d3a..09d7882438 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/MultiResultTableDataWrapper.java @@ -4,18 +4,18 @@ import com.fr.base.TableData; import com.fr.data.MultiResultTableData; import com.fr.data.impl.NameDataModel; import com.fr.data.impl.storeproc.StoreProcedure; -import com.fr.data.operator.DataOperator; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.datapane.preview.ConnectionInfoBeanHelper; import com.fr.design.data.datapane.preview.PreviewTablePane; +import com.fr.design.dialog.CollapsibleDetailDialog; import com.fr.design.dialog.FineJOptionPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; -import com.fr.workspace.server.entity.connection.ConnectionBean; import com.fr.workspace.server.repository.connection.ConnectionRepository; import javax.swing.Icon; @@ -230,7 +230,12 @@ public final class MultiResultTableDataWrapper implements TableDataWrapper { loadingBar.close(); if (!(e instanceof CancellationException)) { FineLoggerFactory.getLogger().error(e.getMessage(), e); - FineJOptionPane.showMessageDialog(parent, e.getMessage()); + if (tableData instanceof StoreProcedure) { + CollapsibleDetailDialog dialog = new CollapsibleDetailDialog(DesignerContext.getDesignerFrame(), new UILabel(Toolkit.i18nText("Fine-Design_Stored_Procedure_Query_Failed")), e.getMessage()); + dialog.setVisible(true); + } else { + FineJOptionPane.showMessageDialog(parent, e.getMessage()); + } } } } diff --git a/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java b/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java new file mode 100644 index 0000000000..cc73abc36d --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java @@ -0,0 +1,145 @@ +package com.fr.design.dialog; + +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIStyle; +import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.constants.LayoutConstants; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import javax.swing.JPanel; +import javax.swing.JDialog; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + + +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.fix; + +/** + * 折叠弹窗 + * + * @author Richard + * @since 11.0 + * Created on 2024/10/22 + */ +public class CollapsibleDetailDialog extends JDialog implements ActionListener { + + public JPanel upInTopPanel; + private JPanel downInTopPanel; + private JPanel topPanel; + public JPanel hiddenPanel; + private JPanel bottomPanel; + private UILabel directUILabel; + private UILabel detailLabel; + // 内容标题 + private final UILabel messageLabel; + // 详情 + private final String detailText; + private final Dimension collapseDimension = FineUIScale.createScaleDimension(450, 185); + private final Dimension unfoldDimension = FineUIScale.createScaleDimension(450, 280); + + public CollapsibleDetailDialog(Frame parent, UILabel label, String detailText) { + super(parent, true); + this.detailText = detailText; + this.messageLabel = label; + initComponent(); + } + + private void initComponent() { + initTopPanel(); + initHiddenPanel(); + initBottomPanel(); + addListeners(); + this.setResizable(false); + this.add(topPanel, BorderLayout.NORTH); + this.add(hiddenPanel, BorderLayout.CENTER); + this.add(bottomPanel, BorderLayout.SOUTH); + this.setSize(this.collapseDimension); + GUICoreUtils.centerWindow(this); + this.setAlwaysOnTop(true); + } + + private void initTopPanel() { + initUpInTopPanel(); + // 查看详情按钮 + directUILabel = new UILabel(); + directUILabel.setIcon(new LazyIcon("plus")); + detailLabel = new UILabel(); + detailLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine_Designer_Look_Detail")); + downInTopPanel = row(fix(30), row(cell(directUILabel), cell(detailLabel), flex())).getComponent(); + topPanel = column(cell(upInTopPanel), cell(downInTopPanel)).getComponent(); + } + + private void initUpInTopPanel() { + upInTopPanel = row(LayoutConstants.HORIZONTAL_GAP, + column(cell(new UILabel(new LazyIcon("error", 20))), flex()), + column(cell(messageLabel))).getComponent(); + upInTopPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + } + + private void initHiddenPanel() { + hiddenPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + JScrollPane scrollPane = new JScrollPane(); + JTextArea textArea = new JTextArea(detailText); + scrollPane.setViewportView(textArea); + scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); + scrollPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); + scrollPane.getViewport().setOpaque(false); + textArea.setOpaque(false); + textArea.setEditable(false); + hiddenPanel = row(fix(30), cell(scrollPane).weight(1)).getComponent(); + hiddenPanel.setVisible(false); + hiddenPanel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); + } + + private void initBottomPanel() { + //底部的按钮面板 + UIButton okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); + FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY); + okButton.addActionListener(this); + bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); + bottomPanel.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); + bottomPanel.add(okButton, BorderLayout.EAST); + } + + private void addListeners() { + downInTopPanel.addMouseListener(new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + toggleHiddenPanel(); + } + }); + } + + private void toggleHiddenPanel() { + if (hiddenPanel.isVisible()) { + hiddenPanel.setVisible(false); + setSize(collapseDimension); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); + directUILabel.setIcon(new LazyIcon("plus")); + } else { + setSize(unfoldDimension); + hiddenPanel.setVisible(true); + detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); + directUILabel.setIcon(new LazyIcon("minus")); + } + } + + @Override + public void actionPerformed(ActionEvent e) { + this.dispose(); + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java index 67b7ffeda8..c736c2e81f 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java +++ b/designer-base/src/main/java/com/fr/design/dialog/UIDetailErrorLinkDialog.java @@ -76,6 +76,7 @@ public class UIDetailErrorLinkDialog extends UIDialog { // 顶部 图标和提示 UILabel errorIcon = new UILabel(new LazyIcon("error", 20)); UILabel errorInfo= new UILabel(builder.reason); + errorInfo.setToolTipText(builder.reason); FineUIStyle.setStyle(errorInfo, FineUIStyle.LABEL_TIP_WINDOW_TITLE); // 中部 详细内容 diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index af825fb4a6..aaf95bd765 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java @@ -315,7 +315,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { // text initFormulaTextArea(); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); - formulaTextArea.setBorder(null); + formulaTextArea.setBorder(new ScaledEmptyBorder(2, 2, 2, 2)); formulaTextAreaScrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); // buttonPane diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java index 4e19650e73..898f9bb68f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java @@ -35,8 +35,8 @@ public class ColumnRowVerticalPane extends ColumnRowPane { initRowSpinner(); pane.add(column(10, - row(cell(rowLabel).weight(0.15), cell(rowSpinner).weight(0.85)), - row(cell(colLabel).weight(0.15), cell(columnSpinner).weight(0.85)) + row(cell(colLabel).weight(0.15), cell(columnSpinner).weight(0.85)), + row(cell(rowLabel).weight(0.15), cell(rowSpinner).weight(0.85)) ).getComponent()); this.addDocumentListener(d); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index b957a1370d..15f0af15b3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -212,10 +212,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S } /** - * 刷新 NameableCreator - * - * @param creators 生成器 - */ + * 刷新 NameableCreator + * + * @param creators 生成器 + */ public void refreshNameableCreator(NameableCreator[] creators) { this.creators = creators; shorts = this.createShortcuts(); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 814e52848b..7d1519f2ce 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -243,8 +243,8 @@ public abstract class UIControlPane extends JControlPane { } /** - * 是否需要隐藏popupEditDialog - */ + * 是否需要隐藏popupEditDialog + */ protected boolean needToHidePopupEditDialog() { // 检查是否有子弹窗,如果有,则不隐藏 for (Window window : popupEditDialog.getOwnedWindows()) { diff --git a/designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java b/designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java index 8e2897c2b1..a0d53ae12c 100644 --- a/designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/core/ReactiveCardPane.java @@ -9,11 +9,13 @@ import java.util.function.Supplier; /** * 简单的响应式面板容器,提供切换布局的功能 + *

懒加载无法兼容事件初始化,如需实现类似功能可考虑 {@link SimpleCardPane} * * @author Levy.Xie * @since 11.0 * Created on 2023/12/25 */ +@Deprecated public class ReactiveCardPane extends JPanel { String selectKey; diff --git a/designer-base/src/main/java/com/fr/design/gui/core/SimpleCardPane.java b/designer-base/src/main/java/com/fr/design/gui/core/SimpleCardPane.java new file mode 100644 index 0000000000..269b2234e7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/core/SimpleCardPane.java @@ -0,0 +1,44 @@ +package com.fr.design.gui.core; + +import javax.swing.JPanel; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; + +/** + * 自适应尺寸大小变更的Card面板 + * + * @author Levy.Xie + * @since 11.0 + * Created on 2024/10/22 + */ +public class SimpleCardPane extends JPanel { + + private final CardLayout cardLayout; + + public SimpleCardPane() { + cardLayout = new CardLayout(); + setLayout(cardLayout); + } + + /** + * 显示卡片 + * @param key 卡片名 + */ + public void show(String key) { + setVisible(true); + cardLayout.show(this, key); + } + + @Override + public Dimension getPreferredSize() { + for (Component comp : getComponents()) { + if (comp.isVisible()) { + return comp.getPreferredSize(); + } + } + setVisible(false); + return new Dimension(0, 0); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java index e378100567..6159e01c6d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/RegPane.java @@ -2,20 +2,34 @@ package com.fr.design.gui.frpane; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.core.ReactiveCardPane; +import com.fr.design.gui.core.SimpleCardPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.form.ui.reg.*; +import com.fr.form.ui.reg.CustomReg; +import com.fr.form.ui.reg.IDCardReg; +import com.fr.form.ui.reg.LengthReg; +import com.fr.form.ui.reg.MailReg; +import com.fr.form.ui.reg.MobileReg; +import com.fr.form.ui.reg.NoneReg; +import com.fr.form.ui.reg.PhoneReg; +import com.fr.form.ui.reg.PostCardReg; +import com.fr.form.ui.reg.RegExp; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.DefaultComboBoxModel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.ListCellRenderer; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; import java.awt.event.ItemEvent; import java.util.EventListener; import java.util.EventObject; @@ -86,10 +100,10 @@ public class RegPane extends BasicPane { regPhonePane = new RegPhonePane(); customRegRexPane = new CustomRegRexPane(); - final ReactiveCardPane cardPane = ReactiveCardPane.create() - .addSupplier("Length", () -> regLengthPane) - .addSupplier("Phone", () -> regPhonePane) - .addSupplier("Custom", () -> customRegRexPane); + final SimpleCardPane cardPane = new SimpleCardPane(); + cardPane.add(regLengthPane, "Length"); + cardPane.add(regPhonePane, "Phone"); + cardPane.add(customRegRexPane, "Custom"); cardPane.setVisible(false); corePane.add(comboPane); @@ -97,19 +111,19 @@ public class RegPane extends BasicPane { initComboListener(cardPane); } - private void initComboListener(ReactiveCardPane cardPane) { + private void initComboListener(SimpleCardPane cardPane) { regComboBox.addActionListener(e -> { RegExp regExp = (RegExp)regComboBox.getSelectedItem(); if(regExp instanceof PhoneReg) { Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem(); String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString(); firePhoneRegAction(regString); - cardPane.select("Phone").populate(); + cardPane.show("Phone"); } else { if (regExp instanceof LengthReg){ - cardPane.select("Length").populate(); + cardPane.show("Length"); } else if (regExp instanceof CustomReg){ - cardPane.select("Custom").populate(); + cardPane.show("Custom"); } else { cardPane.setVisible(false); } diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java index 18ac4eaeeb..2e52922777 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIModeControlContainer.java @@ -44,6 +44,7 @@ public class UIModeControlContainer extends JLayeredPane { private static final int NUM5 = 5; private JComponent upPane; private JComponent downPane; + private JComponent sheetNameTabPane; private JPanel horizontToolPane; private CoverPane coverPane; @@ -115,6 +116,10 @@ public class UIModeControlContainer extends JLayeredPane { this.downPane = downPane; } + public void setSheetNameTabPane(JComponent sheetNameTabPane) { + this.sheetNameTabPane = sheetNameTabPane; + } + protected void onResize(int distance) { } @@ -215,7 +220,8 @@ public class UIModeControlContainer extends JLayeredPane { } if (DesignerMode.isAuthorityEditing() && isSheeetCovered) { - sheetInvisibleCoverPane.setBounds(0, toolPaneY + toolPaneHeight + UIConstants.SIZE, getWidth(), getHeight() - toolPaneY - toolPaneHeight - sheetCorverGap); + sheetInvisibleCoverPane.setBounds(0, toolPaneY + toolPaneHeight + UIConstants.SIZE, + getWidth(), downPane.getHeight() - sheetNameTabPane.getHeight()); UIModeControlContainer.this.add(sheetInvisibleCoverPane); UIModeControlContainer.this.setLayer(sheetInvisibleCoverPane, 2); sheetInvisibleCoverPane.setVisible(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java index 4ba5c9aa5b..175d642b0d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/AlignmentPane.java @@ -4,7 +4,7 @@ package com.fr.design.gui.style; * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. */ -import com.fine.swing.ui.layout.Layouts; +import com.fine.swing.ui.layout.Row; import com.fine.theme.icon.LazyIcon; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; @@ -15,7 +15,6 @@ import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.fun.IndentationUnitProcessor; -import com.fr.design.gui.core.ReactiveCardPane; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; @@ -25,7 +24,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.event.EventDispatcher; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; import com.fr.plugin.ExtraClassManager; import com.fr.plugin.context.PluginContext; import com.fr.plugin.manage.PluginFilter; @@ -46,9 +44,10 @@ import java.util.ArrayList; import java.util.Arrays; import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.fix; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; /** * Pane to edit cell alignment. @@ -61,7 +60,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private static final String[] LAYOUT = {Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Default"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Titled"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Extend"), Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Layout_Image_Adjust")}; - private ReactiveCardPane rotationBarPane; + private JPanel rotationBarPane; private UIComboBox textComboBox; private UIComboBox textRotationComboBox; @@ -91,7 +90,6 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO imageLayoutComboBox = new UIComboBox(LAYOUT); initTextRotationComboBox(); - // todo: 换新图标及反白问题 Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()}, {new LazyIcon("h_center"), new LazyIcon("h_center").white()}, {new LazyIcon("h_right"), new LazyIcon("h_right").white()}, @@ -177,7 +175,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO private JPanel createPane() { JPanel basicPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), 290, 24, basicPane()); JPanel seniorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Basic_Advanced"), 290, 24, seniorPane()); - return Layouts.column( + return column( cell(basicPane), fix(1).with(it -> it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")))), cell(seniorPane) @@ -189,7 +187,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO UILabel verticalLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Style_Alignment_Pane_Vertical") + " ", SwingConstants.LEFT); UIComponentUtils.setLineWrap(horizontalLabel); UIComponentUtils.setLineWrap(verticalLabel); - return Layouts.column(LayoutConstants.VERTICAL_GAP, + return column(LayoutConstants.VERTICAL_GAP, row( cell(horizontalLabel).weight(1.2), cell(hAlignmentPane).weight(3)), @@ -201,7 +199,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO } private JPanel seniorPane() { - return Layouts.column(LayoutConstants.VERTICAL_GAP, + return column(LayoutConstants.VERTICAL_GAP, cell(seniorUpPane()), cell(seniorMiddlePane()), cell(seniorDownPane()) @@ -210,7 +208,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO } private JPanel seniorUpPane() { - return Layouts.column(LayoutConstants.VERTICAL_GAP, + return column(LayoutConstants.VERTICAL_GAP, row( cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"), SwingConstants.LEFT)) .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Image_Layout"))).weight(1.2), @@ -224,28 +222,19 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO } private JPanel seniorMiddlePane() { - rotationBarPane = ReactiveCardPane.create() - .addSupplier("hide", () -> Layouts.row( + Row rotationRow = row(flex(1.2),cell(rotationPane).weight(3)).getComponent(); + + rotationBarPane = column(10, + row( cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), cell(textRotationComboBox).weight(3) - ).getComponent()) - .addSupplier("show", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"), SwingConstants.LEFT)) - .with(it -> it.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_StyleAlignment_Text_Rotation"))).weight(1.2), - cell(textRotationComboBox).weight(3) - ), - row( - flex(1.2), - cell(rotationPane).weight(3) - ) - ).getComponent()); - rotationBarPane.select("show").populate(); + ), + cell(rotationRow) + ).getComponent(); textRotationComboBox.addItemListener(e -> { - String key = (textRotationComboBox.getSelectedIndex() == 0) ? "show" : "hide"; - rotationBarPane.select(key).populate(); + rotationRow.setVisible(textRotationComboBox.getSelectedIndex() == 0); }); return rotationBarPane; } @@ -257,7 +246,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO partSpacingLabel.setToolTipText(partSpacingLabel.getText()); UILabel spacingLabel = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Style_Line_Spacing")), SwingConstants.LEFT); spacingLabel.setToolTipText(spacingLabel.getText()); - return Layouts.column( + return column( row( cell(indentationLabel).weight(1.2), cell(leftIndentSpinner).weight(1.4), diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java index 7978159c1c..293d2893e6 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java @@ -45,7 +45,7 @@ public class MobilePopupRegularPane extends BasicPane { spinnerGroupPane = this.createSpinnerPane(); this.add(column(LayoutConstants.VERTICAL_GAP, cell(this.createRadioButtonGroupPane()), - row(flex(1), cell(spinnerGroupPane).weight(3)) + row(flex(1.5), cell(spinnerGroupPane).weight(3)) ).getComponent()); } @@ -62,7 +62,7 @@ public class MobilePopupRegularPane extends BasicPane { radioButtons.add(autoRadio); radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent()); - return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent(); + return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(radiosPane).weight(3)).getComponent(); } private ActionListener radioActionListener = new ActionListener() { diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java index 701594bf12..3cd58ca51d 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java @@ -83,9 +83,9 @@ public class StyleSettingPane extends BasicBeanPane { UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border")); borderPane.add(column(LayoutConstants.VERTICAL_GAP, - row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderType).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderColor).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderRadiusSpinner).weight(2), flex(3)) + row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderType).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderColor).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderRadiusSpinner).weight(2), flex(2.5)) ).getComponent()); return borderPane; } @@ -102,8 +102,8 @@ public class StyleSettingPane extends BasicBeanPane { JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background")); bgPane.add(column(LayoutConstants.VERTICAL_GAP, - row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(bgColor).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(transparencyPane).weight(3), flex(2)) + row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(bgColor).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(transparencyPane).weight(3), flex(1.5)) ).getComponent()); return bgPane; } @@ -117,9 +117,9 @@ public class StyleSettingPane extends BasicBeanPane { sizePane.add(column(LayoutConstants.VERTICAL_GAP, row( column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1), - cell(mobileRegularPane).weight(4), flex(2) + cell(mobileRegularPane).weight(4.5), flex(1.5) ), - row(flex(1), cell(padRegularPane).weight(4), flex(2)) + row(flex(1), cell(padRegularPane).weight(4.5), flex(1.5)) ).getComponent()); return sizePane; } diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 401065a010..34d20e161d 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,6 +1,7 @@ package com.fr.design.javascript; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.DesignerEnvManager; @@ -187,6 +188,7 @@ public class JSContentPane extends BasicPane { JPanel jsParaPane = new JPanel(new BorderLayout()); funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); UIScrollPane scrollPane = new UIScrollPane(funNameLabel); + scrollPane.setPreferredSize(new Dimension(super.getPreferredSize().width, FineUIScale.scale(80))); scrollPane.setOpaque(true); jsParaPane.add(row(4, cell(scrollPane).weight(1), diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index d0ad936913..ce282861e4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -342,6 +342,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt renameAction.setEnabled(false); delFileAction.setEnabled(false); vcsAction.setEnabled(false); + this.revalidate(); this.repaint(); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java index f89e4104b0..81620a64f5 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/ThemedCellStyleListPane.java @@ -115,7 +115,7 @@ public class ThemedCellStyleListPane extends FurtherBasicBeanPane, Serializable { - private static final Icon SELECTEDMARK_ICON = new LazyIcon("selectedMark"); + private static final Icon SELECTEDMARK_ICON = new LazyIcon("selectedMark", 32); private final CellRectangleStylePreviewPane previewArea; private boolean selected = false; diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java index dd3c86c720..a87d6977bc 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java @@ -109,7 +109,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo cell(scrollPane).weight(1) ).getComponent()); this.add(jPanel, BorderLayout.CENTER); - jPanel.setBorder(new ScaledEmptyBorder(0, 4, 4, 4)); + jPanel.setBorder(new ScaledEmptyBorder(0, 12, 4, 4)); registerDSChangeListener(); } diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java index 976744e3b3..9f7ef617e3 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java @@ -1,20 +1,15 @@ package com.fr.design.style.background.impl; -import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.BackgroundDetailPane; import com.fr.general.Background; -import com.fr.general.locale.image.I18nImage; import javax.swing.*; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; @@ -25,23 +20,14 @@ import static com.fine.swing.ui.layout.Layouts.flex; */ public class NullBackgroundPane extends BackgroundDetailPane { - private static final String NULL_BACKGROUND = "/com/fr/design/images/background/null_background.png"; - private static final Image DEFAULT_NULL_BACKGROUND_IMAGE; - - static { - DEFAULT_NULL_BACKGROUND_IMAGE = I18nImage.getImage(NULL_BACKGROUND); - } - public NullBackgroundPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); UILabel centerLabel = new UILabel( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null")); - ImagePanel imagePane = new ImagePanel(); JPanel pane = column( 10, flex(), - cell(imagePane), cell(centerLabel), flex() ).getComponent(); @@ -60,30 +46,4 @@ public class NullBackgroundPane extends BackgroundDetailPane { public void addChangeListener(ChangeListener changeListener) { // do nothing. } - - /** - * 水平居中绘制 Image - */ - public class ImagePanel extends JPanel { - - public ImagePanel() { - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - if (DEFAULT_NULL_BACKGROUND_IMAGE != null) { - int x = (this.getWidth() - DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null)) / 2; - g.drawImage(DEFAULT_NULL_BACKGROUND_IMAGE, x, 0, this); - } - } - - @Override - public Dimension getPreferredSize() { - if (DEFAULT_NULL_BACKGROUND_IMAGE == null) { - return super.getPreferredSize(); - } - return FineUIScale.scale(new Dimension(DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null), DEFAULT_NULL_BACKGROUND_IMAGE.getHeight(null))); - } - } } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 1751fa98f4..17849321fd 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -733,7 +733,6 @@ public class DBManipulationPane extends BasicBeanPane { // 设置column1的editor columnsComboBox = new UIComboBox(new DefaultComboBoxModel()); - columnsComboBox.setRenderer(new UIComboBoxRenderer() { @Override @@ -754,7 +753,7 @@ public class DBManipulationPane extends BasicBeanPane { return super.stopCellEditing(); } }); - ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(1); + ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); //设置Column 2的Editor column2.setCellEditor(new ColumnValueEditor()); @@ -963,12 +962,12 @@ public class DBManipulationPane extends BasicBeanPane { } /* - * 单击以编辑 + * 双击以编辑 */ @Override public boolean isCellEditable(EventObject anEvent) { if (anEvent instanceof MouseEvent) { - return ((MouseEvent) anEvent).getClickCount() >= 1; + return ((MouseEvent) anEvent).getClickCount() >= 2; } return true; } @@ -1221,6 +1220,11 @@ public class DBManipulationPane extends BasicBeanPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } /* @@ -1246,6 +1250,11 @@ public class DBManipulationPane extends BasicBeanPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } /** @@ -1264,7 +1273,11 @@ public class DBManipulationPane extends BasicBeanPane { setSelected((value != null && ((Boolean) value).booleanValue())); setUI(getUICheckBoxUI()); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor"))); - setBackground(Color.WHITE); + if (isSelected) { + setBackground(UIManager.getColor( "Table.selectionBackground")); + } else { + setBackground(UIManager.getColor("Table.background")); + } return this; } } diff --git a/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg b/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg new file mode 100644 index 0000000000..ffb6e34f7c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg b/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg index 6da83ea77d..afc98ac260 100644 --- a/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg index cdc9c4b08d..7e033c84fa 100644 --- a/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 475c24d733..4cfeeb7521 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -7,6 +7,7 @@ "cut": "cut.svg", "save": "save.svg", "saveFile": "saveFile.svg", + "formExport": "formExport.svg", "copy": "copy.svg", "formatBrush": "formatBrush.svg", "paste": "paste.svg", diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index ef4a4d788f..d6f46b9332 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -457,9 +457,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private class ChartChangeButton extends UIToggleButton { - private final double DEL_WIDTH = scale(9); + private final double DEL_WIDTH = scale(13); private final double DOWN_HEIGHT = scale(1); - private final Icon closeIcon = new LazyIcon("closeTag", 8); + private final Icon closeIcon = new LazyIcon("closeTag", 12); private boolean isMoveOn = false; private String buttonName = ""; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java index 5bbea51697..cb9e9614c0 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java @@ -48,7 +48,8 @@ public class ChartImagePane extends ChartSelectDemoPane { super.paint(g); BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath); - g.drawImage(image1, 0, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null); + int x = (this.getWidth() - scale(IMAGE_WIDTH)) / 2; + g.drawImage(image1, x, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null); } }; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java index b7ac9a7265..0b7e5f7071 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java @@ -5,6 +5,7 @@ import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.foldablepane.UIExpandablePane; @@ -54,6 +55,9 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * 数据点提示内容界面,含有通用设置、富文本编辑器、自定义JS界面 */ @@ -291,14 +295,21 @@ public class VanChartTooltipContentPane extends BasicBeanPaneit.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))).getComponent(); } @@ -310,10 +321,10 @@ public class VanChartTooltipContentPane extends BasicBeanPane { @@ -48,13 +50,13 @@ public class VanChartRichTextPane extends BasicBeanPane { fieldListContent.add(fieldListPane, BorderLayout.NORTH); JScrollPane fieldListScrollPane = new JScrollPane(fieldListContent); - fieldListScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldListScrollPane.setPreferredSize(scale(new Dimension(FIELD_PANE_W, FIELD_PANE_H))); fieldListScrollPane.setHorizontalScrollBar(null); fieldListScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Add_Field"))); // 字段格式和汇总 JScrollPane fieldAttrScrollPane = new JScrollPane(fieldAttrPane); - fieldAttrScrollPane.setPreferredSize(new Dimension(FIELD_PANE_W, FIELD_PANE_H)); + fieldAttrScrollPane.setPreferredSize(scale(new Dimension(FIELD_PANE_W, FIELD_PANE_H))); fieldAttrScrollPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Field_Setting"))); fieldPane.add(fieldListScrollPane); @@ -71,7 +73,7 @@ public class VanChartRichTextPane extends BasicBeanPane { JPanel richEditorPane = new JPanel(); richEditorPane.setLayout(new BorderLayout()); - richEditorPane.setPreferredSize(new Dimension(RICH_EDITOR_W, RICH_EDITOR_H)); + richEditorPane.setPreferredSize(scale(new Dimension(RICH_EDITOR_W, RICH_EDITOR_H))); richEditorPane.add(richEditor, BorderLayout.CENTER); return richEditorPane; diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java index cac695bf17..f6394c0ff9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.map.designer.type; import com.fine.theme.utils.FineLayoutBuilder; +import com.fr.decision.webservice.v10.map.MapEditService; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; @@ -83,9 +84,7 @@ public class WMSLayerPane extends JPanel implements UIObserver { @Override protected Void doInBackground() { - /// 待实现 - // MapEditService.getInstance().getWMSNames(wmsUrl.getText()); - List wmsNames = new ArrayList<>(); + List wmsNames = MapEditService.getInstance().getWMSNames(wmsUrl.getText()); list.clear(); for (String layer : wmsNames) { list.add(new WMSLayer(layer, false)); diff --git a/designer-chart/src/main/resources/com/fr/design/images/background/null_background.png b/designer-chart/src/main/resources/com/fr/design/images/background/null_background.png deleted file mode 100644 index 6178601812..0000000000 Binary files a/designer-chart/src/main/resources/com/fr/design/images/background/null_background.png and /dev/null differ diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java index df486b1d72..985bcc8e22 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java @@ -1,37 +1,76 @@ package com.fanruan.boot.adaptation; +import com.fanruan.carina.Carina; +import com.fanruan.carina.context.ContextListener; +import com.fanruan.portal.authority.PortalAuthorityItems; +import com.fanruan.portal.module.PortalModule; import com.fanruan.portal.module.PortalModuleManager; +import com.fr.stable.StringUtils; import com.fr.third.guava.collect.Sets; import java.util.Optional; import java.util.Set; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_DEPARTMENT_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_DEP_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_EDIT_INFO_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_RESET_PASSWORD_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_FORBIDDEN_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ID; +import static com.fanruan.messenger.ums.authority.UMSAuthorityItems.PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID; +import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_BASE_SETTINGS_ID; +import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_ESD_ID; +import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_ID; /** * 内置服务器支持展示的模块,预期调用顺序在业务模块之后 * * @author Anner * @since 11.0 - * Created on 2024/10/15 + * Created on 2024/10/15 */ public class DesignServerSupportModule { private final static Set SUPPORT_MODULE = Sets.newHashSet( // 系统管理 PORTAL_MANAGEMENT_ID, + // 用户管理 + USER_ID, + USER_ADD_ROLE_ID, + USER_ADD_DEPARTMENT_ID, + USER_ADD_ID, + USER_EDIT_ID, + USER_EDIT_RESET_PASSWORD_ID, + USER_EDIT_EDIT_INFO_ID, + USER_EDIT_DEP_ROLE_ID, + USER_DELETE_ID, + USER_DELETE_ROLE_ID, + USER_FORBIDDEN_ID, // 企业设置 ENTERPRISE_ID, + // 企业设置 - 通知中心 + PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID, // 企业设置 - 通用设置 ENTERPRISE_GENERAL_ID, + // 报表设置 + ENTERPRISE_REPORT_ID, + // 报表设置 - 基础设置 + ENTERPRISE_REPORT_BASE_SETTINGS_ID, + // 报表设置 - 抽数缓存 + ENTERPRISE_REPORT_ESD_ID, // 安全管理 SECURITY_ID, // 地图管理 - MAP_ID - ); + MAP_ID); /** * 注册一下支持展示的模块 @@ -55,8 +94,15 @@ public class DesignServerSupportModule { * 启动入口,重建一下展示的module */ public static void rebuild() { - PortalModuleManager.allModules().keySet().stream() - .filter(m -> !SUPPORT_MODULE.contains(m)) - .forEach(PortalModuleManager::unregister); + Carina.getApplicationContext().addListener(new ContextListener() { + @Override + public void onStart() { + PortalModuleManager.allModules().values().stream() + .filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)) + .map(PortalModule::getId) + .filter(m -> !SUPPORT_MODULE.contains(m)) + .forEach(PortalModuleManager::unregister); + } + }); } -} +} \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java index 7d2f3fd224..c2ff0f85b2 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignReportBaseComponent.java @@ -5,6 +5,10 @@ import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Stop; +import com.fanruan.carina.annotions.Supplemental; +import com.fr.nx.app.web.StreamAndTemplateReportletCreator; +import com.fr.nx.app.web.StreamReportletCreator; +import com.fr.web.factory.WebletFactory; /** * DesignReportBaseComponent @@ -17,6 +21,15 @@ import com.fanruan.carina.annotions.Stop; @DependsOn(dependencies = "design_function_chart_base") public class DesignReportBaseComponent extends ReportBaseComponent { + /** + * prepare + */ + @Supplemental + public void supplemental() { + WebletFactory.registerWebletCreator(StreamReportletCreator.KEY); + WebletFactory.registerWebletCreator(StreamAndTemplateReportletCreator.KEY); + } + /** * start */ diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java index 8656695ecc..a107548fbf 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignPreLoadComponent.java @@ -172,6 +172,11 @@ public class DesignPreLoadComponent { LocaleMarker.create("com/fr/web/i18n/report", LocaleScope.WEB), LocaleMarker.create("com/fr/web/i18n/chart", LocaleScope.WEB) ); + Carina.getApplicationContext().group(InterMutableKey.class).addAll( + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.DESIGN), + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.WEB), + LocaleMarker.create("com/fr/plugin/locale/locale", LocaleScope.SERVER) + ); // WebLocaleProvider插件接口适配 LocaleUtils.registerLocaleParser((localeStr, defaulVal) -> { diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java index 95115cd04b..9524ed9a65 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java @@ -6,6 +6,7 @@ import java.awt.event.KeyEvent; import javax.swing.KeyStroke; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.DesignerContext; @@ -19,7 +20,7 @@ public class NewPolyReportAction extends UpdateAction { public NewPolyReportAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_New_Multi_Report")); this.setMnemonic('F'); - this.setSmallIcon("/com/fr/design/images/m_file/formExport"); + this.setSmallIcon(new LazyIcon("formExport")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER)); } diff --git a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java index f1c6f3d826..bd6de4606b 100644 --- a/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java +++ b/designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java @@ -2,7 +2,7 @@ package com.fr.design.dscolumn; import com.fine.swing.ui.layout.Layouts; import com.fr.design.constants.LayoutConstants; -import com.fr.design.gui.core.ReactiveCardPane; +import com.fr.design.gui.core.SimpleCardPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.FunctionComboBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -44,7 +44,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { private UIButton advancedButton; private JPanel advancedButtonRow; private FunctionComboBox functionComboBox; - private ReactiveCardPane cardPane; + private SimpleCardPane cardPane; private UIComboBox goBox; private ItemListener listener; @@ -68,11 +68,11 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { goBox.addItemListener(ee -> { int i = goBox.getSelectedIndex(); if (i == BIND_GROUP) { - cardPane.select("groupPane").populate(); + cardPane.show("groupPane"); } else if (i == BIND_SELECTED) { cardPane.setVisible(false); } else if (i == BIND_SUMMARY) { - cardPane.select("summaryPane").populate(); + cardPane.show("summaryPane"); CellExpandAttr cellExpandAttr = cellElement.getCellExpandAttr(); cellExpandAttr.setDirection(Constants.NONE); } @@ -93,14 +93,14 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { advancedButtonRow = row(flex(1.2), cell(advancedButton).weight(3)).getComponent(); functionComboBox = new FunctionComboBox(GUICoreUtils.getFunctionArray()); - cardPane = ReactiveCardPane.create() - .addSupplier("groupPane", () -> column(LayoutConstants.VERTICAL_GAP, - row(flex(1.2), cell(groupComboBox).weight(3)), - cell(advancedButtonRow) - ).getComponent()) - .addSupplier("summaryPane", () -> row( - flex(1.2), cell(functionComboBox).weight(3) - ).getComponent()); + cardPane = new SimpleCardPane(); + cardPane.add("groupPane", column(LayoutConstants.VERTICAL_GAP, + row(flex(1.2), cell(groupComboBox).weight(3)), + cell(advancedButtonRow) + ).getComponent()); + cardPane.add("summaryPane", row( + flex(1.2), cell(functionComboBox).weight(3) + ).getComponent()); } @Override @@ -116,12 +116,12 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { if (recordGrouper instanceof FunctionGrouper) { populateFunctionGrouper(); } else if (recordGrouper instanceof SummaryGrouper) { - cardPane.select("summaryPane").populate(); + cardPane.show("summaryPane"); this.goBox.setSelectedIndex(BIND_SUMMARY); this.functionComboBox.setFunction(((SummaryGrouper) recordGrouper).getFunction()); } else if (recordGrouper instanceof CustomGrouper) { // 自定义分组 or 高级分组 - cardPane.select("groupPane").populate(); + cardPane.show("groupPane"); this.goBox.setSelectedIndex(BIND_GROUP); this.groupComboBox.setSelectedIndex(ADVANCED); } @@ -134,11 +134,11 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { if (!((FunctionGrouper) recordGrouper).isCustom()) { int mode = recordGrouper.getDivideMode(); if (mode == FunctionGrouper.GROUPING_MODE) { - cardPane.select("groupPane").populate(); + cardPane.show("groupPane"); this.goBox.setSelectedIndex(BIND_GROUP); this.groupComboBox.setSelectedIndex(COMMON); } else if (mode == FunctionGrouper.CONTINUUM_MODE) { - cardPane.select("groupPane").populate(); + cardPane.show("groupPane"); this.goBox.setSelectedIndex(BIND_GROUP); this.groupComboBox.setSelectedIndex(CONTINUUM); } else if (mode == FunctionGrouper.LIST_MODE) { @@ -147,7 +147,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane { } } else { // 这种情况也放到自定义分组里面 - cardPane.select("groupPane").populate(); + cardPane.show("groupPane"); this.goBox.setSelectedIndex(BIND_GROUP); this.groupComboBox.setSelectedIndex(ADVANCED); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index dd21ff1ed0..b3f628cdb6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -123,6 +123,7 @@ public class ReportComponentComposite extends JPanel implements RemoveListener { centerCardPane.populate(workbook.getTemplateReport(newIndex)); if (parentContainer != null) { parentContainer.setDownPane(ReportComponentComposite.this); + parentContainer.setSheetNameTabPane(sheetNameTab); } if (templateStateList.size() > newIndex) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 09e6ee22bb..dad2f6cc93 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.cell.settingpane; import com.fine.swing.ui.layout.Layouts; +import com.fine.swing.ui.layout.Row; import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; @@ -11,7 +12,6 @@ import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.core.ReactiveCardPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.icheckbox.UICheckBox; @@ -74,14 +74,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane { private UIComboBox showContent; //内容提示 - private ReactiveCardPane showContentPane; + private JPanel showContentPane; private UIButtonGroup tooltipButtonGroup; - private ReactiveCardPane tooltipPane; + private JPanel tooltipPane; private UITextField tooltipTextField; private UITextField fileNameTextField; //文本超出时隐藏 - private ReactiveCardPane overflowPane; + private JPanel overflowPane; private UICheckBox textOverflowCheckBox; private int curSelectedIndex; private UIComboBox showPartComboBox; @@ -112,7 +112,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { // 插入行策略 private UIButtonGroup insertRowPolicyButtonGroup; private ValueEditorPane valueEditor; - private ReactiveCardPane insertRowPolicyPane; + private JPanel insertRowPolicyPane; private UILabel insertRowPolicyLabel; private UIRadioButton exportButton; @@ -220,6 +220,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane { initInsertRowPolicyPane(); return Layouts.column(LayoutConstants.VERTICAL_GAP, cell(seniorUpPane()), + row( + cell(insertRowPolicyLabel).weight(1.2), + cell(insertRowPolicyButtonGroup).weight(3) + ), cell(insertRowPolicyPane) ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, LayoutConstants.VERTICAL_GAP, 0)) ).getComponent(); @@ -236,29 +240,11 @@ public class CellOtherSetPane extends AbstractCellAttrPane { insertRowPolicyLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_InsertRow_Policy", SwingConstants.LEFT)); UIComponentUtils.setLineWrap(insertRowPolicyLabel); - insertRowPolicyPane = ReactiveCardPane.create() - .addSupplier("empty", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(insertRowPolicyLabel).weight(1.2), - cell(insertRowPolicyButtonGroup).weight(3) - ) - ).getComponent()) - .addSupplier("default", () -> Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(insertRowPolicyLabel).weight(1.2), - cell(insertRowPolicyButtonGroup).weight(3) - ), - row( - flex(1.2), - cell(valueEditor).weight(3) - ) - ).getComponent() - ); - insertRowPolicyPane.select("empty").populate(); + insertRowPolicyPane = row( flex(1.2), cell(valueEditor).weight(3)).getComponent(); + insertRowPolicyPane.setVisible(false); insertRowPolicyButtonGroup.addChangeListener(e -> { - String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty"; - insertRowPolicyPane.select(key).populate(); + insertRowPolicyPane.setVisible(insertRowPolicyButtonGroup.getSelectedIndex() == 1); }); } @@ -284,32 +270,24 @@ public class CellOtherSetPane extends AbstractCellAttrPane { UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT); UIComponentUtils.setLineWrap(showContentLabel); + Row downloadRow = row( + cell(downloadLabel).weight(1.2), cell(fileNameTextField).weight(3.0) + ).getComponent(); + downloadRow.setVisible(false); + initTooltipPane(); - showContentPane = ReactiveCardPane.create() - .addSupplier("default", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0) - ), - cell(tooltipPane) - ).getComponent()) - .addSupplier("download", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0) - ), - row( - cell(downloadLabel).weight(1.2), cell(fileNameTextField).weight(3.0) - ), - cell(tooltipPane) - ).getComponent()); - showContentPane.select("default").populate(); + + showContentPane = column(10, + row( + cell(showContentLabel).weight(1.2), cell(showContent).weight(3.0) + ), + cell(downloadRow), + cell(tooltipPane) + ).getComponent(); showContent.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { - if (showContent.getSelectedIndex() == DOWNLOAD_INDEX) { - showContentPane.select("download").populate(); - } else { - showContentPane.select("default").populate(); - } + downloadRow.setVisible(showContent.getSelectedIndex() == DOWNLOAD_INDEX); handleCellShowStyleChange(e); } }); @@ -320,28 +298,19 @@ public class CellOtherSetPane extends AbstractCellAttrPane { tooltipButtonGroup = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_Custom"), Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip_CellValue")}); tooltipTextField = new UITextField(); - tooltipPane = ReactiveCardPane.create() - .addSupplier("define", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0) - ), - row( - flex(1.2), cell(tooltipTextField).weight(3.0) - ) - ).getComponent()) - .addSupplier("cellValue", () -> column(LayoutConstants.VERTICAL_GAP, - row( - cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0) - ) - ).getComponent()); - tooltipPane.select("define").populate(); + Row tooltipTextRow = row( + flex(1.2), cell(tooltipTextField).weight(3.0) + ).getComponent(); + + tooltipPane = column(10, + row( + cell(toolTipLabel).weight(1.2), cell(tooltipButtonGroup).weight(3.0) + ), + cell(tooltipTextRow) + ).getComponent(); tooltipButtonGroup.addChangeListener(e -> { - if (tooltipButtonGroup.getSelectedIndex() == 0) { - tooltipPane.select("define").populate(); - } else { - tooltipPane.select("cellValue").populate(); - } + tooltipTextRow.setVisible(tooltipButtonGroup.getSelectedIndex() == 0); }); } @@ -354,35 +323,40 @@ public class CellOtherSetPane extends AbstractCellAttrPane { UILabel hideTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideType")); textOverflowCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_HideWhenOverflow")); - overflowPane = ReactiveCardPane.create() - .addSupplier("empty", () -> column(LayoutConstants.VERTICAL_GAP, - row(cell(textOverflowCheckBox)) - ).getComponent()) - .addSupplier("showChar", () -> column(LayoutConstants.VERTICAL_GAP, - row(cell(textOverflowCheckBox)), - row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(1.4), flex(0.1), cell(numberLabel).weight(0.5), cell(showCharNums).weight(1.0)), - row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0)) - ).getComponent()) - .addSupplier("showCell", () -> column(LayoutConstants.VERTICAL_GAP, - row(cell(textOverflowCheckBox)), - row(cell(showPartLabel).weight(1.2), cell(showPartComboBox).weight(3.0)), - row(cell(hideTypeLabel).weight(1.2), cell(textOverflowTypeComboBox).weight(3.0)) - ).getComponent()); - overflowPane.select("empty").populate(); + // 字符长度-数量 + Row numPane = row(flex(0.1), cell(numberLabel).weight(0.5), cell(showCharNums).weight(1.0)).getComponent(); + + // 显示部分 & 隐藏方式 + JPanel overflowPolicyPane = column(10, + row( + cell(showPartLabel).weight(1.2), + row( + cell(showPartComboBox).weight(1.4), + cell(numPane).weight(1.6) + ).weight(3) + ), + row( + cell(hideTypeLabel).weight(1.2), + cell(textOverflowTypeComboBox).weight(3.0) + ) + ).getComponent(); + + overflowPane = column(10, + row(cell(textOverflowCheckBox)), + cell(overflowPolicyPane) + ).getComponent(); + + overflowPolicyPane.setVisible(false); + showPartComboBox.addItemListener(e -> { - if (showPartComboBox.getSelectedIndex() == 0) { - overflowPane.select("showChar").populate(); - } else { - overflowPane.select("showCell").populate(); - } + numPane.setVisible(showPartComboBox.getSelectedIndex() == 0); }); + textOverflowCheckBox.addItemListener(e -> { if (e.getStateChange() == ItemEvent.SELECTED) { - if (showPartComboBox.getSelectedIndex() == 0) { - overflowPane.select("showChar").populate(); - } else { - overflowPane.select("showCell").populate(); - } + overflowPolicyPane.setVisible(true); + numPane.setVisible(showPartComboBox.getSelectedIndex() == 0); + // 记录目前自动调整哪个被选中 for (int i = 0; i < adjustRadioButtons.length; i++) { if (adjustRadioButtons[i].isSelected()) { @@ -392,7 +366,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } noAutoRadioButton.setSelected(true); } else { - overflowPane.select("empty").populate(); + overflowPolicyPane.setVisible(false); adjustRadioButtons[curSelectedIndex].setSelected(true); } }); @@ -557,12 +531,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane { } else { tooltipButtonGroup.setSelectedIndex(1); } - if (tooltipButtonGroup.getSelectedIndex() == 0) { - tooltipPane.select("define").populate(); - } else { - tooltipPane.select("cellValue").populate(); - } - tooltipPane.setVisible(true); + tooltipPane.setVisible(tooltipButtonGroup.getSelectedIndex() == 0); if (cellGUIAttr.isHideTextWhenOverflow()) { textOverflowCheckBox.setSelected(true); if (cellGUIAttr.isShowCharNum()) { @@ -607,12 +576,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane { insertRowPolicyButtonGroup.setSelectedIndex(0); this.valueEditor.populate(StringUtils.EMPTY); } - String key = insertRowPolicyButtonGroup.getSelectedIndex() == 1 ? "default" : "empty"; - insertRowPolicyPane.select(key).populate(); - insertRowPolicyPane.setVisible(true); + insertRowPolicyPane.setVisible(insertRowPolicyButtonGroup.getSelectedIndex() == 1); JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (!jTemplate.isJWorkBook()) { //表单中报表块编辑屏蔽掉 插入行策略 - insertRowPolicyPane.select("empty").populate(); + insertRowPolicyPane.setVisible(false); } populateDesensitizationBean(cellElement); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java index 284c290f6d..d89c4eac6d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/desensitization/model/UpdateDataWorker.java @@ -1,10 +1,11 @@ package com.fr.design.mainframe.cell.settingpane.desensitization.model; +import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; -import javax.swing.*; +import javax.swing.SwingWorker; import java.util.HashMap; import java.util.Map; import java.util.concurrent.ExecutionException; @@ -25,8 +26,9 @@ public class UpdateDataWorker extends SwingWorker, Void> { protected Map doInBackground() { Map result = new HashMap<>(); Map allRoles = RemoteAuthorityRepository.getInstance().getAllRoles4Desensitization(); - Map> allRules = RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap(); - + Map> allRules = new HashMap<>(); + allRules.put(DesensitizationRuleSource.SERVER, RemoteAuthorityRepository.getInstance().getAllRoles().getSourceRuleMap().get(DesensitizationRuleSource.SERVER)); + allRules.put(DesensitizationRuleSource.CUSTOM, DesensitizationRuleManager.getInstance().getRulesBySource(DesensitizationRuleSource.CUSTOM)); result.put(ROLE_KEY, allRoles); result.put(RULE_KEY, allRules); diff --git a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java index b2d0e6dd08..6b8929bf22 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java @@ -82,9 +82,9 @@ public class SortColumnRowPane extends JPanel implements UIObserver { void initTextField() { colJTextField = new JTextField(); - colJTextField.setEditable(false); + colJTextField.setEnabled(false); rowJTextField = new JTextField(); - rowJTextField.setEditable(false); + rowJTextField.setEnabled(false); } void initSelectButton() { 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); diff --git a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java index 6df0272410..1befa18bf3 100644 --- a/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java +++ b/designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java @@ -94,6 +94,7 @@ public class HeaderSortRulePane extends JPanel { private ColorControlWindow colorSelector; IconButton(SortRule sortRule) { + this.setLayout(new BorderLayout()); this.sortRule = sortRule; initComponents(); } diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java index c1efe6397f..211c5e0b9f 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ToolBarButton.java @@ -22,8 +22,6 @@ import javax.swing.ImageIcon; public class ToolBarButton extends UIButton implements MouseListener { private Widget widget; private WidgetOption no; - private final int ICON_WIDTH = FineUIScale.scale(16); - private final int ICON_HEIGHT = FineUIScale.scale(16); public ToolBarButton(Icon icon, Widget widget) { this(null, icon, widget); @@ -55,7 +53,7 @@ public class ToolBarButton extends UIButton implements MouseListener { if (icon instanceof ImageIcon) { //自定义上传的图标在设计器工具栏显示需要按照16*16进行缩放 Image originalImage = ((ImageIcon) icon).getImage(); - Image scaledImage = originalImage.getScaledInstance(ICON_WIDTH, ICON_HEIGHT, Image.SCALE_SMOOTH); + Image scaledImage = originalImage.getScaledInstance(FineUIScale.scale(16), FineUIScale.scale(16), Image.SCALE_SMOOTH); icon = new ImageIcon(scaledImage); } super.setIcon(icon); diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 92674958e2..7c2ded7244 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -377,7 +377,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { ColumnRowGroupCellRenderer2 cellRenderer2 = new ColumnRowGroupCellRenderer2(); cellRenderer2.setHorizontalAlignment(SwingConstants.LEFT); column2.setCellRenderer(cellRenderer2); - column2.setCellEditor(new SmartColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); + column2.setCellEditor(new ColumnValueEditor(ValueEditorPaneFactory.cellGroupEditor())); } else { SelectedColumnValueTableCellRenderer renderer = new SelectedColumnValueTableCellRenderer(); renderer.setHorizontalAlignment(SwingConstants.LEFT); @@ -580,6 +580,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return this; } + + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; + } } private class ColumnRowGroupCellRenderer2 extends FineTableHeaderUI.TableRenderer { @@ -613,26 +618,11 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { return this; } - } - } - - protected class SmartColumnValueEditor extends ColumnValueEditor { - protected SmartColumnValueEditor(Editor[] types) { - super(types); - } - - /** - * 双击修改 - * @param anEvent 事件 - * @return 是否可编辑 - */ - @Override - public boolean isCellEditable(EventObject anEvent) { - if (anEvent instanceof MouseEvent) { - return ((MouseEvent) anEvent).getClickCount() >= 2; + @Override + public boolean checkSelected(boolean isSelected, Class columnClass) { + return isSelected; } - return true; } } } 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 bc4648de4b..cf720b37b0 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 @@ -1,5 +1,9 @@ package com.fr.nx.app.designer.menu; +import com.fine.swing.ui.layout.Layouts; +import com.fine.theme.utils.FineUIStyle; +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.icheckbox.UICheckBox; @@ -56,9 +60,9 @@ public class CalculateAttrPane extends BasicBeanPane { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); - JPanel featureFlagPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + 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)); featureLabel.addActionListener(new ActionListener() { @@ -68,77 +72,60 @@ public class CalculateAttrPane extends BasicBeanPane { wDialog.setVisible(true); } }); - featureFlagPanel.add(featureLabel); + featureFlagPanel.add(Layouts.row(Layouts.flex(), Layouts.cell(featureLabel)).getComponent()); - JPanel calculateAttrPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - calculateAttrPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); + initTreeConfigPanel(); -// JPanel calculatedEndPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); -// calculateEnd = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine-Calculate-End")); -// calculatedEndPanel.add(calculateEnd); - JPanel queryCachePanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + List components = new ArrayList<>(); + components.add(new Component[]{featureFlagPanel}); + components.add(new Component[]{initCalculateAttrPanel()}); + components.add(new Component[]{treeConfigPanel}); + + JPanel content = + TableLayoutHelper.createGapTableLayoutPane( + components.toArray(new Component[0][]), + TableLayoutHelper.FILL_LASTCOLUMN, + 5, + 5 + ); + + this.add(content, BorderLayout.CENTER); + } + + private JPanel initCalculateAttrPanel() { queryCache = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Query_Cache")); - queryCachePanel.add(queryCache); - JPanel multiSourcePanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); multiSourceMode = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Feature_Multi_Source")); - multiSourcePanel.add(multiSourceMode); - - JPanel cursorPagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); cursorPage = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Prefer_Cursor_Pagination")); UILabel tipLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Calculate_Prefer_SQL_Pagination_Tip")); - tipLabel.setForeground(Color.GRAY); - cursorPagePanel.add(cursorPage); - cursorPagePanel.add(tipLabel); - -// calculateAttrPanel.add(calculatedEndPanel); - calculateAttrPanel.add(queryCachePanel); - calculateAttrPanel.add(multiSourcePanel); - calculateAttrPanel.add(cursorPagePanel); - + FineUIStyle.setStyle(tipLabel, FineUIStyle.LABEL_TIP); + + JPanel calculateAttrPanel = Layouts.column(10, + Layouts.cell(queryCache), + Layouts.cell(multiSourceMode), + Layouts.cell(cursorPage), + Layouts.cell(tipLabel)).getComponent(); + calculateAttrPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); + return calculateAttrPanel; + } - treeConfigPanel = FRGUIPaneFactory.createTitledBorderPane( - InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config") - ); + private void initTreeConfigPanel() { + treeConfigPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); treeConfigPanel.setVisible(FeatureManager.getInstance().isFlagEnable(FeatureFlags.TREE)); treeConfigPanel.setLayout(new BoxLayout(treeConfigPanel, BoxLayout.Y_AXIS)); - - JPanel treeAsyncQueryPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); treeAsyncQuery = new UICheckBox(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Async_Query")); - treeAsyncQueryPanel.add(treeAsyncQuery); - JPanel treeExpandLayerPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); UILabel treeExpandLayerLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer")); treeExpandLayer = new UISpinner(1, Integer.MAX_VALUE, 1, 1); // 功能不支持,设置先禁用 treeExpandLayer.setEnabled(false); - treeExpandLayerPanel.add(treeExpandLayerLabel); - treeExpandLayerPanel.add(treeExpandLayer); - - JPanel treeExpandLayerLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); UILabel multilineLabel = new UILabel(InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Expand_Layer_Label")); - multilineLabel.setForeground(TIPS_FONT_COLOR); - treeExpandLayerLabelPanel.add(multilineLabel); - - - treeConfigPanel.add(treeAsyncQueryPanel); - treeConfigPanel.add(treeExpandLayerPanel); - treeConfigPanel.add(treeExpandLayerLabelPanel); - - List components = new ArrayList<>(); - components.add(new Component[]{featureFlagPanel}); - components.add(new Component[]{calculateAttrPanel}); - components.add(new Component[]{treeConfigPanel}); - - JPanel content = - TableLayoutHelper.createGapTableLayoutPane( - components.toArray(new Component[0][]), - TableLayoutHelper.FILL_LASTCOLUMN, - 5, - 5 - ); - - this.add(content, BorderLayout.CENTER); + FineUIStyle.setStyle(multilineLabel, FineUIStyle.LABEL_TIP); + treeConfigPanel.add(FineUIUtils.wrapComponentWithTitle(Layouts.column(10, + Layouts.cell(treeAsyncQuery), + Layouts.row(10, Layouts.cell(treeExpandLayerLabel), Layouts.cell(treeExpandLayer)), + Layouts.cell(multilineLabel)).getComponent(), + InterProviderFactory.getProvider().getLocText("Fine-Plugin_Engine_Tree_Config"))); } @Override diff --git a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java index eaee455511..ef7d942fbe 100644 --- a/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java +++ b/designer-realize/src/main/java/com/fr/nx/app/designer/menu/FeatureFlagsPanel.java @@ -1,5 +1,6 @@ package com.fr.nx.app.designer.menu; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; @@ -26,9 +27,8 @@ public class FeatureFlagsPanel extends BasicBeanPane { public FeatureFlagsPanel() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); mainPanel = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); - mainPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0)); JPanel content = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[]{mainPanel}}, @@ -47,7 +47,8 @@ public class FeatureFlagsPanel extends BasicBeanPane { for (Pair entry : featureFlagBean.getAllFlags()) { final FeatureFlag flag = entry.getFirst(); Boolean selected = entry.getSecond(); - JPanel itemPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + JPanel itemPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + itemPanel.setBorder(new ScaledEmptyBorder(0, 0, 10, 0)); final UICheckBox cb = new UICheckBox(flag.getDisplayName()); cb.setSelected(selected); cb.addActionListener(new ActionListener() { diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 092e536190..add76e0744 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -20,7 +20,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.formula.CustomVariableResolver; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; -import com.fr.design.gui.core.ReactiveCardPane; +import com.fr.design.gui.core.SimpleCardPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIHeadGroup; @@ -121,9 +121,9 @@ public class CellDSColumnEditor extends CellQuickEditor { this.createPanes(); this.createSwitchTab(); return Layouts.column(10, - cell(tabsHeaderIconPane), - cell(cardContainer) - ).getComponent(); + cell(tabsHeaderIconPane), + cell(cardContainer) + ).getComponent(); } @Override @@ -268,8 +268,8 @@ public class CellDSColumnEditor extends CellQuickEditor { protected JPanel createContentPane() { initComponents(); return Layouts.column(LayoutConstants.VERTICAL_GAP, - cell(dataPane), cell(groupPane), cell(conditionPane) - ).getComponent(); + cell(dataPane), cell(groupPane), cell(conditionPane) + ).getComponent(); } private void initComponents(){ @@ -589,7 +589,7 @@ public class CellDSColumnEditor extends CellQuickEditor { private JPanel contentPane; private UIComboBox rsComboBox; - private ReactiveCardPane setTipCardPane; + private SimpleCardPane setTipCardPane; private UITextField serialTextField; private JFormulaField topFormulaPane; private JFormulaField bottomFormulaPane; @@ -618,7 +618,7 @@ public class CellDSColumnEditor extends CellQuickEditor { initSetTipCardPane(); contentPane = Layouts.column(LayoutConstants.VERTICAL_GAP, row( - cell(filterLabel).weight(1.2), cell(rsComboBox).weight(3) + cell(filterLabel).weight(1.2), cell(rsComboBox).weight(3) ), cell(setTipCardPane) ).getComponent(); @@ -639,21 +639,15 @@ public class CellDSColumnEditor extends CellQuickEditor { Color tipColor = FlatUIUtils.getUIColor("Label.tipColor", Color.GRAY); Arrays.asList(oddTip, evenTip, specifyTip).forEach(it -> it.setForeground(tipColor)); - setTipCardPane = ReactiveCardPane.create() - .addSupplier(TOP.name(), () -> row(flex(1.2), cell(topFormulaPane).weight(3)).getComponent()) - .addSupplier(BOTTOM.name(), () -> row(flex(1.2), cell(bottomFormulaPane).weight(3)).getComponent()) - .addSupplier(ODD.name(), () -> row( - flex(1.2), - cell(oddTip).weight(3) - ).getComponent()) - .addSupplier(EVEN.name(), () -> row( - flex(1.2), - cell(evenTip).weight(3) - ).getComponent()) - .addSupplier(SPECIFY.name(), () -> column(LayoutConstants.VERTICAL_GAP, - row(flex(1.2), cell(serialTextField).weight(3)), - row(flex(1.2), cell(specifyTip).weight(3)) - ).getComponent()); + setTipCardPane = new SimpleCardPane(); + setTipCardPane.add(TOP.name(), row(flex(1.2), cell(topFormulaPane).weight(3)).getComponent()); + setTipCardPane.add(BOTTOM.name(), row(flex(1.2), cell(bottomFormulaPane).weight(3)).getComponent()); + setTipCardPane.add(ODD.name(), row(flex(1.2), cell(oddTip).weight(3)).getComponent()); + setTipCardPane.add(EVEN.name(), row(flex(1.2), cell(evenTip).weight(3)).getComponent()); + setTipCardPane.add(SPECIFY.name(), column(10, + row(flex(1.2), cell(serialTextField).weight(3)), + row(flex(1.2), cell(specifyTip).weight(3)) + ).getComponent()); // 未定义不显示 setTipCardPane.setVisible(false); } @@ -693,7 +687,8 @@ public class CellDSColumnEditor extends CellQuickEditor { if (type == UNDEFINE) { setTipCardPane.setVisible(false); } else { - setTipCardPane.select(type.name()).populate(); + setTipCardPane.setVisible(true); + setTipCardPane.show(type.name()); } }