Browse Source

按钮间距、布局、optionPaneUI设置确定button style;主题设置面板缩放

newui
renekton 6 months ago
parent
commit
359946750d
  1. 30
      designer-base/src/main/java/com/fine/theme/light/ui/FineOptionPaneUI.java
  2. 6
      designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java
  3. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  4. 9
      designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java
  5. 2
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  6. 3
      designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java
  7. 6
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  8. 21
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java
  9. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  10. 33
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java
  11. 5
      designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java
  12. 15
      designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java
  13. 2
      designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java
  14. 11
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  15. 9
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  16. 12
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java
  17. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java
  18. 4
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  19. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  20. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java
  21. 9
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/FormBodyStyleEditPane.java
  22. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ReportBodyStyleEditPane.java
  23. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java
  24. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ChartPreviewPane.java
  25. 3
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java
  26. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java
  27. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java
  28. 2
      designer-base/src/main/java/com/fr/file/FILEChooserPane.java
  29. 7
      designer-base/src/main/java/com/fr/widgettheme/theme/panel/WidgetDisplayReportThemePreviewPane.java
  30. 2
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties
  31. 7
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  32. 7
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

30
designer-base/src/main/java/com/fine/theme/light/ui/FineOptionPaneUI.java

@ -0,0 +1,30 @@
package com.fine.theme.light.ui;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatOptionPaneUI;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.UIManager;
import javax.swing.plaf.ComponentUI;
import java.awt.Component;
import java.awt.Container;
public class FineOptionPaneUI extends FlatOptionPaneUI {
public static ComponentUI createUI(JComponent c ) {
return new FineOptionPaneUI();
}
@Override
protected void addButtonComponents(Container container, Object[] buttons,
int initialIndex) {
super.addButtonComponents(container, buttons, initialIndex);
Component[] components = container.getComponents();
for (Component component: components) {
if (UIManager.getString("OptionPane.okButtonText", optionPane.getLocale()).equals(((JButton) component).getText())) {
FineUIStyle.setStyle((JButton) component, FineUIStyle.STYLE_PRIMARY);
}
}
}
}

6
designer-base/src/main/java/com/fr/design/actions/file/RenameAction.java

@ -2,6 +2,7 @@ package com.fr.design.actions.file;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.chartx.TwoTuple; import com.fr.chartx.TwoTuple;
@ -194,6 +195,7 @@ public class RenameAction extends UpdateAction {
// 确认按钮 // 确认按钮
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
FineUIStyle.setStyle(confirmButton, FineUIStyle.STYLE_PRIMARY);
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -213,8 +215,8 @@ public class RenameAction extends UpdateAction {
}); });
JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0)); JPanel buttonsPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 8, 0));
buttonsPane.setBorder(new ScaledEmptyBorder(10, 15, 10, 10)); buttonsPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
buttonsPane.add(confirmButton); buttonsPane.add(confirmButton);
buttonsPane.add(cancelButton); buttonsPane.add(cancelButton);

2
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -337,7 +337,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
hiddenPanel.setLayout(new BorderLayout(2, 0)); hiddenPanel.setLayout(new BorderLayout(2, 0));
hiddenPanel.add(new JPanel(), BorderLayout.WEST); hiddenPanel.add(new JPanel(), BorderLayout.WEST);
hiddenPanel.add(new JPanel(), BorderLayout.EAST); hiddenPanel.add(new JPanel(), BorderLayout.EAST);
downPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 15, 9)); downPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 8, 10));
downPane.add(okButton); downPane.add(okButton);
downPane.add(cancelButton); downPane.add(cancelButton);
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));

9
designer-base/src/main/java/com/fr/design/file/DefaultTemplateTreeDefineProcessor.java

@ -1,6 +1,7 @@
package com.fr.design.file; package com.fr.design.file;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.file.DelFileAction; import com.fr.design.actions.file.DelFileAction;
import com.fr.design.actions.file.LocateAction; import com.fr.design.actions.file.LocateAction;
@ -375,7 +376,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
// 确认按钮,默认就可用 // 确认按钮,默认就可用
confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm")); confirmButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Confirm"));
confirmButton.setPreferredSize(new Dimension(60, 25)); confirmButton.setPreferredSize(FineUIScale.scale(new Dimension(60, 25)));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -386,7 +387,7 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
// 取消按钮 // 取消按钮
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
cancelButton.setPreferredSize(new Dimension(60, 25)); cancelButton.setPreferredSize(FineUIScale.scale(new Dimension(60, 25)));
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
@ -396,8 +397,8 @@ public class DefaultTemplateTreeDefineProcessor extends AbstractTemplateTreeDefi
} }
}); });
JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 0)); JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 8, 0));
bottomPanel.setBorder(BorderFactory.createEmptyBorder(10, 15, 10, 10)); bottomPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
bottomPanel.add(confirmButton); bottomPanel.add(confirmButton);
bottomPanel.add(cancelButton); bottomPanel.add(cancelButton);
this.add(bottomPanel, BorderLayout.SOUTH); this.add(bottomPanel, BorderLayout.SOUTH);

2
designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java

@ -73,7 +73,7 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(row(8, this.add(row(4,
cell(formulaTextField).weight(2.4), cell(formulaTextFieldButton).weight(0.5) cell(formulaTextField).weight(2.4), cell(formulaTextFieldButton).weight(0.5)
).getComponent()) ; ).getComponent()) ;
} }

3
designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java

@ -1,5 +1,6 @@
package com.fr.design.gui.columnrow; package com.fr.design.gui.columnrow;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ispinner.ColumnRowSpinner; import com.fr.design.gui.ispinner.ColumnRowSpinner;
@ -133,6 +134,7 @@ public class ColumnRowPane extends JPanel implements UIObserver {
} }
}; };
rowSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner); JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner);
if (rftf != null) { if (rftf != null) {
rftf.setColumns(4); // specify more width than we need rftf.setColumns(4); // specify more width than we need
@ -147,6 +149,7 @@ public class ColumnRowPane extends JPanel implements UIObserver {
return false; return false;
} }
}; };
columnSpinner.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner); JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner);
if (cftf != null) { if (cftf != null) {
cftf.setColumns(3); // specify more width than we need cftf.setColumns(3); // specify more width than we need

6
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -81,7 +81,7 @@ public abstract class UIControlPane extends JControlPane {
if (isNewStyle()) { if (isNewStyle()) {
createPopupEditDialog(cardPane); createPopupEditDialog(cardPane);
this.add(getLeftPane(), BorderLayout.CENTER); this.add(getLeftPane(), BorderLayout.CENTER);
this.setBorder(new ScaledEmptyBorder(10, 10, 15, 10)); this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
} else { } else {
// 增加边框 // 增加边框
JPanel leftPaneWrapper = new JPanel(new BorderLayout()); JPanel leftPaneWrapper = new JPanel(new BorderLayout());
@ -185,6 +185,10 @@ public abstract class UIControlPane extends JControlPane {
this.repaint(); this.repaint();
} }
protected UIToolbar getTopToolBar() {
return this.topToolBar;
}
// 点击"编辑"按钮,弹出面板 // 点击"编辑"按钮,弹出面板
protected class PopupEditDialog extends JDialog { protected class PopupEditDialog extends JDialog {
private JComponent editPane; private JComponent editPane;

21
designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java

@ -1,8 +1,11 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -11,6 +14,7 @@ import com.fr.design.gui.ilist.ListModelElement;
import com.fr.design.gui.ilist.ModNameActionListener; import com.fr.design.gui.ilist.ModNameActionListener;
import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.ilist.UIList;
import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.gui.ilist.UINameEdList;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.EventCreator; import com.fr.design.widget.EventCreator;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
@ -21,6 +25,7 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.ListModel; import javax.swing.ListModel;
@ -78,6 +83,13 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
return isPopulating; return isPopulating;
} }
@Override
protected JPanel getLeftTopPane(UIToolbar topToolBar) {
UIToolbar toolbar = getTopToolBar();
toolbar.setPreferredSize(FineUIScale.scale(new Dimension(160, 24)));
return super.getLeftTopPane(topToolBar);
}
@Override @Override
protected void initLeftPane(JPanel leftPane) { protected void initLeftPane(JPanel leftPane) {
leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER); leftPane.add(new UIScrollPane(contentPane = FRGUIPaneFactory.createVerticalFlowLayout_Pane(true, FlowLayout.LEADING, 0, 0)), BorderLayout.CENTER);
@ -200,6 +212,7 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
nameEdList.setCellRenderer(new UINameableListCellRenderer(true, this.creators)); nameEdList.setCellRenderer(new UINameableListCellRenderer(true, this.creators));
nameEdList.setName(text); nameEdList.setName(text);
nameEdList.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
nameEdList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS); nameEdList.setSelectionBackground(UIConstants.ATTRIBUTE_PRESS);
nameEdList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameEdList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameEdList.addMouseListener(new MouseAdapter() { nameEdList.addMouseListener(new MouseAdapter() {
@ -537,18 +550,18 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li
public ListWrapperPane(String labelText, UINameEdList nameEdList) { public ListWrapperPane(String labelText, UINameEdList nameEdList) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel label = new UILabel(labelText + getWrapperLabelText()) { UILabel label = new UILabel(" " + labelText + getWrapperLabelText()) {
@Override @Override
public void paint(Graphics g) { public void paint(Graphics g) {
((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f)); ((Graphics2D) g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.8f));
super.paint(g); super.paint(g);
} }
}; };
label.setBorder(new ScaledEmptyBorder(0, 8, 0, 0)); label.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, FineUIUtils.getUIColor("fill.hover", "fill.hover")));
label.setOpaque(true); label.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
label.setBackground(Color.WHITE);
label.setForeground(UIManager.getColor("List.wrapper.text.fontColor")); label.setForeground(UIManager.getColor("List.wrapper.text.fontColor"));
label.setFont(label.getFont().deriveFont(11F)); label.setFont(label.getFont().deriveFont(11F));
label.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(24)));
this.nameEdList = nameEdList; this.nameEdList = nameEdList;
this.add(label, BorderLayout.NORTH); this.add(label, BorderLayout.NORTH);
this.add(this.nameEdList, BorderLayout.CENTER); this.add(this.nameEdList, BorderLayout.CENTER);

3
designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupPane.java

@ -5,7 +5,6 @@ import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
@ -107,7 +106,7 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
return row(10, return row(10,
cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())), cell(FRWidgetFactory.createLineWrapLabel(getAddItemText())),
cell(topToolBar).with(it -> { cell(topToolBar).with(it -> {
it.setPreferredSize(new Dimension(0, FineUIScale.scale(24))); it.setPreferredSize(FineUIScale.scale(new Dimension(160, 24)));
it.setBorderPainted(true); it.setBorderPainted(true);
it.setBorder(FineBorderFactory.createWrappedRoundBorder()); it.setBorder(FineBorderFactory.createWrappedRoundBorder());
it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE)); it.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));

33
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -1,21 +1,24 @@
package com.fr.design.gui.itree.filetree; package com.fr.design.gui.itree.filetree;
import com.fine.theme.utils.FineUIUtils;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.filetree.IOFileNodeFilter; import com.fr.file.filetree.IOFileNodeFilter;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Font;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
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.cell;
public class ReportletPane extends BasicPane { public class ReportletPane extends BasicPane {
private TemplateFileTree templateReportletTree; private TemplateFileTree templateReportletTree;
private JScrollPane t_panel; private JScrollPane t_panel;
@ -27,21 +30,18 @@ public class ReportletPane extends BasicPane {
private JPanel cardPane; private JPanel cardPane;
public ReportletPane() { public ReportletPane() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(new BorderLayout());
// Description
UITextArea textPane = new UITextArea();
this.add(textPane, BorderLayout.NORTH);
textPane.setEditable(false);
textPane.setLineWrap(true);
textPane.setFont(DesignUtils.getDefaultGUIFont().applyStyle(Font.BOLD));
textPane.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter"));
JPanel buttonPane = new JPanel(new BorderLayout());
// Description
UILabel tipLabel = new UILabel();
tipLabel.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Schedule_The_Selected_File_Must_Be_End_With_Filter"));
tipLabel.setForeground(FineUIUtils.getUIColor("Label.tipColor", "Label.tipColor"));
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
switchButton = new UIButton("switch"); switchButton = new UIButton("switch");
centerPane.add(GUICoreUtils.createBorderPane(switchButton, BorderLayout.WEST), BorderLayout.NORTH); buttonPane.add(row(10, cell(switchButton), cell(tipLabel)).getComponent());
switchButton.addActionListener(new ActionListener() { switchButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -50,15 +50,16 @@ public class ReportletPane extends BasicPane {
}); });
cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
centerPane.add(cardPane, BorderLayout.CENTER);
cardPane.setLayout(card = new CardLayout()); cardPane.setLayout(card = new CardLayout());
templateReportletTree = new TemplateFileTree(); templateReportletTree = new TemplateFileTree();
templateReportletTree.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
templateReportletTree.setBorder(FineBorderFactory.createWrappedRoundBorder());
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form", ".cptx"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt", ".class", ".frm", ".form", ".cptx"});
templateReportletTree.setFileNodeFilter(filter); templateReportletTree.setFileNodeFilter(filter);
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree(); classReportletTree = new ClassFileTree();
cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS"); cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS");
centerPane.add(column(6, cell(buttonPane), cell(cardPane)).getComponent());
this.refreshEnv(); this.refreshEnv();
} }

5
designer-base/src/main/java/com/fr/design/gui/style/AbstractTranslucentBackgroundSpecialPane.java

@ -1,5 +1,6 @@
package com.fr.design.gui.style; package com.fr.design.gui.style;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UIPercentDragPane; import com.fr.design.gui.frpane.UIPercentDragPane;
@ -51,7 +52,7 @@ public abstract class AbstractTranslucentBackgroundSpecialPane<T extends Backgro
// 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐 // 确保BackgroundSpecialPane高度变化时,Label依然保持与其顶部对齐
JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel backgroundLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
backgroundLabelPane.setBorder(BorderFactory.createEmptyBorder(7, 0, 0, 0)); backgroundLabelPane.setBorder(new ScaledEmptyBorder(7, 0, 0, 0));
backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(backgroundName), BorderLayout.NORTH); backgroundLabelPane.add(FRWidgetFactory.createLineWrapLabel(backgroundName), BorderLayout.NORTH);
JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane( JPanel backgroundComposedPane = TableLayoutHelper.createGapTableLayoutPane(
@ -66,7 +67,7 @@ public abstract class AbstractTranslucentBackgroundSpecialPane<T extends Backgro
{new UILabel(""), opacityPane} {new UILabel(""), opacityPane}
}, },
new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1); new double[]{p, p}, columnSize, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1);
opacityComposedPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); opacityComposedPane.setBorder(new ScaledEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
opacityComposedPane.setVisible(false); opacityComposedPane.setVisible(false);
backgroundPane.addChangeListener(new ChangeListener() { backgroundPane.addChangeListener(new ChangeListener() {

15
designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java

@ -171,7 +171,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyp
} }
}); });
reportletNamePane.add(row(10, reportletNamePane.add(row(4,
cell(reportPathTextField).weight(0.85), cell(reportPathTextField).weight(0.85),
cell(browserButton).weight(0.15) cell(browserButton).weight(0.15)
).getComponent()); ).getComponent());
@ -288,13 +288,12 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyp
// 参数传递方式下拉框 // 参数传递方式下拉框
postComboBox = new UIComboBox(new String[]{"GET", "POST"}); postComboBox = new UIComboBox(new String[]{"GET", "POST"});
postComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
showParameterInterface = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); showParameterInterface = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display"));
content.add(row(10, content.add(row(4,
cell(postComboBox).weight(0.75), cell(postComboBox).weight(0.8),
cell(showParameterInterface).weight(0.25) cell(showParameterInterface).weight(0.2)
).getComponent()); ).getComponent());
return content; return content;
} }
@ -377,9 +376,9 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane<ReportletHyp
UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Designer_Width")); UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Designer_Width"));
UISpinner widthTextFiled = new UISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_V_VALUE); UISpinner widthTextFiled = new UISpinner(0, Integer.MAX_VALUE, 1, DEFAULT_V_VALUE);
this.setWidthTextFiled(widthTextFiled); this.setWidthTextFiled(widthTextFiled);
sizePane.add(column(8, sizePane.add(column(10,
row(10, cell(heightLabel).weight(0.15), cell(heightTextFiled).weight(0.85)), row(4, cell(heightLabel).weight(0.15), cell(heightTextFiled).weight(0.85)),
row(10, cell(widthLabel).weight(0.15), cell(widthTextFiled).weight(0.85)) row(4, cell(widthLabel).weight(0.15), cell(widthTextFiled).weight(0.85))
).getComponent()); ).getComponent());
sizePane.setVisible(true); sizePane.setVisible(true);
dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Size")), sizePane}); dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Size")), sizePane});

2
designer-base/src/main/java/com/fr/design/hyperlink/popup/ContentSettingPane.java

@ -165,7 +165,7 @@ public class ContentSettingPane extends AbstractHyperLinkPane<MobilePopupHyperli
UILabel templateLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Template")); UILabel templateLabel = new UILabel(Toolkit.i18nText("FR-Plugin-Designer_Mobile_Popup_Template"));
templatePanel.add(row(44, templatePanel.add(row(44,
cell(templateLabel), cell(templateLabel),
row(8, row(4,
cell(templatePathTextField).weight(1.0), cell(templatePathTextField).weight(1.0),
cell(templateSelectButton)) cell(templateSelectButton))
).getComponent()); ).getComponent());

11
designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java

@ -42,6 +42,8 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; 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.cell;
@ -187,22 +189,23 @@ public class JSContentPane extends BasicPane {
}.execute(); }.execute();
} }
}); });
labelPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); labelPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
labelPane.add(label,BorderLayout.CENTER); labelPane.add(label,BorderLayout.CENTER);
JPanel jsParaPane = new JPanel(new BorderLayout()); JPanel jsParaPane = new JPanel(new BorderLayout());
funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal")); funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
UIScrollPane scrollPane = new UIScrollPane(funNameLabel); UIScrollPane scrollPane = new UIScrollPane(funNameLabel);
scrollPane.setOpaque(true); scrollPane.setOpaque(true);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC)); scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
jsParaPane.add(row(10, jsParaPane.add(row(4,
cell(scrollPane).weight(0.55), cell(scrollPane).weight(1),
cell(labelPane).weight(0.45) cell(labelPane)
).getComponent()); ).getComponent());
return jsParaPane; return jsParaPane;
} }
protected void initFunctionTitle(String[] args){ protected void initFunctionTitle(String[] args){
funNameLabel = new UILabel(); funNameLabel = new UILabel();
funNameLabel.setBackground(FineUIUtils.getUIColor("background.normal", "background.normal"));
this.setFunctionTitle(args); this.setFunctionTitle(args);
} }

9
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme; package com.fr.design.mainframe.theme;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.TemplateThemeConfig;
@ -37,9 +38,9 @@ import java.awt.event.MouseEvent;
* Created by Starryi on 2021/8/13 * Created by Starryi on 2021/8/13
*/ */
public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel { public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
public static final int INFO_HEIGHT = 30; public static final int INFO_HEIGHT = FineUIScale.scale(30);
public static final int CONTENT_WIDTH = ThemeThumbnail.WIDTH; public static final int CONTENT_WIDTH = FineUIScale.scale(ThemeThumbnail.WIDTH);
public static final int CONTENT_HEIGHT = ThemeThumbnail.HEIGHT + INFO_HEIGHT; public static final int CONTENT_HEIGHT = FineUIScale.scale(ThemeThumbnail.HEIGHT) + INFO_HEIGHT;
private static final Color HOVERING_BORDER_COLOR = new Color(65, 155, 249); private static final Color HOVERING_BORDER_COLOR = new Color(65, 155, 249);
private final String name; private final String name;
@ -151,7 +152,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
private void addProfileButton(JPanel panel) { private void addProfileButton(JPanel panel) {
profileButton = new UILabel(profileIcon); profileButton = new UILabel(profileIcon);
profileButton.setPreferredSize(new Dimension(24, 24)); profileButton.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
panel.add(profileButton, BorderLayout.EAST); panel.add(profileButton, BorderLayout.EAST);
} }

12
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeEditorPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.theme; package com.fr.design.mainframe.theme;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeConfig; import com.fr.base.theme.TemplateThemeConfig;
@ -84,7 +86,7 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
private void initializePane() { private void initializePane() {
setLayout(new BorderLayout(0, 0)); setLayout(new BorderLayout(0, 0));
setPreferredSize(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT)); setPreferredSize(FineUIScale.scale(new Dimension(RIGHT_PANE_WIDTH, RIGHT_PANE_HEIGHT)));
JPanel nameEditPane = createNameEditPane(); JPanel nameEditPane = createNameEditPane();
add(nameEditPane, BorderLayout.NORTH); add(nameEditPane, BorderLayout.NORTH);
@ -103,7 +105,7 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
nameTextField.setThemeConfig(config); nameTextField.setThemeConfig(config);
nameTextField.setEditable(false); nameTextField.setEditable(false);
nameTextField.setEnabled(false); nameTextField.setEnabled(false);
nameTextField.setPreferredSize(new Dimension(165, 20)); nameTextField.setPreferredSize(FineUIScale.scale(new Dimension(165, 20)));
nameTextField.setNameCheckListener(new AutoCheckTextField.CheckListener() { nameTextField.setNameCheckListener(new AutoCheckTextField.CheckListener() {
@Override @Override
public void onChecked(String error, boolean valid) { public void onChecked(String error, boolean valid) {
@ -121,7 +123,7 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
new Component[] { null, nameErrorLabel }, new Component[] { null, nameErrorLabel },
}, new double[] { 20, 20}, new double[] { p, 165}, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_W0); }, new double[] { 20, 20}, new double[] { p, 165}, IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_W0);
container.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); container.setBorder(new ScaledEmptyBorder(5, 0, 0, 0));
return container; return container;
} }
@ -142,7 +144,7 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
{null, tipLabel}, {null, tipLabel},
}, },
rowSize, columnSize, 18, 7); rowSize, columnSize, 18, 7);
content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); content.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
JPanel borderContainer = new JPanel(new BorderLayout()); JPanel borderContainer = new JPanel(new BorderLayout());
borderContainer.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Title"))); borderContainer.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Color_Scheme_Title")));
@ -180,7 +182,7 @@ public abstract class TemplateThemeEditorPane<T extends TemplateTheme> extends J
container.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Custom_Settings_Title"))); container.setBorder(BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Edit_Pane_Custom_Settings_Title")));
uiTabbedPane = new UITabbedPane(); uiTabbedPane = new UITabbedPane();
uiTabbedPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 1)); uiTabbedPane.setBorder(new ScaledEmptyBorder(10, 5, 10, 1));
container.add(uiTabbedPane, BorderLayout.CENTER); container.add(uiTabbedPane, BorderLayout.CENTER);
initPluginListener(); initPluginListener();
return container; return container;

5
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemePreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme; package com.fr.design.mainframe.theme;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemeThumbnail; import com.fr.base.theme.settings.ThemeThumbnail;
@ -22,8 +23,8 @@ import java.awt.image.BufferedImage;
*/ */
public abstract class TemplateThemePreviewPane<T extends TemplateTheme> extends JPanel implements CallbackEvent, ThemePreviewed<T> { public abstract class TemplateThemePreviewPane<T extends TemplateTheme> extends JPanel implements CallbackEvent, ThemePreviewed<T> {
private JPanel parent; private JPanel parent;
public static final int PREVIEW_WIDTH = 627; public static final int PREVIEW_WIDTH = FineUIScale.scale(627);
public static final int PREVIEW_HEIGHT = 532; public static final int PREVIEW_HEIGHT = FineUIScale.scale(532);
public void setParent(JPanel parent) { public void setParent(JPanel parent) {
this.parent = parent; this.parent = parent;

4
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java

@ -88,7 +88,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
JPanel titleContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel titleContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
titleContainer.setPreferredSize(FineUIScale.scale(new Dimension(LEFT_TITLE_PANE_WIDTH, LEFT_TITLE_PANE_HEIGHT))); titleContainer.setPreferredSize(FineUIScale.scale(new Dimension(LEFT_TITLE_PANE_WIDTH, LEFT_TITLE_PANE_HEIGHT)));
JPanel previewContainer = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel previewContainer = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewContainer.setBorder(BorderFactory.createEmptyBorder(5, 4, 10, 4)); previewContainer.setBorder(new ScaledEmptyBorder(5, 4, 10, 4));
titleContainer.add(createTitlePane(), BorderLayout.NORTH); titleContainer.add(createTitlePane(), BorderLayout.NORTH);
titleContainer.add(previewContainer, BorderLayout.CENTER); titleContainer.add(previewContainer, BorderLayout.CENTER);
@ -379,7 +379,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
*/ */
protected JPanel createTitlePane() { protected JPanel createTitlePane() {
JPanel titlePane = new JPanel(); JPanel titlePane = new JPanel();
titlePane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); titlePane.setBorder(new ScaledEmptyBorder(0, 5, 0, 5));
titlePane.setLayout(new BorderLayout()); titlePane.setLayout(new BorderLayout());
leftTitleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Preview_Pane_Title")); leftTitleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Preview_Pane_Title"));
leftTitlePromptLabel = new UILabel(Toolkit.i18nText("Fine-Design_Theme_Control_PC_Prompt")); leftTitlePromptLabel = new UILabel(Toolkit.i18nText("Fine-Design_Theme_Control_PC_Prompt"));

3
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit; package com.fr.design.mainframe.theme.edit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedCellStyle; import com.fr.base.theme.settings.ThemedCellStyle;
import com.fr.base.theme.settings.ThemedCellStyleList; import com.fr.base.theme.settings.ThemedCellStyleList;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -56,7 +57,7 @@ public class CellStyleListEditPane extends JListControlPane {
public CellStyleListEditPane() { public CellStyleListEditPane() {
super(); super();
setBorder(BorderFactory.createEmptyBorder(10, 5, 10, 5)); setBorder(new ScaledEmptyBorder(10, 5, 10, 5));
addModNameActionListener(new ModNameActionListener() { addModNameActionListener(new ModNameActionListener() {
public void nameModed(int index, String oldName, String newName) { public void nameModed(int index, String oldName, String newName) {
if (ComparatorUtils.equals(oldName, newName) || ComparatorUtils.equals(newName, NameInspector.ILLEGAL_NAME_HOLDER)) { if (ComparatorUtils.equals(oldName, newName) || ComparatorUtils.equals(newName, NameInspector.ILLEGAL_NAME_HOLDER)) {

3
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ChartStyleEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit; package com.fr.design.mainframe.theme.edit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedChartStyle; import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
@ -34,7 +35,7 @@ public class ChartStyleEditPane extends MultiTabPane<ThemedChartStyle> {
@Override @Override
protected void initLayout() { protected void initLayout() {
super.initLayout(); super.initLayout();
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
} }
@Override @Override

9
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/FormBodyStyleEditPane.java

@ -1,8 +1,11 @@
package com.fr.design.mainframe.theme.edit; package com.fr.design.mainframe.theme.edit;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedFormBodyStyle; import com.fr.base.theme.settings.ThemedFormBodyStyle;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.style.ComponentBodyStylePane; import com.fr.design.gui.style.ComponentBodyStylePane;
import com.fr.web.component.FineUIShowComponent;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
@ -14,14 +17,14 @@ import javax.swing.ScrollPaneConstants;
* Created by Starryi on 2021/8/12 * Created by Starryi on 2021/8/12
*/ */
public class FormBodyStyleEditPane extends JScrollPane { public class FormBodyStyleEditPane extends JScrollPane {
public static final int LABEL_WIDTH = 60; public static final int LABEL_WIDTH = FineUIScale.scale(60);
public static final int SETTING_WIDTH = 193; public static final int SETTING_WIDTH = FineUIScale.scale(193);
private final ComponentBodyStylePane bodyStylePane; private final ComponentBodyStylePane bodyStylePane;
public FormBodyStyleEditPane() { public FormBodyStyleEditPane() {
bodyStylePane = new ComponentBodyStylePane(LABEL_WIDTH, SETTING_WIDTH); bodyStylePane = new ComponentBodyStylePane(LABEL_WIDTH, SETTING_WIDTH);
bodyStylePane.setBorder(BorderFactory.createEmptyBorder( bodyStylePane.setBorder(new ScaledEmptyBorder(
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,

5
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ReportBodyStyleEditPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit; package com.fr.design.mainframe.theme.edit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.settings.ThemedReportBodyStyle; import com.fr.base.theme.settings.ThemedReportBodyStyle;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -34,12 +35,12 @@ public class ReportBodyStyleEditPane extends JScrollPane {
JPanel uiLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel uiLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
uiLabelPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill")), BorderLayout.NORTH); uiLabelPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill")), BorderLayout.NORTH);
uiLabelPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); uiLabelPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
JPanel backgroundLabeledPane = TableLayoutHelper.createCommonTableLayoutPane( JPanel backgroundLabeledPane = TableLayoutHelper.createCommonTableLayoutPane(
new Component[][]{ new Component[] { uiLabelPane, backgroundPane } }, new Component[][]{ new Component[] { uiLabelPane, backgroundPane } },
new double[] { p }, new double[] { LABEL_WIDTH, SETTING_WIDTH}, IntervalConstants.INTERVAL_L1 new double[] { p }, new double[] { LABEL_WIDTH, SETTING_WIDTH}, IntervalConstants.INTERVAL_L1
); );
backgroundLabeledPane.setBorder(BorderFactory.createEmptyBorder( backgroundLabeledPane.setBorder(new ScaledEmptyBorder(
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,
IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L1,

3
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.edit.ui; package com.fr.design.mainframe.theme.edit.ui;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.FineColor; import com.fr.base.FineColor;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
@ -29,7 +30,7 @@ import java.util.List;
*/ */
public class ColorListPane extends JPanel implements UIObserver { public class ColorListPane extends JPanel implements UIObserver {
public static final int DEFAULT_COLOR_COUNT = 8; public static final int DEFAULT_COLOR_COUNT = 8;
public static final int DEFAULT_COLOR_SIZE = 16; public static final int DEFAULT_COLOR_SIZE = FineUIScale.scale(16);
public static final int DEFAULT_COLOR_GAP = 3; public static final int DEFAULT_COLOR_GAP = 3;
private final int colorCount; private final int colorCount;

3
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ChartPreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.preview; package com.fr.design.mainframe.theme.preview;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.base.chart.BaseChartPainter; import com.fr.base.chart.BaseChartPainter;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
@ -28,7 +29,7 @@ public class ChartPreviewPane extends MiddleChartComponent implements ThemePrevi
private CallbackEvent callbackEvent; private CallbackEvent callbackEvent;
public ChartPreviewPane() { public ChartPreviewPane() {
this.setBorder(BorderFactory.createEmptyBorder(0, 1, 2, 1)); this.setBorder(new ScaledEmptyBorder(0, 1, 2, 1));
} }
public void setCallbackEvent(CallbackEvent callbackEvent) { public void setCallbackEvent(CallbackEvent callbackEvent) {

3
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ComponentPreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.preview; package com.fr.design.mainframe.theme.preview;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageBackground;
@ -59,7 +60,7 @@ public abstract class ComponentPreviewPane extends UINoOpaquePanel implements Th
setLayout(new BorderLayout()); setLayout(new BorderLayout());
if (StringUtils.isNotEmpty(title)) { if (StringUtils.isNotEmpty(title)) {
titlePane = new TitleDemoPane(title); titlePane = new TitleDemoPane(title);
titlePane.setPreferredSize(new Dimension(517, TITLE_HEIGHT)); titlePane.setPreferredSize(FineUIScale.scale(new Dimension(517, TITLE_HEIGHT)));
container.add(titlePane, BorderLayout.NORTH); container.add(titlePane, BorderLayout.NORTH);
} }
container.add(createContentPane(), BorderLayout.CENTER); container.add(createContentPane(), BorderLayout.CENTER);

5
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/FormThemePreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.preview; package com.fr.design.mainframe.theme.preview;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
@ -61,7 +62,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
chartContent.setLayout(new BorderLayout()); chartContent.setLayout(new BorderLayout());
JPanel columnChartPanel = new UINoOpaquePanel() { JPanel columnChartPanel = new UINoOpaquePanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(379, 314); return FineUIScale.scale(new Dimension(379, 314));
} }
}; };
columnChartPanel.setLayout(new BorderLayout()); columnChartPanel.setLayout(new BorderLayout());
@ -70,7 +71,7 @@ public class FormThemePreviewPane extends TemplateThemePreviewPane<FormTheme> {
JPanel pieChartPanel = new UINoOpaquePanel() { JPanel pieChartPanel = new UINoOpaquePanel() {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
return new Dimension(236, 314); return FineUIScale.scale(new Dimension(236, 314));
} }
}; };
pieChartPanel.setLayout(new BorderLayout()); pieChartPanel.setLayout(new BorderLayout());

5
designer-base/src/main/java/com/fr/design/mainframe/theme/preview/ReportThemePreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme.preview; package com.fr.design.mainframe.theme.preview;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.base.theme.ReportTheme; import com.fr.base.theme.ReportTheme;
@ -41,11 +42,11 @@ public class ReportThemePreviewPane extends TemplateThemePreviewPane<ReportTheme
public ReportThemePreviewPane() { public ReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane(); chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 207)); chartPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(615, 207)));
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new ECReportPreviewPane(); reportPreviewPane = new ECReportPreviewPane();
reportPreviewPane.setPreferredSize(new Dimension(615, 297)); reportPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(615, 297)));
this.add(reportPreviewPane, BorderLayout.NORTH); this.add(reportPreviewPane, BorderLayout.NORTH);
this.add(chartPreviewPane, BorderLayout.CENTER); this.add(chartPreviewPane, BorderLayout.CENTER);
} }

2
designer-base/src/main/java/com/fr/file/FILEChooserPane.java

@ -493,7 +493,7 @@ public class FILEChooserPane extends BasicPane {
cell(centerRightPane).weight(1) cell(centerRightPane).weight(1)
).weight(3) ).weight(3)
).weight(1), ).weight(1),
row(10, row(8,
flex(), cell(cancelButton), cell(okButton).with(it -> FineUIStyle.setStyle(it, FineUIStyle.STYLE_PRIMARY)) flex(), cell(cancelButton), cell(okButton).with(it -> FineUIStyle.setStyle(it, FineUIStyle.STYLE_PRIMARY))
) )
).getComponent(); ).getComponent();

7
designer-base/src/main/java/com/fr/widgettheme/theme/panel/WidgetDisplayReportThemePreviewPane.java

@ -1,5 +1,6 @@
package com.fr.widgettheme.theme.panel; package com.fr.widgettheme.theme.panel;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.base.theme.ReportTheme; import com.fr.base.theme.ReportTheme;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -44,14 +45,14 @@ public class WidgetDisplayReportThemePreviewPane extends TemplateThemePreviewPan
public WidgetDisplayReportThemePreviewPane() { public WidgetDisplayReportThemePreviewPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
chartPreviewPane = new ChartPreviewPane(); chartPreviewPane = new ChartPreviewPane();
chartPreviewPane.setPreferredSize(new Dimension(615, 207)); chartPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(615, 207)));
chartPreviewPane.populate(initColumnChart()); chartPreviewPane.populate(initColumnChart());
chartPreviewPane.setCallbackEvent(this); chartPreviewPane.setCallbackEvent(this);
reportPreviewPane = new WidgetThemeECReportPreviewPane(); reportPreviewPane = new WidgetThemeECReportPreviewPane();
reportPreviewPane.setPreferredSize(new Dimension(615, 257)); reportPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(615, 257)));
controlPreviewPane = new ControlPreviewPane(); controlPreviewPane = new ControlPreviewPane();
controlPreviewPane.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); controlPreviewPane.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
controlPreviewPane.setPreferredSize(new Dimension(615, 40)); controlPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(615, 40)));
controlPreviewPane.initControlPreviewPane(); controlPreviewPane.initControlPreviewPane();
this.add(reportPreviewPane, BorderLayout.CENTER); this.add(reportPreviewPane, BorderLayout.CENTER);
this.add(chartPreviewPane, BorderLayout.SOUTH); this.add(chartPreviewPane, BorderLayout.SOUTH);

2
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLaf.properties

@ -17,7 +17,7 @@ MenuUI=com.formdev.flatlaf.ui.FlatMenuUI
MenuBarUI=com.formdev.flatlaf.ui.FlatMenuBarUI MenuBarUI=com.formdev.flatlaf.ui.FlatMenuBarUI
MenuItemUI=com.fine.theme.light.ui.FineMenuItemUI MenuItemUI=com.fine.theme.light.ui.FineMenuItemUI
TemplateListMenuItemUI=com.fine.theme.light.ui.FineTemplateListMenuItemUI TemplateListMenuItemUI=com.fine.theme.light.ui.FineTemplateListMenuItemUI
OptionPaneUI=com.formdev.flatlaf.ui.FlatOptionPaneUI OptionPaneUI=com.fine.theme.light.ui.FineOptionPaneUI
PanelUI=com.fine.theme.light.ui.FinePanelUI PanelUI=com.fine.theme.light.ui.FinePanelUI
PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI PasswordFieldUI=com.formdev.flatlaf.ui.FlatPasswordFieldUI
PopupMenuUI=com.fine.theme.light.ui.FinePopupMenuUI PopupMenuUI=com.fine.theme.light.ui.FinePopupMenuUI

7
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -59,10 +59,9 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
addPaneInCenter(centerPane); addPaneInCenter(centerPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setPreferredSize(new Dimension(centerPane.getWidth(), FineUIScale.scale(380))); this.add(column(20,
this.add(column( cell(FineUIUtils.wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Cell"))),
cell(FineUIUtils.wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Cell"))).weight(0.3), cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))).weight(1)
cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))).weight(0.7)
).getComponent()); ).getComponent());
} }

7
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -50,7 +50,6 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
private void initComponent() { private void initComponent() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
JPanel centerPane = new JPanel(new BorderLayout()); JPanel centerPane = new JPanel(new BorderLayout());
@ -73,9 +72,9 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(column(10, this.add(column(20,
cell(FineUIUtils.wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))).weight(0.5), cell(FineUIUtils.wrapComponentWithTitle(centerPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))),
cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))).weight(0.5) cell(FineUIUtils.wrapComponentWithTitle(parameterViewPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyper_Related_Float"))).weight(1)
).getComponent()); ).getComponent());
} }

Loading…
Cancel
Save