From bc25bd66363228efc6ef067aa3a83071870ee5a0 Mon Sep 17 00:00:00 2001 From: renekton Date: Mon, 21 Oct 2024 17:51:11 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E5=8F=8C=E5=87=BB=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/write/submit/DBManipulationPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java index 1751fa98f4..562de89f43 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/DBManipulationPane.java @@ -754,7 +754,7 @@ public class DBManipulationPane extends BasicBeanPane { return super.stopCellEditing(); } }); - ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(1); + ((DefaultCellEditor) column1.getCellEditor()).setClickCountToStart(2); //设置Column 2的Editor column2.setCellEditor(new ColumnValueEditor()); @@ -963,12 +963,12 @@ public class DBManipulationPane extends BasicBeanPane { } /* - * 单击以编辑 + * 双击以编辑 */ @Override public boolean isCellEditable(EventObject anEvent) { if (anEvent instanceof MouseEvent) { - return ((MouseEvent) anEvent).getClickCount() >= 1; + return ((MouseEvent) anEvent).getClickCount() >= 2; } return true; } From 4f0a939a287eaf3220638f1944852d2ef3597d03 Mon Sep 17 00:00:00 2001 From: renekton Date: Mon, 21 Oct 2024 17:52:15 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E8=A7=86=E8=A7=89=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E9=83=A8=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/CenterRegionContainerPane.java | 2 +- .../com/fr/design/roleAuthority/ReportAndFSManagePane.java | 2 +- .../src/main/resources/com/fine/theme/icon/formExport.svg | 6 ++++++ .../src/main/resources/com/fine/theme/icon/saveFile.svg | 2 +- .../main/resources/com/fine/theme/icon/saveFile_disable.svg | 2 +- .../resources/com/fine/theme/light/ui/fine_light.icon.json | 1 + .../fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 2 +- .../fr/design/mainframe/chart/gui/type/ChartImagePane.java | 3 ++- .../design/actions/file/newReport/NewPolyReportAction.java | 3 ++- 9 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/resources/com/fine/theme/icon/formExport.svg diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index e59628cd15..77e72f27b3 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -113,7 +113,7 @@ public class CenterRegionContainerPane extends JPanel { combineUp = new UIToolbar(FlowLayout.LEFT); setStyle(combineUp, TOP_TOOLS); combineUp.setBorder(new ScaledEmptyBorder(10, 8, 10, 10)); - combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, scale(5), 0)); + combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, scale(10), 0)); setUpUpToolBar(null); } diff --git a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java index dd3c86c720..a87d6977bc 100644 --- a/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java +++ b/designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java @@ -109,7 +109,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo cell(scrollPane).weight(1) ).getComponent()); this.add(jPanel, BorderLayout.CENTER); - jPanel.setBorder(new ScaledEmptyBorder(0, 4, 4, 4)); + jPanel.setBorder(new ScaledEmptyBorder(0, 12, 4, 4)); registerDSChangeListener(); } diff --git a/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg b/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg new file mode 100644 index 0000000000..ffb6e34f7c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/formExport.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg b/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg index 6da83ea77d..afc98ac260 100644 --- a/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/saveFile.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg index cdc9c4b08d..7e033c84fa 100644 --- a/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/saveFile_disable.svg @@ -1,3 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 475c24d733..4cfeeb7521 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -7,6 +7,7 @@ "cut": "cut.svg", "save": "save.svg", "saveFile": "saveFile.svg", + "formExport": "formExport.svg", "copy": "copy.svg", "formatBrush": "formatBrush.svg", "paste": "paste.svg", diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index ef4a4d788f..1ebc487fc4 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,7 +457,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen private class ChartChangeButton extends UIToggleButton { - private final double DEL_WIDTH = scale(9); + private final double DEL_WIDTH = scale(10); private final double DOWN_HEIGHT = scale(1); private final Icon closeIcon = new LazyIcon("closeTag", 8); private boolean isMoveOn = false; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java index 5bbea51697..da3ee30b88 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java @@ -48,7 +48,8 @@ public class ChartImagePane extends ChartSelectDemoPane { super.paint(g); BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath); - g.drawImage(image1, 0, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null); + int x = (this.getWidth() - IMAGE_HIGTH) / 2; + g.drawImage(image1, x, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null); } }; diff --git a/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java b/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java index 95115cd04b..9524ed9a65 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/file/newReport/NewPolyReportAction.java @@ -6,6 +6,7 @@ import java.awt.event.KeyEvent; import javax.swing.KeyStroke; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.IconUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.mainframe.DesignerContext; @@ -19,7 +20,7 @@ public class NewPolyReportAction extends UpdateAction { public NewPolyReportAction() { this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_New_Multi_Report")); this.setMnemonic('F'); - this.setSmallIcon("/com/fr/design/images/m_file/formExport"); + this.setSmallIcon(new LazyIcon("formExport")); this.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_M, DEFAULT_MODIFIER)); } From 2cd5514923ff976c1b72e5776f8a66670e0b9f78 Mon Sep 17 00:00:00 2001 From: lemon Date: Mon, 21 Oct 2024 15:27:10 +0800 Subject: [PATCH 03/10] =?UTF-8?q?REPORT-137646=20&=20REPORT-137829=20fix?= =?UTF-8?q?=EF=BC=9A=E5=88=A0=E9=99=A4=E2=80=9C=E6=B2=A1=E6=9C=89=E8=83=8C?= =?UTF-8?q?=E6=99=AF=E2=80=9D=20&=20=E7=A7=BB=E5=8A=A8=E7=AB=AF=E5=BC=B9?= =?UTF-8?q?=E7=AA=97=E5=B8=83=E5=B1=80=E8=B0=83=E6=95=B4=EF=BC=8Csplit=20p?= =?UTF-8?q?anel=20=E8=AE=BE=E7=BD=AE=E6=8B=96=E6=8B=BD=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/DBTableDataPane.java | 8 ++-- .../design/gui/controlpane/JControlPane.java | 39 ++++++++++++++++- .../design/gui/controlpane/UIControlPane.java | 2 +- .../popup/MobilePopupRegularPane.java | 4 +- .../hyperlink/popup/StyleSettingPane.java | 14 +++--- .../background/impl/NullBackgroundPane.java | 40 ------------------ .../light/ui/laf/FineLightLaf.properties | 2 + .../images/background/null_background.png | Bin 349 -> 0 bytes 8 files changed, 52 insertions(+), 57 deletions(-) delete mode 100644 designer-chart/src/main/resources/com/fr/design/images/background/null_background.png diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index dbe45885cc..937e4ec62c 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -3,6 +3,7 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; +import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.Parameter; import com.fr.base.ParameterHelper; @@ -272,11 +273,8 @@ public class DBTableDataPane extends AbstractTableDataPane implemen JPanel sqlSplitPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(4, 4)); sqlSplitPane.add(box, BorderLayout.CENTER); - - box.setMinimumSize(FineUIScale.scale(new Dimension(300, 400))); - - this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(230, 400))); - this.connectionTableProcedurePane.setMaximumSize(FineUIScale.scale(new Dimension(500, 400))); + int leftComponentMin = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.minimumSize", 120); + this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(leftComponentMin, 400))); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.connectionTableProcedurePane, sqlSplitPane); mainSplitPane.setOneTouchExpandable(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index b957a1370d..c0da6e502f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -1,6 +1,7 @@ package com.fr.design.gui.controlpane; import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.border.FineBorderFactory; @@ -21,7 +22,9 @@ import javax.swing.JSplitPane; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; +import java.awt.Dimension; import java.util.Arrays; +import java.util.Objects; import java.util.stream.Stream; /** @@ -47,6 +50,11 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S protected JPanel cardPane; protected AbstractShortCutFactory shortCutFactory; + protected JSplitPane mainSplitPane; + // split pane 左边组件最小宽度 + protected int leftComponentMin; + // split pane 左边组件最大宽度 + protected int leftComponentMax; JControlPane() { this.initShortCutFactory(); @@ -110,7 +118,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S this.creators = this.createNameableCreators(); initCardPane(); // SplitPane - JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); + JPanel leftComponentPane = getLeftPane(); + leftComponentMin = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.minimumSize", 120); + leftComponentPane.setMinimumSize(FineUIScale.createScaleDimension(leftComponentMin, 0)); + mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftComponentPane, cardPane); mainSplitPane.setOneTouchExpandable(true); this.add(mainSplitPane, BorderLayout.CENTER); @@ -123,11 +134,12 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S } protected void initCardPane() { + leftComponentMax = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.maximumSize", 240); this.controlUpdatePane = createControlUpdatePane(); // p: edit card layout this.cardLayout = new CardLayout(); - cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); + initCardPaneWithMinSize(); cardPane.setLayout(this.cardLayout); // p:选择的Label UILabel selectLabel = new UILabel(); @@ -135,6 +147,29 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S cardPane.add(controlUpdatePane, EDIT); } + /** + * 初始化一个 rightComponent,且指定 minimumSize + * + * {@link javax.swing.plaf.basic.BasicSplitPaneDivider#DragController} 拖拽的时候会调用 getMinimumSize 方法 + * split pane driver 拖拽范围取自 leftComponent 的 minimumSize 和 rightComponent 的 minimumSize + */ + private void initCardPaneWithMinSize() { + cardPane = new JPanel(new CardLayout()) { + @Override + public Dimension getMinimumSize() { + Dimension size = super.getMinimumSize(); + if (mainSplitPane == null) { + return size; + } + Dimension parentSize = mainSplitPane.getSize(); + if (parentSize.width != 0 && Objects.equals(JSplitPane.HORIZONTAL_SPLIT, mainSplitPane.getOrientation())) { + size.width = parentSize.width - FineUIScale.scale(leftComponentMax); + } + return size; + } + }; + } + public void showEditPane() { this.cardLayout.show(cardPane, EDIT); } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 814e52848b..551c05a0bf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -91,7 +91,7 @@ public abstract class UIControlPane extends JControlPane { rightPaneWrapper.add(cardPane, BorderLayout.CENTER); rightPaneWrapper.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); // SplitPane - JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper); + mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper); mainSplitPane.setOneTouchExpandable(true); this.add(mainSplitPane, BorderLayout.CENTER); mainSplitPane.setDividerLocation(getLeftPreferredSize()); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java index 7978159c1c..293d2893e6 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupRegularPane.java @@ -45,7 +45,7 @@ public class MobilePopupRegularPane extends BasicPane { spinnerGroupPane = this.createSpinnerPane(); this.add(column(LayoutConstants.VERTICAL_GAP, cell(this.createRadioButtonGroupPane()), - row(flex(1), cell(spinnerGroupPane).weight(3)) + row(flex(1.5), cell(spinnerGroupPane).weight(3)) ).getComponent()); } @@ -62,7 +62,7 @@ public class MobilePopupRegularPane extends BasicPane { radioButtons.add(autoRadio); radiosPane.add(row(30, cell(customRadio), cell(autoRadio), flex()).getComponent()); - return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1), cell(radiosPane).weight(3)).getComponent(); + return row(cell(new UILabel(this.label, FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(radiosPane).weight(3)).getComponent(); } private ActionListener radioActionListener = new ActionListener() { diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java index 701594bf12..3cd58ca51d 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/StyleSettingPane.java @@ -83,9 +83,9 @@ public class StyleSettingPane extends BasicBeanPane { UILabel borderLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Border")); borderPane.add(column(LayoutConstants.VERTICAL_GAP, - row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderType).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderColor).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(borderRadiusSpinner).weight(2), flex(3)) + row(cell(borderLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Line"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderType).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderColor).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Radius"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(borderRadiusSpinner).weight(2), flex(2.5)) ).getComponent()); return borderPane; } @@ -102,8 +102,8 @@ public class StyleSettingPane extends BasicBeanPane { JLabel bgLabel = new JLabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Background")); bgPane.add(column(LayoutConstants.VERTICAL_GAP, - row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(bgColor).weight(2), flex(3)), - row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1), cell(transparencyPane).weight(3), flex(2)) + row(cell(bgLabel).weight(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Colors"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(bgColor).weight(2), flex(2.5)), + row(flex(1), cell(new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Opacity"), FineUIStyle.LABEL_SECONDARY)).weight(1.5), cell(transparencyPane).weight(3), flex(1.5)) ).getComponent()); return bgPane; } @@ -117,9 +117,9 @@ public class StyleSettingPane extends BasicBeanPane { sizePane.add(column(LayoutConstants.VERTICAL_GAP, row( column(LayoutConstants.VERTICAL_GAP, cell(sizeLabel), flex()).weight(1), - cell(mobileRegularPane).weight(4), flex(2) + cell(mobileRegularPane).weight(4.5), flex(1.5) ), - row(flex(1), cell(padRegularPane).weight(4), flex(2)) + row(flex(1), cell(padRegularPane).weight(4.5), flex(1.5)) ).getComponent()); return sizePane; } diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java index 976744e3b3..9f7ef617e3 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java @@ -1,20 +1,15 @@ package com.fr.design.style.background.impl; -import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.BackgroundDetailPane; import com.fr.general.Background; -import com.fr.general.locale.image.I18nImage; import javax.swing.*; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.Graphics; -import java.awt.Image; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; @@ -25,23 +20,14 @@ import static com.fine.swing.ui.layout.Layouts.flex; */ public class NullBackgroundPane extends BackgroundDetailPane { - private static final String NULL_BACKGROUND = "/com/fr/design/images/background/null_background.png"; - private static final Image DEFAULT_NULL_BACKGROUND_IMAGE; - - static { - DEFAULT_NULL_BACKGROUND_IMAGE = I18nImage.getImage(NULL_BACKGROUND); - } - public NullBackgroundPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); UILabel centerLabel = new UILabel( com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null")); - ImagePanel imagePane = new ImagePanel(); JPanel pane = column( 10, flex(), - cell(imagePane), cell(centerLabel), flex() ).getComponent(); @@ -60,30 +46,4 @@ public class NullBackgroundPane extends BackgroundDetailPane { public void addChangeListener(ChangeListener changeListener) { // do nothing. } - - /** - * 水平居中绘制 Image - */ - public class ImagePanel extends JPanel { - - public ImagePanel() { - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - if (DEFAULT_NULL_BACKGROUND_IMAGE != null) { - int x = (this.getWidth() - DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null)) / 2; - g.drawImage(DEFAULT_NULL_BACKGROUND_IMAGE, x, 0, this); - } - } - - @Override - public Dimension getPreferredSize() { - if (DEFAULT_NULL_BACKGROUND_IMAGE == null) { - return super.getPreferredSize(); - } - return FineUIScale.scale(new Dimension(DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null), DEFAULT_NULL_BACKGROUND_IMAGE.getHeight(null))); - } - } } diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index 0adc8cf686..aab414e72f 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 @@ -794,6 +794,8 @@ FormulaPane.buttonHeight=$Component.defaultHeight SplitPane.dividerSize = 5 SplitPane.continuousLayout = true SplitPane.border = null +SplitPane.leftComponent.minimumSize = 120 +SplitPane.leftComponent.maximumSize = 240 # \u5F71\u54CD\u89C6\u89C9\u6548\u679C\uFF0C\u4E34\u65F6\u5148\u5173\u6389 SplitPane.supportsOneTouchButtons = false SplitPane.centerOneTouchButtons = true diff --git a/designer-chart/src/main/resources/com/fr/design/images/background/null_background.png b/designer-chart/src/main/resources/com/fr/design/images/background/null_background.png deleted file mode 100644 index 617860181278c14cbd9bd9d114956b1a715a5733..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^DIm``W z$lZxy-8q?;Kn_c~qpu?a!^VE@KZ&eB{wGft$B+ufw-*f=859H<7GAIO`*wbjX`#w BVQ&Bc From 2906309b90f43dde42c7395d6ff0e1ef0d1dab6b Mon Sep 17 00:00:00 2001 From: Anner Date: Mon, 21 Oct 2024 12:01:15 +0800 Subject: [PATCH 04/10] =?UTF-8?q?REPORT-130954=20fix:=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=90=AF=E5=8A=A8=E5=B1=8F=E8=94=BD=E4=B8=8D=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adaptation/DesignServerSupportModule.java | 62 +++++++++++++++++++ .../adaptation/ReportAdaptationComponent.java | 5 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java new file mode 100644 index 0000000000..df486b1d72 --- /dev/null +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java @@ -0,0 +1,62 @@ +package com.fanruan.boot.adaptation; + +import com.fanruan.portal.module.PortalModuleManager; +import com.fr.third.guava.collect.Sets; + +import java.util.Optional; +import java.util.Set; + +import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID; +import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID; +import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID; +import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID; +import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID; + +/** + * 内置服务器支持展示的模块,预期调用顺序在业务模块之后 + * + * @author Anner + * @since 11.0 + * Created on 2024/10/15 + */ +public class DesignServerSupportModule { + private final static Set SUPPORT_MODULE = Sets.newHashSet( + // 系统管理 + PORTAL_MANAGEMENT_ID, + // 企业设置 + ENTERPRISE_ID, + // 企业设置 - 通用设置 + ENTERPRISE_GENERAL_ID, + // 安全管理 + SECURITY_ID, + // 地图管理 + MAP_ID + ); + + /** + * 注册一下支持展示的模块 + * + * @param moduleName name + */ + public static void register(String moduleName) { + Optional.of(moduleName).ifPresent(SUPPORT_MODULE::add); + } + + /** + * 取消注册展示的模块 + * + * @param moduleName name + */ + public static void unregister(String moduleName) { + Optional.of(moduleName).ifPresent(SUPPORT_MODULE::remove); + } + + /** + * 启动入口,重建一下展示的module + */ + public static void rebuild() { + PortalModuleManager.allModules().keySet().stream() + .filter(m -> !SUPPORT_MODULE.contains(m)) + .forEach(PortalModuleManager::unregister); + } +} diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java index d09e3db108..7a1a90af3d 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/ReportAdaptationComponent.java @@ -1,6 +1,7 @@ package com.fanruan.boot.adaptation; import com.fanruan.carina.Carina; +import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; import com.fanruan.plugins.resource.PluginResourceHelper; @@ -57,8 +58,8 @@ import java.util.TreeSet; * Created on 2024/6/24 */ @FineComponent(name = "fine_report_adaptation") +@DependsOn(dependencies = {"fine_report"}) public class ReportAdaptationComponent { - /** * 启动 */ @@ -74,6 +75,8 @@ public class ReportAdaptationComponent { // 插件controller注册 PluginControllerManager.getInstance().init(); + // 过滤掉内置服务器不支持的模块 + DesignServerSupportModule.rebuild(); } private void listenEmbedServletFilter(ServletContext servletContext) { From b6f380c068fde84d97961c7bdfa98cd54de1004f Mon Sep 17 00:00:00 2001 From: Anner Date: Mon, 21 Oct 2024 19:04:53 +0800 Subject: [PATCH 05/10] =?UTF-8?q?REPORT-138114=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=AE=BE=E7=BD=AE=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20&=20=E8=A7=84=E9=81=BF=E6=9C=8D=E5=8A=A1=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E7=9A=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adaptation/DesignServerSupportModule.java | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java index df486b1d72..e1bffecddd 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java @@ -1,16 +1,32 @@ package com.fanruan.boot.adaptation; +import com.fanruan.carina.Carina; +import com.fanruan.carina.context.ContextListener; import com.fanruan.portal.module.PortalModuleManager; import com.fr.third.guava.collect.Sets; import java.util.Optional; import java.util.Set; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_DEPARTMENT_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ADD_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_DELETE_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_DEP_ROLE_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_EDIT_INFO_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_EDIT_RESET_PASSWORD_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_FORBIDDEN_ID; +import static com.fanruan.auth.authority.AuthAuthorityItems.USER_ID; +import static com.fanruan.messenger.ums.authority.UMSAuthorityItems.PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_GENERAL_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.ENTERPRISE_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.MAP_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.PORTAL_MANAGEMENT_ID; import static com.fanruan.portal.authority.PortalAuthorityItems.SECURITY_ID; +import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_BASE_SETTINGS_ID; +import static com.fr.decision.authority.base.constant.ReportAuthorityItems.ENTERPRISE_REPORT_ID; /** * 内置服务器支持展示的模块,预期调用顺序在业务模块之后 @@ -23,10 +39,28 @@ public class DesignServerSupportModule { private final static Set SUPPORT_MODULE = Sets.newHashSet( // 系统管理 PORTAL_MANAGEMENT_ID, + // 用户管理 + USER_ID, + USER_ADD_ROLE_ID, + USER_ADD_DEPARTMENT_ID, + USER_ADD_ID, + USER_EDIT_ID, + USER_EDIT_RESET_PASSWORD_ID, + USER_EDIT_EDIT_INFO_ID, + USER_EDIT_DEP_ROLE_ID, + USER_DELETE_ID, + USER_DELETE_ROLE_ID, + USER_FORBIDDEN_ID, // 企业设置 ENTERPRISE_ID, + // 企业设置 - 通知中心 + PORTAL_MANAGEMENT_ENTERPRISE_UMS_ID, // 企业设置 - 通用设置 ENTERPRISE_GENERAL_ID, + // 报表设置 + ENTERPRISE_REPORT_ID, + // 报表设置 - 基础设置 + ENTERPRISE_REPORT_BASE_SETTINGS_ID, // 安全管理 SECURITY_ID, // 地图管理 @@ -55,8 +89,13 @@ public class DesignServerSupportModule { * 启动入口,重建一下展示的module */ public static void rebuild() { - PortalModuleManager.allModules().keySet().stream() - .filter(m -> !SUPPORT_MODULE.contains(m)) - .forEach(PortalModuleManager::unregister); + Carina.getApplicationContext().addListener(new ContextListener() { + @Override + public void onStart() { + PortalModuleManager.allModules().keySet().stream() + .filter(m -> !SUPPORT_MODULE.contains(m)) + .forEach(PortalModuleManager::unregister); + } + }); } } From f8b0b5dae2f76c3f44b83871b87429181d835944 Mon Sep 17 00:00:00 2001 From: renekton Date: Mon, 21 Oct 2024 19:18:03 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E7=BC=A9=E6=94=BE=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/type/ChartImagePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java index da3ee30b88..cb9e9614c0 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java @@ -48,7 +48,7 @@ public class ChartImagePane extends ChartSelectDemoPane { super.paint(g); BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath); - int x = (this.getWidth() - IMAGE_HIGTH) / 2; + int x = (this.getWidth() - scale(IMAGE_WIDTH)) / 2; g.drawImage(image1, x, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null); } }; From 80d07c44c8262b27cbb7200c49a6ddcbef25e204 Mon Sep 17 00:00:00 2001 From: Anner Date: Mon, 21 Oct 2024 19:18:59 +0800 Subject: [PATCH 07/10] =?UTF-8?q?REPORT-138114=20fix:=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=A8=A1=E5=9D=97=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/build.gradle b/build.gradle index 5e9743fd1f..d2d0d1506a 100644 --- a/build.gradle +++ b/build.gradle @@ -110,6 +110,7 @@ allprojects { implementation 'com.fr.datasource:fine-datasource-core:' + fdlVersion implementation 'com.fr.datasource:fine-datasource-web:' + fdlVersion implementation 'com.fr.decision:decision-i18n:' + frVersion + implementation 'com.fr.decision:decision-report:' + frVersion implementation 'com.fr.report:engine-report:' + frDevVersion implementation 'com.fr.report:engine-x:' + frDevVersion implementation 'com.fr.report:engine-chart:' + frDevVersion From 680cc44b1d505c03c710e492fe4c76ca8c3c8483 Mon Sep 17 00:00:00 2001 From: Anner Date: Mon, 21 Oct 2024 20:09:48 +0800 Subject: [PATCH 08/10] =?UTF-8?q?REPORT-138114=20fix:=20=E7=89=B9=E6=AE=8A?= =?UTF-8?q?=E5=A4=84=E7=90=86=E4=B8=80=E4=B8=8B=E8=99=9A=E6=8B=9F=E6=A0=B9?= =?UTF-8?q?=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/boot/adaptation/DesignServerSupportModule.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java index e1bffecddd..91f3fc6eb5 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java +++ b/designer-realize/src/main/java/com/fanruan/boot/adaptation/DesignServerSupportModule.java @@ -2,7 +2,10 @@ package com.fanruan.boot.adaptation; import com.fanruan.carina.Carina; import com.fanruan.carina.context.ContextListener; +import com.fanruan.portal.authority.PortalAuthorityItems; +import com.fanruan.portal.module.PortalModule; import com.fanruan.portal.module.PortalModuleManager; +import com.fr.stable.StringUtils; import com.fr.third.guava.collect.Sets; import java.util.Optional; @@ -92,7 +95,8 @@ public class DesignServerSupportModule { Carina.getApplicationContext().addListener(new ContextListener() { @Override public void onStart() { - PortalModuleManager.allModules().keySet().stream() + PortalModuleManager.allModules().values().stream() + .filter(m -> !StringUtils.equals(m.getParentID(), PortalAuthorityItems.PORTAL_ROOT_ID)).map(PortalModule::getId) .filter(m -> !SUPPORT_MODULE.contains(m)) .forEach(PortalModuleManager::unregister); } From f72cd1d766dead5c1958e8a0a00fa6f6535bf209 Mon Sep 17 00:00:00 2001 From: renekton Date: Tue, 22 Oct 2024 10:06:13 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E7=BC=A9=E6=94=BE=E6=AF=94=E4=BE=8B?= =?UTF-8?q?=E9=AB=98=E6=97=B6=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8=EF=BC=8C?= =?UTF-8?q?=E9=97=B4=E8=B7=9D=E6=94=B9=E5=9B=9E=E5=88=B05?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/CenterRegionContainerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java index 77e72f27b3..e59628cd15 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java @@ -113,7 +113,7 @@ public class CenterRegionContainerPane extends JPanel { combineUp = new UIToolbar(FlowLayout.LEFT); setStyle(combineUp, TOP_TOOLS); combineUp.setBorder(new ScaledEmptyBorder(10, 8, 10, 10)); - combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, scale(10), 0)); + combineUp.setLayout(new FlowLayout(FlowLayout.LEFT, scale(5), 0)); setUpUpToolBar(null); } From 406b9f89b34f9b1395512a45069c49a30cef7769 Mon Sep 17 00:00:00 2001 From: lemon Date: Tue, 22 Oct 2024 10:09:31 +0800 Subject: [PATCH 10/10] =?UTF-8?q?fix=EF=BC=9A=E5=9B=9E=E9=80=80=20?= =?UTF-8?q?=E6=8B=96=E6=8B=BD=E8=8C=83=E5=9B=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tabledatapane/DBTableDataPane.java | 8 ++-- .../design/gui/controlpane/JControlPane.java | 47 +++---------------- .../design/gui/controlpane/UIControlPane.java | 6 +-- .../light/ui/laf/FineLightLaf.properties | 2 - 4 files changed, 14 insertions(+), 49 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java index 937e4ec62c..dbe45885cc 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java @@ -3,7 +3,6 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fine.theme.icon.LazyIcon; import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIStyle; -import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.Parameter; import com.fr.base.ParameterHelper; @@ -273,8 +272,11 @@ public class DBTableDataPane extends AbstractTableDataPane implemen JPanel sqlSplitPane = new JPanel(FRGUIPaneFactory.createScaledBorderLayout(4, 4)); sqlSplitPane.add(box, BorderLayout.CENTER); - int leftComponentMin = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.minimumSize", 120); - this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(leftComponentMin, 400))); + + box.setMinimumSize(FineUIScale.scale(new Dimension(300, 400))); + + this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(230, 400))); + this.connectionTableProcedurePane.setMaximumSize(FineUIScale.scale(new Dimension(500, 400))); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.connectionTableProcedurePane, sqlSplitPane); mainSplitPane.setOneTouchExpandable(true); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index c0da6e502f..15f0af15b3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -1,7 +1,6 @@ package com.fr.design.gui.controlpane; import com.fine.theme.utils.FineUIScale; -import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.border.FineBorderFactory; @@ -22,9 +21,7 @@ import javax.swing.JSplitPane; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; -import java.awt.Dimension; import java.util.Arrays; -import java.util.Objects; import java.util.stream.Stream; /** @@ -50,11 +47,6 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S protected JPanel cardPane; protected AbstractShortCutFactory shortCutFactory; - protected JSplitPane mainSplitPane; - // split pane 左边组件最小宽度 - protected int leftComponentMin; - // split pane 左边组件最大宽度 - protected int leftComponentMax; JControlPane() { this.initShortCutFactory(); @@ -118,10 +110,7 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S this.creators = this.createNameableCreators(); initCardPane(); // SplitPane - JPanel leftComponentPane = getLeftPane(); - leftComponentMin = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.minimumSize", 120); - leftComponentPane.setMinimumSize(FineUIScale.createScaleDimension(leftComponentMin, 0)); - mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftComponentPane, cardPane); + JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, getLeftPane(), cardPane); mainSplitPane.setOneTouchExpandable(true); this.add(mainSplitPane, BorderLayout.CENTER); @@ -134,12 +123,11 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S } protected void initCardPane() { - leftComponentMax = FineUIUtils.getAndScaleInt("SplitPane.leftComponent.maximumSize", 240); this.controlUpdatePane = createControlUpdatePane(); // p: edit card layout this.cardLayout = new CardLayout(); - initCardPaneWithMinSize(); + cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); cardPane.setLayout(this.cardLayout); // p:选择的Label UILabel selectLabel = new UILabel(); @@ -147,29 +135,6 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S cardPane.add(controlUpdatePane, EDIT); } - /** - * 初始化一个 rightComponent,且指定 minimumSize - * - * {@link javax.swing.plaf.basic.BasicSplitPaneDivider#DragController} 拖拽的时候会调用 getMinimumSize 方法 - * split pane driver 拖拽范围取自 leftComponent 的 minimumSize 和 rightComponent 的 minimumSize - */ - private void initCardPaneWithMinSize() { - cardPane = new JPanel(new CardLayout()) { - @Override - public Dimension getMinimumSize() { - Dimension size = super.getMinimumSize(); - if (mainSplitPane == null) { - return size; - } - Dimension parentSize = mainSplitPane.getSize(); - if (parentSize.width != 0 && Objects.equals(JSplitPane.HORIZONTAL_SPLIT, mainSplitPane.getOrientation())) { - size.width = parentSize.width - FineUIScale.scale(leftComponentMax); - } - return size; - } - }; - } - public void showEditPane() { this.cardLayout.show(cardPane, EDIT); } @@ -247,10 +212,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S } /** - * 刷新 NameableCreator - * - * @param creators 生成器 - */ + * 刷新 NameableCreator + * + * @param creators 生成器 + */ public void refreshNameableCreator(NameableCreator[] creators) { this.creators = creators; shorts = this.createShortcuts(); diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 551c05a0bf..7d1519f2ce 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -91,7 +91,7 @@ public abstract class UIControlPane extends JControlPane { rightPaneWrapper.add(cardPane, BorderLayout.CENTER); rightPaneWrapper.setBorder(new ScaledEmptyBorder(0, 10, 0, 0)); // SplitPane - mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper); + JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, leftPaneWrapper, rightPaneWrapper); mainSplitPane.setOneTouchExpandable(true); this.add(mainSplitPane, BorderLayout.CENTER); mainSplitPane.setDividerLocation(getLeftPreferredSize()); @@ -243,8 +243,8 @@ public abstract class UIControlPane extends JControlPane { } /** - * 是否需要隐藏popupEditDialog - */ + * 是否需要隐藏popupEditDialog + */ protected boolean needToHidePopupEditDialog() { // 检查是否有子弹窗,如果有,则不隐藏 for (Window window : popupEditDialog.getOwnedWindows()) { diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index aab414e72f..0adc8cf686 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 @@ -794,8 +794,6 @@ FormulaPane.buttonHeight=$Component.defaultHeight SplitPane.dividerSize = 5 SplitPane.continuousLayout = true SplitPane.border = null -SplitPane.leftComponent.minimumSize = 120 -SplitPane.leftComponent.maximumSize = 240 # \u5F71\u54CD\u89C6\u89C9\u6548\u679C\uFF0C\u4E34\u65F6\u5148\u5173\u6389 SplitPane.supportsOneTouchButtons = false SplitPane.centerOneTouchButtons = true