From 312ea3fe961754b0db7ad05224c360d065c9a9ec Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Tue, 10 Sep 2024 15:02:01 +0800 Subject: [PATCH 01/10] =?UTF-8?q?REPORT-133990=20&=20REPORT-133567=20&=20R?= =?UTF-8?q?EPORT-133398=20&=20REPORT-133389=20&=20REPORT-132370=20&=20REPO?= =?UTF-8?q?RT-133696=20&=20REPORT-131838=E3=80=90newUI=E3=80=91fix:?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=8F=8Afbp=E5=9B=9E=E5=BD=92=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/JDBCDefPane.java | 3 +-- .../datapane/preview/PreviewTablePane.java | 6 ++--- .../TableDataDesensitizationTableModel.java | 2 -- .../tabledatapane/MultiTDTableDataPane.java | 2 +- .../com/fr/design/editlock/EditLockUtils.java | 9 +++----- .../editor/editor/ColumnSelectedEditor.java | 4 +++- .../fr/design/file/MultiTemplateTabPane.java | 2 ++ .../formula/DefaultTinyFormulaPane.java | 2 +- .../fr/design/gui/frpane/FineTabbedPane.java | 21 ----------------- .../design/gui/frpane/UIBubbleFloatPane.java | 7 ++++-- .../fr/design/gui/ibutton/UIButtonGroup.java | 14 +++++++++++ .../gui/ibutton/UIColorButtonWithAuto.java | 3 +-- .../PatternBackgroundQuickPane.java | 13 ++++++----- .../theme/icon/dataset/connection_locked.svg | 4 ++++ .../dataset/connection_locked_disable.svg | 4 ++++ .../fine/theme/icon/font/autoForeground.svg | 7 ++++++ .../icon/font/autoForeground_disable.svg | 7 ++++++ .../fine/theme/light/ui/fine_light.icon.json | 2 ++ .../fr/design/i18n/dimension_en.properties | 4 +++- .../fr/design/i18n/dimension_ja_JP.properties | 2 ++ .../fr/design/i18n/dimension_ko_KR.properties | 2 ++ .../fr/design/i18n/dimension_zh.properties | 2 ++ .../fr/design/i18n/dimension_zh_TW.properties | 2 ++ .../chart/gui/ChartTypeButtonPane.java | 6 ++--- .../chart/custom/VanChartCustomPlotPane.java | 23 ++++--------------- .../component/VanChartLabelContentPane.java | 4 +--- .../chart/designer/other/AutoRefreshPane.java | 7 +++--- ...VanChartCategoryStylePaneWithCheckBox.java | 2 +- 28 files changed, 88 insertions(+), 78 deletions(-) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 33a1903318..a9322f33fc 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -4,7 +4,6 @@ import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIUtils; import com.fr.data.driver.DriverLoader; -import com.fr.data.driver.config.DriverLoaderConfig; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.solution.entity.DriverClasses; import com.fr.datasource.connection.impl.DefaultDatabaseType; @@ -251,7 +250,7 @@ public class JDBCDefPane extends JPanel { cell(driverComboBox).weight(3), flex(0.2), cell(odbcTipsLink).weight(1.8) ).getComponent()) .addSupplier("define", () -> row( - cell(driverLoaderBox).weight(3), cell(driverManageLabel).weight(2) + cell(driverLoaderBox).weight(3), flex(0.2), cell(driverManageLabel).weight(1.8) ).getComponent()); changeDriverRow(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index be39360327..275b3ce6d4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -34,6 +34,7 @@ import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -44,7 +45,6 @@ import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.general.data.DataModel; import com.fr.log.FineLoggerFactory; -import com.fr.workspace.server.entity.connection.ConnectionBean; import com.fr.workspace.server.repository.connection.ConnectionRepository; import javax.swing.BorderFactory; @@ -53,8 +53,6 @@ import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.JScrollBar; -import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; @@ -258,7 +256,7 @@ public class PreviewTablePane extends BasicPane { public void doCancel() { } - }, BasicDialog.DEFAULT); + }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.data.datapane.preview.dialog")); dialog.setVisible(true); // 关闭预览页面 PreviewTablePane.this.dialog.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index 32959ef942..8b3d9464fe 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -127,8 +127,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter(new ParameterTableModel() { diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java index 87ca587f5f..c988f2a711 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -1,13 +1,10 @@ package com.fr.design.editlock; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.SVGLoader; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.general.IOUtils; -import com.fr.workspace.WorkContext; -import com.fr.workspace.server.lock.editlock.EditLockOperator; import com.fr.report.LockItem; import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.tabledata.TableDataRepository; @@ -30,7 +27,7 @@ public class EditLockUtils { /** * 数据连接锁定标志 */ - public static final Icon CONNECTION_LOCKED_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/connection_locked"); + public static final Icon CONNECTION_LOCKED_ICON = new LazyIcon("connection_locked"); /** * 小锁图片 @@ -40,7 +37,7 @@ public class EditLockUtils { /** * 提示弹窗中的提示标志 */ - public static final Icon TOOLTIPS_ICON = IOUtils.readIcon("/com/fr/design/images/m_web/warningIcon.png"); + public static final Icon TOOLTIPS_ICON = new LazyIcon("warning"); /** * 数据连接锁定中 diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java index e6ffbadd66..250e32748d 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -1,5 +1,6 @@ package com.fr.design.editor.editor; +import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.data.SimpleDSColumn; import com.fr.design.data.datapane.TableDataComboBox; @@ -18,6 +19,7 @@ import java.util.regex.Pattern; 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.fix; /** * 选择数据列编辑器 @@ -54,7 +56,7 @@ public class ColumnSelectedEditor extends Editor implements Prep } }); columnNameComboBox = new UIComboBox(); - this.add(row(10, cell(tableDataComboBox), cell(columnNameComboBox)).getComponent()); + this.add(row(cell(tableDataComboBox).weight(1), fix(LayoutConstants.HGAP_LARGE),cell(columnNameComboBox).weight(1)).getComponent()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 1ac3f12ead..8bedd19c96 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -33,6 +33,7 @@ import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.collections.combination.Pair; import com.fr.third.javax.annotation.Nonnull; @@ -357,6 +358,7 @@ public class MultiTemplateTabPane extends Row { public RightMenuCloseAction(CloseOption option, int tplIndex) { this.option = option; this.setName(option.optionName); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); this.tplIndex = tplIndex; } diff --git a/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java index 7b69f306d5..7f26c4884c 100644 --- a/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java @@ -56,6 +56,6 @@ public class DefaultTinyFormulaPane extends TinyFormulaPane{ } private Component createDefaultTinyFormulaPane() { - return row(cell(formulaTextField).weight(2), flex(0.1), cell(formulaTextFieldButton).weight(0.4)).getComponent(); + return row(cell(formulaTextField).weight(1), flex(0.1), cell(formulaTextFieldButton)).getComponent(); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index 1d4274bb99..0ce50448ed 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java @@ -6,12 +6,8 @@ import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.utils.ColorUtils; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.List; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -185,23 +181,6 @@ public class FineTabbedPane extends Box { }); tabGroup.setSelectedIndex(0); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); - if (!useFitTab) { - initTabListeners(); - } - } - - private void initTabListeners() { - List tabs = tabGroup.getLabelButtonList(); - for (UIToggleButton tab : tabs) { - tab.addMouseListener(new MouseAdapter() { - @Override - public void mouseEntered(MouseEvent e) { - if (tab.getPreferredSize().width > tab.getWidth()) { - tab.setToolTipText(tab.getText()); - } - } - }); - } } private void fireStateChanged() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java index eba2ce53bd..4916e33100 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.frpane; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.SystemInfo; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.UIDialog; import com.fr.design.utils.AWTUtilities; import com.fr.log.FineLoggerFactory; @@ -32,6 +33,9 @@ import java.awt.Window; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.cell; + /** * @author Jerry * 非模态悬浮对话框,气泡形状 @@ -226,8 +230,7 @@ public abstract class UIBubbleFloatPane extends BasicBeanPane { } this.setLayout(new BorderLayout()); - this.add(initTopOptionMenu(), BorderLayout.NORTH); - this.add(contentPane, BorderLayout.CENTER); + this.add(column(LayoutConstants.VGAP_MEDIUM, cell(initTopOptionMenu()), cell(contentPane)).getComponent()); } protected JPanel initTopOptionMenu() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index fd74f7d042..4e392da122 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -181,6 +181,7 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb } setBorder(new FineRoundBorder()); initLayout(getCols()); + initTabListeners(); } public UIButtonGroup(String[] textArray, T[] objects) { @@ -192,6 +193,19 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb return UI_CLASS_ID; } + private void initTabListeners() { + for (UIToggleButton tab : labelButtonList) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } + } + /** * 计算按钮组的列布局;支持自定义布局 * diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index b10b1d91f8..7a9a41aef2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -2,7 +2,6 @@ package com.fr.design.gui.ibutton; import com.fine.theme.icon.LazyIcon; import com.fr.chart.base.ChartConstants; -import com.fr.design.constants.UIConstants; import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindowWithAuto; import com.fr.general.ComparatorUtils; @@ -17,7 +16,7 @@ public class UIColorButtonWithAuto extends UIColorButton { } if (!ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { - setIcon(UIConstants.AUTO_FONT_ICON); + setIcon(new LazyIcon("autoForeground")); } super.checkColorChange(oldColor, newColor); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 789bcd16cf..b8ea2bf0a9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -59,13 +59,14 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { backgroundColorPane = new ColorSelectBox(FineUIScale.scale(60)); foregroundColorPane.setSelectObject(DEFAULT_FOREGROUND); foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND); + UILabel foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT); + foregroundLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground")); + UILabel backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT); + backgroundLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")); + this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)).weight(1), - cell(foregroundColorPane).weight(4)), - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)).weight(1), - cell(backgroundColorPane).weight(4)) + row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)), + row(cell(backgroundLabel).weight(1), cell(backgroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); backgroundColorPane.addSelectChangeListener(colorChangeListener); diff --git a/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg new file mode 100644 index 0000000000..a24a789d62 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg new file mode 100644 index 0000000000..3b8bfc5a6f --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg new file mode 100644 index 0000000000..11837397ff --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg new file mode 100644 index 0000000000..46c1bfedc0 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg @@ -0,0 +1,7 @@ + + + + + + + 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 97a5bc70d7..c5da2acc5f 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 @@ -43,6 +43,7 @@ "database_warning": "dataset/database_warning.svg", "preview": "dataset/preview.svg", "connection": "dataset/connection.svg", + "connection_locked": "dataset/connection_locked.svg", "class_table_data": "dataset/class_table_data.svg", "data_table": "dataset/data_table.svg", "multi": "dataset/multi.svg", @@ -170,6 +171,7 @@ "underline": "font/underline.svg", "foreground": "font/foreground.svg", "background": "font/background.svg", + "autoForeground": "font/autoForeground.svg", "h_left": "cellstyle/h_left.svg", "h_center": "cellstyle/h_center.svg", "h_right": "cellstyle/h_right.svg", diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index f35b30539f..f8f5b7f878 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -35,6 +35,8 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=800*630 -com.fr.design.actions.printingSetting.dialog=800*600 +com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 31e4ae38e5..2ffcb1aa42 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 73b022f454..598b8f68d1 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=340*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 1e30edaf4e..0663409e6d 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=660*600 com.fr.design.actions.printingSetting.dialog=660*600 +com.fr.design.data.datapane.preview.dialog=660*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 842dde7fc3..e79bb892d1 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -34,5 +34,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + 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 7f3324a2c3..5f2f7790a1 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,8 +457,8 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private class ChartChangeButton extends UIToggleButton { - private static final double DEL_WIDTH = 9; - private Icon closeIcon = new LazyIcon("closeTag", 8); + private final double DEL_WIDTH = scale(9); + private final Icon closeIcon = new LazyIcon("closeTag", 8); private boolean isMoveOn = false; private String buttonName = ""; @@ -506,7 +506,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void paintDeleteButton(Graphics g2d) { Rectangle2D bounds = this.getBounds(); int x = (int) (bounds.getWidth() - DEL_WIDTH); - closeIcon.paintIcon(this, g2d, scale(x), scale(1)); + closeIcon.paintIcon(this, g2d, x, scale(1)); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index c3dcf73909..9a41401b0b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -3,7 +3,6 @@ package com.fr.van.chart.custom; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; @@ -11,9 +10,7 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.CustomChartDataDefinition; -import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.constants.LayoutConstants; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.log.FineLoggerFactory; @@ -39,6 +36,9 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * Created by Mitisky on 16/2/16. */ @@ -88,22 +88,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { private void initContent() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - autoPane = new JPanel(); - customSelectPane = new VanChartCustomPlotSelectPane(); - - Component[][] components = new Component[][]{ - new Component[]{new JSeparator()}, - new Component[]{customSelectPane} - }; - - double[] columnSize = {p, f}; - double[] rowSize = {p, p}; - customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - + customPane = column(LayoutConstants.VERTICAL_GAP, cell(new JSeparator()), cell(customSelectPane)).getComponent(); contentPane = new JPanel(new CardLayout()) { @Override public Dimension getPreferredSize() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 87605db336..0002b3aceb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -34,9 +34,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { if (isInCondition() || !ChartEditContext.supportTheme()) { return super.createCommonStylePane(); } - // 颜色图标统一使用UIColorButton - setTextAttrPane(new ChartTextAttrPaneWithThemeStyle()); - + setTextAttrPane(new LabelAttrPaneWithThemeStyle()); JPanel stylePanel = new JPanel(new BorderLayout()); stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java index 77c7be9dd8..e559f5f42a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java @@ -84,10 +84,9 @@ public class AutoRefreshPane extends BasicBeanPane { initTooltipSet(); JPanel tipPane = getTooltipPane(); - - JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, - new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel); - + UILabel backgroundDetectionLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")); + backgroundDetectionLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")); + JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, backgroundDetectionLabel, moreLabel); Component[][] components = initComponent(tipPane); contentPane = new JPanel(new BorderLayout()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java index d723fb422b..7c865bd052 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java @@ -69,7 +69,7 @@ public class VanChartCategoryStylePaneWithCheckBox extends JPanel { Point comPoint = settingButton.getLocationOnScreen(); Point arrowPoint = new Point(comPoint.x +settingButton.getWidth() - 25, comPoint.y + settingButton.getHeight()); Dimension size = settingPane.getPreferredSize(); - ClosableBubbleFloatPane pane = new ClosableBubbleFloatPane(Constants.LEFT, arrowPoint, settingPane, size.width, FineUIScale.scale(240)) { + ClosableBubbleFloatPane pane = new ClosableBubbleFloatPane(Constants.LEFT, arrowPoint, settingPane, size.width, FineUIScale.scale(260)) { @Override public void updateContentPane() { From daa843ad8eeeaacc292b989719857b1c3f4a4655 Mon Sep 17 00:00:00 2001 From: "Richard.Fang" Date: Tue, 10 Sep 2024 15:02:01 +0800 Subject: [PATCH 02/10] =?UTF-8?q?REPORT-133990=20&=20REPORT-133567=20&=20R?= =?UTF-8?q?EPORT-133398=20&=20REPORT-133389=20&=20REPORT-132370=20&=20REPO?= =?UTF-8?q?RT-133696=20&=20REPORT-131838=E3=80=90newUI=E3=80=91fix:?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=8F=8Afbp=E5=9B=9E=E5=BD=92=E9=97=AE=E9=A2=98=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/datapane/connect/JDBCDefPane.java | 3 +-- .../datapane/preview/PreviewTablePane.java | 6 ++--- .../TableDataDesensitizationTableModel.java | 2 -- .../tabledatapane/MultiTDTableDataPane.java | 2 +- .../com/fr/design/editlock/EditLockUtils.java | 9 +++----- .../editor/editor/ColumnSelectedEditor.java | 4 +++- .../fr/design/editor/editor/CursorEditor.java | 5 ++++ .../fr/design/file/MultiTemplateTabPane.java | 2 ++ .../formula/DefaultTinyFormulaPane.java | 2 +- .../fr/design/gui/frpane/FineTabbedPane.java | 21 ----------------- .../design/gui/frpane/UIBubbleFloatPane.java | 7 ++++-- .../fr/design/gui/ibutton/UIButtonGroup.java | 14 +++++++++++ .../gui/ibutton/UIColorButtonWithAuto.java | 3 +-- .../PatternBackgroundQuickPane.java | 13 ++++++----- .../theme/icon/dataset/connection_locked.svg | 4 ++++ .../dataset/connection_locked_disable.svg | 4 ++++ .../fine/theme/icon/editor/type_cursor.svg | 3 +++ .../fine/theme/icon/font/autoForeground.svg | 7 ++++++ .../icon/font/autoForeground_disable.svg | 7 ++++++ .../fine/theme/light/ui/fine_light.icon.json | 3 +++ .../fr/design/i18n/dimension_en.properties | 4 +++- .../fr/design/i18n/dimension_ja_JP.properties | 2 ++ .../fr/design/i18n/dimension_ko_KR.properties | 2 ++ .../fr/design/i18n/dimension_zh.properties | 2 ++ .../fr/design/i18n/dimension_zh_TW.properties | 2 ++ .../chart/gui/ChartTypeButtonPane.java | 8 ++++--- .../chart/custom/VanChartCustomPlotPane.java | 23 ++++--------------- .../component/VanChartLabelContentPane.java | 4 +--- .../chart/designer/other/AutoRefreshPane.java | 7 +++--- ...VanChartCategoryStylePaneWithCheckBox.java | 2 +- 30 files changed, 99 insertions(+), 78 deletions(-) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/editor/type_cursor.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 33a1903318..a9322f33fc 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -4,7 +4,6 @@ import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIUtils; import com.fr.data.driver.DriverLoader; -import com.fr.data.driver.config.DriverLoaderConfig; import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.solution.entity.DriverClasses; import com.fr.datasource.connection.impl.DefaultDatabaseType; @@ -251,7 +250,7 @@ public class JDBCDefPane extends JPanel { cell(driverComboBox).weight(3), flex(0.2), cell(odbcTipsLink).weight(1.8) ).getComponent()) .addSupplier("define", () -> row( - cell(driverLoaderBox).weight(3), cell(driverManageLabel).weight(2) + cell(driverLoaderBox).weight(3), flex(0.2), cell(driverManageLabel).weight(1.8) ).getComponent()); changeDriverRow(); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java index be39360327..275b3ce6d4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java @@ -34,6 +34,7 @@ import com.fr.design.gui.iprogressbar.AutoProgressBar; import com.fr.design.gui.itable.SortableJTable; import com.fr.design.gui.itable.TableSorter; import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.i18n.DesignSizeI18nManager; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; @@ -44,7 +45,6 @@ import com.fr.function.TIME; import com.fr.general.FRFont; import com.fr.general.data.DataModel; import com.fr.log.FineLoggerFactory; -import com.fr.workspace.server.entity.connection.ConnectionBean; import com.fr.workspace.server.repository.connection.ConnectionRepository; import javax.swing.BorderFactory; @@ -53,8 +53,6 @@ import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.JPanel; -import javax.swing.JScrollBar; -import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.SwingWorker; @@ -258,7 +256,7 @@ public class PreviewTablePane extends BasicPane { public void doCancel() { } - }, BasicDialog.DEFAULT); + }, DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.data.datapane.preview.dialog")); dialog.setVisible(true); // 关闭预览页面 PreviewTablePane.this.dialog.setVisible(false); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java index 32959ef942..8b3d9464fe 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java @@ -127,8 +127,6 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter(new ParameterTableModel() { diff --git a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java index 87ca587f5f..c988f2a711 100644 --- a/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java +++ b/designer-base/src/main/java/com/fr/design/editlock/EditLockUtils.java @@ -1,13 +1,10 @@ package com.fr.design.editlock; -import com.fr.base.svg.IconUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.SVGLoader; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.general.IOUtils; -import com.fr.workspace.WorkContext; -import com.fr.workspace.server.lock.editlock.EditLockOperator; import com.fr.report.LockItem; import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.tabledata.TableDataRepository; @@ -30,7 +27,7 @@ public class EditLockUtils { /** * 数据连接锁定标志 */ - public static final Icon CONNECTION_LOCKED_ICON = IconUtils.readIcon("/com/fr/design/images/m_web/connection_locked"); + public static final Icon CONNECTION_LOCKED_ICON = new LazyIcon("connection_locked"); /** * 小锁图片 @@ -40,7 +37,7 @@ public class EditLockUtils { /** * 提示弹窗中的提示标志 */ - public static final Icon TOOLTIPS_ICON = IOUtils.readIcon("/com/fr/design/images/m_web/warningIcon.png"); + public static final Icon TOOLTIPS_ICON = new LazyIcon("warning"); /** * 数据连接锁定中 diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java index e6ffbadd66..250e32748d 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java @@ -1,5 +1,6 @@ package com.fr.design.editor.editor; +import com.fr.design.constants.LayoutConstants; import com.fr.design.data.DesignTableDataManager; import com.fr.data.SimpleDSColumn; import com.fr.design.data.datapane.TableDataComboBox; @@ -18,6 +19,7 @@ import java.util.regex.Pattern; 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.fix; /** * 选择数据列编辑器 @@ -54,7 +56,7 @@ public class ColumnSelectedEditor extends Editor implements Prep } }); columnNameComboBox = new UIComboBox(); - this.add(row(10, cell(tableDataComboBox), cell(columnNameComboBox)).getComponent()); + this.add(row(cell(tableDataComboBox).weight(1), fix(LayoutConstants.HGAP_LARGE),cell(columnNameComboBox).weight(1)).getComponent()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java index d8997a5556..caf4fc4893 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java @@ -28,6 +28,11 @@ public class CursorEditor extends Editor { return "type_cursor"; } + @Override + public String getIconId() { + return "type_cursor"; + } + @Override public boolean accept(Object object) { return object instanceof CursorEditor ; diff --git a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java index 1ac3f12ead..8bedd19c96 100644 --- a/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MultiTemplateTabPane.java @@ -33,6 +33,7 @@ import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.file.FILE; import com.fr.file.FileNodeFILE; import com.fr.general.ComparatorUtils; +import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.collections.combination.Pair; import com.fr.third.javax.annotation.Nonnull; @@ -357,6 +358,7 @@ public class MultiTemplateTabPane extends Row { public RightMenuCloseAction(CloseOption option, int tplIndex) { this.option = option; this.setName(option.optionName); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/blank.gif")); this.tplIndex = tplIndex; } diff --git a/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java index 7b69f306d5..7f26c4884c 100644 --- a/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/DefaultTinyFormulaPane.java @@ -56,6 +56,6 @@ public class DefaultTinyFormulaPane extends TinyFormulaPane{ } private Component createDefaultTinyFormulaPane() { - return row(cell(formulaTextField).weight(2), flex(0.1), cell(formulaTextFieldButton).weight(0.4)).getComponent(); + return row(cell(formulaTextField).weight(1), flex(0.1), cell(formulaTextFieldButton)).getComponent(); } } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index 1d4274bb99..0ce50448ed 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java @@ -6,12 +6,8 @@ import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.gui.ibutton.FitUIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.utils.ColorUtils; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.List; import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -185,23 +181,6 @@ public class FineTabbedPane extends Box { }); tabGroup.setSelectedIndex(0); cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem())); - if (!useFitTab) { - initTabListeners(); - } - } - - private void initTabListeners() { - List tabs = tabGroup.getLabelButtonList(); - for (UIToggleButton tab : tabs) { - tab.addMouseListener(new MouseAdapter() { - @Override - public void mouseEntered(MouseEvent e) { - if (tab.getPreferredSize().width > tab.getWidth()) { - tab.setToolTipText(tab.getText()); - } - } - }); - } } private void fireStateChanged() { diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java index eba2ce53bd..4916e33100 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UIBubbleFloatPane.java @@ -3,6 +3,7 @@ package com.fr.design.gui.frpane; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.SystemInfo; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.UIDialog; import com.fr.design.utils.AWTUtilities; import com.fr.log.FineLoggerFactory; @@ -32,6 +33,9 @@ import java.awt.Window; import java.awt.event.AWTEventListener; import java.awt.event.MouseEvent; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.cell; + /** * @author Jerry * 非模态悬浮对话框,气泡形状 @@ -226,8 +230,7 @@ public abstract class UIBubbleFloatPane extends BasicBeanPane { } this.setLayout(new BorderLayout()); - this.add(initTopOptionMenu(), BorderLayout.NORTH); - this.add(contentPane, BorderLayout.CENTER); + this.add(column(LayoutConstants.VGAP_MEDIUM, cell(initTopOptionMenu()), cell(contentPane)).getComponent()); } protected JPanel initTopOptionMenu() { diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index fd74f7d042..4e392da122 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -181,6 +181,7 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb } setBorder(new FineRoundBorder()); initLayout(getCols()); + initTabListeners(); } public UIButtonGroup(String[] textArray, T[] objects) { @@ -192,6 +193,19 @@ public class UIButtonGroup extends Column implements GlobalNameObserver, UIOb return UI_CLASS_ID; } + private void initTabListeners() { + for (UIToggleButton tab : labelButtonList) { + tab.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + if (tab.getPreferredSize().width > tab.getWidth()) { + tab.setToolTipText(tab.getText()); + } + } + }); + } + } + /** * 计算按钮组的列布局;支持自定义布局 * diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java index b10b1d91f8..7a9a41aef2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIColorButtonWithAuto.java @@ -2,7 +2,6 @@ package com.fr.design.gui.ibutton; import com.fine.theme.icon.LazyIcon; import com.fr.chart.base.ChartConstants; -import com.fr.design.constants.UIConstants; import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindowWithAuto; import com.fr.general.ComparatorUtils; @@ -17,7 +16,7 @@ public class UIColorButtonWithAuto extends UIColorButton { } if (!ComparatorUtils.equals(oldColor, ChartConstants.AUTO_FONT_COLOR) && ComparatorUtils.equals(newColor, ChartConstants.AUTO_FONT_COLOR)) { - setIcon(UIConstants.AUTO_FONT_ICON); + setIcon(new LazyIcon("autoForeground")); } super.checkColorChange(oldColor, newColor); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index 789bcd16cf..b8ea2bf0a9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -59,13 +59,14 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { backgroundColorPane = new ColorSelectBox(FineUIScale.scale(60)); foregroundColorPane.setSelectObject(DEFAULT_FOREGROUND); foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND); + UILabel foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT); + foregroundLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground")); + UILabel backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT); + backgroundLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")); + this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground"), UILabel.LEFT)).weight(1), - cell(foregroundColorPane).weight(4)), - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background"), UILabel.LEFT)).weight(1), - cell(backgroundColorPane).weight(4)) + row(cell(foregroundLabel).weight(1), cell(foregroundColorPane).weight(4)), + row(cell(backgroundLabel).weight(1), cell(backgroundColorPane).weight(4)) ).with(it -> it.setBorder(new ScaledEmptyBorder(LayoutConstants.VERTICAL_GAP, 0, 0, 0))).getComponent(), BorderLayout.CENTER); foregroundColorPane.addSelectChangeListener(colorChangeListener); backgroundColorPane.addSelectChangeListener(colorChangeListener); diff --git a/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg new file mode 100644 index 0000000000..a24a789d62 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg new file mode 100644 index 0000000000..3b8bfc5a6f --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/dataset/connection_locked_disable.svg @@ -0,0 +1,4 @@ + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/editor/type_cursor.svg b/designer-base/src/main/resources/com/fine/theme/icon/editor/type_cursor.svg new file mode 100644 index 0000000000..63e0d1fc98 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/editor/type_cursor.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg new file mode 100644 index 0000000000..11837397ff --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg new file mode 100644 index 0000000000..46c1bfedc0 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/autoForeground_disable.svg @@ -0,0 +1,7 @@ + + + + + + + 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 97a5bc70d7..45971eca90 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 @@ -43,6 +43,7 @@ "database_warning": "dataset/database_warning.svg", "preview": "dataset/preview.svg", "connection": "dataset/connection.svg", + "connection_locked": "dataset/connection_locked.svg", "class_table_data": "dataset/class_table_data.svg", "data_table": "dataset/data_table.svg", "multi": "dataset/multi.svg", @@ -170,6 +171,7 @@ "underline": "font/underline.svg", "foreground": "font/foreground.svg", "background": "font/background.svg", + "autoForeground": "font/autoForeground.svg", "h_left": "cellstyle/h_left.svg", "h_center": "cellstyle/h_center.svg", "h_right": "cellstyle/h_right.svg", @@ -384,6 +386,7 @@ "type_double_popup": "editor/type_double_popup.svg", "type_boolean": "editor/type_boolean.svg", "type_boolean_popup": "editor/type_boolean_popup.svg", + "type_cursor": "editor/type_cursor.svg", "date_popup": "editor/date_popup.svg", "param_popup": "editor/param_popup.svg", "cellelement_popup": "editor/cellelement_popup.svg", diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties index f35b30539f..f8f5b7f878 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties @@ -35,6 +35,8 @@ com.fr.design.mainframe.EastRegionContainerPane.minimum=340*400 com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=800*630 -com.fr.design.actions.printingSetting.dialog=800*600 +com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties index 31e4ae38e5..2ffcb1aa42 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=480*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties index 73b022f454..598b8f68d1 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=340*400 com.fr.design.ds.column.cellEditor.pane=900*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties index 1e30edaf4e..0663409e6d 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties @@ -35,5 +35,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=660*600 com.fr.design.actions.printingSetting.dialog=660*600 +com.fr.design.data.datapane.preview.dialog=660*600 + diff --git a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties index 842dde7fc3..e79bb892d1 100644 --- a/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties +++ b/designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties @@ -34,5 +34,7 @@ com.fr.design.mainframe.EastRegionContainerPane.standard=286*400 com.fr.design.ds.column.cellEditor.pane=700*600 com.fr.design.actions.reportWebAttr.dialog=700*630 com.fr.design.actions.printingSetting.dialog=700*600 +com.fr.design.data.datapane.preview.dialog=700*600 + 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 7f3324a2c3..ef4a4d788f 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,8 +457,9 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private class ChartChangeButton extends UIToggleButton { - private static final double DEL_WIDTH = 9; - private Icon closeIcon = new LazyIcon("closeTag", 8); + private final double DEL_WIDTH = scale(9); + private final double DOWN_HEIGHT = scale(1); + private final Icon closeIcon = new LazyIcon("closeTag", 8); private boolean isMoveOn = false; private String buttonName = ""; @@ -506,7 +507,8 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private void paintDeleteButton(Graphics g2d) { Rectangle2D bounds = this.getBounds(); int x = (int) (bounds.getWidth() - DEL_WIDTH); - closeIcon.paintIcon(this, g2d, scale(x), scale(1)); + int y = (int) DOWN_HEIGHT; + closeIcon.paintIcon(this, g2d, x, y); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java index c3dcf73909..9a41401b0b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java @@ -3,7 +3,6 @@ package com.fr.van.chart.custom; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; @@ -11,9 +10,7 @@ import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.CustomChartDataDefinition; -import com.fr.design.ChartTypeInterfaceManager; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.constants.LayoutConstants; import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.log.FineLoggerFactory; @@ -39,6 +36,9 @@ import java.util.HashMap; import java.util.LinkedHashMap; import java.util.Map; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + /** * Created by Mitisky on 16/2/16. */ @@ -88,22 +88,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane { private void initContent() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - autoPane = new JPanel(); - customSelectPane = new VanChartCustomPlotSelectPane(); - - Component[][] components = new Component[][]{ - new Component[]{new JSeparator()}, - new Component[]{customSelectPane} - }; - - double[] columnSize = {p, f}; - double[] rowSize = {p, p}; - customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - + customPane = column(LayoutConstants.VERTICAL_GAP, cell(new JSeparator()), cell(customSelectPane)).getComponent(); contentPane = new JPanel(new CardLayout()) { @Override public Dimension getPreferredSize() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java index 87605db336..0002b3aceb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLabelContentPane.java @@ -34,9 +34,7 @@ public class VanChartLabelContentPane extends VanChartTooltipContentPane { if (isInCondition() || !ChartEditContext.supportTheme()) { return super.createCommonStylePane(); } - // 颜色图标统一使用UIColorButton - setTextAttrPane(new ChartTextAttrPaneWithThemeStyle()); - + setTextAttrPane(new LabelAttrPaneWithThemeStyle()); JPanel stylePanel = new JPanel(new BorderLayout()); stylePanel.add(getTextAttrPane(), BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java index 77c7be9dd8..e559f5f42a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java @@ -84,10 +84,9 @@ public class AutoRefreshPane extends BasicBeanPane { initTooltipSet(); JPanel tipPane = getTooltipPane(); - - JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, - new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel); - + UILabel backgroundDetectionLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")); + backgroundDetectionLabel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")); + JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, backgroundDetectionLabel, moreLabel); Component[][] components = initComponent(tipPane); contentPane = new JPanel(new BorderLayout()); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java index d723fb422b..7c865bd052 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java @@ -69,7 +69,7 @@ public class VanChartCategoryStylePaneWithCheckBox extends JPanel { Point comPoint = settingButton.getLocationOnScreen(); Point arrowPoint = new Point(comPoint.x +settingButton.getWidth() - 25, comPoint.y + settingButton.getHeight()); Dimension size = settingPane.getPreferredSize(); - ClosableBubbleFloatPane pane = new ClosableBubbleFloatPane(Constants.LEFT, arrowPoint, settingPane, size.width, FineUIScale.scale(240)) { + ClosableBubbleFloatPane pane = new ClosableBubbleFloatPane(Constants.LEFT, arrowPoint, settingPane, size.width, FineUIScale.scale(260)) { @Override public void updateContentPane() { From 86c339f163f652bf05c9deb6e1642f8a5a039203 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 11 Sep 2024 10:42:15 +0800 Subject: [PATCH 03/10] =?UTF-8?q?REPORT-134200=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=BB=BA=E7=AB=8Bhsql=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=A9=B1=E5=8A=A8=E7=9A=84=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/preview/ConnectionInfoBeanHelper.java | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java index 26ae869fcd..33e085beb3 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/preview/ConnectionInfoBeanHelper.java @@ -157,7 +157,7 @@ public class ConnectionInfoBeanHelper { .user(jdbcConnection.getUser()) .driver(jdbcConnection.getDriver()) // 关键中的关键,由设计器发出的请求如果要携带密码,不能传明文,必须必须必须传加密后的密码 - .password(withPassword ? encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD) + .password(withPassword ? DataEncryptionHelper.encrypt(jdbcConnection.getPassword()) : DecisionServiceConstants.DEFAULT_PASSWORD) .schema(jdbcConnection.getSchema()) .url(jdbcConnection.getURL()) .creator(jdbcConnection.getCreator()) @@ -188,14 +188,6 @@ public class ConnectionInfoBeanHelper { .verifyCa(jdbcConnection.getSsl().getSslType() == SslType.NORMAL && ((NormalSsl) jdbcConnection.getSsl()).isVerifyCa()); } - private static String encrypt(String password) { - // 如果是空密码或者默认密码,就返回默认的星号回去 - if (StringUtils.isEmpty(password) || StringUtils.equals(password, DecisionServiceConstants.DEFAULT_PASSWORD)) { - return DecisionServiceConstants.DEFAULT_PASSWORD; - } - return TransmissionEncryptionManager.getInstance().getEncryption(WorkplaceConstants.getEncryptionMode()).encrypt(password, WorkplaceConstants.getEncryptionKey()); - } - private static Connection createJDBCConnection(ConnectionInfoBean connectionInfoBean) throws Exception { String name = connectionInfoBean.getConnectionName(); From ed60afc13f73925d3a2b82336952da90731e9f60 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 11 Sep 2024 10:44:42 +0800 Subject: [PATCH 04/10] =?UTF-8?q?REPORT-133424=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=89=93=E5=BC=80=E6=A8=A1=E6=9D=BFA?= =?UTF-8?q?=EF=BC=8C=E5=88=87=E6=8D=A2=E7=8E=AF=E5=A2=83=EF=BC=8C=E6=A8=A1?= =?UTF-8?q?=E6=9D=BFA=E7=9A=84=E9=94=81=E5=AE=9A=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E8=A7=A3=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/backup/EnvBackupHelper.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java b/designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java index bb9575ea19..73d0cbc1b1 100644 --- a/designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java +++ b/designer-base/src/main/java/com/fr/design/backup/EnvBackupHelper.java @@ -4,11 +4,13 @@ import com.fanruan.carina.Carina; import com.fanruan.config.realm.ConfigRepositoryFactory; import com.fanruan.config.realm.local.LocalConfigRepositoryBuilder; import com.fr.design.ConfigHelper; +import com.fr.design.env.RemoteWorkspace; import com.fr.design.mem.MemConfigBackupManager; import com.fr.design.mem.MemConfigRepositoryBuilder; import com.fr.log.FineLoggerFactory; import com.fr.workspace.WorkContext; import com.fr.workspace.Workspace; +import com.fr.workspace.server.repository.connect.FineWorkspaceHttpClient; import java.util.Properties; @@ -42,11 +44,13 @@ public class EnvBackupHelper { FineLoggerFactory.getLogger().info("[EnvBackup] 1.back start..."); this.swtiching = true; local = WorkContext.getCurrent().isLocal(); + origin = WorkContext.getCurrent(); if (local) { properties = ConfigHelper.getEnvProperties(); path = ConfigHelper.getEnvPropertiesPath(); + } else { + closeEnv(); } - origin = WorkContext.getCurrent(); } /** @@ -107,10 +111,30 @@ public class EnvBackupHelper { } else { // 如果是远程,则新环境的配置全部弃用,直接走老的 MemConfigBackupManager.getInstance().failed(); + rollbackEnv(); } } + /** + * 关闭环境 + */ + public void closeEnv() { + // 如果原来是远程,要先发请求告诉原来的环境我这边要断开 + if (origin instanceof RemoteWorkspace) { + origin.close(); + } + } + + /** + * 重新进入老环境 + */ + public void rollbackEnv() { + if (origin instanceof RemoteWorkspace && ((RemoteWorkspace) origin).getClient() instanceof FineWorkspaceHttpClient) { + ((FineWorkspaceHttpClient) ((RemoteWorkspace) origin).getClient()).startHeartBeat(); + } + } + public boolean isSwtiching() { return swtiching; } From f9161342b1dba8ab9a9a212e65d4a2848848e326 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 11 Sep 2024 11:37:16 +0800 Subject: [PATCH 05/10] =?UTF-8?q?REPORT-134249=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E6=A8=A1=E6=9D=BF=E6=95=B0=E6=8D=AE=E9=9B=86?= =?UTF-8?q?=E4=BC=9A=E8=A7=A6=E5=8F=91=E6=9D=83=E9=99=90=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 16d7a054b8..e280028646 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -1751,6 +1751,9 @@ public abstract class JTemplate> } private boolean checkJTemplateAuthority() { + if (WorkContext.getCurrent().isRoot()) { + return true; + } ConnectionAuthorityConfigBean bean = ConnectionRepository.getInstance().getConnectionAuthorityConfig(); if (!(bean !=null && bean.isConnectionEditAuth())) { return true; From 738e2330ce47508a5912eacf6ea6bd4fd05c3a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 11 Sep 2024 14:39:28 +0800 Subject: [PATCH 06/10] =?UTF-8?q?REPORT-134161=20&=20REPORT-134062=20REPOR?= =?UTF-8?q?T-133943=20fix:NewUI=20=E7=89=88=E6=9C=AC=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E9=9D=A2=E6=9D=BF=E3=80=81=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E6=9D=83=E9=99=90=E9=9D=A2=E6=9D=BF=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fine/theme/utils/FineLayoutBuilder.java | 15 ++++++-- .../DefaultTemplateTreeDefineProcessor.java | 29 ++++----------- .../fr/design/file/TemplateDirTreePane.java | 5 ++- .../CheckBoxTreeCellRenderer.java | 4 +-- .../pane/TemplateDirTreeSearchPane.java | 18 +++------- .../vcs/ui/EditFileVersionDialog.java | 36 ++++++++++++------- .../light/ui/laf/FineLightLaf.properties | 2 +- 7 files changed, 51 insertions(+), 58 deletions(-) diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java b/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java index b9144f31ef..7115b3afea 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java @@ -4,8 +4,8 @@ import com.fine.swing.ui.layout.Column; import com.fine.swing.ui.layout.Layouts; import com.fine.swing.ui.layout.Row; import com.fine.swing.ui.layout.Spacer; +import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; import com.fr.stable.collections.combination.Pair; @@ -75,7 +75,7 @@ public class FineLayoutBuilder { Row row = new Row(); List visibleComponents = Arrays.stream(componentArray) .filter(com -> com != null && com.isVisible()).collect(Collectors.toList()); - if (visibleComponents.size() >= 1) { + if (!visibleComponents.isEmpty()) { // 仅当存在可见组件时处理布局 dealWithVisibleComponents(weight, column, componentArray, row, visibleComponents); } @@ -87,6 +87,17 @@ public class FineLayoutBuilder { return new JPanel(); } + /** + * 典型的左右网格布局,竖向间距为典型间距,标签及组件比例采用典型比例 + * + * @param components 组件,两列多行 + * @return 面板 + */ + public static JPanel commonLeftRightLayout(Component[][] components) { + return compatibleTableLayout(LayoutConstants.VERTICAL_GAP, components, + new double[]{LayoutConstants.LEFT_WEIGHT, LayoutConstants.RIGHT_WEIGHT}); + } + private static void dealWithVisibleComponents(double[] weight, Column column, Component[] value, Row row, List components) { if (components.size() == 1 && value[0] != null) { // 仅存在首个元素,则该元素自适应占满整行 diff --git a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java index 728b915163..af018d032f 100644 --- a/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java +++ b/designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java @@ -1,8 +1,8 @@ package com.fr.design.file; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineComponentsFactory; import com.fine.theme.utils.FineUIScale; -import com.fine.theme.utils.FineUIStyle; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.file.DelFileAction; @@ -33,7 +33,6 @@ import com.fr.stable.StringUtils; import com.fr.stable.collections.CollectionUtils; import com.fr.stable.project.ProjectConstants; -import javax.swing.BorderFactory; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JPanel; @@ -42,15 +41,11 @@ import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Dimension; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.flex; -import static com.fine.swing.ui.layout.Layouts.row; import static javax.swing.JOptionPane.WARNING_MESSAGE; import static javax.swing.JOptionPane.YES_NO_OPTION; @@ -380,28 +375,16 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi // 确认按钮,默认就可用 confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); - FineUIStyle.setStyle(confirmButton, FineUIStyle.STYLE_PRIMARY); - confirmButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - confirmClose(); - } - }); + confirmButton.addActionListener(e -> confirmClose()); confirmButton.setEnabled(true); - // 取消按钮 UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); - cancelButton.addActionListener(new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - dispose(); - } - }); + cancelButton.addActionListener(e -> dispose()); - this.add(row(8, flex(), cell(confirmButton), cell(cancelButton)) - .with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 10))).getComponent(), BorderLayout.SOUTH); + JPanel buttonPane = FineComponentsFactory.createConfirmCancelButtonPane(confirmButton, cancelButton); + buttonPane.setBorder(new ScaledEmptyBorder(0, 10, 10, 10)); + this.add(buttonPane, BorderLayout.SOUTH); this.setSize(FineUIScale.scale(new Dimension(660, 600))); this.setTitle(Toolkit.i18nText("Fine-Design_Basic_Move")); diff --git a/designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java b/designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java index 08531b895c..1a9fec015c 100644 --- a/designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java +++ b/designer-base/src/main/java/com/fr/design/file/TemplateDirTreePane.java @@ -1,6 +1,7 @@ package com.fr.design.file; import com.fr.base.FRContext; +import com.fr.design.border.FineBorderFactory; import com.fr.design.gui.itree.filetree.TemplateDirTree; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.i18n.Toolkit; @@ -11,11 +12,9 @@ import com.fr.file.filetree.IOFileNodeFilter; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.tree.TreePath; import java.awt.BorderLayout; -import java.awt.Color; /** * 目录树面板 @@ -35,7 +34,7 @@ public class TemplateDirTreePane extends JPanel { public TemplateDirTreePane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createLineBorder(Color.gray)); + this.setBorder(FineBorderFactory.createWrappedRoundBorder()); templateDirTree = new TemplateDirTree(); remindPane = new TemplateDirSearchRemindPane(getTemplateDirTree()); diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java b/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java index 3a92b44692..d2592aaaa8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java @@ -17,7 +17,6 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTree; import javax.swing.border.Border; -import javax.swing.border.EmptyBorder; import javax.swing.tree.TreeCellRenderer; import javax.swing.tree.TreePath; import java.awt.BorderLayout; @@ -65,6 +64,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende add(_checkBox, BorderLayout.WEST); JPanel gapPanel = new JPanel(); gapPanel.setPreferredSize(FineUIScale.scale(new Dimension(4, 20))); + gapPanel.setOpaque(false); add(gapPanel, BorderLayout.CENTER); _actualTreeRenderer = renderer; } @@ -80,7 +80,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { _checkBox.setPreferredSize(FineUIScale.scale(new Dimension(PROTOTYPE.getPreferredSize().width, 0))); setComponentOrientation(tree.getComponentOrientation()); - + setOpaque(false); TreePath path = tree.getPathForRow(row); handleCheckBox(tree, path); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateDirTreeSearchPane.java b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateDirTreeSearchPane.java index 73d909ae81..11ab4a26ea 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateDirTreeSearchPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/manager/search/searcher/control/pane/TemplateDirTreeSearchPane.java @@ -1,8 +1,8 @@ package com.fr.design.mainframe.manager.search.searcher.control.pane; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.data.datapane.management.search.pane.FineSearchPane; import com.fr.design.file.TemplateDirTreePane; -import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.manager.search.TemplateDirTreeSearchManager; @@ -10,15 +10,10 @@ import com.fr.design.search.event.TreeSearchStatusChangeEvent; import com.fr.design.search.event.TreeSearchStatusChangeListener; import com.fr.stable.StringUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Insets; -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; @@ -29,11 +24,6 @@ import java.awt.event.MouseEvent; */ public class TemplateDirTreeSearchPane extends JPanel implements TreeSearchStatusChangeListener { - /** - * 搜索输入框 - */ - private UITextField searchTextField; - /** * 搜索面板 */ @@ -43,14 +33,14 @@ public class TemplateDirTreeSearchPane extends JPanel implements TreeSearchStatu @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { - TemplateDirTreeSearchManager.getInstance().startSearch(searchTextField.getText()); + TemplateDirTreeSearchManager.getInstance().startSearch(searchPane.getText()); } } }; public TemplateDirTreeSearchPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 15, 0, 10)); + this.setBorder(new ScaledEmptyBorder(10, 10, 0, 10)); initSearchPane(); add(searchPane, BorderLayout.CENTER); TemplateDirTreeSearchManager.getInstance().registerTreeSearchStatusChangeListener(this); @@ -94,7 +84,7 @@ public class TemplateDirTreeSearchPane extends JPanel implements TreeSearchStatu } private void dealWithTextChange() { - if (StringUtils.isEmpty(searchTextField.getText()) && TemplateDirTreeSearchManager.getInstance().isInSearchMode()) { + if (StringUtils.isEmpty(searchPane.getText()) && TemplateDirTreeSearchManager.getInstance().isInSearchMode()) { // 如果是搜索模式下,看作是用户删除输入框文字,仅复原TemplateTreePane TemplateDirTreeSearchManager.getInstance().restoreTreePane(); TemplateDirTreePane.getInstance().refreshDockingView(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java index 2224bb1aec..3b0022e2b4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/EditFileVersionDialog.java @@ -1,5 +1,11 @@ package com.fr.design.mainframe.vcs.ui; +import com.fine.swing.ui.layout.Column; +import com.fine.theme.utils.FineComponentsFactory; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; +import com.fr.design.border.FineBorderFactory; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; @@ -10,7 +16,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.log.FineLoggerFactory; import com.fr.report.entity.VcsEntity; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -19,7 +24,7 @@ import com.fr.workspace.server.vcs.VcsOperator; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.FlowLayout; +import java.awt.Dimension; import java.awt.Frame; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -47,7 +52,7 @@ public class EditFileVersionDialog extends UIDialog { initComponents(); setModal(true); setTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Vcs_Save_Version")); - setSize(300, 220); + setSize(FineUIScale.scale(new Dimension(300, 220))); setResizable(false); GUICoreUtils.centerWindow(this); @@ -55,15 +60,20 @@ public class EditFileVersionDialog extends UIDialog { private void initComponents() { + Column centerColumn = new Column(); + centerColumn.setSpacing(10); + add(centerColumn, BorderLayout.CENTER); + JPanel fontPane = new JPanel(new BorderLayout()); - UILabel fontLabel = new UILabel(" " + Toolkit.i18nText("Fine-Design_Vcs_Version_Message") + ":"); + + UILabel fontLabel = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Version_Message")); fontLabel.setToolTipText(Toolkit.i18nText("Fine-Design_Vcs_Version_Message")); fontPane.add(fontLabel, BorderLayout.NORTH); msgTestArea.setBorder(null); - UIScrollPane scrollPane = new UIScrollPane(msgTestArea); - - UILabel versionTip = new UILabel(" " + Toolkit.i18nText("Fine-Design_Vcs_Version_Number") + ":"); + JPanel scrollPane = FineLayoutBuilder.asBorderLayoutWrapped(new UIScrollPane(msgTestArea)); + scrollPane.setBorder(FineBorderFactory.createWrappedRoundBorder()); + UILabel versionTip = new UILabel(Toolkit.i18nText("Fine-Design_Vcs_Version_Number")); versionTip.setToolTipText(Toolkit.i18nText("Fine-Design_Vcs_Version_Number")); Component[][] components = new Component[][]{ new Component[]{versionTip, versionLabel}, @@ -72,16 +82,16 @@ public class EditFileVersionDialog extends UIDialog { double[] rowSizes = new double[]{25, 100}; double[] columnSizes = new double[]{70, 200}; - add(TableLayoutHelper.createTableLayoutPane(components, rowSizes, columnSizes), BorderLayout.CENTER); - - JPanel buttonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT)); - add(buttonPane, BorderLayout.SOUTH); + JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSizes, columnSizes); UIButton ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); UIButton cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Design_Action_Cancel")); + JPanel buttonPane = FineComponentsFactory.createConfirmCancelButtonPane(ok, cancel); + + centerColumn.add(pane); + centerColumn.add(buttonPane); + centerColumn.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); - buttonPane.add(ok); - buttonPane.add(cancel); ok.addActionListener(new ActionListener() { @Override diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index 5b3fbc9c06..aafdbdf666 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties @@ -1128,7 +1128,7 @@ Tree.selectionInactiveBackground = @selectionBackground Tree.selectionInactiveForeground = @selectionForeground Tree.textBackground = $Tree.background Tree.textForeground = $Tree.foreground -Tree.selectionBorderColor = @cellFocusColor +Tree.selectionBorderColor = #00000000 Tree.dropCellBackground = @dropCellBackground Tree.dropCellForeground = @dropCellForeground Tree.dropLineColor = @dropLineColor From ceeef6aed275bb73c397675571adf26aebff9021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Levy=2EXie-=E8=A7=A3=E5=AE=89=E6=A3=AE?= Date: Wed, 11 Sep 2024 14:39:54 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E6=97=A0jira=20=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E9=81=97=E7=95=99=E9=97=AE=E9=A2=98=E8=A7=A3?= =?UTF-8?q?=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VanChartBeautyPaneWithGradientBar.java | 14 ++++---------- .../designer/component/VanChartHtmlLabelPane.java | 5 +++-- .../style/label/VanChartGaugeLabelDetailPane.java | 5 ++--- .../label/VanChartPieCategoryLabelDetailPane.java | 12 ++---------- .../van/chart/gauge/VanChartGaugeBeautyPane.java | 15 ++++----------- .../van/chart/gauge/VanChartGaugeSeriesPane.java | 5 ++--- 6 files changed, 17 insertions(+), 39 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java index 9c811d04c0..cdfd92aea5 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPaneWithGradientBar.java @@ -1,11 +1,11 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chart.base.GradientStyle; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.plugin.chart.type.GradientType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -29,18 +29,12 @@ public class VanChartBeautyPaneWithGradientBar extends VanChartBeautyPane { private JPanel initGradientBarPane() { colorGradient = new FixedGradientBar(4, 140); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{null, colorGradient}, }; - gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - + gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components); + gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); return gradientBarPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java index 0c916ef4dd..90213ea924 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea; import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants; import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.plugin.chart.base.VanChartHtmlLabel; @@ -69,7 +70,7 @@ public class VanChartHtmlLabelPane extends JPanel { JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); - this.setLayout(new BorderLayout()); + this.setLayout(FRGUIPaneFactory.createScaledBorderLayout(0, 10)); this.add(contentPane, BorderLayout.NORTH); if (widthAndHeightPane != null) { this.add(widthAndHeightPane, BorderLayout.CENTER); @@ -150,7 +151,7 @@ public class VanChartHtmlLabelPane extends JPanel { new Component[]{isCustomWidth, customWidth}, new Component[]{isCustomHeight, customHeight}, }; - return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1, 1}); } private void checkWidth() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index cdaa4ec1a9..a50e25d351 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java @@ -22,7 +22,6 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -62,7 +61,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { initStyleListener(); - return FineLayoutBuilder.compatibleTableLayout(10, getLabelStyleComponents(plot),new double[]{1.2, 3}); + return FineLayoutBuilder.commonLeftRightLayout(getLabelStyleComponents(plot)); } protected void initStyleListener() { @@ -118,7 +117,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { - return TableLayout4VanChartHelper.createGapTableLayoutPane(title, panel); + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), panel); } protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java index 4c28c78b08..f6fc9b8b06 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieCategoryLabelDetailPane.java @@ -1,13 +1,11 @@ package com.fr.van.chart.designer.style.label; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.stable.Constants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.pie.style.VanChartPieCategoryLabelContentPane; @@ -40,18 +38,12 @@ public class VanChartPieCategoryLabelDetailPane extends VanChartPlotLabelDetailP UIButtonGroup position = new UIButtonGroup<>(positionName, positionValue); setPosition(position); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p}; - double[] col = {f, e}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), position}, }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.commonLeftRightLayout(components); } protected void checkPositionPane(String title) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java index 61a1fc5e31..7fa6b47e51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeBeautyPane.java @@ -1,15 +1,14 @@ package com.fr.van.chart.gauge; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.chart.base.ChartConstants; import com.fr.chart.base.GradientStyle; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.style.background.gradient.FixedGradientBar; import com.fr.plugin.chart.type.GradientType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -29,24 +28,18 @@ public class VanChartGaugeBeautyPane extends VanChartBeautyPane { public VanChartGaugeBeautyPane() { super(); this.add(initGradientBarPane(), BorderLayout.SOUTH); - this.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); initListener(); } private JPanel initGradientBarPane() { colorGradient = new FixedGradientBar(4, 140); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{null, colorGradient}, }; - gradientBarPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + gradientBarPane = FineLayoutBuilder.commonLeftRightLayout(components); + gradientBarPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); colorGradient.updateColor(ChartConstants.GRADIENT_END, ChartConstants.GRADIENT_START); return gradientBarPane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java index 60c8bc5c4b..2b3976647a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugeSeriesPane.java @@ -27,7 +27,6 @@ import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GradientType; import com.fr.stable.Constants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartFillStylePane; import com.fr.van.chart.designer.style.series.VanChartMultiColorSeriesPane; @@ -172,7 +171,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { } } - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, gaugeLayout); + JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), gaugeLayout); gaugeLayout.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -211,7 +210,7 @@ public class VanChartGaugeSeriesPane extends VanChartMultiColorSeriesPane { private JPanel createGaugeStylePane() { JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); - JPanel centerPanel = FineLayoutBuilder.compatibleTableLayout(10, getDiffComponentsWithGaugeStyle(), new double[]{1.2, 3}); + JPanel centerPanel = FineLayoutBuilder.commonLeftRightLayout(getDiffComponentsWithGaugeStyle()); panel.add(centerPanel, BorderLayout.CENTER); if (rotate != null) { JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, From 45274c9214b984b268d250006244fd73b02f364b Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 11 Sep 2024 15:27:33 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=8D=95=E6=B5=8B=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/DesignTableDataManagerTest.java | 6 +- .../template/info/TemplateInfoTestHelper.java | 24 ------ .../fr/design/menu/SnapChatMenuDefTest.java | 5 -- .../fr/design/os/impl/SupportOSImplTest.java | 16 +--- .../java/com/fr/design/ui/FineUIDemo.java | 2 +- .../src/test/java/com/fr/design/ui/Model.java | 34 +++++++++ .../com/fr/design/ui/ModernUIPaneTest.java | 75 ------------------- .../ui/report/TemplateWebSettingDemo.java | 4 +- 8 files changed, 42 insertions(+), 124 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/ui/Model.java delete mode 100644 designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java diff --git a/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java b/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java index 3b3f8cad8e..83edd79c16 100644 --- a/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java +++ b/designer-base/src/test/java/com/fr/design/data/DesignTableDataManagerTest.java @@ -51,9 +51,9 @@ public class DesignTableDataManagerTest { EasyMock.expect(TableDataConfig.getInstance()).andReturn(config).once().andReturn(config2).once(); PowerMock.mockStatic(TableDataFactory.class); - EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData(config)) + EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData()) .andReturn(new String[]{"firstData", "secondData"}).once(); - EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData(config2)) + EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData()) .andReturn(new String[]{"firstData", "secondData"}).once(); @@ -119,7 +119,7 @@ public class DesignTableDataManagerTest { EasyMock.expect(dataSource.getTableData("ds2")).andReturn(td2).anyTimes(); EasyMock.expect(TableDataConfig.getInstance()).andReturn(config).anyTimes(); PowerMock.mockStatic(TableDataFactory.class); - EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData(config)) + EasyMock.expect(TableDataFactory.getSortOfChineseNameOfServerData()) .andReturn(new String[]{"ds1", "ds2"}).anyTimes(); EasyMock.expect(TableDataFactory.getSortOfChineseNameOfTemplateData(dataSource)) .andReturn(new String[]{"ds1", "ds2"}); diff --git a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java index 8ba0278729..c812a0e971 100644 --- a/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java +++ b/designer-base/src/test/java/com/fr/design/mainframe/template/info/TemplateInfoTestHelper.java @@ -1,12 +1,7 @@ package com.fr.design.mainframe.template.info; -import com.fr.config.BBSAttr; -import com.fr.config.MarketConfig; -import com.fr.design.DesignerEnvManager; import com.fr.general.ComparatorUtils; import com.fr.json.JSONObject; -import org.easymock.EasyMock; -import org.powermock.api.easymock.PowerMock; import java.lang.reflect.Field; import java.lang.reflect.Modifier; @@ -31,23 +26,4 @@ class TemplateInfoTestHelper { field.set(null, newValue); } - static void setUpMockForNewInstance() throws Exception { - MarketConfig mockMarketConfig = EasyMock.mock(MarketConfig.class); - BBSAttr bbsAttr = EasyMock.mock(BBSAttr.class); - EasyMock.expect(bbsAttr.getBbsUid()).andReturn(71113).anyTimes(); - EasyMock.expect(mockMarketConfig.getBBSAttr()).andReturn(bbsAttr).anyTimes(); - - PowerMock.mockStatic(MarketConfig.class); - EasyMock.expect(MarketConfig.getInstance()).andReturn(mockMarketConfig).anyTimes(); - - PowerMock.mockStatic(DesignerEnvManager.class); - DesignerEnvManager envManager = EasyMock.mock( DesignerEnvManager.class); - EasyMock.expect(envManager.getUUID()).andReturn("6b6699ff-ec63-43b0-9deb-b580a5f10411").anyTimes(); - EasyMock.expect(envManager.isJoinProductImprove()).andReturn(true).anyTimes(); - EasyMock.expect(DesignerEnvManager.getEnvManager()).andReturn(envManager).anyTimes(); - EasyMock.replay(mockMarketConfig, bbsAttr, envManager); - - - PowerMock.replayAll(); - } } diff --git a/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java index 277e7101bc..81984c7304 100644 --- a/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java +++ b/designer-base/src/test/java/com/fr/design/menu/SnapChatMenuDefTest.java @@ -9,9 +9,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.notification.SnapChatAllTypes; import com.fr.design.notification.SnapChatConfig; import com.fr.stable.xml.XMLableReader; -import com.fr.store.StateHubManager; -import com.fr.store.impl.MemoryLock; -import com.fr.store.impl.MemoryStore; import com.fr.transaction.Configurations; import com.fr.transaction.LocalConfigurationHelper; import org.easymock.EasyMock; @@ -41,8 +38,6 @@ public class SnapChatMenuDefTest { DaoContext.setXmlEntityDao(new LocalXmlEntityDao()); DaoContext.setClassHelperDao(new LocalClassHelperDao()); DaoContext.setEntityDao(new LocalEntityDao()); - StateHubManager.setLock(new MemoryLock()); - StateHubManager.setStorage(new MemoryStore()); Configurations.setHelper(new LocalConfigurationHelper()); } diff --git a/designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java b/designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java index d49ab5e073..e78e7812e1 100644 --- a/designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java +++ b/designer-base/src/test/java/com/fr/design/os/impl/SupportOSImplTest.java @@ -1,16 +1,13 @@ package com.fr.design.os.impl; import com.fr.general.GeneralContext; -import com.fr.third.org.apache.commons.math3.analysis.function.Pow; import junit.framework.TestCase; import org.junit.Assert; import org.junit.Test; - -import java.util.Locale; - import org.junit.runner.RunWith; import org.powermock.modules.junit4.PowerMockRunner; -import org.powermock.reflect.Whitebox; + +import java.util.Locale; /** * @author hades @@ -27,13 +24,4 @@ public class SupportOSImplTest extends TestCase { Assert.assertFalse(SupportOSImpl.AUTOPUSHUPDATE.support()); } - @Test - public void testGetMacOsVersion() throws Exception { - String backUp = System.getProperty("os.version"); - System.setProperty("os.version", "10.16"); - int number = Whitebox.invokeMethod(SupportOSImpl.MACOS_WEB_PLUGIN_MANAGEMENT, "getMacOsVersion"); - Assert.assertEquals(16, number); - System.setProperty("os.version", backUp); - } - } \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java b/designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java index 23ac04a05c..e124b3eded 100644 --- a/designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java +++ b/designer-base/src/test/java/com/fr/design/ui/FineUIDemo.java @@ -20,7 +20,7 @@ public class FineUIDemo { // 是否需要开启调试窗口 DesignerEnvManager.getEnvManager().setOpenDebug(true); - final JxUIPane pane = new JxUIPane.Builder() + final JxUIPane pane = new JxUIPane.Builder() .withComponent(StartComponent.KEY).build(); contentPane.add(pane, BorderLayout.CENTER); frame.setVisible(true); diff --git a/designer-base/src/test/java/com/fr/design/ui/Model.java b/designer-base/src/test/java/com/fr/design/ui/Model.java new file mode 100644 index 0000000000..7ea42d830b --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/ui/Model.java @@ -0,0 +1,34 @@ +package com.fr.design.ui; + +/** + * 测试用 + * + * @author vito + * @since 11.0 + * Created on 2024/9/11 + */ +public class Model { + private String name; + private int age; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public void print(String message) { + System.out.println(message); + } + +} \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java b/designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java deleted file mode 100644 index 9676ee998a..0000000000 --- a/designer-base/src/test/java/com/fr/design/ui/ModernUIPaneTest.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.fr.design.ui; - -import com.fr.design.DesignerEnvManager; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * @author richie - * @version 10.0 - * Created by richie on 2019-03-05 - */ -public class ModernUIPaneTest { - - public static void main(String... args) { - final JFrame frame = new JFrame(); - frame.setSize(1200, 800); - JPanel contentPane = (JPanel) frame.getContentPane(); - // 是否需要开启调试窗口 - DesignerEnvManager.getEnvManager().setOpenDebug(true); - final ModernUIPane pane = new ModernUIPane.Builder() - .withEMB("/com/fr/design/ui/demo.html").namespace("Pool").build(); - contentPane.add(pane, BorderLayout.CENTER); - - Model model = new Model(); - model.setAge(20); - model.setName("Pick"); - pane.populate(model); - - JPanel panel = new JPanel(new FlowLayout()); - contentPane.add(panel, BorderLayout.SOUTH); - JButton button = new JButton("点击我可以看到Swing的弹框,输出填写的信息"); - panel.add(button); - button.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - Model returnValue = pane.update(); - if (returnValue != null) { - JOptionPane.showMessageDialog(frame, String.format("姓名为:%s,年龄为:%d", returnValue.getName(), returnValue.getAge())); - } - } - }); - frame.setVisible(true); - frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - } - - public static class Model { - private String name; - private int age; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - - public void print(String message) { - System.out.println(message); - } - - } - -} \ No newline at end of file diff --git a/designer-base/src/test/java/com/fr/design/ui/report/TemplateWebSettingDemo.java b/designer-base/src/test/java/com/fr/design/ui/report/TemplateWebSettingDemo.java index d1067c4e79..6a77c98f77 100644 --- a/designer-base/src/test/java/com/fr/design/ui/report/TemplateWebSettingDemo.java +++ b/designer-base/src/test/java/com/fr/design/ui/report/TemplateWebSettingDemo.java @@ -2,7 +2,7 @@ package com.fr.design.ui.report; import com.fr.design.DesignerEnvManager; import com.fr.design.jxbrowser.JxUIPane; -import com.fr.design.ui.ModernUIPaneTest; +import com.fr.design.ui.Model; import javax.swing.JFrame; import javax.swing.JPanel; @@ -21,7 +21,7 @@ public class TemplateWebSettingDemo { // 是否需要开启调试窗口 DesignerEnvManager.getEnvManager().setOpenDebug(true); - final JxUIPane pane = new JxUIPane.Builder() + final JxUIPane pane = new JxUIPane.Builder() .withComponent(TemplateWebSettingComponent.KEY).build(); contentPane.add(pane, BorderLayout.CENTER); frame.setVisible(true); From 5a16283f671e5f013d17fba9fb68462ce8a314b7 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 11 Sep 2024 16:35:05 +0800 Subject: [PATCH 09/10] =?UTF-8?q?REPORT-134268=20=E3=80=90FBP=E3=80=91?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E6=9C=AC=E5=9C=B0=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=9E=E6=8E=A5=E6=88=90=E5=8A=9F=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=97=B6=E8=BF=9E=E6=8E=A5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/server/GlobalTableDataAction.java | 3 --- .../data/datapane/connect/LocalConnectionSource.java | 10 ---------- .../data/datapane/preview/TableDataBeanHelper.java | 3 --- 3 files changed, 16 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java index 71487b5649..34daece1dd 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/GlobalTableDataAction.java @@ -87,14 +87,11 @@ public class GlobalTableDataAction extends UpdateAction implements ResponseDataS final Map connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map tableDataMap = new HashMap<>(); try { - TransmissionEncryptionManager.setTransEncryptionLevel(1); for (ServerDataSetBean bean : beans) { tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); } } catch (Exception e) { throw new RuntimeException(e); - } finally { - TransmissionEncryptionManager.removeTransEncryptionLevel(); } final TableDataManagerPane globalTableDataPane = new TableDataManagerPane() { diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java index 1aaa2fb46a..cf3066f9eb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/LocalConnectionSource.java @@ -52,26 +52,19 @@ public class LocalConnectionSource extends BaseConnectionSource { @Override public String[] testConnection(ConnectionInfoBean database) throws Exception { try { - // 暂时这么处理,后续最好拉到外层包装一下 - TransmissionEncryptionManager.setTransEncryptionLevel(1); return ConnectionProcessorFactory.testConnectionWithSchemaReturn(database); } catch (DriverNotFoundException e) { throw new DriverUnExistException(); - } finally { - TransmissionEncryptionManager.removeTransEncryptionLevel(); } } @Override public void add(ConnectionInfoBean bean) throws Exception { try { - TransmissionEncryptionManager.setTransEncryptionLevel(1); Connection connection = ConnectionProcessorFactory.createConnection(bean); validate(bean.getConnectionName(), connection); ConnectionProcessorFactory.addConnection(bean); } catch (DriverNotFoundException e) { throw new DriverUnExistException(); - } finally { - TransmissionEncryptionManager.removeTransEncryptionLevel(); } } @@ -84,14 +77,11 @@ public class LocalConnectionSource extends BaseConnectionSource { @Override public void update(ConnectionInfoBean bean) throws Exception { try { - TransmissionEncryptionManager.setTransEncryptionLevel(1); Connection connection = ConnectionProcessorFactory.createConnection(bean); validate(bean.getConnectionName(), connection); ConnectionProcessorFactory.updateConnection(bean.getConnectionName(), bean); } catch (DriverNotFoundException e) { throw new DriverUnExistException(); - } finally { - TransmissionEncryptionManager.removeTransEncryptionLevel(); } } 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 68f2584153..ad3f9ad14e 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 @@ -52,14 +52,11 @@ public class TableDataBeanHelper { final Map connectionMap = ConnectionInfoBeanHelper.createConnectionMap(ConnectionRepository.getInstance().getAll()); final Map tableDataMap = new HashMap<>(); try { - TransmissionEncryptionManager.setTransEncryptionLevel(1); for (ServerDataSetBean bean : beans) { tableDataMap.put(bean.getDatasetName() , TableDataBeanHelper.getTableDataSet(connectionMap, bean.getDatasetType(), bean.getDatasetData())); } } catch (Exception e) { throw new RuntimeException(e); - } finally { - TransmissionEncryptionManager.removeTransEncryptionLevel(); } return tableDataMap; } From 8e51c3860b43d979bd0bc0b8040d322cd76a6e40 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Wed, 11 Sep 2024 17:07:46 +0800 Subject: [PATCH 10/10] =?UTF-8?q?REPORT-134376=20=E3=80=90fr-fbp=E5=9B=9E?= =?UTF-8?q?=E5=BD=92=E3=80=91=E5=81=B6=E7=8E=B0=E4=BF=9D=E5=AD=98=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=EF=BC=8C=E6=8F=90=E7=A4=BA=E6=A8=A1=E6=9D=BF=E9=94=81?= =?UTF-8?q?=E5=AE=9A=E4=BF=A1=E6=81=AF=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fanruan/boot/env/function/DesignComponent.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java index 8a31974196..06fe5526a2 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignComponent.java @@ -60,6 +60,7 @@ import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; import com.fr.design.javascript.ProcessTransitionAdapter; +import com.fr.design.lock.TemplateLockInfoReSave; import com.fr.design.login.DesignerLoginType; import com.fr.design.login.guide.DesignerGuideHelper; import com.fr.design.login.message.DesignerMessageHelper; @@ -221,6 +222,7 @@ public class DesignComponent { DesignerWorkspaceLoader.init(); storePassport(); AlphaFineHelper.switchConfig4Locale(); + TemplateLockInfoReSave.startListener(); RPCConnectHandlerCenter.startListener(); RecoverManager.register(new RecoverForDesigner()); } @@ -534,6 +536,7 @@ public class DesignComponent { public void stop() { unloadLogAppender(); DesignerSocketIO.close(); + TemplateLockInfoReSave.stopListener(); } /**