diff --git a/build.gradle b/build.gradle index 7201922fe8..9f6c3dd88b 100644 --- a/build.gradle +++ b/build.gradle @@ -90,8 +90,8 @@ allprojects { implementation 'com.github.weisj:jsvg:1.2.0' implementation 'com.formdev:flatlaf:3.4' implementation 'com.formdev:flatlaf-extras:3.4' - implementation 'com.fanruan.vito:gui-inspector:1.0.2' implementation 'com.fine.swing.ui:layout:1.0-SNAPSHOT' + implementation 'com.fanruan.vito:gui-inspector:1.0.2' testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-api-easymock:1.7.1' diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java index b541811f8f..1ca238934e 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIUtils.java @@ -395,7 +395,7 @@ public class FineUIUtils { UILabel label = new UILabel(title); wrapBoldLabelWithUnderline(label); return column(LayoutConstants.VERTICAL_GAP, - cell(label), cell(component) + cell(label), cell(component).weight(1.0) ).getComponent(); } diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index 061eb884f7..682403f461 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -10,6 +10,7 @@ import com.fr.base.Style; import com.fr.base.svg.SVGIcon; import com.fr.base.svg.IconUtils; import com.fr.design.actions.core.ActionFactory; +import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UICheckBoxMenuItem; import com.fr.design.gui.imenu.UIMenuEastAttrItem; @@ -116,11 +117,13 @@ public abstract class UpdateAction extends ShortCut implements Action { this.enabled = newValue; //循环遍历所有的Enable属性. - Iterator valueIt = this.componentMap.values().iterator(); - while (valueIt.hasNext()) { - Object valueObject = valueIt.next(); - if (valueObject instanceof JComponent) { - ((JComponent) valueObject).setEnabled(this.enabled); + if (this.componentMap != null) { + Iterator valueIt = this.componentMap.values().iterator(); + while (valueIt.hasNext()) { + Object valueObject = valueIt.next(); + if (valueObject instanceof JComponent) { + ((JComponent) valueObject).setEnabled(this.enabled); + } } } } diff --git a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java index 83d6e24ac8..a3e01ecf02 100644 --- a/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java +++ b/designer-base/src/main/java/com/fr/design/carton/FeedbackToolboxDialog.java @@ -1,5 +1,6 @@ package com.fr.design.carton; +import com.fine.theme.utils.FineUIScale; import com.fr.decision.webservice.v10.log.download.utils.LogZipUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; @@ -87,7 +88,7 @@ public class FeedbackToolboxDialog extends JDialog { body.add(midPane, BorderLayout.CENTER); midPane.add(infoPane, BorderLayout.NORTH); Dimension dimension = new Dimension(662, 556); - body.setPreferredSize(dimension); + body.setPreferredSize(FineUIScale.scale(dimension)); this.body = body; } @@ -102,8 +103,8 @@ public class FeedbackToolboxDialog extends JDialog { } else { this.uiDatePicker = new UIDatePicker(UIDatePicker.STYLE_CN_DATE1, null, this); } - Dimension dimension = new Dimension(160, 100); - uiDatePicker.setPreferredSize(dimension); + Dimension dimension = new Dimension(100, 100); + uiDatePicker.setPreferredSize(FineUIScale.scale(dimension)); northPane.add(GUICoreUtils.createFlowPane(new Component[]{title, uiDatePicker}, FlowLayout.LEFT)); exportLogLabel = new UILabel(); exportLogLabel.setText(Toolkit.i18nText("Fine-Design_Basic_Carton_Export_Carton_Log")); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 96ab6bd724..e0a3ca99e6 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -222,9 +222,9 @@ public class ChoosePane extends BasicBeanPane implements Refresha } protected void initComponentsLayout(PreviewLabel previewLabel, int labelSize) { - UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database") + ":"); - UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model") + ":"); - UILabel l3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table") + ":"); + UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database")); + UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model")); + UILabel l3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table")); if (labelSize > 0) { Dimension pSize = new Dimension(labelSize, 25); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 76f32d6f0c..9bf4d325de 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.IconUtils; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; @@ -61,7 +62,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) { editButton = new UILockButton( EditLockUtils.CONNECTION_LOCKED_ICON, - IconUtils.readIcon("/com/fr/design/images/m_web/connection"), + new LazyIcon("connection"), EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, null ); 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 f31bbab0e8..48f81a2d11 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 @@ -1,6 +1,7 @@ package com.fr.design.data.tabledata.tabledatapane; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.fr.base.Parameter; import com.fr.base.ParameterHelper; import com.fr.data.core.db.TableProcedure; @@ -245,10 +246,10 @@ public class DBTableDataPane extends AbstractTableDataPane implemen RTextScrollPane sqlTextScrollPane = new RTextScrollPane(this.sqlTextPane); sqlTextScrollPane.setLineNumbersEnabled(true); sqlTextScrollPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC)); - sqlTextScrollPane.setPreferredSize(new Dimension(680, 600)); + sqlTextScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(680, 600))); JPanel paraMeanPane = new JPanel(new BorderLayout()); - paraMeanPane.setPreferredSize(new Dimension(680, 90)); + paraMeanPane.setPreferredSize(FineUIScale.scale(new Dimension(680, 90))); UILabel paraMean = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Param_DES")); paraMeanPane.add(paraMean, BorderLayout.CENTER); @@ -338,7 +339,7 @@ public class DBTableDataPane extends AbstractTableDataPane implemen this.barErrorTips.setVisible(false); esdSettingsBtn = new UIButton(Toolkit.i18nText("Fine-Design_ESD_Strategy_Config")); - esdSettingsBtn.setPreferredSize(new Dimension(72, 24)); + esdSettingsBtn.setPreferredSize(FineUIScale.scale(new Dimension(72, 24))); esdSettingsBtn.addActionListener(new ActionListener() { @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 3b658d0cef..d8997a5556 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 @@ -14,7 +14,6 @@ public class CursorEditor extends Editor { this.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor")); this.add(label); - this.setPreferredSize(new Dimension(10,20)); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor")); this.setEnabled(false); } diff --git a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java index 2acf6e772a..f1e15bf4a1 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/FunctionManagerPane.java @@ -104,7 +104,7 @@ public class FunctionManagerPane extends BasicPane { @Override public NameableCreator[] createNameableCreators() { NameableCreator funcDef = new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function"), - new LazyIcon("param"), FunctionDef.class, FunctionContentPane.class); + new LazyIcon("page_query"), FunctionDef.class, FunctionContentPane.class); return new NameableCreator[]{funcDef}; } diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index 4f76c2e69f..f48aa3d252 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -133,7 +133,6 @@ public class ColumnRowPane extends JPanel implements UIObserver { } }; - rowSpinner.setPreferredSize(new Dimension(60, 24)); JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner); if (rftf != null) { rftf.setColumns(4); // specify more width than we need @@ -148,7 +147,6 @@ public class ColumnRowPane extends JPanel implements UIObserver { return false; } }; - columnSpinner.setPreferredSize(new Dimension(60, 24)); JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner); if (cftf != null) { cftf.setColumns(3); // specify more width than we need diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java index 035b056fa3..4e19650e73 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowVerticalPane.java @@ -24,7 +24,7 @@ public class ColumnRowVerticalPane extends ColumnRowPane { public ColumnRowVerticalPane( ) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel pane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); + JPanel pane = new JPanel(FRGUIPaneFactory.createBorderLayout()); this.add(pane, BorderLayout.NORTH); UILabel colLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); @@ -35,8 +35,8 @@ public class ColumnRowVerticalPane extends ColumnRowPane { initRowSpinner(); pane.add(column(10, - row(flex(0.005), cell(rowLabel).weight(0.195), cell(rowSpinner).weight(0.8)), - row(flex(0.005), cell(colLabel).weight(0.195), cell(columnSpinner).weight(0.8)) + row(cell(rowLabel).weight(0.15), cell(rowSpinner).weight(0.85)), + row(cell(colLabel).weight(0.15), cell(columnSpinner).weight(0.85)) ).getComponent()); this.addDocumentListener(d); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java index de904f5a45..611a5fef9b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java @@ -1,5 +1,9 @@ package com.fr.design.gui.frpane; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.light.ui.FineRoundBorder; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.editor.ValueEditorPane; @@ -19,6 +23,8 @@ import java.awt.event.ActionListener; import java.util.ArrayList; import java.util.Iterator; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.cell; public class ObjectProperiesPane extends BasicBeanPane { private UIButton addButton; @@ -27,12 +33,13 @@ public class ObjectProperiesPane extends BasicBeanPane { public ObjectProperiesPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - + this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + " " +com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property")); + this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"), + new LazyIcon("add")); buttonPane.add(this.addButton, BorderLayout.WEST); - this.add(buttonPane, BorderLayout.NORTH); - + buttonPane.setPreferredSize(FineUIScale.scale(new Dimension(0, 24))); + this.addButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -43,8 +50,7 @@ public class ObjectProperiesPane extends BasicBeanPane { }); selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); -// selectedItemPane.setLayout(new BoxLayout(selectedItemPane,BoxLayout.Y_AXIS)); - + JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(selectedItemPane, BorderLayout.NORTH); @@ -52,8 +58,12 @@ public class ObjectProperiesPane extends BasicBeanPane { selectedItemScrollPane.setViewportView(northPane); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); JPanel centerPane = new JPanel(new BorderLayout()); + centerPane.setBorder(new FineRoundBorder()); centerPane.add(selectedItemScrollPane); - this.add(centerPane, BorderLayout.CENTER); + this.add(column(4, + cell(buttonPane), + cell(centerPane).weight(1.0) + ).getComponent()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java index 6b8e0e65b4..e464110b47 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java @@ -1,5 +1,7 @@ package com.fr.design.gui.style; +import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.theme.TemplateTheme; import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; @@ -45,7 +47,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver { public FollowingThemePane(String name) { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS); followingThemeButtonGroup.setAutoFireStateChanged(false); @@ -74,7 +76,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver { double f = TableLayout.FILL; JPanel followingThemePane = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{new Component[] { followingThemeLabel, FRGUIPaneFactory.createBorderLayoutNorthPaneWithComponent(followingThemeButtonGroup)}}, - new double[] { p }, new double[] { SETTING_LABEL_WIDTH, f }, 10, 0); + new double[] { p }, new double[] {FineUIScale.scale(SETTING_LABEL_WIDTH), f }, 10, 0); followingThemePane.setVisible(false); add(followingThemePane, BorderLayout.NORTH); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 57db2f06f5..fd1d7355f7 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -291,7 +291,6 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane { extendPane.add(extendParametersCheckBox); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane(), extendPane); - parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Toolkit.i18nText("Fine-Design_Basic_Parameters"), null)); this.add(column( cell(northPane), - cell(parameterViewPane).weight(1.0) + cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, Toolkit.i18nText("Fine-Design_Basic_Parameters"))).weight(1.0) ).getComponent()); } diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java index b5e3a62772..7749b059cd 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java @@ -166,7 +166,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane { this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 10)); tipsPane1 = new UILabel(); tipsPane1.setHorizontalAlignment(SwingConstants.LEFT); - tipsPane1.setForeground(Color.gray); + FineUIStyle.setStyle(tipsPane1, FineUIStyle.LABEL_WARNING_TIP); tipsPane2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_EmailPane_Tips")); UILabel mainTextLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_EmailPane_Mail_Content")); diff --git a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java index 9257d619f5..369b3c7caf 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java @@ -1,6 +1,8 @@ package com.fr.design.javascript; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIUtils; +import com.fr.base.svg.IconUtils; import com.fr.design.DesignerEnvManager; import com.fr.design.border.UIRoundedBorder; import com.fr.design.constants.KeyWords; @@ -188,12 +190,13 @@ public class JSContentPane extends BasicPane { labelPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); labelPane.add(label,BorderLayout.CENTER); JPanel jsParaPane = new JPanel(new BorderLayout()); - + funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); UIScrollPane scrollPane = new UIScrollPane(funNameLabel); + scrollPane.setOpaque(true); scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); jsParaPane.add(row(10, - cell(scrollPane).weight(0.6), - cell(labelPane).weight(0.4) + cell(scrollPane).weight(0.55), + cell(labelPane).weight(0.45) ).getComponent()); return jsParaPane; } diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java index e2a740c534..1efd313940 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java @@ -1,5 +1,6 @@ package com.fr.design.javascript; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.Parameter; import com.fr.design.data.tabledata.tabledatapane.OneListTableModel; import com.fr.design.dialog.FineJOptionPane; @@ -69,20 +70,17 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { importedJsPane = createImportedJsPane(); jsPane = createJSContentPane(defaultArgs); - jsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"))); JPanel topPane = new JPanel(new BorderLayout()); topPane.add(row(10, - cell(importedJsPane).weight(0.5), - cell(parameterPane).weight(0.5) + cell(FineUIUtils.wrapComponentWithTitle(importedJsPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"))).weight(0.5), + cell(FineUIUtils.wrapComponentWithTitle(parameterPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))).weight(0.5) ).getComponent()); - topPane.setBorder(BorderFactory.createEmptyBorder(0, 0, BOTTOM_BORDER, 0)); - this.setLayout(new BorderLayout()); this.add(column(10, cell(topPane).weight(0.5), - cell(jsPane).weight(0.5) + cell(FineUIUtils.wrapComponentWithTitle(jsPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"))).weight(0.5) ).getComponent()); this.reLayoutForChart(); @@ -111,7 +109,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { protected ReportletParameterViewPane createParameterViewPane(){ ReportletParameterViewPane parameterPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); - parameterPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); parameterPane.addTableEditorListener(new TableModelListener() { public void tableChanged(TableModelEvent e) { List list = parameterPane.update(); @@ -147,7 +144,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane { } }; UITableEditorPane importedJsPane = new UITableEditorPane(model); - importedJsPane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportServerP_Import_JavaScript"))); return importedJsPane; } diff --git a/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java index f5a0a1a756..5ad5581181 100644 --- a/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java +++ b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java @@ -1,5 +1,6 @@ package com.fr.design.menu; +import com.fine.theme.utils.FineUIScale; import com.fr.base.GraphHelper; import com.fr.design.actions.UpdateAction; import com.fr.design.gui.ilable.UILabel; @@ -52,11 +53,11 @@ public class NameSeparator extends UpdateAction { } public Dimension getSize() { - return new Dimension(super.getSize().width, 20); + return new Dimension(super.getSize().width, FineUIScale.scale(30)); } public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, 20); + return new Dimension(super.getPreferredSize().width, FineUIScale.scale(30)); } } diff --git a/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java b/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java index 76986b5520..7d1f65a789 100644 --- a/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java +++ b/designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java @@ -39,21 +39,22 @@ public class ParameterPane extends BasicBeanPane { protected void initComponents() { this.setLayout(new BorderLayout()); //名字 - nameTextField = new UITextField(); + nameTextField = new UITextField(10); nameTextField.setEditable(false); //默认值 valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); // richer:要排列显示的控件 JPanel centerPane = column(LayoutConstants.VERTICAL_GAP, - row(LayoutConstants.HORIZONTAL_GAP, + row(20, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name"))).weight(0.1), cell(nameTextField).weight(0.8), flex(0.1)), - row(LayoutConstants.HORIZONTAL_GAP, + row(20, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value"))).weight(0.1), cell(valueEditor).weight(0.8), flex(0.1)) - ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 0))).getComponent(); + ).getComponent(); + centerPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 0)); this.add(centerPane, BorderLayout.CENTER); } diff --git a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java index 033e2cb07f..40a386ae30 100644 --- a/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java @@ -1,5 +1,6 @@ package com.fr.design.update.ui.dialog; +import com.fine.theme.utils.FineUIScale; import com.fr.decision.update.data.UpdateConstants; import com.fr.decision.update.info.UpdateCallBack; import com.fr.decision.update.info.UpdateProgressCallBack; @@ -295,7 +296,7 @@ public class UpdateMainDialog extends UIDialog { loadingLabel = new LoadingLabel(); loadingLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Checking_Jar_Update")); updateButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Updater_Update")); - updateButton.setPreferredSize(UPDATE_BUTTON); + updateButton.setPreferredSize(FineUIScale.scale(UPDATE_BUTTON)); updateButton.setEnabled(false); double[] rowSize = {TableLayout.PREFERRED}; diff --git a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java index 564b09d467..600a182732 100644 --- a/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java +++ b/designer-base/src/main/java/com/fr/design/web/CustomIconPane.java @@ -1,9 +1,11 @@ package com.fr.design.web; +import com.fine.theme.light.ui.FineRoundBorder; import com.fr.base.BaseUtils; import com.fr.base.GraphHelper; import com.fr.base.Icon; import com.fr.base.IconManager; +import com.fr.design.border.FineBorderFactory; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; @@ -41,6 +43,7 @@ import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Window; +import javax.swing.BorderFactory; import javax.swing.ButtonGroup; import javax.swing.ImageIcon; import javax.swing.JComponent; @@ -60,6 +63,10 @@ import java.awt.event.FocusListener; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * carl:自定义Icon编辑 */ @@ -86,11 +93,11 @@ public class CustomIconPane extends BasicPane { private void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + UILabel iconLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon")); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Icon"))); - JPanel noNamePane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); - centerPane.add(noNamePane, BorderLayout.CENTER); - + JPanel noNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + noNamePane.setBorder(new FineRoundBorder()); + noNamePane.setBackground(Color.WHITE); iconPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); // 开始加图标选择按钮 @@ -100,14 +107,14 @@ public class CustomIconPane extends BasicPane { refreshIconPane(false); jsPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); - jsPane.setPreferredSize(new Dimension(200, 180)); noNamePane.add(jsPane); - DescriptionTextArea des = new DescriptionTextArea(2); - des.setText(createDescriptionText()); - centerPane.add(des, BorderLayout.SOUTH); - - this.add(centerPane, BorderLayout.CENTER); + UILabel desLabel = new UILabel(createDescriptionText()); + desLabel.setForeground(Color.GRAY); + centerPane.add(column( + cell(noNamePane).weight(0.9), + cell(desLabel).weight(0.1) + ).getComponent()); JPanel eastPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); JPanel buttonPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); @@ -118,8 +125,10 @@ public class CustomIconPane extends BasicPane { initEditButton(buttonPane); eastPane.add(buttonPane); - this.add(eastPane, BorderLayout.EAST); - + this.add(column(10, + cell(iconLabel), + row(10, cell(centerPane).weight(0.9), cell(eastPane).weight(0.1)).weight(1.0) + ).getComponent()); } @@ -369,7 +378,7 @@ public class CustomIconPane extends BasicPane { g2d.drawImage(iconImage, ICON_X, ICON_Y, IconManager.DEFAULT_ICONWIDTH, IconManager.DEFAULT_ICONHEIGHT, null); } if (this.iconName != null && ComparatorUtils.equals(this.iconName, selectedIconName)) { - g2d.setPaint(Color.RED); + g2d.setPaint(Color.BLUE); } else { g2d.setPaint(Color.LIGHT_GRAY); } diff --git a/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java b/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java index a02efff2dc..57df8937fa 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java @@ -61,12 +61,17 @@ public class DateValuePane extends Column { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"))); cardLayout.show(customPane, tabTitles[index]); }); - this.add( - row( - cell(titleLabel).weight(1.2), cell(widgetValueHead).weight(1.6), flex(1.4) - ), - cell(customRow) - ); + if (StringUtils.isNotEmpty(title)) { + this.add( + row( + cell(titleLabel).weight(1.2), cell(widgetValueHead).weight(3) + ), + cell(customRow) + ); + } else { + this.add(cell(widgetValueHead),cell(customPane)); + } + } diff --git a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java index 5b0cd2c3b6..9c1a65b723 100644 --- a/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java +++ b/designer-base/src/main/java/com/fr/design/write/submit/CustomJobPane.java @@ -1,6 +1,7 @@ package com.fr.design.write.submit; import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; @@ -26,6 +27,7 @@ import java.awt.event.ActionListener; import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.flex; /** * Author : Shockway @@ -41,16 +43,17 @@ public abstract class CustomJobPane extends BasicBeanPane { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(); + classNameTextField.setPreferredSize(FineUIScale.scale(new Dimension(0, 24))); UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); browserButton.setPreferredSize(new Dimension( GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - classNameTextField.getPreferredSize().height)); + FineUIScale.scale(24))); UIButton editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); editButton.setPreferredSize(new Dimension( GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")) + 40, - classNameTextField.getPreferredSize().height)); + FineUIScale.scale(24))); UITextArea area = new UITextArea(2, 1); @@ -91,23 +94,22 @@ public abstract class CustomJobPane extends BasicBeanPane { } }); - reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"), null)); reportletNamePane.setLayout(new BorderLayout()); - reportletNamePane.add(row(10, - cell(classNameTextField).weight(0.8), - cell(browserButton).weight(0.1), - cell(editButton).weight(0.1) - ).getComponent()); + reportletNamePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); + reportletNamePane.add(row(4, + cell(classNameTextField).weight(1.0), + cell(browserButton), + cell(editButton) + ).getComponent(), BorderLayout.CENTER); objectProperiesPane = new ObjectProperiesPane(); - objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"), null)); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + dsPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); dsPane.add(area); - dsPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"), null)); - this.add(column( - cell(reportletNamePane), - cell(objectProperiesPane).weight(1.0), - cell(dsPane) + this.add(column(20, + cell(FineUIUtils.wrapComponentWithTitle(reportletNamePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Name"))), + cell(FineUIUtils.wrapComponentWithTitle(objectProperiesPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"))).weight(1.0), + cell(FineUIUtils.wrapComponentWithTitle(dsPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Custom_Job_Description"))) ).getComponent()); checkAddButtonEnable(); } 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 c7c07ba412..5de1d0d052 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 @@ -2,7 +2,9 @@ package com.fr.design.write.submit; import com.fine.swing.ui.layout.Layouts; import com.fine.theme.icon.LazyIcon; +import com.fine.swing.ui.layout.Spacer; import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.BaseFormula; import com.fr.base.Parameter; import com.fr.data.DataConstants; @@ -16,8 +18,10 @@ import com.fr.design.constants.UIConstants; import com.fr.design.data.datapane.ChoosePaneSupportFormula; import com.fr.design.data.datapane.DataBaseItems; import com.fr.design.data.tabledata.tabledatapane.FormatExplanationPane; +import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.editor.ValueEditorPane; @@ -94,6 +98,7 @@ import java.util.EventObject; import java.util.List; import java.util.stream.Collectors; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; @@ -155,42 +160,45 @@ public class DBManipulationPane extends BasicBeanPane { JPanel typePane = new JPanel(new BorderLayout()); typePane.add(row(10, - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type") + ":")), + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Choose_Submit_Type"))), cell(dmlConfigComboBox)).getComponent()); - typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))); chooseTable = new ChoosePaneSupportFormula(); - chooseTable.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table"))); - chooseTable.setTableNameComboBoxPopSize(160, 320); + chooseTable.setTableNameComboBoxPopSize(FineUIScale.scale(160), FineUIScale.scale(320)); // peter:编辑的TablePane JPanel editTablePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - editTablePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))); editTablePane.setBounds(0, 0, FineUIScale.scale(280), FineUIScale.scale(180)); keyColumnValuesTable = new KeyColumnNameValueTable(); - editTablePane.add(new UIScrollPane(this.keyColumnValuesTable), BorderLayout.CENTER); + editTablePane.add(new UIScrollPane(keyColumnValuesTable), BorderLayout.CENTER); keyColumnValuesTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); - keyColumnValuesTable.setPreferredScrollableViewportSize(new Dimension(280, 150)); + keyColumnValuesTable.setPreferredScrollableViewportSize(FineUIScale.scale(new Dimension(280, 150))); keyColumnValuesTable.setShowHorizontalLines(true); DefaultTableCellHeaderRenderer headerRenderer = new DefaultTableCellHeaderRenderer(); headerRenderer.setHorizontalAlignment(SwingConstants.LEFT); keyColumnValuesTable.getTableHeader().setDefaultRenderer(headerRenderer); - northPane.add(column(10, true, - cell(typePane), - cell(chooseTable)) - .getComponent()); - - this.add(column(10, true, - cell(northPane), - cell(editTablePane)) + northPane.add(column(10, + cell(FineUIUtils.wrapComponentWithTitle(typePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Write_Submit_Type"))), + cell(FineUIUtils.wrapComponentWithTitle(chooseTable, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Table")))) .getComponent()); + JPanel bottomPane = initBottomPane(); + this.add(new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + JPanel contentPane = new JPanel(new BorderLayout()); + contentPane.add(column(10, + cell(northPane), + cell(FineUIUtils.wrapComponentWithTitle(editTablePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Base_Value"))), + cell(bottomPane)) + .getComponent(), BorderLayout.CENTER); + return contentPane; + } + }); initJTableColumn(); addButtons(editTablePane); - addBottomPane(); - addListeners(); } @@ -258,16 +266,19 @@ public class DBManipulationPane extends BasicBeanPane { UpdateCheckBox.setEnabled(b); } - private void addBottomPane() { - JPanel eventPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - eventPane.add(addEventButton()); + private JPanel initBottomPane() { + JPanel eventPane = new JPanel(new BorderLayout()); + eventPane.setPreferredSize(createControlBtnPanePreferredSize()); + eventPane.add(addEventButton(), BorderLayout.WEST); JPanel conditionPane = this.createConditionPane(); JPanel btPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); - btPane.add(eventPane, BorderLayout.CENTER); - btPane.add(conditionPane, BorderLayout.NORTH); - this.add(btPane, BorderLayout.SOUTH); + btPane.add(column(5, + cell(FineUIUtils.wrapComponentWithTitle(conditionPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))), + cell(eventPane) + ).getComponent()); + return btPane; } private UIButton addEventButton() { @@ -295,7 +306,6 @@ public class DBManipulationPane extends BasicBeanPane { private JPanel createConditionPane() { JPanel conditionPane = new JPanel(); - conditionPane.setPreferredSize(createConditionPanePreferredSize()); setBorderAndLayout(conditionPane); @@ -307,7 +317,7 @@ public class DBManipulationPane extends BasicBeanPane { DefaultTreeCellRenderer cr = (DefaultTreeCellRenderer) conditionsTree.getCellRenderer(); cr.setForeground(UIConstants.NORMAL_BACKGROUND); JScrollPane jp = new JScrollPane(conditionsTree); - + jp.setPreferredSize(FineUIScale.scale(new Dimension(0, 40))); UIButton addSubmitConditionButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Submit_Condition")); addSubmitConditionButton.addActionListener(new ActionListener() { @Override @@ -336,12 +346,12 @@ public class DBManipulationPane extends BasicBeanPane { } }); - JPanel controlBtnPane = new JPanel(new GridLayout(1, 1, 4, 4)); - controlBtnPane.setPreferredSize(createControlBtnPanePreferredSize()); - controlBtnPane.add(addSubmitConditionButton); + JPanel controlBtnPane = new JPanel(new BorderLayout()); + controlBtnPane.setPreferredSize(FineUIScale.scale(new Dimension(122, 20))); + controlBtnPane.add(addSubmitConditionButton, BorderLayout.NORTH); conditionPane.add(row( - cell(jp).weight(0.74), - column(cell(controlBtnPane).weight(0.5),cell(new UILabel()).weight(0.5)).weight(0.26) + cell(jp).weight(1.0), + cell(new Spacer(122).add(controlBtnPane)) ).getComponent()); return conditionPane; @@ -349,8 +359,6 @@ public class DBManipulationPane extends BasicBeanPane { protected void setBorderAndLayout(JPanel jPanel) { jPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); - jPanel.setBorder(BorderFactory.createTitledBorder( - new ModLineBorder(ModLineBorder.TOP), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Submit_Condition"))); } protected void addComponent(JPanel mainPane, JScrollPane addPane) { @@ -359,7 +367,7 @@ public class DBManipulationPane extends BasicBeanPane { protected Dimension createConditionPanePreferredSize() { - return new Dimension(454, 80); + return FineUIScale.scale(new Dimension(454, 80)); } protected Dimension createControlBtnPanePreferredSize() { diff --git a/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java b/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java index f7ede9f1a0..fbd4e7f0a1 100644 --- a/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java +++ b/designer-base/src/main/java/com/fr/env/detect/ui/EnvDetectorDialog.java @@ -1,5 +1,9 @@ package com.fr.env.detect.ui; +import com.fine.theme.light.ui.FineRoundBorder; +import com.fine.theme.utils.FineUIStyle; +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.ui.FlatUIUtils; import com.fr.base.svg.IconUtils; import com.fr.design.components.notification.NotificationDialog; import com.fr.design.components.notification.NotificationDialogProperties; @@ -9,6 +13,7 @@ import com.fr.design.constants.DesignerColor; import com.fr.design.constants.UIConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; +import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; @@ -141,7 +146,7 @@ public class EnvDetectorDialog extends JDialog { JPanel headerPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); headerPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 12, 0)); - this.detectButton = new UIButton(buttonStatus.getDesc()) { + this.detectButton = new UIToggleButton(buttonStatus.getDesc()) { @Override public ButtonUI getUI() { @@ -162,7 +167,6 @@ public class EnvDetectorDialog extends JDialog { }; } }; - detectButton.setForeground(Color.WHITE); detectButton.setToolTipText(buttonStatus.getDesc()); detectButton.addActionListener(event -> { if (buttonStatus.isNotExecuting()) { @@ -171,9 +175,9 @@ public class EnvDetectorDialog extends JDialog { stopDetecting(detectButton); } }); - detectButton.setPreferredSize(new Dimension(68, 20)); - detectButton.setBorderPainted(false); - detectButton.setContentAreaFilled(false); + detectButton.setForeground(FineUIUtils.getUIColor("background.normal", "background.normal")); + detectButton.setBackground(FineUIUtils.getUIColor("EnvDetectorButton.background", "EnvDetectorButton.background")); + headerPanel.add(detectButton, BorderLayout.WEST); UILabel openUtilBoxLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Carton_Feedback_ToolBox")); diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/bold.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/bold.svg index f95596d86c..4aa1b6c071 100644 --- a/designer-base/src/main/resources/com/fine/theme/icon/font/bold.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/bold.svg @@ -1,5 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/italic.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/italic.svg index 5bdf5f2159..3d53d5ffe8 100755 --- a/designer-base/src/main/resources/com/fine/theme/icon/font/italic.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/italic.svg @@ -1,5 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/font/underline.svg b/designer-base/src/main/resources/com/fine/theme/icon/font/underline.svg index d792b37af9..326f2fa6e0 100755 --- a/designer-base/src/main/resources/com/fine/theme/icon/font/underline.svg +++ b/designer-base/src/main/resources/com/fine/theme/icon/font/underline.svg @@ -1,5 +1,3 @@ - + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/insert/float_normal.svg b/designer-base/src/main/resources/com/fine/theme/icon/insert/float_normal.svg new file mode 100644 index 0000000000..b2204b711e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/insert/float_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_下拉列表用_normal + + + + 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 9a2987e2d7..1aeb2eef61 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 @@ -146,6 +146,7 @@ "image": "insert/image.svg", "bias": "insert/bias.svg", "sub_report": "insert/sub_report.svg", + "float_normal": "insert/float_normal.svg", "popup": { "normal": "popup/popup.svg" }, 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 70e0f58a1d..eabd62e110 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 @@ -222,6 +222,8 @@ CombinationButton.background = $Button.background CombinationButton.borderColor = $Component.borderColor CombinationButton.arc = $Button.arc +EnvDetecorButton.background = #FF419BF9 + #---- CheckBox ---- CheckBox.arc = 4 CheckBox.margin = 2,0,2,0 diff --git a/designer-base/src/main/resources/com/fr/design/images/edit/advancedEditor.svg b/designer-base/src/main/resources/com/fr/design/images/edit/advancedEditor.svg deleted file mode 100644 index 84c516886f..0000000000 --- a/designer-base/src/main/resources/com/fr/design/images/edit/advancedEditor.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/designer-base/src/main/resources/com/fr/design/images/server/global_param.png b/designer-base/src/main/resources/com/fr/design/images/server/global_param.png deleted file mode 100644 index f449cba6f4..0000000000 Binary files a/designer-base/src/main/resources/com/fr/design/images/server/global_param.png and /dev/null differ diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java index c1e3f1e65f..b9dc9408d5 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java @@ -1,5 +1,7 @@ package com.fr.design.chart.series.SeriesCondition.impl; +import com.fine.theme.utils.FineUIScale; +import com.fine.theme.utils.FineUIUtils; import com.fr.base.Utils; import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.design.gui.columnrow.ColumnRowVerticalPane; @@ -42,7 +44,7 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 " + "")).weight(0.15), - flex(0.4) + cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 " + "")).weight(0.2), + flex(0.35) ), row( 10, cell(copyLabel).weight(0.12), cell(copyTitleTextField).weight(0.33), - cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18" + "")).weight(0.15), - flex(0.4) + cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18" + "")).weight(0.2), + flex(0.35) ) ).getComponent(); diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java index 9fbeee2098..5c5f2e51b2 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java @@ -1,6 +1,7 @@ package com.fr.design.report; import com.fine.theme.utils.FineUIScale; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.editor.editor.IntegerEditor; @@ -48,6 +49,7 @@ import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.box; +import static com.fine.swing.ui.layout.Layouts.fix; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; import static com.fine.theme.utils.FineUIScale.scale; @@ -92,7 +94,7 @@ public class ReportEnginePane extends BasicBeanPane { outAdvicePane.setPreferredSize(new Dimension(FineUIScale.scale(600), FineUIScale.scale(160))); outAdvicePane.add(createAdvicePane()); - this.add(column(10, + this.add(column(20, cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))), cell(wrapComponentWithTitle(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))).weight(1.0), cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice")))) @@ -135,7 +137,8 @@ public class ReportEnginePane extends BasicBeanPane { * 目前先屏蔽,后面新引擎显示页码再加上相关代码 */ private void createEngineXSettingPane() { - outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); + outEngineXSettingPane = new JPanel(new BorderLayout()); + UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine")); JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); engineXPageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); @@ -151,17 +154,26 @@ public class ReportEnginePane extends BasicBeanPane { rowCountBox.setSelected(false); rowCountPanel.add(rowCountBox); JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip")); - engineXSettingPane.add(column(10, - cell(pageQueryBoxPanel), - cell(engineXPageQueryPane), - cell(rowCountPanel), - cell(tip)) + engineXSettingPane.add(row(20, + column(10, + column(fix(6), cell(title)), + cell(new UILabel()), + cell(new UILabel()), + cell(new UILabel()) + ), + + column(10, + cell(pageQueryBoxPanel), + cell(engineXPageQueryPane), + cell(rowCountPanel), + cell(tip))) .getComponent()); outEngineXSettingPane.add(engineXSettingPane); } private void createLineEngineSettingPane() { - outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); + outLineEngineSettingPane = new JPanel(new BorderLayout()); + UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine")); JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); lineEnginePageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); @@ -174,10 +186,15 @@ public class ReportEnginePane extends BasicBeanPane { lineEngineSettingPane.add(lineEnginePageQueryPane); lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane)); JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); - lineEngineSettingPane.add(column(10, - cell(pageQueryBoxPanel), - cell(lineEnginePageQueryPane), - cell(tipPane)) + lineEngineSettingPane.add(row(20, + column(10, + column(fix(6), cell(title)), + cell(new UILabel()), + cell(new UILabel())), + column(10, + cell(pageQueryBoxPanel), + cell(lineEnginePageQueryPane), + cell(tipPane))) .getComponent()); outLineEngineSettingPane.add(lineEngineSettingPane); } @@ -191,12 +208,12 @@ public class ReportEnginePane extends BasicBeanPane { } private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) { - double p = TableLayout.PREFERRED; - double rowSize[] = {p, p}; - double columnSize[] = {p, p}; - Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage") + ":"), countPerPageEditor}}; - JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); + JPanel pageQueryPane = new JPanel(new BorderLayout()); + pageQueryPane.setBorder(new ScaledEmptyBorder(0, 8, 0, 0)); + pageQueryPane.add(row(4, + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage"))), + cell(countPerPageEditor) + ).getComponent()); return pageQueryPane; } @@ -242,16 +259,9 @@ public class ReportEnginePane extends BasicBeanPane { buttonGroup.add(lineEngine); radioButtons.add(newEngine); radioButtons.add(lineEngine); - double p = TableLayout.FILL; - double[] rowSize = {p}; - double[] columnSize = {p, p, p, p, p}; - Component[][] components = new Component[][]{ - new Component[]{ - newEngine, - lineEngine - } - }; - JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + + JPanel pagingEngineRadioPanel = new JPanel(new BorderLayout()); + pagingEngineRadioPanel.add(row(20, cell(newEngine), cell(lineEngine)).getComponent()); newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane)); lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane)); return pagingEngineRadioPanel; diff --git a/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java b/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java index 359a06ba73..232ebc2e1d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/WriteShortCutsPane.java @@ -1,6 +1,8 @@ package com.fr.design.report; +import com.fine.theme.utils.FineUIUtils; +import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon; import com.fr.config.ServerPreferenceConfig; import com.fr.design.gui.ibutton.UIButton; @@ -17,13 +19,14 @@ import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.GridBagConstraints; -import java.awt.GridBagLayout; -import java.awt.GridLayout; -import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; +import static com.fine.swing.ui.layout.Layouts.flex; + public class WriteShortCutsPane extends JPanel{ private static final int V_GAP = 20; private static final int MAX_LABEL_WIDTH = 100; @@ -47,45 +50,35 @@ public class WriteShortCutsPane extends JPanel{ } private JPanel createContentPane() { - JPanel contentPane = new JPanel(); + JPanel contentPane = new JPanel(new BorderLayout()); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); - // 纵向布局,横向自适应 - contentPane.setLayout(new GridBagLayout()); - GridBagConstraints cons = new GridBagConstraints(); - cons.fill = GridBagConstraints.HORIZONTAL; - cons.weightx = 1; - cons.gridx = 0; - cons.insets = new Insets(20, 0, 0, 0); - contentPane.add(getFeatureNamePane(), cons); - contentPane.add(getHintsPane(), cons); + contentPane.add(column(20, + cell(FineUIUtils.wrapComponentWithTitle(getFeatureNamePane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Shortcut_Set"))), + cell(FineUIUtils.wrapComponentWithTitle(getHintsPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"))) + ).getComponent()); return contentPane; } private JPanel getFeatureNamePane(){ - JPanel featureNamePane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Shortcut_Set")); - featureNamePane.setLayout(new BorderLayout()); - - UILabel name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.CENTER); + JPanel featureNamePane = new JPanel(new BorderLayout()); + featureNamePane.setBorder(BorderFactory.createEmptyBorder(16, 0, 0, 0)); + UILabel name = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Feature_Name"), SwingConstants.RIGHT); UILabel nextCol = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Column"), SwingConstants.CENTER); UILabel nextRow = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Next_Row"), SwingConstants.CENTER); - UILabel shortName = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Keys"), SwingConstants.CENTER); + UILabel shortName = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Current_Keys"), SwingConstants.RIGHT); UIComponentUtils.setLineWrap(shortName, MAX_LABEL_WIDTH); nextColHK = new UILabel(nextColString, SwingConstants.CENTER); JPanel switchBtnPane = getSwitchBtnPane(); nextRowHK = new UILabel(nextRowString, SwingConstants.CENTER); - JPanel centerPane = new JPanel(new GridLayout(2, 4, 0, 0)); - centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - centerPane.add(name); - centerPane.add(nextCol); - centerPane.add(new JPanel()); - centerPane.add(nextRow); - centerPane.add(shortName); - centerPane.add(nextColHK); - centerPane.add(switchBtnPane); - centerPane.add(nextRowHK); + JPanel centerPane = new JPanel(new BorderLayout()); + centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + centerPane.add(column(24, + row(10, cell(name).weight(0.13), cell(nextCol).weight(0.15), cell(new JPanel()).weight(0.12), cell(nextRow).weight(0.15), flex(0.45)), + row(10, cell(shortName).weight(0.13), cell(nextColHK).weight(0.15), cell(switchBtnPane).weight(0.12), cell(nextRowHK).weight(0.15), flex(0.45)) + ).getComponent()); featureNamePane.add(centerPane, BorderLayout.CENTER); @@ -102,25 +95,22 @@ public class WriteShortCutsPane extends JPanel{ } private JPanel getHintsPane(){ - JPanel hintsPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")); - hintsPane.setLayout(new BorderLayout()); + JPanel hintsPane = new JPanel(new BorderLayout()); + hintsPane.setBorder(BorderFactory.createEmptyBorder(16, 0, 0, 0)); - UILabel systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.CENTER); + UILabel systemDefault = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_System_Default"), SwingConstants.RIGHT); UILabel preColText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Column"), SwingConstants.CENTER); UILabel preRowText = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cursor_To_Previous_Row"), SwingConstants.CENTER); - preCol = new UILabel("Shift+" + nextColString, SwingConstants.CENTER); - preRow = new UILabel("Shift+" + nextRowString, SwingConstants.CENTER); - - JPanel centerPane = new JPanel(new GridLayout(2, 3, 0, V_GAP)); - centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 100)); + preCol = new UILabel("Shift+" + nextColString, SwingConstants.LEFT); + preRow = new UILabel("Shift+" + nextRowString, SwingConstants.LEFT); - centerPane.add(systemDefault); - centerPane.add(preColText); - centerPane.add(preCol); + JPanel centerPane = new JPanel(new BorderLayout()); + centerPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); - centerPane.add(new JPanel()); - centerPane.add(preRowText); - centerPane.add(preRow); + centerPane.add(column(24, + row(10, cell(systemDefault).weight(0.13), cell(preColText).weight(0.24), cell(preCol).weight(0.14), flex(0.64)), + row(10, cell(new JPanel()).weight(0.13), cell(preRowText).weight(0.24), cell(preRow).weight(0.14), flex(0.64)) + ).getComponent()); hintsPane.add(centerPane, BorderLayout.CENTER); diff --git a/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java b/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java index 7c183cd83d..48a57dd913 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java @@ -41,7 +41,7 @@ public class CommonPane extends JPanel { ), //报表缓存有效时间 row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cache_Validate_Time"))).weight(0.2), - row(cell(this.cacheValidateTimeEditor).weight(0.7), fix(5), cell(new UILabel("milliseconds")).weight(0.3)).weight(0.4), + row(cell(this.cacheValidateTimeEditor).weight(0.6), fix(5), cell(new UILabel("milliseconds")).weight(0.4)).weight(0.4), flex(0.4) ) ).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); diff --git a/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java b/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java index d99058d205..71dbd52603 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/CellWidgetCardPane.java @@ -7,9 +7,7 @@ import com.fr.design.dialog.AttrScrollPane; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicScrollPane; import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.ibutton.UIHeadGroup; -import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.widget.mobile.WidgetMobilePane; @@ -36,7 +34,9 @@ public class CellWidgetCardPane extends BasicPane { private WidgetMobilePane currentWidgetMobilePane; //属性配置切换面板 private ArrayList paneList; - private FineTabbedPane tabsPane; + private JPanel center; + private UIHeadGroup tabsHeaderIconPane; + private CardLayout tabbedPane; private BasicWidgetPropertySettingPane widgetPropertyPane; //通用属性容器 @@ -64,11 +64,31 @@ public class CellWidgetCardPane extends BasicPane { this.removeAll(); this.setLayout(FRGUIPaneFactory.createBorderLayout()); + tabbedPane = new CardLayout(); + center = new JPanel(tabbedPane); final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")}; + tabsHeaderIconPane = new UIHeadGroup(tabTitles) { + @Override + public void tabChanged(int index) { + tabbedPane.show(center, tabTitles[index]); + } + }; + + JPanel wrapperPane = new JPanel(new BorderLayout()); + wrapperPane.add(tabsHeaderIconPane, BorderLayout.NORTH); + wrapperPane.add(center, BorderLayout.CENTER); + wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)); + this.add(wrapperPane, BorderLayout.CENTER); // 属性 attriTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + BasicScrollPane basicScrollPane = new AttrScrollPane() { + @Override + protected JPanel createContentPane() { + return attriTabPane; + } + }; widgetPropertyPane = new BasicWidgetPropertySettingPane(); UIExpandablePane basicPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"), 280, 24, widgetPropertyPane); attriCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); @@ -91,17 +111,10 @@ public class CellWidgetCardPane extends BasicPane { mobileCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); mobileTabPane.add(mobileCardPane, BorderLayout.CENTER); mobileCardLayout = (CardLayout) mobileCardPane.getLayout(); - tabsPane = FineTabbedPane.builder() - .addTab(tabTitles[0], new UIScrollPane(attriTabPane)) - .addTab(tabTitles[1], eventTabPane) - .addTab(tabTitles[2], mobileTabPane) - .build(); - JPanel wrapperPane = new JPanel(new BorderLayout()); - wrapperPane.add(tabsPane, BorderLayout.CENTER); - wrapperPane.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)); - wrapperPane.setOpaque(false); - this.add(wrapperPane, BorderLayout.CENTER); + center.add(basicScrollPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attribute")); + center.add(eventTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event")); + center.add(mobileTabPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Mobile_Terminal")); initPaneList(); } @@ -109,7 +122,7 @@ public class CellWidgetCardPane extends BasicPane { private void initPaneList() { paneList = new ArrayList(); paneList.add(attriTabPane); - paneList.add(eventTabPane); + paneList.add(eventPane); paneList.add(mobileTabPane); } @@ -148,7 +161,7 @@ public class CellWidgetCardPane extends BasicPane { currentWidgetMobilePane = mobilePane; - //tabsHeaderIconPane.setSelectedIndex(0); + tabsHeaderIconPane.setSelectedIndex(0); } public Widget update() { diff --git a/designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java b/designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java index 38316cbd76..b941b02efa 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ValueWidgetPane.java @@ -15,11 +15,6 @@ import com.fr.form.ui.WidgetValue; import java.awt.*; -import static com.fine.swing.ui.layout.Layouts.column; -import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.flex; - public class ValueWidgetPane extends WidgetPane { private JPanel widgetValuePane; private WidgetValueEditor widgetValueEditor; @@ -32,24 +27,18 @@ public class ValueWidgetPane extends WidgetPane { public JPanel initNorthPane(){ JPanel northPane = super.initNorthPane(); - label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Value")); + label = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Widget_Value")+ ":"); label.setVisible(false); - widgetValuePane = new JPanel(new BorderLayout()); - - JPanel centerPane = new JPanel(new BorderLayout()); - centerPane.setOpaque(false); - widgetValuePane.setOpaque(false); - centerPane.add(row( - cell(label).weight(68), - cell(widgetValuePane).weight(372)).getComponent() - ); - JPanel jPanel = new JPanel(); - jPanel.setBackground(Color.WHITE); - jPanel.setLayout(new BorderLayout()); - jPanel.add(column(10, true, - cell(northPane), - cell(centerPane) - ).getComponent()); + widgetValuePane = new JPanel(); + widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout()); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, p, f}; + double[] rowSize = {p}; + Component[][] components = new Component[][]{ + new Component[]{northPane, label,widgetValuePane}, + }; + JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return jPanel; } diff --git a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java index 162ed117c2..80ba33ef26 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/WidgetPane.java @@ -80,8 +80,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener this.add(column( 10, - cell(northPane).weight(0.17), - cell(cellEditorCardPane).weight(0.83) + cell(northPane), + cell(cellEditorCardPane).weight(1) ).getComponent() ); } @@ -90,8 +90,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener return column( row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Widget"))).weight(68), - cell(editorTypeComboBox).weight(372) + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Select_Widget"))).weight(LEFT_WEIGHT), + cell(editorTypeComboBox).weight(RIGHT_WEIGHT) ) ).getComponent(); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java index 8ba27909f2..c7ff5fdddb 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/BasicWidgetPropertySettingPane.java @@ -15,6 +15,8 @@ import java.awt.BorderLayout; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.column; import static com.fine.swing.ui.layout.Layouts.row; +import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT; +import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT; public class BasicWidgetPropertySettingPane extends BasicPane { @@ -31,11 +33,13 @@ public class BasicWidgetPropertySettingPane extends BasicPane { widgetNameComboBox = new ParameterTreeComboBox(); widgetNameComboBox.refreshTree(); - this.add(row(LayoutConstants.HORIZONTAL_GAP, - cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Name"))).weight(0.2), - cell(widgetNameComboBox).weight(0.6), - cell(enableCheckBox).weight(0.1), - cell(visibleCheckBox).weight(0.1) + this.add(column(LayoutConstants.VERTICAL_GAP, + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Name"))).weight(LEFT_WEIGHT), + cell(widgetNameComboBox).weight(RIGHT_WEIGHT) + ), + cell(enableCheckBox), + cell(visibleCheckBox) ).getComponent()); } diff --git a/designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java b/designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java index 454337d3f0..d1ecaeca5c 100644 --- a/designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java +++ b/designer-realize/src/main/java/com/fr/design/widget/ui/DateEditorDefinePane.java @@ -1,14 +1,16 @@ package com.fr.design.widget.ui; -import com.fine.theme.light.ui.FineRoundBorder; -import com.formdev.flatlaf.ui.FlatUIUtils; +import com.fr.base.FRContext; import com.fr.data.core.FormatField; -import com.fr.design.constants.LayoutConstants; +import com.fr.design.border.UIRoundedBorder; +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.IntervalConstants; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.widget.component.DateValuePane; import com.fr.design.widget.component.UIComboBoxNoArrow; import com.fr.design.widget.ui.designer.date.DateFormatCheckManager; @@ -17,30 +19,29 @@ import com.fr.form.ui.DateEditor; import com.fr.stable.ArrayUtils; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import javax.swing.border.EmptyBorder; -import javax.swing.plaf.BorderUIResource; +import javax.swing.border.TitledBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; import java.text.SimpleDateFormat; import java.util.Date; -import static com.fine.swing.ui.layout.Layouts.cell; -import static com.fine.swing.ui.layout.Layouts.column; -import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.flex; -import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT; -import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT; - public class DateEditorDefinePane extends DirectWriteEditorDefinePane { - private UIButtonGroup returnTypeButtonGroup; + private UIButtonGroup returnTypeComboBox; private DateValuePane startDv; private DateValuePane endDv; private UIComboBox currentFormatComboBox; - private UILabel currentSampleLabel; - private UIButtonGroup formatButtonGroup; + private UILabel currentSamplelabel; + private UIButtonGroup fomatHeadGroup; + private static final int SAMPLE_LABEL_PADDING = 4; + public DateEditorDefinePane() { } @@ -52,22 +53,33 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") , - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); + returnTypeComboBox = new UIButtonGroup<>(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); JPanel formatHead = createFormatHead(); - startDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date")); - endDv = new DateValuePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date")); - UILabel returnTypeLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")); - - return column(LayoutConstants.VERTICAL_GAP, - cell(formatHead), - cell(startDv), - cell(endDv), - cell(waterMarkDictPane), - row( - cell(returnTypeLabel).weight(LEFT_WEIGHT), cell(returnTypeButtonGroup).weight(1.4), flex(1.6) - ) - ).getComponent(); + startDv = new DateValuePane(); + endDv = new DateValuePane(); + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format")); + formatLabel.setVerticalAlignment(SwingConstants.TOP); + UILabel startDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_Start_Date")); + startDateLabel.setVerticalAlignment(SwingConstants.TOP); + UILabel endDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date")); + endDateLabel.setVerticalAlignment(SwingConstants.TOP); + Component[][] components = new Component[][]{ + new Component[]{formatLabel, formatHead}, + new Component[]{startDateLabel, startDv}, + new Component[]{endDateLabel, endDv}, + new Component[]{waterMarkDictPane, null}, + new Component[]{extraPane, null}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox } + }; + double[] rowSize = {p, p, p, p, p, p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}, {1, 1}}; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); + + + return panel; } @Override @@ -76,20 +88,20 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane refreshPreviewLabel()); - timeFormatComboBox.addActionListener(e -> refreshPreviewLabel()); + dateFormatComboBox.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + refreshPreviewLabel(); + } + }); + timeFormatComboBox.addActionListener(new ActionListener(){ + public void actionPerformed(ActionEvent e){ + refreshPreviewLabel(); + } + }); final UILabel dateSampleLabel = createSamplePane(); final UILabel timeSampleLabel = createSamplePane(); + JPanel fomatHeadPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); final CardLayout cardLayout = new CardLayout(); final JPanel customPane = new JPanel(cardLayout); JPanel dateFormatPane = createFormatPane(dateFormatComboBox, dateSampleLabel); JPanel timeFormatPane = createFormatPane(timeFormatComboBox, timeSampleLabel); customPane.add(dateFormatPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date")); customPane.add(timeFormatPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")); - final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")}; - formatButtonGroup = new UIButtonGroup<>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")}); - formatButtonGroup.addChangeListener(e -> { - int newSelectedIndex = formatButtonGroup.getSelectedIndex(); - cardLayout.show(customPane, tabTitles[newSelectedIndex]); - if(newSelectedIndex == 0){ - currentFormatComboBox = dateFormatComboBox; - currentSampleLabel = dateSampleLabel; - }else{ - currentFormatComboBox = timeFormatComboBox; - currentSampleLabel = timeSampleLabel; + final String[] tabTitles = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")}; + fomatHeadGroup = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Date"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Time")}); + fomatHeadGroup.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + int newSelectedIndex = fomatHeadGroup.getSelectedIndex(); + cardLayout.show(customPane, tabTitles[newSelectedIndex]); + if(newSelectedIndex == 0){ + currentFormatComboBox = dateFormatComboBox; + currentSamplelabel = dateSampleLabel; + }else{ + currentFormatComboBox = timeFormatComboBox; + currentSamplelabel = timeSampleLabel; + } + refreshPreviewLabel(); } - refreshPreviewLabel(); }); - return column(LayoutConstants.VERTICAL_GAP, - row( - cell(formatLabel).weight(LEFT_WEIGHT), cell(formatButtonGroup).weight(1.4), flex(1.6) - ), - row(flex(LEFT_WEIGHT), cell(customPane).weight(RIGHT_WEIGHT)) - ).getComponent(); + fomatHeadPane.add(fomatHeadGroup, BorderLayout.NORTH); + fomatHeadPane.add(customPane, BorderLayout.CENTER); + return fomatHeadPane; } + + private void refreshPreviewLabel() { String text = (String) currentFormatComboBox.getSelectedItem(); if (text != null && text.length() > 0) { @@ -153,15 +172,14 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane