Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/newui)

* commit '3290e2168280d111f8e384363119a72760b21bbd':
  REPORT-127437 fix: 修复 jtable 滚动条问题
  REPORT-127437 feat: 【newui】面板翻新 & 解决部分图标、代码问题
  REPORT-127437 设计器翻新 阻塞点解决 & 存量面板翻新
newui
Renekton-张世豪 4 months ago
parent
commit
5f6e67c5d7
  1. 82
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java
  2. 18
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/condition/CellHighlightAddMenuDef.java
  4. 1
      designer-base/src/main/java/com/fr/design/condition/ConditionAttrSingleConditionPane.java
  5. 24
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  6. 17
      designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java
  7. 1
      designer-base/src/main/java/com/fr/design/condition/HighLightConditionAction.java
  8. 19
      designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
  9. 12
      designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java
  10. 5
      designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java
  11. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  12. 9
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java
  13. 2
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java
  14. 20
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java
  15. 15
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java
  16. 16
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java
  17. 35
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java
  18. 10
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java
  19. 27
      designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java
  20. 10
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java
  21. 11
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  22. 2
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  23. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  24. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  25. 29
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java
  26. 102
      designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java
  27. 7
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java
  28. 89
      designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java
  29. 5
      designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java
  30. 2
      designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java
  31. 3
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java
  32. 48
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  33. 26
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java
  34. 31
      designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java
  35. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/background/BackgroundSettingPane.java
  36. 46
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/AbstractSupportSelectTablePane.java
  37. 27
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java
  38. 10
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java
  39. 2
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCellRender.java
  40. 8
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java
  41. 23
      designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsOperatorPane.java
  42. 2
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java
  43. 54
      designer-base/src/main/java/com/fr/design/report/SelectImagePane.java
  44. 41
      designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java
  45. 67
      designer-base/src/main/java/com/fr/design/style/BorderPane.java
  46. 5
      designer-base/src/main/java/com/fr/design/style/FRFontPane.java
  47. 83
      designer-base/src/main/java/com/fr/design/style/FormatPane.java
  48. 7
      designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java
  49. 3
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  50. 9
      designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java
  51. 31
      designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java
  52. 55
      designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java
  53. 29
      designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java
  54. 6
      designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java
  55. 10
      designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java
  56. 34
      designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java
  57. 10
      designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java
  58. 1
      designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java
  59. 35
      designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java
  60. 129
      designer-base/src/main/java/com/fr/env/RemoteEnvPane.java
  61. 3
      designer-base/src/main/resources/com/fine/theme/icon/colorPicker.svg
  62. 7
      designer-base/src/main/resources/com/fine/theme/icon/pageQuery.svg
  63. 3
      designer-base/src/main/resources/com/fine/theme/icon/pages.svg
  64. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/newLine.svg
  65. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page.svg
  66. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/pages.svg
  67. 8
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/selectedAll.svg
  68. 7
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  69. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  70. 5
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  71. 22
      designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java
  72. 9
      designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java
  73. 8
      designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java
  74. BIN
      designer-chart/src/main/resources/com/fr/design/images/background/null_background.png
  75. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java
  76. 28
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java
  77. 36
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java
  78. 37
      designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java
  79. 16
      designer-realize/src/main/java/com/fr/design/condition/BackPane.java
  80. 42
      designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java
  81. 16
      designer-realize/src/main/java/com/fr/design/condition/FontPane.java
  82. 14
      designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java
  83. 2
      designer-realize/src/main/java/com/fr/design/condition/HighLightConditionAttributesPane.java
  84. 14
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  85. 13
      designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java
  86. 14
      designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java
  87. 14
      designer-realize/src/main/java/com/fr/design/condition/PagePane.java
  88. 13
      designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java
  89. 14
      designer-realize/src/main/java/com/fr/design/condition/WHPane.java
  90. 14
      designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java
  91. 7
      designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java
  92. 18
      designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java
  93. 18
      designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterPane.java
  94. 13
      designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java
  95. 7
      designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java
  96. 8
      designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java
  97. 8
      designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java
  98. 69
      designer-realize/src/main/java/com/fr/design/report/SubReportPane.java
  99. 2
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

82
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConfigPane.java

@ -1,5 +1,9 @@
package com.fr.design.actions.help.alphafine; package com.fr.design.actions.help.alphafine;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -37,6 +41,11 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* Created by XiaXiang on 2017/4/6. * Created by XiaXiang on 2017/4/6.
*/ */
@ -74,13 +83,14 @@ public class AlphaFineConfigPane extends BasicPane {
} }
private void initComponents() { private void initComponents() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
createOpenPane(contentPane);
createOnlinePane(contentPane);
createShortcutsPane(contentPane);
createSearchConfigPane(contentPane);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(contentPane, BorderLayout.NORTH); add(column(
10,
cell(createOpenPane()),
cell(createOnlinePane()),
cell(createShortcutsPane()),
cell(createSearchConfigPane())
).getComponent());
} }
private Component[][] initOnlineComponents() { private Component[][] initOnlineComponents() {
@ -91,11 +101,7 @@ public class AlphaFineConfigPane extends BasicPane {
} }
// 搜索范围 // 搜索范围
private void createSearchConfigPane(JPanel contentPane) { private Component createSearchConfigPane() {
double[] rowSize = {ROW_HEIGHT, ROW_HEIGHT, ROW_HEIGHT};
double[] columnSize = {COLUMN_WIDTH, COLUMN_WIDTH, COLUMN_WIDTH};
JPanel searchConfigWrapperPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range"));
// 搜索选项 // 搜索选项
productDynamicsCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Product_News")); productDynamicsCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Product_News"));
containActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Function")); containActionCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Function"));
@ -105,11 +111,9 @@ public class AlphaFineConfigPane extends BasicPane {
containFileContentSearchCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content")); containFileContentSearchCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Templates_Content"));
containTemplateShopCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Shop")); containTemplateShopCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Template_Shop"));
containMyTemplateCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_My_Templates")); containMyTemplateCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_My_Templates"));
JPanel searchConfigPane = TableLayoutHelper.createTableLayoutPane(initSearchRangeComponents(), rowSize, columnSize);
// 自定义排序 // 自定义排序
JPanel customSortWrapperPane = new JPanel(); JPanel customSortWrapperPane = new JPanel();
customSortWrapperPane.setPreferredSize(new Dimension(SEARCH_CONFIG_PANE_HEIGHT, SEARCH_CONFIG_PANE_WIDTH));
customSortWrapperPane.setAlignmentY(JPanel.TOP_ALIGNMENT); customSortWrapperPane.setAlignmentY(JPanel.TOP_ALIGNMENT);
customSortLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Config_Custom_Sort"), false); customSortLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Config_Custom_Sort"), false);
customSortLabel.setForeground(UIConstants.NORMAL_BLUE); customSortLabel.setForeground(UIConstants.NORMAL_BLUE);
@ -123,9 +127,11 @@ public class AlphaFineConfigPane extends BasicPane {
customSortLabel.setEnabled(false); customSortLabel.setEnabled(false);
} }
searchConfigWrapperPane.add(searchConfigPane); initSearchRangeComponents();
searchConfigWrapperPane.add(customSortWrapperPane); return FineUIUtils.wrapComponentWithTitle(column(5,
contentPane.add(searchConfigWrapperPane); row(cell(productDynamicsCheckbox).weight(0.25), cell(containTemplateShopCheckbox).weight(0.25), cell(containDocumentCheckbox).weight(0.25), cell(customSortWrapperPane).weight(0.25)),
row(cell(containPluginCheckbox).weight(0.25), cell(containActionCheckbox).weight(0.25), cell(containMyTemplatePane).weight(0.25), flex(0.25))
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Range"));
} }
/** /**
@ -139,15 +145,10 @@ public class AlphaFineConfigPane extends BasicPane {
} }
private Component[][] initSearchRangeComponents() { private void initSearchRangeComponents() {
// 我的模板checkbox设置,点击后 // 我的模板checkbox设置,点击后
initMyTemplateSearchPane(); initMyTemplateSearchPane();
Component[][] components = new Component[][]{
new Component[]{productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox},
new Component[]{containPluginCheckbox, containActionCheckbox, containMyTemplatePane},
};
// 添加选项点事件,无选中选项时自定排序按钮置灰 // 添加选项点事件,无选中选项时自定排序按钮置灰
UICheckBox[] checkBoxes = new UICheckBox[]{productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox, containPluginCheckbox, containActionCheckbox, containMyTemplateCheckbox}; UICheckBox[] checkBoxes = new UICheckBox[]{productDynamicsCheckbox, containTemplateShopCheckbox, containDocumentCheckbox, containPluginCheckbox, containActionCheckbox, containMyTemplateCheckbox};
for (UICheckBox box : checkBoxes) { for (UICheckBox box : checkBoxes) {
@ -155,7 +156,6 @@ public class AlphaFineConfigPane extends BasicPane {
customSortLabel.setEnabled(hasSelectedSearchRangeCheckBox()); customSortLabel.setEnabled(hasSelectedSearchRangeCheckBox());
}); });
} }
return components;
} }
/** /**
@ -184,7 +184,7 @@ public class AlphaFineConfigPane extends BasicPane {
* 搜索范围-我的模板 * 搜索范围-我的模板
*/ */
private void initMyTemplateSearchPane() { private void initMyTemplateSearchPane() {
containMyTemplatePane = new JPanel(new FlowLayout(FlowLayout.LEFT, 4, 5)); containMyTemplatePane = new JPanel(new BorderLayout(4, 5));
containMyTemplateCheckbox.setBorder(BorderFactory.createEmptyBorder()); containMyTemplateCheckbox.setBorder(BorderFactory.createEmptyBorder());
containMyTemplateCheckbox.addActionListener(new ActionListener() { containMyTemplateCheckbox.addActionListener(new ActionListener() {
@Override @Override
@ -199,7 +199,7 @@ public class AlphaFineConfigPane extends BasicPane {
myTemplateSearchConfigButton = new JButton(); myTemplateSearchConfigButton = new JButton();
myTemplateSearchConfigButton.setBorder(BorderFactory.createEmptyBorder()); myTemplateSearchConfigButton.setBorder(BorderFactory.createEmptyBorder());
myTemplateSearchConfigButton.setMargin(new Insets(0, 0, 0, 0)); myTemplateSearchConfigButton.setMargin(new Insets(0, 0, 0, 0));
myTemplateSearchConfigButton.setIcon(IconUtils.readIcon("/com/fr/design/mainframe/alphafine/images/config.svg")); myTemplateSearchConfigButton.setIcon(new LazyIcon("tool_config"));
myTemplateSearchMenu = new UIPopupMenu(); myTemplateSearchMenu = new UIPopupMenu();
containTemplateNameSearchCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_AlphaFine_Config_Name_Search")); containTemplateNameSearchCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_AlphaFine_Config_Name_Search"));
containFileContentSearchCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_AlphaFine_Config_Content_Search")); containFileContentSearchCheckbox = new UICheckBox(Toolkit.i18nText("Fine-Design_AlphaFine_Config_Content_Search"));
@ -209,11 +209,13 @@ public class AlphaFineConfigPane extends BasicPane {
containFileContentSearchCheckbox.setBackground(null); containFileContentSearchCheckbox.setBackground(null);
myTemplateSearchMenu.add(containTemplateNameSearchCheckbox); myTemplateSearchMenu.add(containTemplateNameSearchCheckbox);
myTemplateSearchMenu.add(containFileContentSearchCheckbox); myTemplateSearchMenu.add(containFileContentSearchCheckbox);
containTemplateNameSearchCheckbox.setBorder(new ScaledEmptyBorder(0, 5, 0, 5));
containFileContentSearchCheckbox.setBorder(new ScaledEmptyBorder(0, 5, 0, 5));
myTemplateSearchConfigButton.addMouseListener(new MouseAdapter() { myTemplateSearchConfigButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
super.mouseClicked(e); super.mouseClicked(e);
GUICoreUtils.showPopupMenu(myTemplateSearchMenu, containMyTemplatePane, containMyTemplateCheckbox.getWidth(), containMyTemplatePane.getY()); GUICoreUtils.showPopupMenu(myTemplateSearchMenu, containMyTemplatePane, containMyTemplateCheckbox.getWidth(), containMyTemplatePane.getHeight());
} }
@Override @Override
@ -222,24 +224,22 @@ public class AlphaFineConfigPane extends BasicPane {
myTemplateSearchMenu.setVisible(false); myTemplateSearchMenu.setVisible(false);
} }
}); });
containMyTemplatePane.add("containMyTemplateCheckbox", containMyTemplateCheckbox); FineUIStyle.setStyle(myTemplateSearchConfigButton, FineUIStyle.PLAIN_BUTTON);
containMyTemplatePane.add("myTemplateSearchConfigButton", myTemplateSearchConfigButton); containMyTemplatePane.add(row(2, cell(containMyTemplateCheckbox), cell(myTemplateSearchConfigButton)).getComponent());
} }
private void createShortcutsPane(JPanel contentPane) { private Component createShortcutsPane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Shortcut_Config"));
shortcutsField = new UITextField(); shortcutsField = new UITextField();
shortcutsField.setEditable(false); shortcutsField.setEditable(false);
shortcutsField.selectAll(); shortcutsField.selectAll();
shortcutsField.setPreferredSize(new Dimension(100, 20));
initFieldListener(); initFieldListener();
northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open") + ":"));
northPane.add(shortcutsField);
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_SetShortcuts")); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_SetShortcuts"));
label.setForeground(LABEL_TEXT); label.setForeground(LABEL_TEXT);
northPane.add(label); return FineUIUtils.wrapComponentWithTitle(
contentPane.add(northPane); row(10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open") + ":")),
cell(shortcutsField), cell(label)
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Shortcut_Config"));
} }
private void initFieldListener() { private void initFieldListener() {
@ -265,8 +265,7 @@ public class AlphaFineConfigPane extends BasicPane {
}); });
} }
private void createOnlinePane(JPanel contentPane) { private Component createOnlinePane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Type"));
searchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search")); searchOnlineCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Internet_Search"));
needSegmentationCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Segmentation")); needSegmentationCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_Segmentation"));
searchOnlineCheckbox.addActionListener(new ActionListener() { searchOnlineCheckbox.addActionListener(new ActionListener() {
@ -292,15 +291,12 @@ public class AlphaFineConfigPane extends BasicPane {
double[] rowSize = {ROW_HEIGHT}; double[] rowSize = {ROW_HEIGHT};
double[] columnSize = {COLUMN_WIDTH, COLUMN_WIDTH, COLUMN_WIDTH}; double[] columnSize = {COLUMN_WIDTH, COLUMN_WIDTH, COLUMN_WIDTH};
JPanel onlinePane = TableLayoutHelper.createTableLayoutPane(initOnlineComponents(), rowSize, columnSize); JPanel onlinePane = TableLayoutHelper.createTableLayoutPane(initOnlineComponents(), rowSize, columnSize);
northPane.add(onlinePane); return FineUIUtils.wrapComponentWithTitle(onlinePane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Search_Type"));
contentPane.add(northPane);
} }
private void createOpenPane(JPanel contentPane) { private Component createOpenPane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable"));
enabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine")); enabledCheckbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable_AlphaFine"));
northPane.add(enabledCheckbox); return FineUIUtils.wrapComponentWithTitle(enabledCheckbox, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_AlphaFine_Enable"));
contentPane.add(northPane);
} }
@Override @Override

18
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

@ -1,6 +1,6 @@
package com.fr.design.actions.help.alphafine.component; package com.fr.design.actions.help.alphafine.component;
import com.fr.base.svg.IconUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.actions.help.alphafine.AlphaFineConfigPane; import com.fr.design.actions.help.alphafine.AlphaFineConfigPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -74,14 +74,14 @@ public class CustomSortPane extends JPanel {
} }
private void createToolbarPane() { private void createToolbarPane() {
top = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/top.svg")); top = new UIButton(new LazyIcon("to_top"));
bottom = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/bottom.svg")); bottom = new UIButton(new LazyIcon("to_bottom"));
up = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/up.svg")); up = new UIButton(new LazyIcon("move_up"));
down = new UIButton(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/down.svg")); down = new UIButton(new LazyIcon("move_down"));
top.setDisabledIcon(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/top_disable.svg")); top.setDisabledIcon(new LazyIcon("to_top").disabled());
bottom.setDisabledIcon(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/bottom_disable.svg")); bottom.setDisabledIcon(new LazyIcon("to_bottom").disabled());
up.setDisabledIcon(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/up_disable.svg")); up.setDisabledIcon(new LazyIcon("move_up").disabled());
down.setDisabledIcon(IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/down_disable.svg")); down.setDisabledIcon(new LazyIcon("move_down").disabled());
top.addActionListener(e -> { top.addActionListener(e -> {
SwingUtilities.invokeLater(() -> { SwingUtilities.invokeLater(() -> {
sortItemPane.setComponentZOrder(selectedLabel, 0); sortItemPane.setComponentZOrder(selectedLabel, 0);

4
designer-base/src/main/java/com/fr/design/condition/CellHighlightAddMenuDef.java

@ -29,7 +29,9 @@ public class CellHighlightAddMenuDef extends MenuDef {
// 生成UIButton,iconpath不可为null // 生成UIButton,iconpath不可为null
public UIButton createUIButton() { public UIButton createUIButton() {
if (createdButton == null) { if (createdButton == null) {
if (this.iconPath != null && this.name != null) { if (icon != null) {
createdButton = new UIButton(icon);
} else if (this.iconPath != null && this.name != null) {
createdButton = new UIButton(BaseUtils.readIcon(this.iconPath)); createdButton = new UIButton(BaseUtils.readIcon(this.iconPath));
} else if (this.iconPath != null) { } else if (this.iconPath != null) {
createdButton = new UIButton(BaseUtils.readIcon(this.iconPath)); createdButton = new UIButton(BaseUtils.readIcon(this.iconPath));

1
designer-base/src/main/java/com/fr/design/condition/ConditionAttrSingleConditionPane.java

@ -40,7 +40,6 @@ public abstract class ConditionAttrSingleConditionPane<T> extends SingleConditio
conditionAttributesPane.resetUseAbleActionList(); conditionAttributesPane.resetUseAbleActionList();
conditionAttributesPane.updateMenuDef(); conditionAttributesPane.updateMenuDef();
conditionAttributesPane.checkConditionPane(); conditionAttributesPane.checkConditionPane();
conditionAttributesPane.resetWindow();
conditionAttributesPane.redraw(); conditionAttributesPane.redraw();
} }

24
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -3,6 +3,7 @@ package com.fr.design.condition;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
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.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.common.annotations.Open; import com.fr.common.annotations.Open;
@ -32,7 +33,7 @@ import static com.fine.swing.ui.layout.Layouts.row;
@Open @Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> { public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
private static final int MIN_HEIGHT = 60; private static final int MAT_HEIGHT = 120;
protected CellHighlightAddMenuDef menuDef; protected CellHighlightAddMenuDef menuDef;
protected JPanel selectedItemPane; protected JPanel selectedItemPane;
@ -44,7 +45,16 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
//可用的Actions. //可用的Actions.
protected java.util.List<UpdateAction> useAbleActionList = new java.util.ArrayList<UpdateAction>(); protected java.util.List<UpdateAction> useAbleActionList = new java.util.ArrayList<UpdateAction>();
protected JScrollPane selectedItemScrollPane = new JScrollPane(); protected JScrollPane selectedItemScrollPane = new JScrollPane() {
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
if (size.height > MAT_HEIGHT) {
size.height = MAT_HEIGHT;
}
return size;
}
};
protected void initComponents() { protected void initComponents() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -70,13 +80,14 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
addItemPane.add(toolBar, BorderLayout.WEST); addItemPane.add(toolBar, BorderLayout.WEST);
addItemPane.setBorder(new FineRoundBorder()); addItemPane.setBorder(new FineRoundBorder());
addItemPane.setPreferredSize(new Dimension(addItemPane.getPreferredSize().width, FineUIScale.scale(24)));
selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); selectedItemPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
// 选中的添加Itempane // 选中的添加Itempane
selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
dealScrollPane(selectedItemScrollPane); dealScrollPane(selectedItemScrollPane);
this.add(FineUIUtils.wrapComponentWithTitle(column( this.add(FineUIUtils.wrapComponentWithTitle(column(
@ -139,13 +150,6 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
} }
} }
/**
* 根据所需属性个数设置属性布局大小
*/
public void resetWindow() {
selectedItemScrollPane.setPreferredSize(new Dimension(selectedItemScrollPane.getWidth(), Math.min(35 * (classPaneMap.size() - useAbleActionList.size()), 150)));
}
public void removeConditionAttrSingleConditionPane(JComponent component) { public void removeConditionAttrSingleConditionPane(JComponent component) {
selectedItemPane.remove(component); selectedItemPane.remove(component);
} }

17
designer-base/src/main/java/com/fr/design/condition/DSColumnLiteConditionPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.utils.FineUIScale;
import com.fr.data.condition.CommonCondition; import com.fr.data.condition.CommonCondition;
import com.fr.data.condition.JoinCondition; import com.fr.data.condition.JoinCondition;
import com.fr.data.core.Compare; import com.fr.data.core.Compare;
@ -115,15 +116,19 @@ public class DSColumnLiteConditionPane extends LiteConditionPane<CommonCondition
} }
}); });
conditionValuePane = createValueEditorPane(); conditionValuePane = createValueEditorPane();
keyColumnPane.setPreferredSize(new Dimension(175, keyColumnPane.getPreferredSize().height)); keyColumnPane.setPreferredSize(new Dimension(FineUIScale.scale(175), keyColumnPane.getPreferredSize().height));
conditionOPComboBox.setPreferredSize(new Dimension(80, 20)); conditionOPComboBox.setPreferredSize(FineUIScale.scale(new Dimension(80, 20)));
UILabel columLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Available_Columns") + ":");
columLabel.setPreferredSize(FineUIScale.scale(new Dimension(68, 24)));
UILabel operatorLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ConditionB_Operator") + ":");
operatorLabel.setPreferredSize(FineUIScale.scale(new Dimension(68, 24)));
Component[][] components = { Component[][] components = {
{ new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Available_Columns") + ":"), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ConditionB_Operator") + ":"), { columLabel,
new UILabel() }, { keyColumnPane, conditionOPComboBox, conditionValuePane } }; keyColumnPane, operatorLabel, conditionOPComboBox, conditionValuePane}};
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = { p, p }; double rowSize[] = { p };
double columnSize[] = { p, p, TableLayout.FILL }; double columnSize[] = { p, p, p, p, TableLayout.FILL };
JPanel leftPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel leftPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(leftPanel, BorderLayout.CENTER); this.add(leftPanel, BorderLayout.CENTER);

1
designer-base/src/main/java/com/fr/design/condition/HighLightConditionAction.java

@ -29,7 +29,6 @@ public class HighLightConditionAction extends UpdateAction {
conditionAttributesPane.removeUpdateActionFromUsableList(this); conditionAttributesPane.removeUpdateActionFromUsableList(this);
conditionAttributesPane.updateMenuDef(); conditionAttributesPane.updateMenuDef();
conditionAttributesPane.checkConditionPane(); conditionAttributesPane.checkConditionPane();
conditionAttributesPane.resetWindow();
conditionAttributesPane.redraw(); conditionAttributesPane.redraw();
conditionAttrSingleConditionPane.setDefault(); conditionAttrSingleConditionPane.setDefault();
} }

19
designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java

@ -54,6 +54,7 @@ import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell; 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.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
@ -440,7 +441,7 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
cell(northButtonPane), cell(northButtonPane),
row( row(
cell(treeScrollPane).weight(0.75), cell(buttonPane).weight(0.25) cell(treeScrollPane).weight(0.75), cell(buttonPane).weight(0.25)
) ).weight(1)
).with(it -> { ).with(it -> {
it.setBorder(new FineRoundBorder()); it.setBorder(new FineRoundBorder());
it.setOpaque(true); it.setOpaque(true);
@ -512,10 +513,11 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
conditionTitleLabel = new UILabel(); conditionTitleLabel = new UILabel();
FineUIUtils.wrapBoldLabelWithUnderline(conditionTitleLabel); FineUIUtils.wrapBoldLabelWithUnderline(conditionTitleLabel);
UILabel conditionTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Type") + ":"); UILabel conditionTypeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Type") + ":");
conditionTypeLabel.setPreferredSize(FineUIScale.scale(new Dimension(68, 24)));
commonRadioButton.addActionListener(radioActionListener); commonRadioButton.addActionListener(radioActionListener);
formulaRadioButton.addActionListener(radioActionListener); formulaRadioButton.addActionListener(radioActionListener);
conditonTypePane = row(10, conditonTypePane = row(
cell(conditionTypeLabel).weight(0.15), cell(commonRadioButton), cell(formulaRadioButton), flex() cell(conditionTypeLabel), fix(LayoutConstants.VGAP_MEDIUM), cell(commonRadioButton), fix(10), cell(formulaRadioButton), flex()
).getComponent(); ).getComponent();
JPanel conditionWrapperPane = column(10, JPanel conditionWrapperPane = column(10,
cell(conditionTitleLabel), cell(conditionTitleLabel),
@ -539,9 +541,12 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
conditionCardPane.add(formulaConditionPane, "FORMULA"); conditionCardPane.add(formulaConditionPane, "FORMULA");
formulaTextArea = new UITextArea(); formulaTextArea = new UITextArea();
UIButton editFormulaButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Define")); UIButton editFormulaButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Define"));
formulaConditionPane.add(row(10, formulaConditionPane.add(row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula") + " =")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Lite_Condition_Formula") + " ="))
.with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(68, 24)))),
fix(LayoutConstants.VGAP_MEDIUM),
cell(formulaTextArea).weight(2), cell(formulaTextArea).weight(2),
fix(10),
cell(editFormulaButton)) cell(editFormulaButton))
.getComponent()); .getComponent());
editFormulaButton.addActionListener(actionListener1); editFormulaButton.addActionListener(actionListener1);
@ -572,11 +577,11 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
cell(andRadioButton).weight(0.5), cell(andRadioButton).weight(0.5),
cell(orRadioButton).weight(0.5) cell(orRadioButton).weight(0.5)
).weight(0.35), ).weight(0.35),
flex(0.4), flex(0.3),
row(5, row(5,
cell(addButton).weight(0.5), cell(addButton).weight(0.5),
cell(modifyButton).weight(0.5) cell(modifyButton).weight(0.5)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 8, 0, 0))).weight(0.25) ).with(it -> it.setBorder(new ScaledEmptyBorder(0, 8, 0, 0))).weight(0.35)
).with(it -> it.setBorder(BorderFactory.createCompoundBorder( ).with(it -> it.setBorder(BorderFactory.createCompoundBorder(
FineBorderFactory.createDefaultUnderlineBorder(), FineBorderFactory.createDefaultUnderlineBorder(),
new ScaledEmptyBorder(5, 5, 5, 5)) new ScaledEmptyBorder(5, 5, 5, 5))

12
designer-base/src/main/java/com/fr/design/condition/ObjectLiteConditionPane.java

@ -2,8 +2,11 @@ package com.fr.design.condition;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import javax.swing.DefaultComboBoxModel; import javax.swing.DefaultComboBoxModel;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -78,13 +81,14 @@ public class ObjectLiteConditionPane extends LiteConditionPane<ObjectCondition>
}); });
conditionValuePane = ValueEditorPaneFactory.createAllValueEditorPaneWithGlobalListener(); conditionValuePane = ValueEditorPaneFactory.createAllValueEditorPaneWithGlobalListener();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Operator") + ":");
label.setPreferredSize(FineUIScale.scale(new Dimension(68, 24)));
Component[][] components = { { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ConditionB_Operator") + ":"), new UILabel() }, Component[][] components = { { label, conditionOPComboBox, conditionValuePane }};
{ conditionOPComboBox, conditionValuePane } };
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double rowSize[] = { p, p }; double rowSize[] = { p };
double columnSize[] = { p, TableLayout.FILL }; double columnSize[] = { p, p, TableLayout.FILL };
JPanel leftPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel leftPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.add(leftPanel, BorderLayout.CENTER); this.add(leftPanel, BorderLayout.CENTER);

5
designer-base/src/main/java/com/fr/design/condition/SingleConditionPane.java

@ -1,11 +1,14 @@
package com.fr.design.condition; package com.fr.design.condition;
import java.awt.Color;
import java.awt.Insets; import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -30,6 +33,8 @@ public abstract class SingleConditionPane<T> extends BasicPane {
cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove")); cancel.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Action_Remove"));
cancel.addActionListener(cancleListener); cancel.addActionListener(cancleListener);
cancel.setMargin(new Insets(0, 0, 0, 0)); cancel.setMargin(new Insets(0, 0, 0, 0));
cancel.setBorder(new ScaledEmptyBorder(0, 0, 0, 20));
cancel.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
} }
} }
} }

8
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -2,7 +2,9 @@ package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
@ -77,7 +79,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
JPanel centerPane = initCenterPane(); JPanel centerPane = initCenterPane();
this.add(connectionComboBox, BorderLayout.NORTH); this.add(connectionComboBox, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height)); this.setPreferredSize(new Dimension(FineUIScale.scale(WIDTH), getPreferredSize().height));
addKeyMonitor(); addKeyMonitor();
} }
@ -174,8 +176,8 @@ public class ConnectionTableProcedurePane extends BasicPane {
searchField.setPlaceholder(Toolkit.i18nText("Fine-Design_Basic_Table_Search")); searchField.setPlaceholder(Toolkit.i18nText("Fine-Design_Basic_Table_Search"));
searchField.getDocument().addDocumentListener(searchListener); searchField.getDocument().addDocumentListener(searchListener);
// 搜索图标 // 搜索图标
UILabel searchLabel = new UILabel(IconUtils.readIcon("/com/fr/design/images/data/search")); UILabel searchLabel = new UILabel(new LazyIcon("search"));
searchLabel.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 3)); searchLabel.setBorder(new ScaledEmptyBorder(0, 3, 0, 3));
searchField.setBorder(null); searchField.setBorder(null);
panel.add(row(cell(searchLabel), cell(searchField).weight(1)).with(it -> it.setBorder(new FineRoundBorder())).getComponent()); panel.add(row(cell(searchLabel), cell(searchField).weight(1)).with(it -> it.setBorder(new FineRoundBorder())).getComponent());
panel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); panel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));

9
designer-base/src/main/java/com/fr/design/data/datapane/connect/ItemEditableComboBoxPanel.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -48,7 +50,7 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
Dimension buttonSize = new Dimension(24, 24); Dimension buttonSize = FineUIScale.scale(new Dimension(24, 24));
itemComboBox = new UIComboBox(); itemComboBox = new UIComboBox();
itemComboBox.setEnabled(true); itemComboBox.setEnabled(true);
this.add(itemComboBox, BorderLayout.CENTER); this.add(itemComboBox, BorderLayout.CENTER);
@ -56,13 +58,14 @@ public abstract class ItemEditableComboBoxPanel extends JPanel {
JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 0 ,4); JPanel jPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 0 ,4);
editButton = initEditButton(editButton, buttonSize); editButton = initEditButton(editButton, buttonSize);
editButton.setBorder(null); editButton.setBorder(null);
editButton.setBackground(new Color(246, 248, 250, 255)); editButton.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
jPanel.add(editButton); jPanel.add(editButton);
jPanel.add(refreshButton); jPanel.add(refreshButton);
jPanel.setOpaque(true);
this.add(jPanel, BorderLayout.EAST); this.add(jPanel, BorderLayout.EAST);
refreshButton.setPreferredSize(buttonSize); refreshButton.setPreferredSize(buttonSize);
refreshButton.setBorder(null); refreshButton.setBorder(null);
refreshButton.setBackground(new Color(246, 248, 250, 255)); refreshButton.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250, 255)));
refreshButton.addActionListener(new ActionListener() { refreshButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
refreshItems(); refreshItems();

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

@ -75,7 +75,7 @@ public class JNDIDefPane extends JPanel {
"org.jboss.naming.HttpNamingContextFactory", "org.jnp.interfaces.NamingContextFactory", "com.caucho.burlap.BurlapContextFactory", }); "org.jboss.naming.HttpNamingContextFactory", "org.jnp.interfaces.NamingContextFactory", "com.caucho.burlap.BurlapContextFactory", });
JNDIFactoryComboBox.setEditable(true); JNDIFactoryComboBox.setEditable(true);
JNDIFactoryComboBox.addActionListener(jndiListener); JNDIFactoryComboBox.addActionListener(jndiListener);
JNDIFactoryComboBox.setPreferredSize(FineUIScale.scale(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2))); JNDIFactoryComboBox.setPreferredSize(new Dimension(FineUIScale.scale(30), JNDIFactoryComboBox.getPreferredSize().height + FineUIScale.scale(2)));
// 上下文 // 上下文
JPanel contextPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contextPane = FRGUIPaneFactory.createBorderLayout_S_Pane();

20
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/ChooseMark.java

@ -1,11 +1,17 @@
package com.fr.design.data.datapane.preview.desensitization.view.common; package com.fr.design.data.datapane.preview.desensitization.view.common;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import javax.swing.AbstractCellEditor; import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
/** /**
@ -17,16 +23,21 @@ import java.awt.Component;
*/ */
public class ChooseMark extends AbstractCellEditor implements TableCellEditor, TableCellRenderer { public class ChooseMark extends AbstractCellEditor implements TableCellEditor, TableCellRenderer {
private final UIRadioButton selectedButton; private UIRadioButton selectedButton;
private final JPanel pane = new JPanel(new BorderLayout());
public ChooseMark() { public ChooseMark() {
this.selectedButton = new UIRadioButton(); this.selectedButton = new UIRadioButton();
this.selectedButton.setOpaque(false);
pane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
pane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
} }
@Override @Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
selectedButton.setSelected(isSelected); selectedButton.setSelected(isSelected);
return selectedButton; pane.add(this.selectedButton);
return pane;
} }
@Override @Override
@ -36,7 +47,10 @@ public class ChooseMark extends AbstractCellEditor implements TableCellEditor, T
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
pane.removeAll();
selectedButton = new UIRadioButton();
selectedButton.setSelected(isSelected); selectedButton.setSelected(isSelected);
return selectedButton; pane.add(this.selectedButton);
return pane;
} }
} }

15
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/common/DesensitizationOpenPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.preview.desensitization.view.common; package com.fr.design.data.datapane.preview.desensitization.view.common;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.border.UITitledBorder; import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
@ -14,11 +15,15 @@ import com.fr.general.locale.LocaleMark;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Desktop; import java.awt.Desktop;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.net.URL; import java.net.URL;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/** /**
* 启用数据脱敏的面板 * 启用数据脱敏的面板
* *
@ -45,10 +50,7 @@ public class DesensitizationOpenPane extends JPanel {
public DesensitizationOpenPane() { public DesensitizationOpenPane() {
VerticalFlowLayout layout = new VerticalFlowLayout(VerticalFlowLayout.TOP); this.setLayout(new BorderLayout());
layout.setAlignLeft(true);
this.setLayout(layout);
this.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Report_Desensitization_Config")));
JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel panel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
// 启用数据脱敏的勾选框 // 启用数据脱敏的勾选框
@ -73,10 +75,7 @@ public class DesensitizationOpenPane extends JPanel {
// 提示Label // 提示Label
tipsLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened_Tooltips")); tipsLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Opened_Tooltips"));
tipsLabel.setForeground(UIConstants.CHECK_BOX_TIP_FONT_COLOR); this.add(FineUIUtils.wrapComponentWithTitle(column(10, cell(panel), cell(tipsLabel)).getComponent(), Toolkit.i18nText("Fine-Design_Report_Desensitization_Config")));
this.add(panel);
this.add(tipsLabel);
} }
/** /**

16
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleChoosePane.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane.preview.desensitization.view.rule; package com.fr.design.data.datapane.preview.desensitization.view.rule;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.DesensitizationRuleManager;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
@ -18,9 +20,11 @@ import com.fr.stable.StringUtils;
import com.fr.stable.collections.CollectionUtils; import com.fr.stable.collections.CollectionUtils;
import javax.swing.AbstractCellEditor; import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import java.awt.CardLayout; import java.awt.CardLayout;
@ -131,7 +135,6 @@ public class DesensitizationRuleChoosePane extends JPanel {
this.setDefaultEditor(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.setDefaultEditor(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane());
this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane()); this.setDefaultRenderer(DesensitizationRuleStatusPane.class, new DesensitizationRuleStatusPane());
this.createTable().getColumnModel().getColumn(0).setMaxWidth(20); this.createTable().getColumnModel().getColumn(0).setMaxWidth(20);
this.createTable().getColumnModel().getColumn(3).setMaxWidth(60);
} }
@Override @Override
@ -199,6 +202,9 @@ public class DesensitizationRuleChoosePane extends JPanel {
// 规则状态 // 规则状态
this.ruleStatusLabel = new UILabel(); this.ruleStatusLabel = new UILabel();
this.ruleStatusLabel.setForeground(Color.RED); this.ruleStatusLabel.setForeground(Color.RED);
this.ruleStatusLabel.setOpaque(true);
this.ruleStatusLabel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
this.ruleStatusLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
} }
/** /**
@ -243,7 +249,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
public AddRuleAction() { public AddRuleAction() {
this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add")); this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add"));
this.setSmallIcon("/com/fr/design/standard/add/add_black", false); this.setSmallIcon(new LazyIcon("add"));
} }
@Override @Override
@ -276,7 +282,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
public EditRuleAction() { public EditRuleAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Edit"));
this.setSmallIcon(IconUtils.readIcon("/com/fr/design/standard/edit/edit")); this.setSmallIcon(new LazyIcon("edit"));
} }
@Override @Override
@ -322,7 +328,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
public DeleteRuleAction(Component parent) { public DeleteRuleAction(Component parent) {
super(parent); super(parent);
this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove"));
this.setSmallIcon("/com/fr/design/images/control/remove"); this.setSmallIcon(new LazyIcon("remove"));
} }
@Override @Override
@ -349,7 +355,7 @@ public class DesensitizationRuleChoosePane extends JPanel {
public DebugRuleAction(Component parent) { public DebugRuleAction(Component parent) {
this.parent = parent; this.parent = parent;
this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug")); this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug"));
this.setSmallIcon("/com/fr/design/standard/debug/debug"); this.setSmallIcon(new LazyIcon("debug"));
} }
@Override @Override

35
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRuleDebugPane.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane.preview.desensitization.view.rule; package com.fr.design.data.datapane.preview.desensitization.view.rule;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.desensitize.calculate.DesensitizationCalculator; import com.fr.data.desensitize.calculate.DesensitizationCalculator;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -22,6 +24,11 @@ import java.awt.event.ActionListener;
import java.awt.event.FocusEvent; import java.awt.event.FocusEvent;
import java.awt.event.FocusListener; import java.awt.event.FocusListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 脱敏规则调试页 * 脱敏规则调试页
* *
@ -48,9 +55,8 @@ public class DesensitizationRuleDebugPane extends BasicPane {
} }
private JPanel initNorthPane() { private JPanel initNorthPane() {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description")); JPanel northPane = new JPanel(new BorderLayout());
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0));
UILabel desensitizationRule = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm")); UILabel desensitizationRule = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Algorithm"));
UILabel characterReplace = new UILabel(rule.getRuleType().getRuleTypeName()); UILabel characterReplace = new UILabel(rule.getRuleType().getRuleTypeName());
UILabel description = new UILabel(DesensitizationRule.getDescription(rule)); UILabel description = new UILabel(DesensitizationRule.getDescription(rule));
@ -65,14 +71,14 @@ public class DesensitizationRuleDebugPane extends BasicPane {
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED},
20), 20),
BorderLayout.CENTER); BorderLayout.CENTER);
northPane.add(panel); northPane.add(FineUIUtils.wrapComponentWithTitle(panel, Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Description")));
northPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return northPane; return northPane;
} }
private JPanel initCenterPane() { private JPanel initCenterPane() {
JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug")); JPanel centerPane = new JPanel(new BorderLayout());
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(20, 10, 0, 0));
UILabel beforeDesensitize = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Before")); UILabel beforeDesensitize = new UILabel(Toolkit.i18nText("Fine-Design_Report_Desensitization_Before"));
UITextField beforeDesensitizeText = new UITextField(20); UITextField beforeDesensitizeText = new UITextField(20);
@ -105,19 +111,14 @@ public class DesensitizationRuleDebugPane extends BasicPane {
} }
}); });
JComponent[][] components = new JComponent[][]{ beforeDesensitize.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
{beforeDesensitize, beforeDesensitizeText, desensitizeButton}, afterDesensitize.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
{afterDesensitize, afterDesensitizeText, new UILabel()} panel.add(column(10,
}; row(cell(beforeDesensitize), cell(beforeDesensitizeText).weight(0.6), flex(0.02), cell(desensitizeButton).weight(0.2), flex()),
panel.add( row(cell(afterDesensitize), cell(afterDesensitizeText).weight(0.82), flex())
TableLayoutHelper.createCommonTableLayoutPane( ).getComponent());
components,
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED},
20),
BorderLayout.CENTER);
centerPane.add(panel); centerPane.add(FineUIUtils.wrapComponentWithTitle(panel, Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Debug")));
return centerPane; return centerPane;
} }

10
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/rule/DesensitizationRulePane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.preview.desensitization.view.rule; package com.fr.design.data.datapane.preview.desensitization.view.rule;
import com.fine.theme.utils.FineUIUtils;
import com.fr.data.desensitize.rule.base.DesensitizationRule; import com.fr.data.desensitize.rule.base.DesensitizationRule;
import com.fr.data.desensitize.rule.base.DesensitizationRuleSource; import com.fr.data.desensitize.rule.base.DesensitizationRuleSource;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -11,6 +12,9 @@ import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.util.Map; import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/** /**
* 脱敏规则展示页 * 脱敏规则展示页
* *
@ -49,14 +53,14 @@ public class DesensitizationRulePane extends BasicBeanPane<DesensitizationRule>
private void initPane() { private void initPane() {
// 内容面板 // 内容面板
contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Choose")));
this.add(contentPane, BorderLayout.CENTER); this.add(contentPane, BorderLayout.CENTER);
// 规则来源选择Pane // 规则来源选择Pane
ruleSourceChoosePane = new DesensitizationRuleSourceChoosePane(this); ruleSourceChoosePane = new DesensitizationRuleSourceChoosePane(this);
// 规则选择Pane // 规则选择Pane
ruleChoosePane = new DesensitizationRuleChoosePane(latestRules); ruleChoosePane = new DesensitizationRuleChoosePane(latestRules);
contentPane.add(ruleSourceChoosePane, BorderLayout.NORTH);
contentPane.add(ruleChoosePane, BorderLayout.CENTER); contentPane.add(FineUIUtils.wrapComponentWithTitle(column(10, cell(ruleSourceChoosePane), cell(ruleChoosePane)).getComponent(),
Toolkit.i18nText("Fine-Design_Report_Desensitization_Rule_Choose")));
} }
/** /**

27
designer-base/src/main/java/com/fr/design/data/datapane/preview/desensitization/view/setting/TableDataDesensitizationTableModel.java

@ -1,5 +1,7 @@
package com.fr.design.data.datapane.preview.desensitization.view.setting; package com.fr.design.data.datapane.preview.desensitization.view.setting;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.DesensitizationTableData;
import com.fr.data.desensitize.base.TableDataDesensitizationItem; import com.fr.data.desensitize.base.TableDataDesensitizationItem;
import com.fr.data.desensitize.rule.DesensitizationRuleManager; import com.fr.data.desensitize.rule.DesensitizationRuleManager;
@ -24,10 +26,12 @@ import com.fr.stable.StringUtils;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import javax.swing.AbstractCellEditor; import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.CellEditorListener; import javax.swing.event.CellEditorListener;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
@ -277,6 +281,9 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
// 规则名称展示 // 规则名称展示
ruleNameTextField = new UITextField(); ruleNameTextField = new UITextField();
ruleNameTextField.setEnabled(false); ruleNameTextField.setEnabled(false);
ruleNameTextField.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
ruleNameTextField.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
ruleNameTextField.setOpaque(true);
// 规则选择按钮 // 规则选择按钮
chooseButton = new UIButton(APOSTROPHE); chooseButton = new UIButton(APOSTROPHE);
chooseButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Click_To_Choose_Rule")); chooseButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Desensitization_Click_To_Choose_Rule"));
@ -307,6 +314,9 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
DesensitizationRuleDescriptionPane() { DesensitizationRuleDescriptionPane() {
// 规则描述 // 规则描述
this.descriptionLabel = new UILabel(); this.descriptionLabel = new UILabel();
this.descriptionLabel.setOpaque(true);
this.descriptionLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
this.descriptionLabel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
} }
/** /**
@ -371,6 +381,14 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
} }
}); });
setBoxStyle();
}
private void setBoxStyle() {
this.rolesCheckBox.getEditor().setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
this.rolesCheckBox.getEditor().setOpaque(true);
this.rolesCheckBox.getArrowButton().setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
this.rolesCheckBox.getArrowButton().setOpaque(true);
} }
@Override @Override
@ -434,6 +452,9 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
// 规则状态 // 规则状态
this.ruleStatusLabel = new UILabel(); this.ruleStatusLabel = new UILabel();
this.ruleStatusLabel.setForeground(Color.RED); this.ruleStatusLabel.setForeground(Color.RED);
this.ruleStatusLabel.setOpaque(true);
this.ruleStatusLabel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
this.ruleStatusLabel.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
} }
/** /**
@ -477,7 +498,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
public AddDesensitizationAction() { public AddDesensitizationAction() {
this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add")); this.setName(Toolkit.i18nText("Fine-Design_Report_Desensitization_Add"));
this.setSmallIcon("/com/fr/design/standard/add/add_black", false); this.setSmallIcon(new LazyIcon("add"));
} }
@Override @Override
@ -495,7 +516,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
public RemoveDesensitizationAction(Component component) { public RemoveDesensitizationAction(Component component) {
super(component); super(component);
this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Base_Remove"));
this.setSmallIcon("/com/fr/design/standard/remove/remove_red", false); this.setSmallIcon(new LazyIcon("remove"));
} }
@Override @Override
@ -508,7 +529,7 @@ public class TableDataDesensitizationTableModel extends UITableModelAdapter<Tabl
public RefreshTableAction() { public RefreshTableAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon("/com/fr/design/standard/refresh/refresh", false); this.setSmallIcon(new LazyIcon("refresh"));
} }
@Override @Override

10
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/DBTableDataPane.java

@ -2,6 +2,7 @@ package com.fr.design.data.tabledata.tabledatapane;
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.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.ParameterHelper; import com.fr.base.ParameterHelper;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
@ -263,12 +264,13 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
sqlSplitPane.add(box, BorderLayout.CENTER); sqlSplitPane.add(box, BorderLayout.CENTER);
box.setMinimumSize(new Dimension(300, 400)); box.setMinimumSize(FineUIScale.scale(new Dimension(300, 400)));
this.connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400)); this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(230, 400)));
this.connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400)); this.connectionTableProcedurePane.setMaximumSize(FineUIScale.scale(new Dimension(500, 400)));
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.connectionTableProcedurePane, sqlSplitPane);
mainSplitPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
mainSplitPane.setOneTouchExpandable(true); mainSplitPane.setOneTouchExpandable(true);
contentPane.add(mainSplitPane, BorderLayout.CENTER); contentPane.add(mainSplitPane, BorderLayout.CENTER);
} }
@ -630,7 +632,7 @@ public class DBTableDataPane extends AbstractTableDataPane<DBTableData> implemen
public EditPageQueryAction() { public EditPageQueryAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Layer_Page_Report_Page_Query")); this.setName(Toolkit.i18nText("Fine-Design_Basic_Layer_Page_Report_Page_Query"));
this.setMnemonic('L'); this.setMnemonic('L');
this.setSmallIcon(new LazyIcon("text")); this.setSmallIcon(new LazyIcon("page_query"));
} }
@Override @Override

11
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -1,6 +1,8 @@
package com.fr.design.data.tabledata.tabledatapane; package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.StoreProcedureParameter; import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
@ -100,7 +102,7 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
storeProcedureContext.setEditable(false); storeProcedureContext.setEditable(false);
UIScrollPane storeProcedureContextPane = new UIScrollPane(storeProcedureContext); UIScrollPane storeProcedureContextPane = new UIScrollPane(storeProcedureContext);
storeProcedureContextPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC)); storeProcedureContextPane.setBorder(new UIRoundedBorder(UIManager.getColor("defaultBorderColor"), 1, UIConstants.ARC));
storeProcedureContextPane.setPreferredSize(new Dimension(680, 600)); storeProcedureContextPane.setPreferredSize(FineUIScale.scale(new Dimension(680, 600)));
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
namePane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Stored_Procedure") + ":")); namePane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Stored_Procedure") + ":"));
@ -126,11 +128,12 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
// 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table // 左边的Panel,上面是选择DatabaseConnection的ComboBox,下面DatabaseConnection对应的Table
initconnectionTableProcedurePane(); initconnectionTableProcedurePane();
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
this.connectionTableProcedurePane.setMinimumSize(new Dimension(230, 400)); this.connectionTableProcedurePane.setMinimumSize(FineUIScale.scale(new Dimension(230, 400)));
this.connectionTableProcedurePane.setMaximumSize(new Dimension(500, 400)); this.connectionTableProcedurePane.setMaximumSize(FineUIScale.scale(new Dimension(500, 400)));
box.setMinimumSize(new Dimension(300, 400)); box.setMinimumSize(FineUIScale.scale(new Dimension(300, 400)));
// 使用SplitPane // 使用SplitPane
JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane); JSplitPane mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, connectionTableProcedurePane, sqlSplitPane);
mainSplitPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
mainSplitPane.setOneTouchExpandable(true); mainSplitPane.setOneTouchExpandable(true);
this.add(mainSplitPane, BorderLayout.CENTER); this.add(mainSplitPane, BorderLayout.CENTER);
} }

2
designer-base/src/main/java/com/fr/design/dialog/BasicPane.java

@ -317,7 +317,7 @@ public abstract class BasicPane extends JPanel {
cell(showfield = new UILabel(" ")).weight(0.3) cell(showfield = new UILabel(" ")).weight(0.3)
).getComponent()); ).getComponent());
showfield.setForeground(new Color(204, 0, 1)); showfield.setForeground(new Color(204, 0, 1));
showfield.setPreferredSize(FineUIScale.scale(new Dimension(220, showfield.getPreferredSize().height))); showfield.setPreferredSize(new Dimension(FineUIScale.scale(220), showfield.getPreferredSize().height));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.centerPane = bPane; this.centerPane = bPane;
this.add(bPane, BorderLayout.CENTER); this.add(bPane, BorderLayout.CENTER);

3
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -2,6 +2,7 @@ package com.fr.design.gui.controlpane;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -383,7 +384,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), 24)); setPreferredSize(FineUIScale.scale(new Dimension(list.getWidth(), 24)));
if (value instanceof ListModelElement) { if (value instanceof ListModelElement) {
ListModelElement element = ((ListModelElement) value); ListModelElement element = ((ListModelElement) value);
Nameable nameable = element.wrapper; Nameable nameable = element.wrapper;

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

@ -192,12 +192,12 @@ public abstract class UIControlPane extends JControlPane {
private JComponent editPane; private JComponent editPane;
private PopupToolPane popupToolPane; private PopupToolPane popupToolPane;
private static final int WIDTH = 570; private static final int WIDTH = 570;
private static final int HEIGHT = 490; private static final int HEIGHT = 553;
PopupEditDialog(JComponent pane) { PopupEditDialog(JComponent pane) {
super(DesignerContext.getDesignerFrame()); super(DesignerContext.getDesignerFrame());
setUndecorated(true); setUndecorated(true);
pane.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); pane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
this.editPane = pane; this.editPane = pane;
JPanel editPaneWrapper = new JPanel(new BorderLayout()); JPanel editPaneWrapper = new JPanel(new BorderLayout());
popupToolPane = new PopupToolPane(this); popupToolPane = new PopupToolPane(this);

29
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java

@ -1,5 +1,9 @@
package com.fr.design.gui.icombocheckbox; package com.fr.design.gui.icombocheckbox;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
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;
@ -81,7 +85,8 @@ public class UICheckListPopup extends UIPopupMenu {
checkboxPane.setLayout(new GridLayout(checkBoxList.size(), 1, 0, 0)); checkboxPane.setLayout(new GridLayout(checkBoxList.size(), 1, 0, 0));
checkboxPane.setBackground(Color.WHITE); checkboxPane.setBackground(Color.WHITE);
jScrollPane = new UIScrollPane(checkboxPane); jScrollPane = new UIScrollPane(checkboxPane);
jScrollPane.setBorder(new FineRoundBorder());
jScrollPane.setBackground(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250)));
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(jScrollPane, BorderLayout.CENTER); this.add(jScrollPane, BorderLayout.CENTER);
@ -106,10 +111,10 @@ public class UICheckListPopup extends UIPopupMenu {
} }
addSelectListener(); addSelectListener();
jScrollPane.setPreferredSize(new Dimension(130, checkBoxList.size() * CHECKBOX_HEIGHT + 10)); jScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(140, checkBoxList.size() * CHECKBOX_HEIGHT + 10)));
//超过1页的数量时显示滚动条 //超过1页的数量时显示滚动条
if (checkBoxList.size() > maxDisplayNumber) { if (checkBoxList.size() > maxDisplayNumber) {
jScrollPane.setPreferredSize(new Dimension(130, maxDisplayNumber * CHECKBOX_HEIGHT)); jScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(140, maxDisplayNumber * CHECKBOX_HEIGHT)));
} }
checkboxPane.repaint(); checkboxPane.repaint();
jScrollPane.repaint(); jScrollPane.repaint();
@ -117,11 +122,11 @@ public class UICheckListPopup extends UIPopupMenu {
private void addOneCheckValue(Object checkValue) { private void addOneCheckValue(Object checkValue) {
JPanel checkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel checkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
checkPane.setPreferredSize(new Dimension(120, CHECKBOX_HEIGHT)); checkPane.setPreferredSize(FineUIScale.scale(new Dimension(140, CHECKBOX_HEIGHT)));
final JCheckBox temp = createCheckbox(); final JCheckBox temp = createCheckbox();
final UILabel label = new UILabel(checkValue.toString()); final UILabel label = new UILabel(checkValue.toString());
label.setBackground(Color.WHITE); label.setBackground(Color.WHITE);
label.setPreferredSize(new Dimension(80, 20)); label.setPreferredSize(FineUIScale.scale(new Dimension(100, 20)));
checkPane.setBackground(Color.WHITE); checkPane.setBackground(Color.WHITE);
checkPane.add(temp); checkPane.add(temp);
checkPane.add(label); checkPane.add(label);
@ -137,10 +142,10 @@ public class UICheckListPopup extends UIPopupMenu {
private JCheckBox createCheckbox() { private JCheckBox createCheckbox() {
JCheckBox checkBox = new JCheckBox(); JCheckBox checkBox = new JCheckBox();
checkBox.setPreferredSize(new Dimension(20, 20)); checkBox.setPreferredSize(FineUIScale.scale(new Dimension(20, 20)));
checkBox.setBackground(Color.WHITE); checkBox.setBackground(Color.WHITE);
checkBox.setIcon(IOUtils.readIcon(IconPathConstants.CHECKBOX_NORMAL)); checkBox.setIcon(new LazyIcon("checkbox_unchecked"));
checkBox.setSelectedIcon(IOUtils.readIcon(IconPathConstants.CHECKBOX_SELECTED)); checkBox.setSelectedIcon(new LazyIcon("checkbox_checked"));
return checkBox; return checkBox;
} }
@ -252,17 +257,17 @@ public class UICheckListPopup extends UIPopupMenu {
private void switchSelectIcon(int selectCount) { private void switchSelectIcon(int selectCount) {
JCheckBox checkBox = checkBoxList.get(0); JCheckBox checkBox = checkBoxList.get(0);
if (selectCount == 0) { if (selectCount == 0) {
checkBox.setIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_NORMAL)); checkBox.setIcon(new LazyIcon("checkbox_unchecked"));
} else if (selectCount < checkBoxList.size() - 1) { } else if (selectCount < checkBoxList.size() - 1) {
//虽然有选中,但是要判断此时全选状态去换图标 //虽然有选中,但是要判断此时全选状态去换图标
if (checkBoxList.get(0).isSelected()) { if (checkBoxList.get(0).isSelected()) {
checkBox.setSelectedIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_HATFSELECT)); checkBox.setSelectedIcon(new LazyIcon("checkbox_checked"));
} else { } else {
checkBox.setIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_HATFSELECT)); checkBox.setIcon(new LazyIcon("checkbox_part_checked"));
} }
} else { } else {
//全选了,图标要换回来 //全选了,图标要换回来
checkBox.setSelectedIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_SELECTED)); checkBox.setIcon(new LazyIcon("checkbox_checked"));
} }
} }

102
designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java

@ -1,5 +1,7 @@
package com.fr.design.gui.icombocheckbox; package com.fr.design.gui.icombocheckbox;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
@ -11,10 +13,12 @@ import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.event.PopupMenuEvent; import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener; import javax.swing.event.PopupMenuListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -154,66 +158,21 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private UIButton createArrowButton() { private UIButton createArrowButton() {
final UIButton arrowBtn = new UIButton(); final UIButton arrowBtn = new UIButton();
arrowBtn.setNormalPainted(false); arrowBtn.setNormalPainted(false);
arrowBtn.setPreferredSize(new Dimension(20, 5)); arrowBtn.setPreferredSize(FineUIScale.scale(new Dimension(20, 5)));
arrowBtn.setBackground(new Color(218, 218, 218)); arrowBtn.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
arrowBtn.setOpaque(true); arrowBtn.setOpaque(true);
arrowBtn.setIcon(getIcon()); arrowBtn.setIcon(getIcon());
arrowBtn.setExtraPainted(false); arrowBtn.setExtraPainted(false);
addPopupListener(arrowBtn); addPopupListener(arrowBtn);
arrowBtn.addMouseListener(new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
arrowBtn.setBackground(new Color(200, 200, 200));
}
@Override
public void mouseExited(MouseEvent e) {
arrowBtn.setBackground(new Color(218, 218, 218));
}
});
return arrowBtn; return arrowBtn;
} }
private UITextField createEditor() { private UITextField createEditor() {
UITextField editor = new UITextField() { UITextField editor = new TextField();
@Override
protected void initListener() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
attributeChange();
}
});
this.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
UIComboCheckBox.this.popup.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
// do nothing
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
attributeChange();
if (uiObserverListener != null) {
uiObserverListener.doChange();
}
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
// do nothing
}
});
}
};
editor.setEditable(false); editor.setEditable(false);
editor.setPreferredSize(new Dimension(110, 20)); editor.setPreferredSize(FineUIScale.scale(new Dimension(110, 20)));
editor.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 0, UIManager.getColor("defaultBorderColor")));
addPopupListener(editor); addPopupListener(editor);
return editor; return editor;
@ -269,6 +228,8 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
private void togglePopup() { private void togglePopup() {
if (this.arrowButton.isEnabled()) { if (this.arrowButton.isEnabled()) {
popup.setBorder(new FineRoundBorder());
popup.setPreferredSize(new Dimension(FineUIScale.scale(this.getWidth()), (int) popup.getPreferredSize().getHeight()));
popup.show(this, 0, getHeight()); popup.show(this, 0, getHeight());
} }
} }
@ -434,6 +395,47 @@ public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNam
this.arrowButton.setEnabled(enabled); this.arrowButton.setEnabled(enabled);
} }
private class TextField extends UITextField {
@Override
protected void initListener() {
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
attributeChange();
}
});
this.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
attributeChange();
}
});
addPopupMenuListener();
}
private void addPopupMenuListener() {
UIComboCheckBox.this.popup.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
// do nothing
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
attributeChange();
if (uiObserverListener != null) {
uiObserverListener.doChange();
}
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
// do nothing
}
});
}
}
/** /**
* 简单的测试demo * 简单的测试demo
* @param args * @param args

7
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/ParameterTableModel.java

@ -1,5 +1,7 @@
package com.fr.design.gui.itableeditorpane; package com.fr.design.gui.itableeditorpane;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
@ -240,8 +242,11 @@ public class ParameterTableModel extends UITableModelAdapter<ParameterProvider>
public ParameterValueRenderer(ValueEditorPane valueEditorPane) { public ParameterValueRenderer(ValueEditorPane valueEditorPane) {
disableLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Paramete_Name")); disableLable = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Set_Paramete_Name"));
disableLable.setForeground(Color.pink); FineUIStyle.setStyle(disableLable, FineUIStyle.LABEL_WARNING_TIP);
disableLable.setHorizontalAlignment(SwingConstants.LEFT); disableLable.setHorizontalAlignment(SwingConstants.LEFT);
disableLable.setOpaque(true);
disableLable.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
disableLable.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
editor = valueEditorPane; editor = valueEditorPane;
} }

89
designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java

@ -1,24 +1,39 @@
package com.fr.design.gui.itableeditorpane; package com.fr.design.gui.itableeditorpane;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
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.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.event.TableModelListener; import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Insets; import java.awt.Insets;
import java.util.List; import java.util.List;
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;
/** /**
* 表格编辑面板,一般是两列.- 用泛型实现用的时候请定义T.model里面的T要一样 * 表格编辑面板,一般是两列.- 用泛型实现用的时候请定义T.model里面的T要一样
* *
@ -30,9 +45,9 @@ public class UITableEditorPane<T> extends BasicPane {
* *
*/ */
private static final long serialVersionUID = 6855793816972735815L; private static final long serialVersionUID = 6855793816972735815L;
private JTable editTable; protected static JTable editTable;
// 放置action 的按钮. // 放置action 的按钮.
private UITableModelAdapter<T> tableModel; protected UITableModelAdapter<T> tableModel;
private String leftLabelName; private String leftLabelName;
private JPanel buttonPane; private JPanel buttonPane;
@ -67,17 +82,35 @@ public class UITableEditorPane<T> extends BasicPane {
UIScrollPane scrollPane = new UIScrollPane(editTable); UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new FineRoundBorder()); scrollPane.setBorder(new FineRoundBorder());
pane.add(scrollPane, BorderLayout.CENTER);
initbuttonPane(action); initbuttonPane(action);
JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel controlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
controlPane.add(buttonPane, BorderLayout.EAST); controlPane.add(buttonPane, BorderLayout.EAST);
controlPane.add(content == null ? l : content, BorderLayout.WEST); controlPane.add(content == null ? l : content, BorderLayout.WEST);
pane.add(controlPane, BorderLayout.NORTH); pane.add(column(cell(controlPane), cell(buildScrollTablePane(scrollPane)).weight(1)).getComponent());
this.editTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer()); this.editTable.getTableHeader().setDefaultRenderer(new TableHeaderRenderer());
this.editTable.setDefaultRenderer(Object.class, new TableRenderer());
this.editTable.setRowHeight(FineUIScale.scale(24));
}
/**
* 组合 jtable 和垂直滚动条
* @param scrollPane
* @return
*/
protected Component buildScrollTablePane(JScrollPane scrollPane) {
return row(
cell(scrollPane).weight(1),
column(
cell(new UILabel()).with(it -> {
it.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 1, UIManager.getColor("defaultBorderColor")));
it.setPreferredSize(FineUIScale.scale(new Dimension(scrollPane.getVerticalScrollBar().getWidth(), (int) editTable.getTableHeader().getPreferredSize().getHeight())));
}),
cell(scrollPane.getVerticalScrollBar()).weight(1).with(it -> {
it.setBorder(BorderFactory.createMatteBorder(1, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
}))
).getComponent();
} }
public UITableModelAdapter<T> getTableModel() { public UITableModelAdapter<T> getTableModel() {
@ -164,7 +197,10 @@ public class UITableEditorPane<T> extends BasicPane {
return buttonPane; return buttonPane;
} }
public JTable getEditTable() { /**
* @return jTable
*/
public static JTable getEditTable() {
return editTable; return editTable;
} }
@ -193,13 +229,48 @@ public class UITableEditorPane<T> extends BasicPane {
public static class TableHeaderRenderer extends DefaultTableCellRenderer { public static class TableHeaderRenderer extends DefaultTableCellRenderer {
public TableHeaderRenderer() { public TableHeaderRenderer() {
setHorizontalAlignment(SwingConstants.LEFT); setHorizontalAlignment(SwingConstants.LEFT);
setPreferredSize(new Dimension(this.getWidth(), FineUIScale.scale(24)));
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (column == table.getColumnCount() - 1) {
((JComponent) component).setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
} else {
((JComponent) component).setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
}
return component;
}
}
/**
* 设置 Table 表身格式
*/
public static class TableRenderer extends DefaultTableCellRenderer {
public TableRenderer() {
} }
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
setBorder(UIManager.getBorder("TableHeader.cellBorder")); if(component instanceof JLabel) {
return this; String toolTipText = GeneralUtils.objectToString(value);
if (StringUtils.isNotEmpty(toolTipText)) {
((JLabel) component).setToolTipText(toolTipText);
}
}
if (column == table.getColumnCount() - 1) {
((JComponent) component).setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")),
new ScaledEmptyBorder(0,4,0,0)));
} else {
((JComponent) component).setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")),
new ScaledEmptyBorder(0,4,0,0)));
}
component.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return component;
} }
} }
} }

5
designer-base/src/main/java/com/fr/design/gui/itree/checkboxtree/CheckBoxTreeCellRenderer.java

@ -6,6 +6,7 @@
package com.fr.design.gui.itree.checkboxtree; package com.fr.design.gui.itree.checkboxtree;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -63,7 +64,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
add(_checkBox, BorderLayout.WEST); add(_checkBox, BorderLayout.WEST);
JPanel gapPanel = new JPanel(); JPanel gapPanel = new JPanel();
gapPanel.setPreferredSize(new Dimension(4, 20)); gapPanel.setPreferredSize(FineUIScale.scale(new Dimension(4, 20)));
add(gapPanel, BorderLayout.CENTER); add(gapPanel, BorderLayout.CENTER);
_actualTreeRenderer = renderer; _actualTreeRenderer = renderer;
} }
@ -77,7 +78,7 @@ public class CheckBoxTreeCellRenderer extends NullPanel implements TreeCellRende
} }
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
_checkBox.setPreferredSize(new Dimension(PROTOTYPE.getPreferredSize().width, 0)); _checkBox.setPreferredSize(FineUIScale.scale(new Dimension(PROTOTYPE.getPreferredSize().width, 0)));
setComponentOrientation(tree.getComponentOrientation()); setComponentOrientation(tree.getComponentOrientation());
TreePath path = tree.getPathForRow(row); TreePath path = tree.getPathForRow(row);

2
designer-base/src/main/java/com/fr/design/layout/FRGUIPaneFactory.java

@ -149,7 +149,7 @@ public class FRGUIPaneFactory {
* @return FRGridLayout对象 * @return FRGridLayout对象
*/ */
public static LayoutManager createNColumnGridLayout(int nColumn) { public static LayoutManager createNColumnGridLayout(int nColumn) {
return new FRGridLayout(nColumn); return new FRGridLayout(nColumn, 4, 2);
} }
public static LayoutManager createCenterLayout(JComponent centerBody) { public static LayoutManager createCenterLayout(JComponent centerBody) {

3
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
@ -16,6 +17,7 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
@ -228,6 +230,7 @@ public class CenterRegionContainerPane extends JPanel {
// 颜色,字体那些按钮的工具栏 // 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
setStyle(toolbarComponent, TOP_TOOLS); setStyle(toolbarComponent, TOP_TOOLS);
toolbarComponent.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
toolbarComponent.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)); toolbarComponent.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
JPanel customNorthPane = strategy.customNorthPane(toolbarPane, plus); JPanel customNorthPane = strategy.customNorthPane(toolbarPane, plus);
if (!isExist(customNorthPane)) { if (!isExist(customNorthPane)) {

48
designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

@ -1,6 +1,10 @@
package com.fr.design.mainframe.check; package com.fr.design.mainframe.check;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -18,12 +22,21 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
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.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 字体缺失检测的具体结果对话框 * 字体缺失检测的具体结果对话框
* *
@ -54,44 +67,41 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
super(parent,true); super(parent,true);
//提示信息 //提示信息
JPanel imagePanel = new JPanel(); JPanel imagePanel = new JPanel();
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/warnings/warning32.png")); imageLabel = new UILabel(new LazyIcon("warning"));
imagePanel.add(imageLabel); imagePanel.add(imageLabel);
String link = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT); String link = LocaleLinkProvider.getInstance().getLink(PROPS_LINK_KEY, PROPS_LINK_KEY_DEFAULT);
JPanel messagePanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); JPanel messagePanel = new JPanel(new FlowLayout());
MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"),
link); link);
linkMessage.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink")); linkMessage.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
messagePanel.add(linkMessage); messagePanel.add(linkMessage);
// 查看详情按钮 // 查看详情按钮
directUiLabel = new UILabel(); directUiLabel = new UILabel();
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); directUiLabel.setIcon(new LazyIcon("plus"));
detailLabel = new UILabel(); detailLabel = new UILabel();
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
upInTopPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); upInTopPanel = row(
upInTopPanel.add(imageLabel, BorderLayout.WEST); column(flex(), cell(imageLabel), flex()).with(it -> it.setPreferredSize(new Dimension(FineUIScale.scale(30), it.getHeight()))),
upInTopPanel.add(messagePanel, BorderLayout.CENTER); cell(messagePanel)).getComponent();
downInTopPanel = row(fix(30), row(cell(directUiLabel), cell(detailLabel), flex())).getComponent();
downInTopPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); topPanel = column(cell(upInTopPanel), cell(downInTopPanel)).getComponent();
downInTopPanel.add(directUiLabel, BorderLayout.WEST);
downInTopPanel.add(detailLabel, BorderLayout.CENTER);
topPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
topPanel.add(upInTopPanel, BorderLayout.NORTH);
topPanel.add(downInTopPanel, BorderLayout.SOUTH);
//中间的详情展示(可隐藏) //中间的详情展示(可隐藏)
hiddenPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); hiddenPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
hiddenPanel.setBorder(BorderFactory.createEmptyBorder(0,12,0,12));
JScrollPane scrollPane = new JScrollPane(); JScrollPane scrollPane = new JScrollPane();
JTextArea checkArea = new JTextArea(areaText); JTextArea checkArea = new JTextArea(areaText);
scrollPane.setViewportView(checkArea); scrollPane.setViewportView(checkArea);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
scrollPane.getViewport().setOpaque(false);
checkArea.setOpaque(false);
checkArea.setEnabled(false); checkArea.setEnabled(false);
hiddenPanel.add(scrollPane); hiddenPanel = row(fix(30), cell(scrollPane).weight(1)).getComponent();
hiddenPanel.setVisible(false); hiddenPanel.setVisible(false);
hiddenPanel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
downInTopPanel.addMouseListener(new MouseAdapter() { downInTopPanel.addMouseListener(new MouseAdapter() {
@Override @Override
@ -100,12 +110,12 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
hiddenPanel.setVisible(false); hiddenPanel.setVisible(false);
CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse")); CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); directUiLabel.setIcon(new LazyIcon("plus"));
} else { } else {
CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.unfold")); CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.unfold"));
hiddenPanel.setVisible(true); hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); directUiLabel.setIcon(new LazyIcon("minus"));
} }
} }
}); });

26
designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java

@ -1,5 +1,8 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.stable.collections.combination.Pair; import com.fr.stable.collections.combination.Pair;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.TRL; import com.fr.base.TRL;
@ -97,11 +100,11 @@ public class DesignerLogHandler {
// 所有的面板 // 所有的面板
private LogHandlerBar caption; private LogHandlerBar caption;
private JCheckBoxMenuItem showInfo; private UICheckBox showInfo;
private JCheckBoxMenuItem showError; private UICheckBox showError;
private JCheckBoxMenuItem showServer; private UICheckBox showServer;
private LogHandlerArea logHandlerArea; private LogHandlerArea logHandlerArea;
@ -137,11 +140,11 @@ public class DesignerLogHandler {
caption.clearMessage(); caption.clearMessage();
} }
}; };
showInfo = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Info"), true); showInfo = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Info"), true);
showInfo.addItemListener(itemlistener); showInfo.addItemListener(itemlistener);
showError = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Warn"), true); showError = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Warn"), true);
showError.addItemListener(itemlistener); showError.addItemListener(itemlistener);
showServer = new JCheckBoxMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Error"), true); showServer = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Log_Level_Error"), true);
showServer.addItemListener(itemlistener); showServer.addItemListener(itemlistener);
caption.addSetListener(new ActionListener() { caption.addSetListener(new ActionListener() {
@ -149,21 +152,20 @@ public class DesignerLogHandler {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
JPopupMenu jPopupMenu = new JPopupMenu(); JPopupMenu jPopupMenu = new JPopupMenu();
jPopupMenu.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
int logLevelInt = Log4jConfig.getInstance().getRootLevel().intLevel(); int logLevelInt = Log4jConfig.getInstance().getRootLevel().intLevel();
if (logLevelInt <= DesignerLogger.INFO_INT) { if (logLevelInt <= DesignerLogger.INFO_INT) {
jPopupMenu.add(showInfo); jPopupMenu.add(showInfo);
jPopupMenu.add(showError); jPopupMenu.add(showError);
jPopupMenu.add(showServer); jPopupMenu.add(showServer);
jPopupMenu.show(caption, caption.getWidth() + GAP_X, INFO_GAP_Y);
} else if (logLevelInt == DesignerLogger.ERROR_INT) { } else if (logLevelInt == DesignerLogger.ERROR_INT) {
jPopupMenu.add(showError); jPopupMenu.add(showError);
jPopupMenu.add(showServer); jPopupMenu.add(showServer);
jPopupMenu.show(caption, caption.getWidth() + GAP_X, ERRO_GAP_Y);
} else { } else {
jPopupMenu.add(showServer); jPopupMenu.add(showServer);
jPopupMenu.show(caption, caption.getWidth() + GAP_X, SERVER_GAP_Y);
} }
jPopupMenu.show(caption, caption.getWidth() - (int) jPopupMenu.getPreferredSize().getWidth() - 10, (int) -jPopupMenu.getPreferredSize().getHeight());
} }
}); });
} }
@ -211,17 +213,17 @@ public class DesignerLogHandler {
popup = new JPopupMenu(); popup = new JPopupMenu();
selectAll = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All")); selectAll = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select_All"));
selectAll.addActionListener(popupListener); selectAll.addActionListener(popupListener);
selectAll.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/selectedall.png")); selectAll.setIcon(new LazyIcon("select_all"));
popup.add(selectAll); popup.add(selectAll);
copy = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy")); copy = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy"));
copy.addActionListener(popupListener); copy.addActionListener(popupListener);
copy.setIcon(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); copy.setIcon(new LazyIcon("copy"));
popup.add(copy); popup.add(copy);
clear = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All")); clear = new UIMenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Clear_All"));
clear.addActionListener(popupListener); clear.addActionListener(popupListener);
clear.setIcon(BaseUtils.readIcon("/com/fr/design/images/log/clear.png")); clear.setIcon(new LazyIcon("clearStash"));
popup.add(clear); popup.add(clear);
selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER)); selectAll.setAccelerator(KeyStroke.getKeyStroke('A', DEFAULT_MODIFIER));

31
designer-base/src/main/java/com/fr/design/mainframe/loghandler/LogHandlerBar.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.loghandler; package com.fr.design.mainframe.loghandler;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
@ -34,7 +36,7 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
private int ERRORNUM = 0; private int ERRORNUM = 0;
private int SERVERNUM = 0; private int SERVERNUM = 0;
private static final int FLOW_LAYOUT_HGAP = 10; private static final int FLOW_LAYOUT_HGAP = 10;
private static final int FLOW_LAYOUT_VGAP = 5; private static final int FLOW_LAYOUT_VGAP = 8;
private boolean isWithSerious; private boolean isWithSerious;
@ -46,25 +48,18 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
this.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOW_LAYOUT_HGAP, FLOW_LAYOUT_VGAP)); this.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOW_LAYOUT_HGAP, FLOW_LAYOUT_VGAP));
// this.setUI(new LogHandlerBarUI()); // this.setUI(new LogHandlerBarUI());
this.text = text; this.text = text;
clear = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/clear.png")); clear = creatPlainButtonByIconId("clearStash");
clear.setMargin(null);
clear.setOpaque(false);
clear.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
clear.setToolTipText(i18nText("Fine-Design_Basic_Clear_All")); clear.setToolTipText(i18nText("Fine-Design_Basic_Clear_All"));
selectedall = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/selectedall.png")); selectedall = creatPlainButtonByIconId("selected_all");
selectedall.setMargin(null);
selectedall.setOpaque(false);
selectedall.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
selectedall.setToolTipText(i18nText("Fine-Design_Basic_Select_All")); selectedall.setToolTipText(i18nText("Fine-Design_Basic_Select_All"));
set = new UIButton(BaseUtils.readIcon("com/fr/design/images/log/setting.png")); set = creatPlainButtonByIconId("filter_popup");
set.setMargin(null);
set.setOpaque(false);
set.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
set.setToolTipText(i18nText("Fine-Design_Report_Set")); set.setToolTipText(i18nText("Fine-Design_Report_Set"));
normalLabel = new UILabel(i18nText("Fine-Design_Basic_NNormal") + "(0)"); normalLabel = new UILabel(i18nText("Fine-Design_Basic_NNormal") + "(0)");
normalLabel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
alertLabel = new UILabel(i18nText("Fine-Design_Basic_Alert") + "(0)"); alertLabel = new UILabel(i18nText("Fine-Design_Basic_Alert") + "(0)");
alertLabel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
seriouslyLabel = new UILabel(i18nText("Fine-Design_Basic_Seriously") + "(0)"); seriouslyLabel = new UILabel(i18nText("Fine-Design_Basic_Seriously") + "(0)");
seriouslyLabel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
this.add(normalLabel); this.add(normalLabel);
this.add(alertLabel); this.add(alertLabel);
this.add(seriouslyLabel); this.add(seriouslyLabel);
@ -73,6 +68,12 @@ public class LogHandlerBar extends JPanel implements ItemSelectable {
this.add(set); this.add(set);
} }
private UIButton creatPlainButtonByIconId(String iconId) {
UIButton button = new UIButton(new LazyIcon(iconId, 18));
FineUIStyle.setStyle(button, FineUIStyle.PLAIN_BUTTON);
return button;
}
/** /**
* 更新日志数量统计标签 * 更新日志数量统计标签
*/ */

6
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/background/BackgroundSettingPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.theme.edit.background; package com.fr.design.mainframe.theme.edit.background;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -71,8 +73,8 @@ public class BackgroundSettingPane extends BasicBeanPane<Background> {
JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), headCombobox}}, new Component[][]{new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Fill")), headCombobox}},
TableLayoutHelper.FILL_NONE, 33, 5); TableLayoutHelper.FILL_NONE, 33, 5);
headCombobox.setPreferredSize(new Dimension(160, 20)); headCombobox.setPreferredSize(FineUIScale.scale(new Dimension(160, 20)));
jPanel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10)); jPanel.setBorder(new ScaledEmptyBorder(5, 10, 5, 10));
return jPanel; return jPanel;
} }

46
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/AbstractSupportSelectTablePane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.vcs.ui; package com.fr.design.mainframe.vcs.ui;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.data.tabledata.tabledatapane.loading.TipsPane; import com.fr.design.data.tabledata.tabledatapane.loading.TipsPane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -21,6 +23,7 @@ import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.RowSorter; import javax.swing.RowSorter;
import javax.swing.SortOrder;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.UIManager; import javax.swing.UIManager;
@ -153,7 +156,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
tablePane.setLayout(new BorderLayout()); tablePane.setLayout(new BorderLayout());
tablePane.add(tableTopPane, BorderLayout.NORTH); tablePane.add(tableTopPane, BorderLayout.NORTH);
tablePane.add(tableContentPane, BorderLayout.CENTER); tablePane.add(tableContentPane, BorderLayout.CENTER);
tableContentPane.getEditTable().getColumnModel().getColumn(0).setMaxWidth(50); tableContentPane.getEditTable().getColumnModel().getColumn(0).setMaxWidth(28);
RowSorter<UITableModelAdapter<T>> sorter = new TableRowSorter<UITableModelAdapter<T>>(model) { RowSorter<UITableModelAdapter<T>> sorter = new TableRowSorter<UITableModelAdapter<T>>(model) {
@Override @Override
public boolean isSortable(int column) { public boolean isSortable(int column) {
@ -173,7 +176,6 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
tableContentPane = new UITableEditorPane<>(model); tableContentPane = new UITableEditorPane<>(model);
model.setList(entities); model.setList(entities);
JTable table = tableContentPane.getEditTable(); JTable table = tableContentPane.getEditTable();
table.getTableHeader().setBackground(DEFAULT_HEADER_COLOR);
table.getTableHeader().setDefaultRenderer(new HeaderRenderer(tableContentPane.getEditTable())); table.getTableHeader().setDefaultRenderer(new HeaderRenderer(tableContentPane.getEditTable()));
table.addMouseListener(new MouseAdapter() { table.addMouseListener(new MouseAdapter() {
@Override @Override
@ -251,6 +253,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
public class HeaderRenderer implements TableCellRenderer { public class HeaderRenderer implements TableCellRenderer {
JTableHeader tableHeader; JTableHeader tableHeader;
final UICheckBox selectBox; final UICheckBox selectBox;
private boolean ascSort = true;
public HeaderRenderer(JTable table) { public HeaderRenderer(JTable table) {
this.tableHeader = table.getTableHeader(); this.tableHeader = table.getTableHeader();
@ -264,12 +267,14 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
int selectColumn = tableHeader.columnAtPoint(e.getPoint()); int selectColumn = tableHeader.columnAtPoint(e.getPoint());
if (selectColumn == 0) { if (selectColumn == 0) {
boolean value = !selectBox.isSelected(); boolean value = !selectBox.isSelected();
selectBox.setSelected(value);
selectAllOrNull(value); selectAllOrNull(value);
selectCount = value ? table.getRowCount() : 0; selectCount = value ? table.getRowCount() : 0;
setHeaderStatus(table, value);
changeExtraComponentStatus(); changeExtraComponentStatus();
tableHeader.repaint(); tableHeader.repaint();
model.fireTableDataChanged(); model.fireTableDataChanged();
} else {
ascSort = table.getRowSorter().getSortKeys().get(0).getSortOrder() == SortOrder.ASCENDING;
} }
} }
} }
@ -288,13 +293,26 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
* *
* @param table * @param table
*/ */
public void refreshHeader(JTable table, boolean value) { public void refreshHeader(JTable table, boolean isAllSelected) {
selectBox.setSelected(value); setHeaderStatus(table, isAllSelected);
int rowHeight = table.getRowHeight(); int rowHeight = table.getRowHeight();
table.updateUI(); table.updateUI();
table.setRowHeight(rowHeight); table.setRowHeight(rowHeight);
} }
public void setHeaderStatus(JTable table, boolean isAllSelected) {
if (isAllSelected) {
selectBox.setSelected(true);
selectBox.setSelectedIcon(new LazyIcon("checkbox_checked"));
} else if (selectCount > 0 && selectCount < table.getRowCount()) {
selectBox.setSelected(true);
selectBox.setSelectedIcon(new LazyIcon("checkbox_part_checked"));
} else {
selectBox.setSelected(false);
selectBox.setSelectedIcon(new LazyIcon("checkbox_unchecked"));
}
}
@Override @Override
public Component getTableCellRendererComponent(JTable table, public Component getTableCellRendererComponent(JTable table,
Object value, Object value,
@ -306,7 +324,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
String valueStr = (String) value; String valueStr = (String) value;
UILabel label = new UILabel(valueStr); UILabel label = new UILabel(valueStr);
if (needIcon4Head(column)) { if (needIcon4Head(column)) {
label.setIcon(IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_sort")); setAscSort(label, column);
label.setHorizontalTextPosition(JLabel.LEFT); label.setHorizontalTextPosition(JLabel.LEFT);
label.setHorizontalAlignment(SwingConstants.LEFT); label.setHorizontalAlignment(SwingConstants.LEFT);
} }
@ -320,6 +338,16 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
return component; return component;
} }
private void setAscSort(UILabel label, int column) {
if (column != 0) {
if (ascSort) {
label.setIcon(new LazyIcon("sort_asc"));
} else {
label.setIcon(new LazyIcon("sort_desc"));
}
}
}
} }
@ -338,7 +366,7 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
setColumnClass(classes); setColumnClass(classes);
this.setDefaultEditor(Boolean.class, new BooleanEditor()); this.setDefaultEditor(Boolean.class, new BooleanEditor());
this.setDefaultRenderer(Boolean.class, new BooleanRenderer()); this.setDefaultRenderer(Boolean.class, new BooleanRenderer());
this.setDefaultRenderer(UILabel.class, new ToolTipTableCellRenderer()); this.createTable().getColumnModel().getColumn(0).setCellRenderer(new BooleanRenderer());
} }
@Override @Override
@ -387,8 +415,8 @@ public abstract class AbstractSupportSelectTablePane<T extends TableEntity> exte
boolean isSelected, boolean hasFocus, int row, int column) { boolean isSelected, boolean hasFocus, int row, int column) {
setSelected((Boolean) table.getValueAt(row, 0)); setSelected((Boolean) table.getValueAt(row, 0));
setUI(getUICheckBoxUI()); setUI(getUICheckBoxUI());
setBorder(BorderFactory.createEmptyBorder()); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
setBackground(isSelected ? DEFAULT_SELECT_TABLE_ROW_COLOR : Color.WHITE); setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return this; return this;
} }
} }

27
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecyclePane.java

@ -1,5 +1,9 @@
package com.fr.design.mainframe.vcs.ui; package com.fr.design.mainframe.vcs.ui;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -32,6 +36,8 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText; import static com.fr.design.i18n.Toolkit.i18nText;
/** /**
@ -42,11 +48,11 @@ import static com.fr.design.i18n.Toolkit.i18nText;
* Created on 2023/7/5 * Created on 2023/7/5
*/ */
public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity> { public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity> {
public static final Icon ICON_SEARCH = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_recycle_search"); public static final Icon ICON_SEARCH = new LazyIcon("search");
public static final Icon ICON_REFRESH = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_restore", IconUtils.ICON_TYPE_NORMAL); public static final Icon ICON_REFRESH = new LazyIcon("refresh");
public static final Icon ICON_REFRESH_DISABLE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_restore", IconUtils.ICON_TYPE_DISABLED); public static final Icon ICON_REFRESH_DISABLE = new LazyIcon("refresh").disabled();
public static final Icon ICON_DELETE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete", IconUtils.ICON_TYPE_NORMAL); public static final Icon ICON_DELETE = new LazyIcon("remove");
public static final Icon ICON_DELETE_DISABLE = IconUtils.readSVGIcon("/com/fr/design/standard/vcslist/vcs_recycle_delete", IconUtils.ICON_TYPE_DISABLED); public static final Icon ICON_DELETE_DISABLE = new LazyIcon("remove").disabled();
private Set<VcsTableOperatorListener> listenerSet = new HashSet<>(); private Set<VcsTableOperatorListener> listenerSet = new HashSet<>();
@ -116,8 +122,14 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
searchTextField = new UITextField(); searchTextField = new UITextField();
searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Vcs_Start_Search")); searchTextField.setPlaceholder(Toolkit.i18nText("Fine-Design_Vcs_Start_Search"));
searchTextField.setColumns(COLUMNS_COUNT); searchTextField.setColumns(COLUMNS_COUNT);
leftPane.add(new UILabel(ICON_SEARCH)); UILabel searchLabel = new UILabel(ICON_SEARCH);
leftPane.add(searchTextField); searchLabel.setBorder(new ScaledEmptyBorder(0, 3, 0, 3));
searchTextField.setBorder(null);
leftPane = row(cell(searchLabel), cell(searchTextField).weight(1)).with(it -> {
it.setBorder(new FineRoundBorder());
it.setOpaque(true);
it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
}).getComponent();
} }
//右边面板,包括还原按钮+删除按钮 //右边面板,包括还原按钮+删除按钮
if (isNeedRestore()) { if (isNeedRestore()) {
@ -136,6 +148,7 @@ public class RecyclePane extends AbstractSupportSelectTablePane<VcsTableEntity>
} }
tableTopPane.add(leftPane, BorderLayout.EAST); tableTopPane.add(leftPane, BorderLayout.EAST);
tableTopPane.add(rightPane, BorderLayout.WEST); tableTopPane.add(rightPane, BorderLayout.WEST);
tableTopPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
} }

10
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/RecycleSettingPane.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe.vcs.ui; package com.fr.design.mainframe.vcs.ui;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
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;
@ -49,17 +49,19 @@ public class RecycleSettingPane extends BasicPane {
private void init() { private void init() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UITabbedPane tabbedPane = new UITabbedPane();
//回收站内容 //回收站内容
JPanel recyclePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel recyclePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
UIScrollPane recycleScrollPane = patchScroll(recyclePane); UIScrollPane recycleScrollPane = patchScroll(recyclePane);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane);
recyclePane.add(new RecyclePane()); recyclePane.add(new RecyclePane());
//通用设置 //通用设置
JPanel settingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel settingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
UIScrollPane settingScrollPane = patchScroll(settingPane); UIScrollPane settingScrollPane = patchScroll(settingPane);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane);
settingPane.add(createSchedulePane()); settingPane.add(createSchedulePane());
FineTabbedPane tabbedPane = FineTabbedPane.builder()
.addTab(Toolkit.i18nText("Fine-Design_Vcs_Recycle_Content"), recycleScrollPane)
.addTab(Toolkit.i18nText("Fine-Design_Basic_Carton_General_Settings"), settingScrollPane)
.withHeadRatio(0.3f).build();
this.add(tabbedPane, BorderLayout.CENTER); this.add(tabbedPane, BorderLayout.CENTER);
} }

2
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsCellRender.java

@ -23,7 +23,7 @@ public class VcsCellRender implements TableCellRenderer {
@Override @Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
vcsPanel.setBackground(isSelected ? DEFAULT_SELECT_TABLE_ROW_COLOR : Color.WHITE); vcsPanel.setOpaque(false);
return vcsPanel; return vcsPanel;
} }
} }

8
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsNewPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.vcs.ui; package com.fr.design.mainframe.vcs.ui;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
@ -66,9 +67,9 @@ public class VcsNewPane extends RecyclePane {
private static final int DOUBLE_CLICK_COUNT = 2; private static final int DOUBLE_CLICK_COUNT = 2;
protected VcsOperatorPane operatorPane; protected VcsOperatorPane operatorPane;
private static final Icon PREVIEW_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_operator_preview"); private static final Icon PREVIEW_ICON = new LazyIcon("preview");
private static final Icon DELETE_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_operator_delete"); private static final Icon DELETE_ICON = new LazyIcon("remove");
private static final Icon RESTORE_ICON = IconUtils.readIcon("/com/fr/design/standard/vcslist/vcs_operator_restore"); private static final Icon RESTORE_ICON = new LazyIcon("refresh");
private UILabel restore; private UILabel restore;
private UILabel delete; private UILabel delete;
@ -126,7 +127,6 @@ public class VcsNewPane extends RecyclePane {
this.operatorPane = createOperatorPane(); this.operatorPane = createOperatorPane();
this.model.setDefaultEditor(VcsOperatorPane.class, new VcsCellEditor(createOperatorPane())); this.model.setDefaultEditor(VcsOperatorPane.class, new VcsCellEditor(createOperatorPane()));
this.model.setDefaultRenderer(VcsOperatorPane.class, new VcsCellRender(createOperatorPane())); this.model.setDefaultRenderer(VcsOperatorPane.class, new VcsCellRender(createOperatorPane()));
this.model.setDefaultRenderer(UILabel.class, new ToolTipTableCellRenderer());
} }

23
designer-base/src/main/java/com/fr/design/mainframe/vcs/ui/VcsOperatorPane.java

@ -1,17 +1,25 @@
package com.fr.design.mainframe.vcs.ui; package com.fr.design.mainframe.vcs.ui;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.UIManager;
import java.awt.*; import java.awt.*;
import java.util.List; import java.util.List;
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.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 操作面板用于置放常用的操作label * 操作面板用于置放常用的操作label
@ -30,11 +38,20 @@ public class VcsOperatorPane extends JPanel {
private void init(List<JComponent> iconJComponentMap) { private void init(List<JComponent> iconJComponentMap) {
this.setLayout(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout()); JPanel panel = new JPanel();
this.setLayout(new BorderLayout());
panel.setLayout(FRGUIPaneFactory.createLeftZeroVgapNormalHgapLayout());
for (JComponent value : iconJComponentMap) { for (JComponent value : iconJComponentMap) {
value.setCursor(new Cursor(Cursor.HAND_CURSOR)); value.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.add(value); panel.add(value);
} }
panel.setOpaque(false);
add(column(flex(), row(fix(4), cell(panel)), flex())
.with(it -> {
it.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
it.setOpaque(true);
}).getComponent());
} }
} }

2
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -71,7 +71,7 @@ public class MenuDef extends ShortCut {
protected JPopupMenu popupMenu; protected JPopupMenu popupMenu;
protected boolean hasScrollSubMenu; protected boolean hasScrollSubMenu;
protected boolean isHeadMenu; protected boolean isHeadMenu;
private Icon icon; protected Icon icon;
private String anchor; private String anchor;

54
designer-base/src/main/java/com/fr/design/report/SelectImagePane.java

@ -1,10 +1,13 @@
package com.fr.design.report; package com.fr.design.report;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.ImgChooseWrapper; import com.fr.design.gui.frpane.ImgChooseWrapper;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.image.ImageFileChooser; import com.fr.design.style.background.image.ImageFileChooser;
import com.fr.design.style.background.image.ImagePreviewPane; import com.fr.design.style.background.image.ImagePreviewPane;
@ -13,7 +16,8 @@ import com.fr.report.cell.Elem;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import com.fr.report.cell.painter.CellImagePainter; import com.fr.report.cell.painter.CellImagePainter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -25,6 +29,10 @@ import javax.swing.JFileChooser;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
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;
/** /**
* <p>这个类主要用于插入图片时的设置</p> * <p>这个类主要用于插入图片时的设置</p>
* <p>这个类原本在designer-realize包下面现在表单也可选择图片所以应该抽为公用的base包包名不变应该不影响插件使用</p> * <p>这个类原本在designer-realize包下面现在表单也可选择图片所以应该抽为公用的base包包名不变应该不影响插件使用</p>
@ -69,33 +77,33 @@ public class SelectImagePane extends BasicPane {
public SelectImagePane() { public SelectImagePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
// preview pane // preview pane
JPanel previewContainerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(previewContainerPane, BorderLayout.CENTER);
JPanel previewOwnerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewOwnerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"), null));
previewPane = new ImagePreviewPane(); previewPane = new ImagePreviewPane();
previewOwnerPane.add(new JScrollPane(previewPane)); previewPane.setOpaque(false);
this.add(column(
JPanel selectFilePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); 5,
previewContainerPane.add(selectFilePane, BorderLayout.EAST); cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
selectFilePane.setBorder(BorderFactory row(
.createEmptyBorder(8, 2, 4, 0)); 10,
cell(new JScrollPane(previewPane)).with(it -> {
it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
it.getViewport().setOpaque(false);
it.setBorder(new FineRoundBorder());
}).weight(1),
cell(initSelectFilePane())
).weight(1)
).getComponent());
}
/**
* 选择图片
* @return
*/
public JPanel initSelectFilePane() {
UIButton selectPictureButton = new UIButton( UIButton selectPictureButton = new UIButton(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Image_Select_Picture")); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Image_Select_Picture"));
selectFilePane.add(selectPictureButton, BorderLayout.NORTH);
selectPictureButton.setMnemonic('S'); selectPictureButton.setMnemonic('S');
selectPictureButton.addActionListener(selectPictureActionListener); selectPictureButton.addActionListener(selectPictureActionListener);
JPanel layoutPane = FRGUIPaneFactory.createMediumHGapHighTopFlowInnerContainer_M_Pane();
selectFilePane.add(layoutPane, BorderLayout.CENTER);
//布局 //布局
defaultRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); defaultRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"));
tiledRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image_Titled")); tiledRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Image_Titled"));
@ -107,12 +115,11 @@ public class SelectImagePane extends BasicPane {
extendRadioButton.addActionListener(layoutActionListener); extendRadioButton.addActionListener(layoutActionListener);
adjustRadioButton.addActionListener(layoutActionListener); adjustRadioButton.addActionListener(layoutActionListener);
JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15)); JPanel jp = new JPanel(new GridLayout(4, 1, 10, 10));
jp.add(defaultRadioButton); jp.add(defaultRadioButton);
jp.add(tiledRadioButton); jp.add(tiledRadioButton);
jp.add(extendRadioButton); jp.add(extendRadioButton);
jp.add(adjustRadioButton); jp.add(adjustRadioButton);
layoutPane.add(jp);
ButtonGroup layoutBG = new ButtonGroup(); ButtonGroup layoutBG = new ButtonGroup();
layoutBG.add(defaultRadioButton); layoutBG.add(defaultRadioButton);
@ -125,6 +132,7 @@ public class SelectImagePane extends BasicPane {
// init image file chooser. // init image file chooser.
imageFileChooser = new ImageFileChooser(); imageFileChooser = new ImageFileChooser();
imageFileChooser.setMultiSelectionEnabled(false); imageFileChooser.setMultiSelectionEnabled(false);
return column(10, cell(selectPictureButton), cell(jp)).getComponent();
} }
// 调整图片样式,只有水平和垂直对齐以及拉伸。相对于背景,平铺不予考虑。 // 调整图片样式,只有水平和垂直对齐以及拉伸。相对于背景,平铺不予考虑。

41
designer-base/src/main/java/com/fr/design/roleAuthority/ReportAndFSManagePane.java

@ -1,6 +1,8 @@
package com.fr.design.roleAuthority; package com.fr.design.roleAuthority;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineToggleButtonUI;
import com.formdev.flatlaf.ui.FlatUIUtils;
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.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
@ -9,6 +11,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIHead;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
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;
@ -24,10 +27,11 @@ import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JToggleButton;
import javax.swing.JTree; import javax.swing.JTree;
import javax.swing.ScrollPaneConstants; import javax.swing.ScrollPaneConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -37,14 +41,19 @@ import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreeNode; import javax.swing.tree.TreeNode;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.GridLayout; import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell; 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.column;
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;
/** /**
@ -96,7 +105,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
jPanel.setOpaque(true); jPanel.setOpaque(true);
jPanel.add(column( jPanel.add(column(
4, 4,
row(2, cell(new UILabel(new LazyIcon("digitalPlatform"))), cell(buttonGroup)), row(cell(buttonGroup), flex()),
cell(scrollPane) cell(scrollPane)
).getComponent()); ).getComponent());
this.add(jPanel, BorderLayout.CENTER); this.add(jPanel, BorderLayout.CENTER);
@ -191,10 +200,7 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
} }
private void initbuttonGroup() { private void initbuttonGroup() {
buttonGroup = new UIHeadGroup(iconList()) {
Icon[] iconArray = new Icon[]{BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")};
String[] textArray = new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name")};
buttonGroup = new UIHeadGroup(textArray) {
public void tabChanged(int index) { public void tabChanged(int index) {
roleTree.setEditable(false); roleTree.setEditable(false);
if (op != null) { if (op != null) {
@ -207,6 +213,27 @@ public class ReportAndFSManagePane extends DockingView implements Prepare4DataSo
} }
} }
}; };
for (int i = 0; i < buttonGroup.getComponents().length; i++) {
Component component = buttonGroup.getComponent(i);
if (!(component instanceof JToggleButton)) {
continue;
}
((JToggleButton) component).setUI(new FineToggleButtonUI(false) {
@Override
protected void paintBackground(Graphics g, JComponent c) {
super.paintBackground(g, c);
g.setColor(FlatUIUtils.getUIColor("default.background", new Color(246, 248, 250)));
g.fillRect(0, 0, getWidth(), getHeight());
}
});
}
}
private static List<UIHead> iconList() {
List<UIHead> uiHeads = new ArrayList<>();
uiHeads.add(new UIHead(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FS_Name"), new LazyIcon("digitalPlatform")));
return uiHeads;
} }
/** /**

67
designer-base/src/main/java/com/fr/design/style/BorderPane.java

@ -3,7 +3,9 @@
*/ */
package com.fr.design.style; package com.fr.design.style;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
@ -19,8 +21,8 @@ import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -35,6 +37,8 @@ import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
@ -76,7 +80,7 @@ public class BorderPane extends BasicPane {
private LineComboBox currentLineCombo; private LineComboBox currentLineCombo;
private NewColorSelectBox currentLineColorPane; private NewColorSelectBox currentLineColorPane;
private UIButton insidebutton; private JToggleButton insidebutton;
public BorderPane() { public BorderPane() {
this.initComponents(); this.initComponents();
@ -85,12 +89,13 @@ public class BorderPane extends BasicPane {
protected void initComponents() { protected void initComponents() {
initBasicComponents(); initBasicComponents();
JPanel borderAllControlPane = initButtonPanel(); JPanel borderAllControlPane = initButtonPanel();
JPanel borderLeftPane = column(flex(), cell(topToggleButton), cell(horizontalToggleButton), cell(bottomToggleButton), flex()).getComponent(); JPanel borderLeftPane = column(5, flex(), cell(topToggleButton), cell(horizontalToggleButton), cell(bottomToggleButton), flex()).getComponent();
JPanel borderBottomPane = row(flex(), cell(leftToggleButton), cell(verticalToggleButton), cell(rightToggleButton), flex()).getComponent(); JPanel borderBottomPane = row(5, flex(), cell(leftToggleButton), cell(verticalToggleButton), cell(rightToggleButton), flex()).getComponent();
this.currentLineColorPane.setSelectObject(Color.BLUE); this.currentLineColorPane.setSelectObject(Color.BLUE);
Component northPane1 = initNorthPanel(); Component northPane1 = initNorthPanel();
Component centerPane1 = FineUIUtils.wrapComponentWithTitle(row(5, cell(borderLeftPane), Component centerPane1 = FineUIUtils.wrapComponentWithTitle(row(5, cell(borderLeftPane),
column(5, row(flex(), cell(borderAllControlPane),flex()), cell(borderComponent).with(it -> it.setPreferredSize(new Dimension(600, 300))), cell(borderBottomPane)) column(5, row(flex(), cell(borderAllControlPane),flex()), cell(borderComponent)
.with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(600, 300)))), cell(borderBottomPane))
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview")); ).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.add(column(10, cell(northPane1), cell(centerPane1)).getComponent()); this.add(column(10, cell(northPane1), cell(centerPane1)).getComponent());
} }
@ -115,14 +120,30 @@ public class BorderPane extends BasicPane {
} }
private JPanel initButtonPanel() { private JPanel initButtonPanel() {
UIButton button1 = createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No")); JToggleButton button1 = createVerButtonPane(NO_BORDERS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_No"));
UIButton button2 = createVerButtonPane(EXTERNAL_BORDERS, ""); JToggleButton button2 = createVerButtonPane(EXTERNAL_BORDERS, "");
UIButton button3 = createVerButtonPane(INSIDE_BORDERS, ""); JToggleButton button3 = createVerButtonPane(INSIDE_BORDERS, "");
ButtonGroup buttonGroup = new ButtonGroup(); ItemListener itemListener = e -> {
buttonGroup.add(button1); AbstractButton button = (AbstractButton) e.getSource();
buttonGroup.add(button2); if (e.getStateChange() == ItemEvent.SELECTED) {
buttonGroup.add(button3); if (button == button1) {
return row(cell(button1), cell(button2), cell(button3)).getComponent(); if (button2.isSelected()) {
button2.setSelected(false);
}
if (button3.isSelected()) {
button3.setSelected(false);
}
} else if (button == button2 || button == button3) {
if (button1.isSelected()) {
button1.setSelected(false);
}
}
}
};
button1.addItemListener(itemListener);
button2.addItemListener(itemListener);
button3.addItemListener(itemListener);
return row(5, cell(button1), cell(button2), cell(button3)).getComponent();
} }
private Component initNorthPanel() { private Component initNorthPanel() {
@ -156,7 +177,7 @@ public class BorderPane extends BasicPane {
} }
} }
private UIButton createVerButtonPane(int display, String text) { private JToggleButton createVerButtonPane(int display, String text) {
JPanel verPane = new JPanel(); JPanel verPane = new JPanel();
BorderButton button = new BorderButton(display); BorderButton button = new BorderButton(display);
@ -253,9 +274,9 @@ public class BorderPane extends BasicPane {
this.borderType = borderType; this.borderType = borderType;
if (horizontal) { if (horizontal) {
this.setPreferredSize(new Dimension(40, 24)); this.setPreferredSize(FineUIScale.scale(new Dimension(40, 24)));
} else { } else {
this.setPreferredSize(new Dimension(24, 40)); this.setPreferredSize(FineUIScale.scale(new Dimension(24, 40)));
} }
this.addActionListener(this); this.addActionListener(this);
} }
@ -305,7 +326,7 @@ public class BorderPane extends BasicPane {
} }
// Shortcut setting button // Shortcut setting button
private class BorderButton extends UIButton implements ActionListener { private class BorderButton extends JToggleButton implements ActionListener {
private int border; private int border;
private BorderButton(int border) { private BorderButton(int border) {
@ -315,8 +336,8 @@ public class BorderPane extends BasicPane {
} else if(border == BorderPane.INSIDE_BORDERS) { } else if(border == BorderPane.INSIDE_BORDERS) {
this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_format/in.png")); this.setIcon(BaseUtils.readIcon("com/fr/design/images/m_format/in.png"));
} }
this.setPreferredSize(FineUIScale.scale(new Dimension(40, 24)));
this.addActionListener(this); this.addActionListener(this);
setPreferredSize(new Dimension(36, 24));
setFocusPainted(false); setFocusPainted(false);
} }
@ -583,16 +604,16 @@ public class BorderPane extends BasicPane {
int pInset = 4; int pInset = 4;
int pWidth = this.getWidth() / 2 - 20 - pInset; int pWidth = this.getWidth() / 2 - 20 - pInset;
int pHeight = this.getHeight() / 2 - 20 - pInset; int pHeight = this.getHeight() / 2 - 20 - pInset;
g.setColor(Color.lightGray); g.setColor(FlatUIUtils.getUIColor("fill.hover", new Color(230,233,239)));
g.fillRect(20, 20, pWidth, pHeight); g.fillRect(20, 20, pWidth, pHeight);
g.setColor(Color.lightGray); g.setColor(FlatUIUtils.getUIColor("fill.hover", new Color(230,233,239)));
g.fillRect(this.getWidth() / 2 + pInset + 1, 20, pWidth, pHeight); g.fillRect(this.getWidth() / 2 + pInset + 1, 20, pWidth, pHeight);
g.setColor(Color.lightGray); g.setColor(FlatUIUtils.getUIColor("fill.hover", new Color(230,233,239)));
g.fillRect(20, this.getHeight() / 2 + pInset + 1, pWidth, pHeight); g.fillRect(20, this.getHeight() / 2 + pInset + 1, pWidth, pHeight);
g.setColor(Color.lightGray); g.setColor(FlatUIUtils.getUIColor("fill.hover", new Color(230,233,239)));
g.fillRect(this.getWidth() / 2 + pInset + 1, this.getHeight() / 2 + pInset + 1, pWidth, pHeight); g.fillRect(this.getWidth() / 2 + pInset + 1, this.getHeight() / 2 + pInset + 1, pWidth, pHeight);
} else { } else {
g.setColor(Color.lightGray); g.setColor(FlatUIUtils.getUIColor("fill.hover", new Color(230,233,239)));
g.fillRect(20, 20, this.getWidth() - 40, this.getHeight() - 40); g.fillRect(20, 20, this.getWidth() - 40, this.getHeight() - 40);
} }
updateBorders(g); updateBorders(g);

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

@ -3,7 +3,6 @@
*/ */
package com.fr.design.style; package com.fr.design.style;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -27,7 +26,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridBagConstraints; import java.awt.GridBagConstraints;
import java.awt.GridBagLayout; import java.awt.GridBagLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -101,7 +99,6 @@ public class FRFontPane extends BasicPane {
initCheckbox(); initCheckbox();
// preview pane. // preview pane.
preview = new FRFontPreviewArea(); preview = new FRFontPreviewArea();
preview.setPreferredSize(FineUIScale.scale(new Dimension(640, 240)));
//peteter:这里主动从Context, 获得默认的FRFont的值. //peteter:这里主动从Context, 获得默认的FRFont的值.
DefaultValues defaultValues = FRContext.getDefaultValues(); DefaultValues defaultValues = FRContext.getDefaultValues();
@ -166,7 +163,7 @@ public class FRFontPane extends BasicPane {
row(cell(this.isStrikethroughCheckBox), fix(5), cell(this.isShadowCheckBox), fix(5), row(cell(this.isStrikethroughCheckBox), fix(5), cell(this.isShadowCheckBox), fix(5),
cell(this.isSuperscriptCheckBox), fix(5), cell(this.isSubscriptCheckBox), flex()).weight(0.6) cell(this.isSuperscriptCheckBox), fix(5), cell(this.isSubscriptCheckBox), flex()).weight(0.6)
), ),
column(5, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(preview)) column(5, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(preview).weight(1)).weight(1)
).getComponent()); ).getComponent());
} }

83
designer-base/src/main/java/com/fr/design/style/FormatPane.java

@ -3,7 +3,10 @@
*/ */
package com.fr.design.style; package com.fr.design.style;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
@ -21,6 +24,7 @@ import com.fr.stable.StringUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -33,6 +37,7 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -43,6 +48,7 @@ import java.util.Date;
import static com.fine.swing.ui.layout.Layouts.cell; 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.column;
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;
/** /**
@ -84,41 +90,73 @@ public class FormatPane extends BasicPane {
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); this.setBorder(new ScaledEmptyBorder(4, 4, 4, 4));
//sample pane //sample pane
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()); JPanel samplePane = initSamplePane();
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
initRadioButton(); initRadioButton();
initRadioButtonGroup(); initRadioButtonGroup();
//left control pane initPattern();
JPanel leftControlPane = initLeftControlPane();
//content pane.
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
patternTextField = new UITextField();
contentPane.add(patternTextField, BorderLayout.NORTH);
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
patternList = new JList(new DefaultListModel());
contentPane.add(new JScrollPane(patternList), BorderLayout.CENTER);
patternList.addListSelectionListener(patternListSelectionListener);
//init values. //init values.
nullRadioButton.setSelected(true); nullRadioButton.setSelected(true);
this.applyRadioActionListener(this.nullRadioButton); this.applyRadioActionListener(this.nullRadioButton);
JScrollPane scrollPane = initPatternScrollPanel();
this.add(column( this.add(column(
10, 10,
cell(FineUIUtils.wrapComponentWithTitle(sampleLabel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"))), cell(samplePane),
row( row(10,
column(
10, 10,
cell(FineUIUtils.wrapComponentWithTitle(leftControlPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Format_Category"))).weight(0.1), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Format_Category"))).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 0, 0))),
cell(contentPane).weight(0.5) cell(initLeftControlPane()),
) flex()
).weight(0.1),
column(
10,
cell(patternTextField),
cell(scrollPane).weight(1)
).weight(0.5)
).weight(1)
).getComponent()); ).getComponent());
} }
private JPanel initSamplePane() {
JPanel samplePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
samplePane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_StyleFormat_Sample"), null));
samplePane.setLayout(FRGUIPaneFactory.createBorderLayout());
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(new ScaledEmptyBorder(10, 0, 10, 0));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return samplePane;
}
private void initPattern() {
patternTextField = new UITextField();
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
patternList = new JList(new DefaultListModel());
patternList.setCellRenderer(new DefaultListCellRenderer(){
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
setOpaque(false);
return this;
}
});
patternList.addListSelectionListener(patternListSelectionListener);
}
private JScrollPane initPatternScrollPanel() {
JScrollPane scrollPane = new JScrollPane(patternList);
patternList.setOpaque(false);
scrollPane.getViewport().setOpaque(false);
scrollPane.getVerticalScrollBar().setOpaque(false);
scrollPane.setBorder(new FineRoundBorder());
scrollPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return scrollPane;
}
private void initRadioButton () { private void initRadioButton () {
nullRadioButton = new UIRadioButton(FormatField.getInstance().getName(FormatContents.NULL)); nullRadioButton = new UIRadioButton(FormatField.getInstance().getName(FormatContents.NULL));
nullRadioButton.setMnemonic('o'); nullRadioButton.setMnemonic('o');
@ -183,7 +221,6 @@ public class FormatPane extends BasicPane {
JPanel pane = new JPanel(); JPanel pane = new JPanel();
pane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); pane.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
pane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
pane.add(radioButton); pane.add(radioButton);
return pane; return pane;

7
designer-base/src/main/java/com/fr/design/style/background/BackgroundPane.java

@ -7,6 +7,7 @@ import java.awt.Dimension;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.frpane.FineTabbedPane;
@ -40,7 +41,7 @@ public class BackgroundPane extends BasicPane {
BackgroundFactory.getWrapper(ColorBackground.class).setType( BackgroundFactory.getWrapper(ColorBackground.class).setType(
DesignerContext.getDesignerFrame().isServerConfig() ? ColorNoThemeBackgroundPane.class : ColorBackgroundPane.class); DesignerContext.getDesignerFrame().isServerConfig() ? ColorNoThemeBackgroundPane.class : ColorBackgroundPane.class);
this.initComponents(); this.initComponents();
this.setPreferredSize(new Dimension(400, 300)); this.setPreferredSize(FineUIScale.scale(new Dimension(400, 300)));
} }
protected void initComponents() { protected void initComponents() {
@ -48,9 +49,7 @@ public class BackgroundPane extends BasicPane {
initTabPane(); initTabPane();
tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build(); tabbedPane = tabbedPaneBuilder.withHeadRatio(0.65f).build();
add(column( add(cell(tabbedPane).weight(1).getComponent());
cell(tabbedPane)
).getComponent());
} }
protected void initTabPane() { protected void initTabPane() {

3
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.gradient; package com.fr.design.style.background.gradient;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.base.background.GradientBackground; import com.fr.base.background.GradientBackground;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
@ -76,7 +77,7 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
) )
).getComponent(); ).getComponent();
jpanel.setPreferredSize(new Dimension(600, 450)); jpanel.setPreferredSize(FineUIScale.scale(new Dimension(600, 450)));
this.add(FineUIUtils.wrapComponentWithTitle(jpanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Background_Choose_Gradient_Color"))); this.add(FineUIUtils.wrapComponentWithTitle(jpanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Style_Background_Choose_Gradient_Color")));
} }

9
designer-base/src/main/java/com/fr/design/style/background/impl/BPane.java

@ -7,9 +7,6 @@ import com.fr.design.style.background.BackgroundDetailPane;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/** /**
* Created by richie on 16/5/18. * Created by richie on 16/5/18.
*/ */
@ -21,15 +18,11 @@ public abstract class BPane extends BackgroundDetailPane {
protected void initComponents(int nColumn) { protected void initComponents(int nColumn) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
JPanel typePane2 = new JPanel(); JPanel typePane2 = new JPanel();
typePane2.setLayout(layoutOfTypePane(nColumn)); typePane2.setLayout(layoutOfTypePane(nColumn));
setChildrenOfTypePane(typePane2); setChildrenOfTypePane(typePane2);
JPanel contentPane = column( JPanel contentPane = (JPanel) FineUIUtils.wrapComponentWithTitle(typePane2, titleOfTypePane());
10,
cell(FineUIUtils.wrapComponentWithTitle(typePane2, titleOfTypePane()))
).getComponent();
this.add(contentPane, BorderLayout.NORTH); this.add(contentPane, BorderLayout.NORTH);
setChildrenOfContentPane(contentPane); setChildrenOfContentPane(contentPane);

31
designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java

@ -1,6 +1,7 @@
package com.fr.design.style.background.impl; package com.fr.design.style.background.impl;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground; import com.fr.base.background.ImageFileBackground;
@ -56,7 +57,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
// preview pane // preview pane
previewPane = new ImagePreviewPane(); previewPane = new ImagePreviewPane();
previewPane.addChangeListener(imageSizeChangeListener); previewPane.addChangeListener(imageSizeChangeListener);
previewPane.setOpaque(false);
// init image file chooser. // init image file chooser.
imageFileChooser = new ImageFileChooser(); imageFileChooser = new ImageFileChooser();
@ -68,13 +69,14 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
row( row(
10, 10,
cell(new JScrollPane(previewPane)).weight(0.65).with(it -> { cell(new JScrollPane(previewPane)).with(it -> {
it.getViewport().setBackground(Color.WHITE); it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor"))); it.getViewport().setOpaque(false);
}), it.setBorder(new FineRoundBorder());
cell(initSelectFilePane()).weight(0.1) }).weight(1),
).with(it -> it.setPreferredSize(new Dimension(it.getWidth(), 400))) cell(initSelectFilePane())
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); ).weight(1)
).getComponent());
} }
public JPanel initSelectFilePane() { public JPanel initSelectFilePane() {
@ -94,7 +96,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
extendRadioButton.addActionListener(layoutActionListener); extendRadioButton.addActionListener(layoutActionListener);
adjustRadioButton.addActionListener(layoutActionListener); adjustRadioButton.addActionListener(layoutActionListener);
JPanel jp = new JPanel(new GridLayout(4, 1, 15, 15)); JPanel jp = new JPanel(new GridLayout(4, 1, 10, 10));
for (UIRadioButton button : imageLayoutButtons()) { for (UIRadioButton button : imageLayoutButtons()) {
jp.add(button); jp.add(button);
} }
@ -104,14 +106,7 @@ public class ImageBackgroundPane extends BackgroundDetailPane {
layoutBG.add(extendRadioButton); layoutBG.add(extendRadioButton);
layoutBG.add(adjustRadioButton); layoutBG.add(adjustRadioButton);
defaultRadioButton.setSelected(true); defaultRadioButton.setSelected(true);
return column( return column(10, cell(selectPictureButton), cell(jp)).getComponent();
15,
cell(selectPictureButton),
column(
15,
cell(jp)
)
).getComponent();
} }
protected UIRadioButton[] imageLayoutButtons() { protected UIRadioButton[] imageLayoutButtons() {

55
designer-base/src/main/java/com/fr/design/style/background/impl/NullBackgroundPane.java

@ -1,27 +1,52 @@
package com.fr.design.style.background.impl; package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane; import com.fr.design.style.background.BackgroundDetailPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.general.locale.image.I18nImage;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
/** /**
* Null background pane. * Null background pane.
*/ */
public class NullBackgroundPane extends BackgroundDetailPane { public class NullBackgroundPane extends BackgroundDetailPane {
private static final String NULL_BACKGROUND = "/com/fr/design/images/background/null_background.png";
private static final Image DEFAULT_NULL_BACKGROUND_IMAGE;
static {
DEFAULT_NULL_BACKGROUND_IMAGE = I18nImage.getImage(NULL_BACKGROUND);
}
public NullBackgroundPane() { public NullBackgroundPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel centerLabel = new UILabel( UILabel centerLabel = new UILabel(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null")); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background_Background_Is_Null"));
this.add(centerLabel); ImagePanel imagePane = new ImagePanel();
JPanel pane = column(
10,
flex(),
cell(imagePane),
cell(centerLabel),
flex()
).getComponent();
centerLabel.setHorizontalAlignment(SwingConstants.CENTER); centerLabel.setHorizontalAlignment(SwingConstants.CENTER);
add(pane, BorderLayout.CENTER);
} }
public void populate(Background background) { public void populate(Background background) {
@ -35,4 +60,30 @@ public class NullBackgroundPane extends BackgroundDetailPane {
public void addChangeListener(ChangeListener changeListener) { public void addChangeListener(ChangeListener changeListener) {
// do nothing. // do nothing.
} }
/**
* 水平居中绘制 Image
*/
public class ImagePanel extends JPanel {
public ImagePanel() {
}
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
if (DEFAULT_NULL_BACKGROUND_IMAGE != null) {
int x = (this.getWidth() - DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null)) / 2;
g.drawImage(DEFAULT_NULL_BACKGROUND_IMAGE, x, 0, this);
}
}
@Override
public Dimension getPreferredSize() {
if (DEFAULT_NULL_BACKGROUND_IMAGE == null) {
return super.getPreferredSize();
}
return FineUIScale.scale(new Dimension(DEFAULT_NULL_BACKGROUND_IMAGE.getWidth(null), DEFAULT_NULL_BACKGROUND_IMAGE.getHeight(null)));
}
}
} }

29
designer-base/src/main/java/com/fr/design/style/background/impl/PatternBackgroundPane.java

@ -1,5 +1,6 @@
package com.fr.design.style.background.impl; package com.fr.design.style.background.impl;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.background.PatternBackground; import com.fr.base.background.PatternBackground;
@ -18,6 +19,7 @@ import java.awt.event.ActionListener;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex; import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.swing.ui.layout.Layouts.row;
@ -68,27 +70,26 @@ public class PatternBackgroundPane extends BPane {
protected void setChildrenOfContentPane(JPanel contentPane) { protected void setChildrenOfContentPane(JPanel contentPane) {
// colors // colors
JPanel colorPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors"));
foregroundColorPane = new ColorSelectBox(80); foregroundColorPane = new ColorSelectBox(80);
foregroundColorPane.setPreferredSize(new Dimension(80, 24)); foregroundColorPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 24)));
backgroundColorPane = new ColorSelectBox(80); backgroundColorPane = new ColorSelectBox(80);
backgroundColorPane.setPreferredSize(new Dimension(80, 24)); backgroundColorPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 24)));
foregroundColorPane.setSelectObject(Color.lightGray); foregroundColorPane.setSelectObject(Color.lightGray);
backgroundColorPane.setSelectObject(Color.black); backgroundColorPane.setSelectObject(Color.black);
contentPane.add(FineUIUtils.wrapComponentWithTitle(row( contentPane.add(FineUIUtils.wrapComponentWithTitle(column(
10, 10,
row( row(
10, 60,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Foreground") + ":")).weight(0.1),
cell(foregroundColorPane) cell(foregroundColorPane).weight(0.45),
).weight(0.1), flex()
),
row( row(
10, 60,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background") + ":")), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background") + ":")).weight(0.1),
cell(backgroundColorPane) cell(backgroundColorPane).weight(0.45),
).weight(0.1), flex()
flex(0.1) )
).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors"))); ).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Colors")));
} }

6
designer-base/src/main/java/com/fr/design/style/color/ColorAdjustPane.java

@ -38,7 +38,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
public static final Color[] DEFAULT_COLORS = ChartConstants.NEW_FEATURES; public static final Color[] DEFAULT_COLORS = ChartConstants.NEW_FEATURES;
private static final int COUNT_OF_ROW = 20; private static final int COUNT_OF_ROW = 12;
private static final int MAX_BUTTON = 40; private static final int MAX_BUTTON = 40;
@ -83,7 +83,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
private void createContentPane() { private void createContentPane() {
VerticalFlowLayout layout = new VerticalFlowLayout(0, 0, 0); VerticalFlowLayout layout = new VerticalFlowLayout(0, 0, 0);
layout.setAlignLeft(true); layout.setAlignLeft(true);
this.setLayout(new BorderLayout()); this.setLayout(layout);
for (int i = 0, size = colorButtons.size(); i < size; i += COUNT_OF_ROW) { for (int i = 0, size = colorButtons.size(); i < size; i += COUNT_OF_ROW) {
JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(2, 2); JPanel panel = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(2, 2);
@ -126,7 +126,7 @@ public class ColorAdjustPane extends JPanel implements UIObserver {
}; };
colorButton.addChangeListener(changeListener); colorButton.addChangeListener(changeListener);
colorButton.setBorder(new ScaledEmptyBorder(0, 0, 0, 15)); colorButton.setBorder(new ScaledEmptyBorder(0, 0, 0, 1));
return colorButton; return colorButton;
} }

10
designer-base/src/main/java/com/fr/design/style/color/ColorSelectDetailPane.java

@ -1,7 +1,9 @@
package com.fr.design.style.color; package com.fr.design.style.color;
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.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.FineTabbedPane; import com.fr.design.gui.frpane.FineTabbedPane;
@ -76,7 +78,7 @@ public class ColorSelectDetailPane extends BasicPane {
// 颜色选择器面板 // 颜色选择器面板
selectedPanel = new JColorChooser(this.color); selectedPanel = new JColorChooser(this.color);
selectedPanel.setPreferredSize(new Dimension(selectedPanel.getWidth(), SELECT_PANEL_HEIGHT)); selectedPanel.setPreferredSize(new Dimension(selectedPanel.getWidth(), FineUIScale.scale(SELECT_PANEL_HEIGHT)));
selectedPanel.setPreviewPanel(new JPanel()); selectedPanel.setPreviewPanel(new JPanel());
swatchChooserPanel = new SwatchChooserPanel(); swatchChooserPanel = new SwatchChooserPanel();
@ -87,7 +89,7 @@ public class ColorSelectDetailPane extends BasicPane {
// 预览 // 预览
previewPanel = new JPanel(new BorderLayout()); previewPanel = new JPanel(new BorderLayout());
final ColorChooserPreview colorChooserPreview = new ColorChooserPreview(); final ColorChooserPreview colorChooserPreview = new ColorChooserPreview();
colorChooserPreview.setBackground(Color.WHITE); colorChooserPreview.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
ColorSelectionModel model = selectedPanel.getSelectionModel(); ColorSelectionModel model = selectedPanel.getSelectionModel();
model.addChangeListener(new ChangeListener() { model.addChangeListener(new ChangeListener() {
@Override @Override
@ -128,8 +130,8 @@ public class ColorSelectDetailPane extends BasicPane {
cell(new UILabel(i18nText("Fine-Design_Basic_Preview"))), cell(new UILabel(i18nText("Fine-Design_Basic_Preview"))),
cell(previewPanel).with(it -> { cell(previewPanel).with(it -> {
it.setBorder(new FineRoundBorder()); it.setBorder(new FineRoundBorder());
it.setPreferredSize(new Dimension(this.getPreferredSize().width, 120)); it.setPreferredSize(new Dimension(this.getPreferredSize().width, FineUIScale.scale(120)));
it.setBackground(Color.WHITE); it.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
}) })
)).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10))) )).with(it -> it.setBorder(new ScaledEmptyBorder(0, 10, 0, 10)))
).getComponent(); ).getComponent();

34
designer-base/src/main/java/com/fr/design/style/color/CustomChooserPanel.java

@ -11,6 +11,7 @@ import javax.swing.ButtonGroup;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JColorChooser; import javax.swing.JColorChooser;
import javax.swing.JLayeredPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -22,6 +23,9 @@ import javax.swing.event.DocumentListener;
import javax.swing.text.BadLocationException; import javax.swing.text.BadLocationException;
import javax.swing.text.Document; import javax.swing.text.Document;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.islider.UISlider; import com.fr.design.gui.islider.UISlider;
@ -593,10 +597,10 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
*/ */
protected void buildChooser() { protected void buildChooser() {
setLayout(new BorderLayout(10, 0)); setLayout(new BorderLayout(10, 0));
setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), 180)); setPreferredSize(new Dimension((int) this.getPreferredSize().getWidth(), FineUIScale.scale(180)));
add(buildRightPanel(), BorderLayout.CENTER); add(buildRightPanel(), BorderLayout.CENTER);
JPanel container = new JPanel(); JPanel container = new JPanel();
container.setLayout(new BorderLayout()); container.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 0));
gradientPanel = createGradientPanel(); gradientPanel = createGradientPanel();
MouseAdapter ml = new MainGradientMouseListener(); MouseAdapter ml = new MainGradientMouseListener();
@ -612,10 +616,16 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
slider.setOrientation(SwingConstants.VERTICAL); slider.setOrientation(SwingConstants.VERTICAL);
updateSlider(); updateSlider();
JLayeredPane layeredPane = new JLayeredPane();
layeredPane.add(trackPanel, JLayeredPane.DEFAULT_LAYER);
layeredPane.add(slider, JLayeredPane.PALETTE_LAYER);
container.add(gradientPanel, BorderLayout.WEST); container.add(gradientPanel);
container.add(slider, BorderLayout.CENTER); container.add(layeredPane);
container.add(trackPanel, BorderLayout.EAST);
layeredPane.setPreferredSize(FineUIScale.scale(new Dimension(12, 180)));
slider.setSize(FineUIScale.scale(new Dimension(12, 180)));
trackPanel.setSize(FineUIScale.scale(new Dimension(12, 180)));
add(container, BorderLayout.WEST); add(container, BorderLayout.WEST);
slider.addChangeListener(new SliderChangeListener()); slider.addChangeListener(new SliderChangeListener());
@ -691,7 +701,11 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
private Container buildRightPanel() { private Container buildRightPanel() {
JPanel container = new JPanel(new BorderLayout()); JPanel container = new JPanel(new BorderLayout());
JButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON18, true); JButton pickColorButton = PickColorButtonFactory.getPickColorButton(this, PickColorButtonFactory.IconType.ICON24, true);
JPanel pane = new JPanel(new BorderLayout());
pane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
pane.add(pickColorButton);
pane.setBorder(new FineRoundBorder());
container.add(column( container.add(column(
10, 10,
row( row(
@ -704,11 +718,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
BUTTON_SPINNER_GAP, BUTTON_SPINNER_GAP,
row(fix((int) hRadio.getPreferredSize().getHeight()), cell(new UILabel("#")), flex()).with(it -> it.setPreferredSize(hRadio.getPreferredSize())), row(fix((int) hRadio.getPreferredSize().getHeight()), cell(new UILabel("#")), flex()).with(it -> it.setPreferredSize(hRadio.getPreferredSize())),
cell(field), cell(field),
column( cell(pane)
flex(),
cell(pickColorButton),
flex()
)
) )
).getComponent()); ).getComponent());
@ -780,7 +790,7 @@ class CustomChooserPanel extends AbstractColorChooserPanel implements ColorSelec
TextDocumentListener listen = new TextDocumentListener(); TextDocumentListener listen = new TextDocumentListener();
field = new UITextField(); field = new UITextField();
field.setPreferredSize(new Dimension(hSpinner.getPreferredSize())); field.setPreferredSize(FineUIScale.scale(new Dimension(hSpinner.getPreferredSize())));
field.getDocument().addDocumentListener(listen); field.getDocument().addDocumentListener(listen);
return column( return column(

10
designer-base/src/main/java/com/fr/design/style/color/DetailColorSelectPane.java

@ -11,6 +11,7 @@ import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D; import java.awt.geom.Rectangle2D;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIUtils; import com.fine.theme.utils.FineUIUtils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -43,7 +44,6 @@ public class DetailColorSelectPane extends BasicPane {
} }
public DetailColorSelectPane(boolean supportTheme) { public DetailColorSelectPane(boolean supportTheme) {
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 0, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
colorSelectPane = NewColorSelectPane.createColorSelectPaneWithTheme(supportTheme); colorSelectPane = NewColorSelectPane.createColorSelectPaneWithTheme(supportTheme);
@ -78,13 +78,13 @@ public class DetailColorSelectPane extends BasicPane {
5, 5,
row( row(
20, 20,
cell(colorSelectPane.transparentButton).weight(0.2), cell(colorSelectPane.transparentButton).weight(0.3),
cell(new UILabel("<html><font color=gray>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview") + "</font></html>")).weight(0.36) cell(new UILabel("<html><font color=gray>" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview") + "</font></html>")).weight(0.53)
), ),
row( row(
20, 20,
cell(colorSelectPane.theme).weight(0.2).with(it -> it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor")))), cell(colorSelectPane.theme).weight(0.3).with(it -> it.setBorder(new FineRoundBorder())),
cell(colorPreviewPane).weight(0.36).with(it -> it.setBorder(BorderFactory.createMatteBorder(1, 1, 1, 1, UIManager.getColor("defaultBorderColor")))) cell(colorPreviewPane).weight(0.53).with(it -> it.setBorder(new FineRoundBorder()))
) )
).getComponent(); ).getComponent();
this.add(FineUIUtils.wrapComponentWithTitle(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"))); this.add(FineUIUtils.wrapComponentWithTitle(center, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color")));

1
designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java

@ -298,6 +298,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency")); transparentButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_ChartF_Transparency"));
transparentButton.addActionListener(e -> doTransparent()); transparentButton.addActionListener(e -> doTransparent());
transparentButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); transparentButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
transparentJpanel.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
transparentJpanel.add(transparentButton, BorderLayout.CENTER); transparentJpanel.add(transparentButton, BorderLayout.CENTER);
transparentJpanel.setBorder(new ScaledEmptyBorder(6, 6, 6, 6)); transparentJpanel.setBorder(new ScaledEmptyBorder(6, 6, 6, 6));
this.add(transparentJpanel, BorderLayout.NORTH); this.add(transparentJpanel, BorderLayout.NORTH);

35
designer-base/src/main/java/com/fr/design/style/color/PickColorButtonFactory.java

@ -1,12 +1,13 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.gui.ibutton.SpecialUIButton; import com.fr.design.gui.ibutton.SpecialUIButton;
import com.fr.design.gui.ibutton.UIBasicButtonUI; import com.fr.design.gui.ibutton.UIBasicButtonUI;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComponent; import javax.swing.JComponent;
import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Graphics; import java.awt.Graphics;
@ -20,9 +21,7 @@ import java.awt.event.MouseEvent;
class PickColorButtonFactory { class PickColorButtonFactory {
private static int iconSize; private static int iconSize;
private static final int SIZE_16 = 16; private static final int SIZE_16 = 16;
private static final int SIZE_18 = 18; private static final int SIZE_24 = 24;
private static IconType iconType;
private static Image iconImage;
/** /**
* 生成取色按钮 * 生成取色按钮
@ -33,17 +32,16 @@ class PickColorButtonFactory {
*/ */
static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) { static JButton getPickColorButton(final ColorSelectable colorSelectable, IconType iconType, final boolean setColorRealTime) {
final SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI()); final SpecialUIButton pickColorButton = new SpecialUIButton(new WhiteButtonUI());
PickColorButtonFactory.iconType = iconType; pickColorButton.setIcon(new LazyIcon("color_picker"));
pickColorButton.setOpaque(false);
if (iconType == IconType.ICON16) { if (iconType == IconType.ICON16) {
iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker16.png");
iconSize = SIZE_16; iconSize = SIZE_16;
} else { } else {
iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker18.png"); iconSize = SIZE_24;
iconSize = SIZE_18;
pickColorButton.setBorderPainted(false); pickColorButton.setBorderPainted(false);
} }
pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize)); pickColorButton.setPreferredSize(FineUIScale.scale(new Dimension(iconSize, iconSize)));
pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR)); pickColorButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
// 不能使用 ActionListener,否则设计器工具栏中的取色按钮会有问题(REPORT-13654) // 不能使用 ActionListener,否则设计器工具栏中的取色按钮会有问题(REPORT-13654)
@ -64,30 +62,13 @@ class PickColorButtonFactory {
* 取色按钮可使用的图标尺寸 * 取色按钮可使用的图标尺寸
*/ */
public enum IconType { public enum IconType {
ICON16, ICON18 ICON16, ICON24
} }
private static class WhiteButtonUI extends UIBasicButtonUI { private static class WhiteButtonUI extends UIBasicButtonUI {
@Override @Override
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
super.paint(g, c); super.paint(g, c);
Dimension size = c.getSize();
g.setColor(Color.WHITE);
g.fillRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1);
g.setColor(new Color(153, 153, 153)); // #999999
g.drawRoundRect(0, 0, size.width - 1, size.height - 1, 1, 1);
if (iconType == IconType.ICON16) {
g.drawImage(
iconImage,
(size.width - iconImage.getWidth(null)) / 2,
(size.height - iconImage.getHeight(null)) / 2,
iconImage.getWidth(null),
iconImage.getHeight(null),
null
);
} else {
g.drawImage(iconImage, 0, 0, iconSize, iconSize, null);
}
} }
} }
} }

129
designer-base/src/main/java/com/fr/env/RemoteEnvPane.java vendored

@ -1,5 +1,8 @@
package com.fr.env; package com.fr.env;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -76,6 +79,9 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); private UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel")); private UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
private UILabel uiLabel = new UILabel(); private UILabel uiLabel = new UILabel();
private final int FIRST_COL_WIDTH = 72;
private final int SECOND_COL_WIDTH = 68;
/** /**
* 是否启用 https 勾选框 * 是否启用 https 勾选框
@ -251,50 +257,22 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
public RemoteEnvPane() { public RemoteEnvPane() {
// 配置内容面板 // 配置内容面板
JPanel contentPanel = new JPanel(new BorderLayout()); JPanel contentPanel = new JPanel(new BorderLayout());
contentPanel.setBorder(
BorderFactory.createCompoundBorder(
new EmptyBorder(6, 0, 0, 0),
UITitledBorder.createBorderWithTitle(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Config")))
);
// 服务器地址地址 // 服务器地址地址
final JPanel configPanel = new JPanel(new BorderLayout()); final JPanel configPanel = new JPanel(new BorderLayout());
configPanel.setBorder( certPathLabel.setHorizontalAlignment(SwingConstants.LEFT);
BorderFactory.createCompoundBorder( certSecretKeyLabel.setHorizontalAlignment(SwingConstants.LEFT);
new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server")
)
)
);
certPathLabel.setHorizontalAlignment(SwingConstants.RIGHT);
certSecretKeyLabel.setHorizontalAlignment(SwingConstants.RIGHT);
packConfigPanel(configPanel); packConfigPanel(configPanel);
// 服务器账号配置 // 服务器账号配置
JPanel accountPanel = new JPanel(new BorderLayout()); JPanel accountPanel = new JPanel(new BorderLayout());
accountPanel.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
accountPanel.setBorder(BorderFactory.createCompoundBorder(
new EmptyBorder(15, 0, 0, 0),
BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Platform_Account")
)
));
packAccountPanel(accountPanel); packAccountPanel(accountPanel);
// 测试链接按钮 // 测试链接按钮
JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); JPanel testPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
testPanel.setBorder(BorderFactory.createEmptyBorder()); testPanel.setBorder(BorderFactory.createEmptyBorder());
testPanel.setPreferredSize(new Dimension(437, 20));
UIButton testConnectionButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Test_Connection")); UIButton testConnectionButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Test_Connection"));
testConnectionButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection")); testConnectionButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
@ -306,14 +284,15 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}); });
testPanel.add(testConnectionButton); testPanel.add(testConnectionButton);
contentPanel.add(configPanel, BorderLayout.NORTH); contentPanel.add(configPanel, BorderLayout.NORTH);
contentPanel.add(accountPanel, BorderLayout.CENTER); contentPanel.add(accountPanel, BorderLayout.CENTER);
contentPanel.add(packRememberPwdConfigPanel(), BorderLayout.SOUTH); UILabel label = new UILabel();
FineUIUtils.wrapBoldLabelWithUnderline(label);
contentPanel.add(label, BorderLayout.SOUTH);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(contentPanel, BorderLayout.NORTH); panel.add(FineUIUtils.wrapComponentWithTitle(contentPanel, Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Config")), BorderLayout.NORTH);
panel.add(testPanel, BorderLayout.CENTER); panel.add(testPanel, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(440, 600)); panel.setPreferredSize(new Dimension(FineUIScale.scale(440), (int) panel.getPreferredSize().getHeight()));
UIScrollPane scrollPane = new UIScrollPane(panel); UIScrollPane scrollPane = new UIScrollPane(panel);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(scrollPane); this.add(scrollPane);
@ -395,43 +374,42 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private void packConfigPanel(JPanel configPanel) { private void packConfigPanel(JPanel configPanel) {
// 主机名 // 主机名
UILabel hostNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Host_IP")); UILabel hostNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Host_IP"));
hostNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); hostNameLabel.setHorizontalAlignment(SwingConstants.LEFT);
// 端口 // 端口
UILabel portLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Port")); UILabel portLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Port"));
portLabel.setHorizontalAlignment(SwingConstants.RIGHT); portLabel.setHorizontalAlignment(SwingConstants.LEFT);
// web应用 // web应用
UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Web_Name")); UILabel webAppNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Web_Name"));
webAppNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); webAppNameLabel.setHorizontalAlignment(SwingConstants.LEFT);
// servlet // servlet
UILabel servletNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Servlet_Name")); UILabel servletNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Servlet_Name"));
servletNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); servletNameLabel.setHorizontalAlignment(SwingConstants.LEFT);
// 主机位置 // 主机位置
UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_URL")); UILabel remoteEnvURLLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_URL"));
remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.RIGHT); remoteEnvURLLabel.setHorizontalAlignment(SwingConstants.LEFT);
//远程服务器
UILabel remoteServerLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server"));
remoteServerLabel.setHorizontalAlignment(SwingConstants.LEFT);
enableSubDocListener(); enableSubDocListener();
JPanel urlPanel = TableLayoutHelper.createGapTableLayoutPane( JPanel urlPanel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{hostNameLabel, hostNameInput}, new Component[]{remoteServerLabel, hostNameLabel, hostNameInput},
new Component[]{portLabel, portInput}, new Component[]{new UILabel(), portLabel, portInput},
new Component[]{webAppNameLabel, webAppNameInput}, new Component[]{new UILabel(), webAppNameLabel, webAppNameInput},
new Component[]{servletNameLabel, servletNameInput}, new Component[]{new UILabel(), servletNameLabel, servletNameInput},
new Component[]{remoteEnvURLLabel, remoteEnvURLInput} new Component[]{new UILabel(), remoteEnvURLLabel, remoteEnvURLInput}
}, },
new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED}, new double[]{PREFERRED, PREFERRED, PREFERRED, PREFERRED, PREFERRED},
new double[]{PREFERRED, FILL}, new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL},
5, 14,
10 10
); );
TableLayoutHelper.modifyTableLayoutIndexVGap(urlPanel, 0, 10);
JTextPane urlTipsPane = new JTextPane(); JTextPane urlTipsPane = new JTextPane();
urlTipsPane.setEditable(false); urlTipsPane.setEditable(false);
urlTipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server_Config_Tips")); urlTipsPane.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Server_Config_Tips"));
@ -482,7 +460,6 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
private void packHttpsConfigPanel() { private void packHttpsConfigPanel() {
double[] rows = new double[]{PREFERRED}; double[] rows = new double[]{PREFERRED};
boolean httpsEnabled = httpsCheckbox.isSelected(); boolean httpsEnabled = httpsCheckbox.isSelected();
@ -491,13 +468,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
} }
JPanel content = TableLayoutHelper.createGapTableLayoutPane( JPanel content = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{ new Component[][]{
new Component[]{httpsCheckbox, new JPanel()}, new Component[]{httpsCheckbox, new JPanel(), new UILabel()},
new Component[]{certPathLabel, httpsCertFileInputPanel}, new Component[]{new UILabel(), certPathLabel, httpsCertFileInputPanel},
new Component[]{certSecretKeyLabel, certSecretKeyInput} new Component[]{new UILabel(), certSecretKeyLabel, certSecretKeyInput}
}, },
rows, rows,
new double[]{PREFERRED, FILL}, new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL},
5, 14,
10 10
); );
httpsConfigPanel.add(content, BorderLayout.CENTER); httpsConfigPanel.add(content, BorderLayout.CENTER);
@ -508,10 +485,13 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
// 用户名 // 用户名
UILabel userNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Username")); UILabel userNameLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Username"));
userNameLabel.setHorizontalAlignment(SwingConstants.RIGHT); userNameLabel.setHorizontalAlignment(SwingConstants.LEFT);
// 密码 // 密码
UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password")); UILabel passwordLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remote_Env_Account_Password"));
passwordLabel.setHorizontalAlignment(SwingConstants.RIGHT); passwordLabel.setHorizontalAlignment(SwingConstants.LEFT);
UILabel accountLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Remotex_Env_Platform_Account"));
accountLabel.setHorizontalAlignment(SwingConstants.LEFT);
//输入密码的时候检测下大写锁定 //输入密码的时候检测下大写锁定
passwordInput.addMouseListener(new MouseAdapter() { passwordInput.addMouseListener(new MouseAdapter() {
@ -527,42 +507,25 @@ public class RemoteEnvPane extends BasicBeanPane<RemoteDesignerWorkspaceInfo> {
}); });
Component[][] accountComponents = new Component[][]{ Component[][] accountComponents = new Component[][]{
new Component[]{userNameLabel, usernameInput}, new Component[]{accountLabel, userNameLabel, usernameInput},
new Component[]{passwordLabel, passwordInput} new Component[]{new UILabel(), passwordLabel, passwordInput},
new Component[]{new UILabel(), new UILabel(), rememberPwdCheckbox}
}; };
JPanel content = TableLayoutHelper.createGapTableLayoutPane(accountComponents, JPanel content = TableLayoutHelper.createGapTableLayoutPane(accountComponents,
new double[]{PREFERRED, PREFERRED}, new double[]{PREFERRED, PREFERRED, PREFERRED},
new double[]{PREFERRED, FILL}, new double[]{FIRST_COL_WIDTH, SECOND_COL_WIDTH, FILL},
5, 14,
10 10
); );
TableLayoutHelper.modifyTableLayoutIndexVGap(content, 0, 10);
accountPanel.add(content, BorderLayout.CENTER); accountPanel.add(content, BorderLayout.CENTER);
} }
private JPanel packRememberPwdConfigPanel() {
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{rememberPwdCheckbox}
},
new double[]{PREFERRED},
new double[]{PREFERRED},
5,
10
);
TableLayoutHelper.modifyTableLayoutIndexHGap(panel, 0, 50);
return panel;
}
private JPanel createHttpsCertFileInputPanel() { private JPanel createHttpsCertFileInputPanel() {
JPanel inputPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); JPanel inputPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
inputPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); inputPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
inputPanel.add(certPathInput, BorderLayout.CENTER); inputPanel.add(certPathInput, BorderLayout.CENTER);
inputPanel.add(fileChooserButton, BorderLayout.EAST); inputPanel.add(fileChooserButton, BorderLayout.EAST);
fileChooserButton.setPreferredSize(new Dimension(20, 20));
fileChooserButton.addActionListener(new ActionListener() { fileChooserButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {

3
designer-base/src/main/resources/com/fine/theme/icon/colorPicker.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M25.0077 2.87868C26.1792 1.70711 28.0787 1.70711 29.2503 2.87868C30.4219 4.05025 30.4219 5.94975 29.2503 7.12132L24.6186 11.753L26.7652 13.8995C27.5462 14.6805 27.5462 15.9469 26.7652 16.7279C25.9841 17.509 24.7178 17.509 23.9367 16.7279L22.4974 15.2886L9.82843 27.9575C8.26633 29.5196 5.73367 29.5196 4.17157 27.9575C2.60948 26.3954 2.60948 23.8627 4.17157 22.3006L16.8405 9.6317L15.4515 8.24264C14.6704 7.4616 14.6704 6.19527 15.4515 5.41422C16.2325 4.63317 17.4988 4.63317 18.2799 5.41422L20.376 7.51033L25.0077 2.87868ZM18.2547 11.0459L5.58579 23.7149C4.80474 24.4959 4.80474 25.7622 5.58579 26.5433C6.36683 27.3243 7.63316 27.3243 8.41421 26.5433L21.0832 13.8743L18.2547 11.0459Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 874 B

7
designer-base/src/main/resources/com/fine/theme/icon/pageQuery.svg

@ -0,0 +1,7 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M3 6V3C3 2.44772 3.44772 2 4 2C4.55228 2 5 2.44772 5 3L5 6H26V3C26 2.44772 26.4477 2 27 2C27.5523 2 28 2.44772 28 3V6C28 7.10457 27.1046 8 26 8H5C3.89543 8 3 7.10457 3 6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M7 16C7 15.4477 7.44772 15 8 15H17.8728C16.894 15.506 16.0199 16.1864 15.2917 17H8C7.44772 17 7 16.5523 7 16Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M26 12V14.9355C26.7281 15.2974 27.4003 15.7549 28 16.2917V12C28 10.8954 27.1046 10 26 10H5C3.89543 10 3 10.8954 3 12V29C3 29.5523 3.44772 30 4 30C4.55228 30 5 29.5523 5 29V12H26Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M13.0549 22C13.1316 21.3065 13.287 20.6368 13.5121 20H8C7.44772 20 7 20.4477 7 21C7 21.5523 7.44772 22 8 22H13.0549Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M27.1584 18.0944C29.6895 20.6255 29.9662 24.5487 27.973 27.3342L29.6637 29.0249C30.0943 29.4555 30.0943 30.1536 29.6637 30.5842C29.2331 31.0147 28.535 31.0147 28.1045 30.5842L26.4263 28.906C23.6357 30.9721 19.6535 30.7175 17.0944 28.1584C14.2808 25.3448 14.2529 20.8111 17.032 18.032C19.8111 15.2529 24.3448 15.2808 27.1584 18.0944ZM25.8066 26.8066C27.7882 24.8249 27.7932 21.5576 25.7442 19.5086C23.6952 17.4596 20.4278 17.4645 18.4462 19.4462C16.4645 21.4278 16.4596 24.6952 18.5086 26.7442C20.5576 28.7932 23.8249 28.7882 25.8066 26.8066Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/pages.svg

@ -1,3 +0,0 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM15.1257 23.4731H17.9056C18.0038 23.4731 18.0834 23.5635 18.0834 23.6751L18.0834 25.096C18.0834 25.2075 18.0038 25.298 17.9056 25.298H12.8535C12.7553 25.298 12.6756 25.2075 12.6756 25.096V24.0115L15.0422 20.8298C15.4491 20.2669 15.7311 19.8272 15.8882 19.5106C16.0524 19.1851 16.1345 18.8509 16.1345 18.5079C16.1345 18.1297 16.0488 17.8263 15.8775 17.5976C15.7061 17.369 15.4741 17.2546 15.1814 17.2546C14.8816 17.2546 14.6174 17.3909 14.389 17.6636C14.2022 17.8793 14.0512 18.1716 13.936 18.5402C13.8962 18.6675 13.7633 18.7261 13.6626 18.6543L12.7548 18.0069C12.6887 17.9597 12.657 17.8688 12.6798 17.7839C12.8713 17.0712 13.1948 16.521 13.6501 16.1332C14.1356 15.7111 14.696 15.5 15.3313 15.5C15.8311 15.5 16.263 15.6275 16.6271 15.8826C16.9983 16.1288 17.2803 16.4719 17.473 16.9116C17.6729 17.3514 17.7729 17.8527 17.7729 18.4156C17.7729 18.9697 17.6622 19.4886 17.4409 19.9723C17.2267 20.4472 16.8412 21.0673 16.2844 21.8325L15.1257 23.4731ZM7.26472 18.9072C7.14616 18.9826 7 18.8852 7 18.7309V17.3546C7 17.2845 7.03206 17.2193 7.08469 17.1825L9.35585 15.5962C9.38387 15.5766 9.41613 15.5662 9.44903 15.5662H10.6107C10.709 15.5662 10.7886 15.6567 10.7886 15.7683L10.7886 25.096C10.7886 25.2075 10.709 25.298 10.6107 25.298H9.21249C9.11425 25.298 9.03462 25.2075 9.03462 25.096V17.7823L7.26472 18.9072ZM24.6573 21.1992C24.4289 20.8034 24.0969 20.5044 23.6614 20.3021C24.0184 20.0998 24.2861 19.8184 24.4646 19.4578C24.6502 19.0972 24.743 18.6706 24.743 18.1781C24.743 17.6504 24.6395 17.1843 24.4324 16.7797C24.2254 16.3751 23.9327 16.0629 23.5543 15.843C23.1831 15.6143 22.7512 15.5 22.2586 15.5C21.6232 15.5 21.0735 15.6979 20.6095 16.0937C20.1765 16.4548 19.8647 16.969 19.6741 17.6365C19.6496 17.7223 19.6816 17.8152 19.749 17.8628L20.6169 18.4751C20.716 18.545 20.8462 18.4892 20.8887 18.3658C21.0022 18.0366 21.1483 17.7761 21.327 17.5844C21.5554 17.3382 21.8231 17.215 22.1301 17.215C22.4157 17.215 22.6477 17.3162 22.8262 17.5185C23.0046 17.7208 23.0939 17.989 23.0939 18.3232C23.0939 18.6838 22.9832 18.9872 22.7619 19.2335C22.5477 19.471 22.2372 19.5897 21.8303 19.5897H21.5905C21.4923 19.5897 21.4126 19.6802 21.4126 19.7917V20.9708C21.4126 21.0824 21.4923 21.1728 21.5905 21.1728H21.7018C22.8012 21.1728 23.3509 21.617 23.3509 22.5053C23.3509 22.9099 23.2402 23.2265 23.0189 23.4551C22.8047 23.6838 22.537 23.7982 22.2158 23.7982C21.8874 23.7982 21.5911 23.6838 21.327 23.4551C21.1142 23.2639 20.9501 23.0013 20.8346 22.6673C20.7913 22.5422 20.6593 22.4838 20.5588 22.5548L19.645 23.2009C19.5761 23.2496 19.5445 23.3454 19.5718 23.4322C19.7759 24.0807 20.1003 24.5809 20.5453 24.9327C21.0307 25.3109 21.5983 25.5 22.2479 25.5C22.7548 25.5 23.2152 25.3901 23.6293 25.1702C24.0505 24.9415 24.3825 24.6161 24.6252 24.1939C24.8751 23.763 25 23.2485 25 22.6504C25 22.0699 24.8858 21.5862 24.6573 21.1992Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.2 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/newLine.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 6C4 5.44772 4.44772 5 5 5H27C27.5523 5 28 5.44772 28 6C28 6.55228 27.5523 7 27 7H5C4.44772 7 4 6.55228 4 6ZM28 12C28 11.4477 27.5523 11 27 11C26.4477 11 26 11.4477 26 12V23H20V19.6603C20 19.0732 19.3727 18.7792 19.0059 19.1943L15.1706 23.534C14.9431 23.7914 14.9431 24.2086 15.1706 24.466L19.0059 28.8057C19.3727 29.2208 20 28.9268 20 28.3397V25H27C27.5523 25 28 24.5523 28 24V12ZM5 14C4.44772 14 4 14.4477 4 15C4 15.5523 4.44771 16 5 16H22C22.5523 16 23 15.5523 23 15C23 14.4477 22.5523 14 22 14H5ZM4 24C4 23.4477 4.44772 23 5 23H11C11.5523 23 12 23.4477 12 24C12 24.5523 11.5523 25 11 25H5C4.44772 25 4 24.5523 4 24Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 811 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM14.4472 25.9454C14.9806 26.0884 15.529 25.7718 15.6719 25.2383L16.0975 23.6499H18C18.5523 23.6499 19 23.2022 19 22.6499C19 22.0976 18.5523 21.6499 18 21.6499H16.6334L17.4373 18.6499H19C19.5523 18.6499 20 18.2022 20 17.6499C20 17.0976 19.5523 16.6499 19 16.6499H17.9732L18.2601 15.5791C18.403 15.0456 18.0865 14.4973 17.553 14.3543C17.0195 14.2114 16.4712 14.528 16.3282 15.0614L15.9026 16.6499H12.9732L13.2601 15.5791C13.403 15.0456 13.0865 14.4973 12.553 14.3543C12.0195 14.2114 11.4712 14.528 11.3282 15.0614L10.9026 16.6499H9C8.44771 16.6499 8 17.0976 8 17.6499C8 18.2022 8.44772 18.6499 9 18.6499H10.3667L9.56286 21.6499H8C7.44771 21.6499 7 22.0976 7 22.6499C7 23.2022 7.44772 23.6499 8 23.6499H9.02696L8.74005 24.7207C8.59711 25.2542 8.91369 25.8025 9.44716 25.9454C9.98063 26.0884 10.529 25.7718 10.6719 25.2383L11.0975 23.6499H14.027L13.7401 24.7207C13.5971 25.2542 13.9137 25.8025 14.4472 25.9454ZM15.3667 18.6499H12.4373L11.6334 21.6499H14.5629L15.3667 18.6499Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/pages.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M27 28V13H20C18.8954 13 18 12.1045 18 11V4H5L5 28H27ZM20 4.82843L26.1716 11H20V4.82843ZM5 2C3.89543 2 3 2.89543 3 4V28C3 29.1046 3.89543 30 5 30H27C28.1046 30 29 29.1046 29 28V11.8284C29 11.298 28.7893 10.7893 28.4142 10.4142L20.5858 2.58579C20.2107 2.21071 19.702 2 19.1716 2H5ZM13 18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V15H8C7.44772 15 7 14.5523 7 14C7 13.4477 7.44772 13 8 13H11V10C11 9.44772 11.4477 9 12 9C12.5523 9 13 9.44772 13 10V13H16C16.5523 13 17 13.4477 17 14C17 14.5523 16.5523 15 16 15H13V18ZM25 21C25 20.4477 24.5523 20 24 20H21V17C21 16.4477 20.5523 16 20 16C19.4477 16 19 16.4477 19 17V20H16C15.4477 20 15 20.4477 15 21C15 21.5523 15.4477 22 16 22H19V25C19 25.5523 19.4477 26 20 26C20.5523 26 21 25.5523 21 25V22H24C24.5523 22 25 21.5523 25 21Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 971 B

8
designer-base/src/main/resources/com/fine/theme/icon/toolbar/selectedAll.svg

@ -0,0 +1,8 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 6C14 5.44772 14.4477 5 15 5H29C29.5523 5 30 5.44772 30 6C30 6.55228 29.5523 7 29 7H15C14.4477 7 14 6.55228 14 6Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M14 16C14 15.4477 14.4477 15 15 15H29C29.5523 15 30 15.4477 30 16C30 16.5523 29.5523 17 29 17H15C14.4477 17 14 16.5523 14 16Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M14 26C14 25.4477 14.4477 25 15 25H29C29.5523 25 30 25.4477 30 26C30 26.5523 29.5523 27 29 27H15C14.4477 27 14 26.5523 14 26Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M5.38797 10.2728C5.20108 10.2315 5.02338 10.1382 4.87802 9.99281L2.30456 7.41935C1.89848 7.01327 1.89848 6.35488 2.30456 5.9488C2.71064 5.54272 3.36903 5.54272 3.77511 5.9488L5.6207 7.79439L10.1105 3.30456C10.5166 2.89848 11.175 2.89848 11.5811 3.30456C11.9872 3.71064 11.9872 4.36903 11.5811 4.77511L6.36063 9.99555C6.09679 10.2594 5.72643 10.3518 5.38797 10.2728Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M5.38796 19.5729C5.20108 19.5316 5.02338 19.4383 4.87802 19.2929L2.30456 16.7195C1.89848 16.3134 1.89848 15.655 2.30456 15.2489C2.71064 14.8428 3.36903 14.8428 3.77511 15.2489L5.6207 17.0945L10.1105 12.6047C10.5166 12.1986 11.175 12.1986 11.5811 12.6047C11.9872 13.0108 11.9872 13.6691 11.5811 14.0752L6.36063 19.2957C6.09678 19.5595 5.72642 19.6519 5.38796 19.5729Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M5.38796 28.873C5.20108 28.8317 5.02338 28.7384 4.87802 28.593L2.30456 26.0196C1.89848 25.6135 1.89848 24.9551 2.30456 24.549C2.71064 24.1429 3.36903 24.1429 3.77511 24.549L5.6207 26.3946L10.1105 21.9048C10.5166 21.4987 11.175 21.4987 11.5811 21.9048C11.9872 22.3109 11.9872 22.9692 11.5811 23.3753L6.36063 28.5958C6.09678 28.8596 5.72642 28.952 5.38796 28.873Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

7
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -29,7 +29,8 @@
"recycle": "recycle.svg", "recycle": "recycle.svg",
"time": "time.svg", "time": "time.svg",
"logo": "logo.svg", "logo": "logo.svg",
"pages": "pages.svg", "page_query": "pageQuery.svg",
"color_picker": "colorPicker.svg",
"digitalPlatform": "digitalPlatform.svg", "digitalPlatform": "digitalPlatform.svg",
"tables": "tables.svg", "tables": "tables.svg",
"views": "views.svg", "views": "views.svg",
@ -249,6 +250,10 @@
"scale": "toolbar/scale.svg", "scale": "toolbar/scale.svg",
"printerOffset": "toolbar/printerOffset.svg", "printerOffset": "toolbar/printerOffset.svg",
"customButton": "toolbar/customButton.svg", "customButton": "toolbar/customButton.svg",
"page": "toolbar/page.svg",
"pages": "toolbar/pages.svg",
"new_line": "toolbar/newLine.svg",
"selected_all": "toolbar/selectedAll.svg",
"cellelement_small": "cellelement.svg", "cellelement_small": "cellelement.svg",
"forbid": "expand/forbid.svg", "forbid": "expand/forbid.svg",
"horizontal_expand": "expand/horizontal.svg", "horizontal_expand": "expand/horizontal.svg",

1
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -128,6 +128,7 @@ defaultBorderFocusShadow = #2576ef19
defaultBorderFocusWidth = 0 defaultBorderFocusWidth = 0
brand.normal=#2576EF brand.normal=#2576EF
color.brand4=#84B1F6 color.brand4=#84B1F6
default.background = @background
background.normal=#FFFFFF background.normal=#FFFFFF
text.white=#ffffff text.white=#ffffff
text.placeholder=fade(@foreground, 40%) text.placeholder=fade(@foreground, 40%)

5
designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java

@ -5,6 +5,7 @@ package com.fr.design.mainframe;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -43,9 +44,9 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected void initComponent() { protected void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
// 外部轮廓大小固定,适配滚动面板 // 外部轮廓大小固定,适配滚动面板
this.setPreferredSize(FineUIScale.scale(new Dimension(getWidth(), 900))); this.setPreferredSize(new Dimension(getWidth(), FineUIScale.scale(900)));
} }
@Override @Override

22
designer-chart/src/main/java/com/fr/design/module/ChartEmptyDataStylePane.java

@ -1,6 +1,9 @@
package com.fr.design.module; package com.fr.design.module;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.ChartEmptyDataStyleConf; import com.fr.base.ChartEmptyDataStyleConf;
import com.fr.base.Style; import com.fr.base.Style;
@ -27,6 +30,7 @@ import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout; import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
@ -42,7 +46,7 @@ import static com.fine.swing.ui.layout.Layouts.row;
* Created by mengao on 2017/11/23. * Created by mengao on 2017/11/23.
*/ */
public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane { public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private static final int WIDTH = 150; private static final int WIDTH = 100;
private static final int HEIGHT = 26; private static final int HEIGHT = 26;
private static final int FIVE = 5; private static final int FIVE = 5;
private static final int TEN = 10; private static final int TEN = 10;
@ -91,7 +95,7 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private void initEmptyData() { private void initEmptyData() {
emptyData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}); emptyData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")});
emptyData.setSelectedIndex(0); emptyData.setSelectedIndex(0);
emptyData.setPreferredSize(new Dimension(WIDTH, HEIGHT)); emptyData.setPreferredSize(FineUIScale.scale(new Dimension(WIDTH, HEIGHT)));
emptyData.addActionListener(new ActionListener() { emptyData.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -104,7 +108,7 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
private void initImageData() { private void initImageData() {
imageData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")}); imageData = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Mode_Auto"), Toolkit.i18nText("Fine-Design_Chart_Mode_Custom")});
imageData.setSelectedIndex(0); imageData.setSelectedIndex(0);
imageData.setPreferredSize(new Dimension(WIDTH, HEIGHT)); imageData.setPreferredSize(FineUIScale.scale(new Dimension(WIDTH, HEIGHT)));
imageData.addActionListener(new ActionListener() { imageData.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -121,15 +125,19 @@ public class ChartEmptyDataStylePane extends AbstractAttrNoScrollPane {
// preview pane // preview pane
JPanel previewContainerPane = new JPanel(new BorderLayout()); JPanel previewContainerPane = new JPanel(new BorderLayout());
centerPane.add(previewContainerPane, BorderLayout.CENTER); centerPane.add(previewContainerPane, BorderLayout.CENTER);
centerPane.add(new UILabel((Toolkit.i18nText("Fine-Design_Basic_Preview"))), BorderLayout.NORTH);
JPanel previewOwnerPane = new JPanel(new BorderLayout()); UILabel label = new UILabel((Toolkit.i18nText("Fine-Design_Basic_Preview")));
label.setBorder(new ScaledEmptyBorder(10, 0, 10, 0));
centerPane.add(label, BorderLayout.NORTH);
previewPane = new ImagePreviewPane();
JScrollPane previewOwnerPane = new JScrollPane(previewPane);
previewOwnerPane.setBorder(new FineRoundBorder()); previewOwnerPane.setBorder(new FineRoundBorder());
previewOwnerPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
previewOwnerPane.getViewport().setOpaque(false);
previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER); previewContainerPane.add(previewOwnerPane, BorderLayout.CENTER);
previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST); previewContainerPane.add(initSelectFilePane(), BorderLayout.EAST);
previewPane = new ImagePreviewPane();
previewOwnerPane.add(new JScrollPane(previewPane));
// init image file chooser. // init image file chooser.

9
designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.module; package com.fr.design.module;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.ChartColorMatching; import com.fr.base.ChartColorMatching;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
@ -47,6 +48,8 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
private ColorAdjustPane colorAdjustPane; private ColorAdjustPane colorAdjustPane;
private FixedGradientBar colorGradient; private FixedGradientBar colorGradient;
private final Integer COLOR_ADJUST_PANE_WIDTH = 240;
private final Integer COLOR_ADJUST_PANE_HEIGHT = 88;
public ChartPreFillStylePane() { public ChartPreFillStylePane() {
initComponents(); initComponents();
@ -58,7 +61,6 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")});
groupButton.setSelectedIndex(0); groupButton.setSelectedIndex(0);
changeColorSetPane = new JPanel(cardLayout = new CardLayout()); changeColorSetPane = new JPanel(cardLayout = new CardLayout());
changeColorSetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient"); changeColorSetPane.add(colorGradient = new FixedGradientBarNoTheme(4, 150), "gradient");
changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc"); changeColorSetPane.add(colorAdjustPane = new ColorAdjustPane(), "acc");
cardLayout.show(changeColorSetPane, "acc"); cardLayout.show(changeColorSetPane, "acc");
@ -76,7 +78,10 @@ public class ChartPreFillStylePane extends BasicBeanPane<ChartColorMatching> {
cell(groupButton).weight(0.1), cell(groupButton).weight(0.1),
flex(0.2) flex(0.2)
), ),
cell(changeColorSetPane) row(
cell(changeColorSetPane).with(it -> it.setPreferredSize(FineUIScale.scale(new Dimension(COLOR_ADJUST_PANE_WIDTH, COLOR_ADJUST_PANE_HEIGHT)))),
flex()
)
).getComponent()); ).getComponent());
} }

8
designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java

@ -1,5 +1,6 @@
package com.fr.design.module; package com.fr.design.module;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fr.base.ChartColorMatching; import com.fr.base.ChartColorMatching;
import com.fr.chart.base.ChartUtils; import com.fr.chart.base.ChartUtils;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
@ -55,17 +56,16 @@ public class ChartPreStylePane extends BasicBeanPane<ChartColorMatching> {
chartComponent = new ChartComponent(); chartComponent = new ChartComponent();
chartComponent.populate(cc); chartComponent.populate(cc);
chartComponent.setPreferredSize(new Dimension(441, 356));
chartComponent.setSupportEdit(false); chartComponent.setSupportEdit(false);
this.add(column( this.add(column(
20, 10,
cell(fillStylePane), cell(fillStylePane),
column( column(
10, 10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
cell(chartComponent) cell(chartComponent).weight(1).with(it -> it.setBorder(new FineRoundBorder()))
) ).weight(1)
).getComponent()); ).getComponent());
initListener(ChartPreStylePane.this); initListener(ChartPreStylePane.this);

BIN
designer-chart/src/main/resources/com/fr/design/images/background/null_background.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

4
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceMainDialog.java

@ -1,6 +1,7 @@
package com.fr.design.actions.replace.ui; package com.fr.design.actions.replace.ui;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.actions.replace.action.ITChecker; import com.fr.design.actions.replace.action.ITChecker;
import com.fr.design.actions.replace.action.ShowSearchResultAction; import com.fr.design.actions.replace.action.ShowSearchResultAction;
@ -38,7 +39,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.fr.design.actions.replace.ui.ITTableEditorPane.editTable;
import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable; import static com.fr.design.actions.replace.ui.ITTableEditorPane.getEditTable;
/** /**
@ -148,7 +148,7 @@ public class ITReplaceMainDialog extends UIDialog {
replaceComboBox.setEnabled(false); replaceComboBox.setEnabled(false);
replaceComboBox.setEditable(true); replaceComboBox.setEditable(true);
northPane.getReplaceButton().setEnabled(false); northPane.getReplaceButton().setEnabled(false);
westPanel.getLeftPanel().setPreferredSize(new Dimension(ITReplaceWestPanel.LEFT_WIDTH, this.getHeight())); westPanel.getLeftPanel().setPreferredSize(new Dimension(FineUIScale.scale(ITReplaceWestPanel.LEFT_WIDTH), this.getHeight()));
((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input")); ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Search_Input"));
((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input")); ((UITextField) (northPane.getReplaceInputCombobox().getEditor().getEditorComponent())).setPlaceholder(Toolkit.i18nText("Fine-Design_Replace_Input"));
((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() { ((UITextField) (northPane.getFindInputCombobox().getEditor().getEditorComponent())).addActionListener(new ActionListener() {

28
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditor.java

@ -1,13 +1,13 @@
package com.fr.design.actions.replace.ui; package com.fr.design.actions.replace.ui;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -17,12 +17,10 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.DefaultCellEditor; import javax.swing.DefaultCellEditor;
import javax.swing.JComponent;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JTable; import javax.swing.JTable;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.plaf.UIResource; import javax.swing.plaf.UIResource;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
@ -62,26 +60,14 @@ public class ITTableEditor extends UITableModelAdapter {
}); });
DefaultTableCellRenderer cellRenderer = new DefaultTableCellRenderer() { this.setDefaultRenderer(UILabel.class, new UITableEditorPane.TableRenderer());
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
((JComponent) c).setBorder(BorderFactory.createCompoundBorder(
BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")),
new ScaledEmptyBorder(0,4,0,0)));
c.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
return c;
}
};
this.setDefaultRenderer(UILabel.class, cellRenderer);
this.setDefaultEditor(ITTableButton.class, new ITTableButton()); this.setDefaultEditor(ITTableButton.class, new ITTableButton());
this.setDefaultRenderer(ITTableButton.class, new ITTableButton()); this.setDefaultRenderer(ITTableButton.class, new ITTableButton());
this.setDefaultEditor(Boolean.class, new ITBooleanEditor()); this.setDefaultEditor(Boolean.class, new ITBooleanEditor());
this.setDefaultRenderer(Boolean.class, new ITBooleanRenderer()); this.setDefaultRenderer(Boolean.class, new ITBooleanRenderer());
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(50); this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CONTENT_INDEX).setMaxWidth(FineUIScale.scale(50));
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(28); this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setMaxWidth(FineUIScale.scale(28));
this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setCellRenderer(new ITBooleanRenderer()); this.createTable().getColumnModel().getColumn(ITReplaceSouthPanel.CHECKBOX_INDEX).setCellRenderer(new ITBooleanRenderer());
} }
@ -283,7 +269,11 @@ public class ITTableEditor extends UITableModelAdapter {
setEnabled(!content.isReplaced()); setEnabled(!content.isReplaced());
setSelected((value != null && ((Boolean) value).booleanValue())); setSelected((value != null && ((Boolean) value).booleanValue()));
setUI(getUICheckBoxUI()); setUI(getUICheckBoxUI());
if (column == table.getColumnCount() - 1) {
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
} else {
setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor"))); setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
}
setBackground(Color.WHITE); setBackground(Color.WHITE);
return this; return this;
} }

36
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITTableEditorPane.java

@ -4,15 +4,12 @@ import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.TRL; import com.fr.base.TRL;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
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.itableeditorpane.UITableEditAction; import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itableeditorpane.UITableModelAdapter; import com.fr.design.gui.itableeditorpane.UITableModelAdapter;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -21,6 +18,7 @@ import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -38,23 +36,23 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
/** /**
* 表格面板 * 表格面板
* *
* @author Destiny.Lin * @author Destiny.Lin
* @version 11.0 * @version 11.0
* created by Destiny.Lin on 2022-08-22 * created by Destiny.Lin on 2022-08-22
* @since
* Created On
*/ */
public class ITTableEditorPane<T> extends BasicPane { public class ITTableEditorPane<T> extends UITableEditorPane<T> {
public static JTable editTable;
private UITableModelAdapter<T> tableModel;
private String leftLabelName; private String leftLabelName;
private JPanel buttonPane; private JPanel buttonPane;
public ITTableEditorPane(UITableModelAdapter<T> model) { public ITTableEditorPane(UITableModelAdapter<T> model) {
this.tableModel = model; super(model);
this.initComponent(model.createAction());
} }
@ -64,7 +62,7 @@ public class ITTableEditorPane<T> extends BasicPane {
* *
* @param action * @param action
*/ */
private void initComponent(UITableEditAction[] action) { public void initComponent(UITableEditAction[] action) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
editTable = tableModel.createTable(); editTable = tableModel.createTable();
editTable.addMouseListener(new MouseClickListener() { editTable.addMouseListener(new MouseClickListener() {
@ -91,8 +89,8 @@ public class ITTableEditorPane<T> extends BasicPane {
} }
}); });
UIScrollPane scrollPane = new UIScrollPane(editTable); UIScrollPane scrollPane = new UIScrollPane(editTable);
scrollPane.setBorder(new UIRoundedBorder(UIConstants.TITLED_BORDER_COLOR, 1, UIConstants.ARC));
this.add(scrollPane, BorderLayout.CENTER); add(cell(buildScrollTablePane(scrollPane)).weight(1).getComponent());
} }
/** /**
@ -223,7 +221,11 @@ public class ITTableEditorPane<T> extends BasicPane {
component.setForeground(tableHeader.getForeground()); component.setForeground(tableHeader.getForeground());
component.setBackground(tableHeader.getBackground()); component.setBackground(tableHeader.getBackground());
component.setFont(tableHeader.getFont()); component.setFont(tableHeader.getFont());
component.setBorder(UIManager.getBorder("TableHeader.cellBorder")); if (column == table.getColumnCount() - 1) {
component.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIManager.getColor("defaultBorderColor")));
} else {
component.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 1, UIManager.getColor("defaultBorderColor")));
}
return component; return component;
} }
@ -237,13 +239,7 @@ public class ITTableEditorPane<T> extends BasicPane {
* @param table * @param table
*/ */
public static void makeFace(JTable table) { public static void makeFace(JTable table) {
Dimension size = table.getTableHeader().getPreferredSize();
size.height = 26;//设置新的表头高度
table.getTableHeader().setBackground(FlatUIUtils.getUIColor("TableHeader.background", Color.WHITE)); table.getTableHeader().setBackground(FlatUIUtils.getUIColor("TableHeader.background", Color.WHITE));
table.getTableHeader().setPreferredSize(size);
table.getTableHeader().setDefaultRenderer(new ITHeaderRenderer(table)); table.getTableHeader().setDefaultRenderer(new ITHeaderRenderer(table));
} }

37
designer-realize/src/main/java/com/fr/design/cell/editor/BiasTextPainterCellEditor.java

@ -3,6 +3,9 @@
*/ */
package com.fr.design.cell.editor; package com.fr.design.cell.editor;
import com.fine.swing.ui.layout.Layouts;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ibutton.UIRadioButton;
@ -36,7 +39,6 @@ import java.awt.event.ActionListener;
public class BiasTextPainterCellEditor extends AbstractCellEditor { public class BiasTextPainterCellEditor extends AbstractCellEditor {
private BiasTextPainterPane biasTextPainterPane = null; private BiasTextPainterPane biasTextPainterPane = null;
private static final double MULTIPLE = FineDesignScreen.isHighDPI() ? 2 : 1.5;
/** /**
* Constructor. * Constructor.
@ -87,8 +89,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
Window parentWindow = SwingUtilities.getWindowAncestor(grid); Window parentWindow = SwingUtilities.getWindowAncestor(grid);
this.biasTextPainterPane = new BiasTextPainterPane(); this.biasTextPainterPane = new BiasTextPainterPane();
Dimension dimension = this.biasTextPainterPane.getPreferredSize(); Dimension wrapDimension = FineUIScale.scale(new Dimension(360, 172));
Dimension wrapDimension = new Dimension((int) (dimension.width * MULTIPLE), (int) (dimension.height * Math.pow(MULTIPLE, 2)));
this.biasTextPainterPane.populate(biasTextPainter); this.biasTextPainterPane.populate(biasTextPainter);
return this.biasTextPainterPane.showWindowWithCustomSize(parentWindow, new DialogActionAdapter() { return this.biasTextPainterPane.showWindowWithCustomSize(parentWindow, new DialogActionAdapter() {
@ -111,31 +112,14 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
private UIRadioButton choice2; private UIRadioButton choice2;
public BiasTextPainterPane() { public BiasTextPainterPane() {
JPanel defaultPane = this; this.setLayout(new BorderLayout());
//center UILabel formulaLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Tip", "\" | \"", "Season | Product"));
JPanel centerPane =FRGUIPaneFactory.createBorderLayout_S_Pane();
defaultPane.add(centerPane, BorderLayout.CENTER);
//text
JPanel textPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
centerPane.add(textPane, BorderLayout.CENTER);
UILabel formulaLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Tip", "'|'", "Season|Product"));
textPane.add(formulaLabel, BorderLayout.NORTH);
formulaLabel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 0));
textPane.add(Box.createVerticalStrut(2), BorderLayout.SOUTH);
formulaTextArea = new UITextArea(); formulaTextArea = new UITextArea();
JScrollPane scrollPane = new JScrollPane(formulaTextArea); JScrollPane scrollPane = new JScrollPane(formulaTextArea);
// 去了scollPane的边框,否则会有两层边框,略丑 scrollPane.setBorder(new FineRoundBorder());
scrollPane.setBorder(null); formulaTextArea.setBorder(null);
textPane.add(scrollPane, BorderLayout.CENTER);
JPanel choicePane = FRGUIPaneFactory.createX_AXISBoxInnerContainer_S_Pane();
choice1 = new UIRadioButton((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Upper_Left_To_Lower_Right"))); choice1 = new UIRadioButton((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Upper_Left_To_Lower_Right")));
choice2 = new UIRadioButton((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Lower_Left_To_Upper_Right"))); choice2 = new UIRadioButton((com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Slope_Line_Lower_Left_To_Upper_Right")));
@ -146,10 +130,7 @@ public class BiasTextPainterCellEditor extends AbstractCellEditor {
group.add(choice1); group.add(choice1);
group.add(choice2); group.add(choice2);
choicePane.add(choice1); add(Layouts.column(10, Layouts.cell(formulaLabel).weight(0.1), Layouts.cell(scrollPane).weight(0.12), Layouts.row(5, Layouts.cell(choice1), Layouts.cell(choice2)).weight(0.12)).getComponent());
choicePane.add(choice2);
centerPane.add(choicePane, BorderLayout.SOUTH);
} }
@Override @Override

16
designer-realize/src/main/java/com/fr/design/condition/BackPane.java

@ -1,5 +1,8 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -33,7 +36,7 @@ public class BackPane extends ConditionAttrSingleConditionPane<HighlightAction>
super(conditionAttributesPane); super(conditionAttributesPane);
backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background") + ":"); backgroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Background") + ":");
this.backgroundPreviewPane = new BackgroundPreviewLabel(); this.backgroundPreviewPane = new BackgroundPreviewLabel();
this.backgroundPreviewPane.setPreferredSize(new Dimension(80, 20)); this.backgroundPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 20)));
UIButton editBackgroundButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); UIButton editBackgroundButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
editBackgroundButton.addActionListener(new ActionListener() { editBackgroundButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -48,21 +51,22 @@ public class BackPane extends ConditionAttrSingleConditionPane<HighlightAction>
}).setVisible(true); }).setVisible(true);
} }
}); });
this.backgroundPreviewPane.setBorder(new FineRoundBorder());
this.backScopeComboBox = new UIComboBox(new String[] { this.backScopeComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") }); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.backgroundPreviewPane.setBackgroundObject(ColorBackground.getInstance(Color.WHITE)); this.backgroundPreviewPane.setBackgroundObject(ColorBackground.getInstance(Color.WHITE));
backgroundLabel.setPreferredSize(new Dimension(100, backgroundLabel.getHeight()));
this.add(row(10, cell(backgroundLabel), row( this.setLayout(new BorderLayout());
this.add(row(10, cell(backgroundLabel).weight(0.2), row(
10, 10,
cell(backgroundPreviewPane), cell(backgroundPreviewPane),
cell(editBackgroundButton), cell(editBackgroundButton),
cell(backScopeComboBox), cell(backScopeComboBox)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

42
designer-realize/src/main/java/com/fr/design/condition/BorderHighlightPane.java

@ -1,5 +1,7 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.CellBorderStyle; import com.fr.base.CellBorderStyle;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -29,8 +31,33 @@ public class BorderHighlightPane extends ConditionAttrSingleConditionPane<Highli
private UIButton borderButton; private UIButton borderButton;
public BorderHighlightPane(final ConditionAttributesPane conditionAttributesPane) { public BorderHighlightPane(final ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane); super(conditionAttributesPane);
borderButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); borderButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")) {
borderButton.setPreferredSize(new Dimension(53, 23)); @Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g.create();
if (border == null) {
return;
}
if (border.getTopStyle() == 1) {
g2d.setColor(border.getTopColor());
g2d.drawLine(4, 4, getWidth() - 4, 4);
}
if (border.getLeftStyle() == 1) {
g2d.setColor(border.getLeftColor());
g2d.drawLine(4, 4, 4, getHeight() - 4);
}
if (border.getBottomStyle() == 1) {
g2d.setColor(border.getBottomColor());
g2d.drawLine(4, getHeight() - 4, getWidth() - 4, getHeight() - 4);
}
if (border.getRightStyle() == 1) {
g2d.setColor(border.getRightColor());
g2d.drawLine(getWidth() - 4, getHeight() - 4, getWidth() - 4, 4);
}
}
};
borderButton.setPreferredSize(FineUIScale.scale(new Dimension(53, 23)));
borderButton.addActionListener(new ActionListener() { borderButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
final BorderPane borderPane = new BorderPane(); final BorderPane borderPane = new BorderPane();
@ -52,13 +79,12 @@ public class BorderHighlightPane extends ConditionAttrSingleConditionPane<Highli
UILabel borderLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border")); UILabel borderLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Border"));
borderLabel.setPreferredSize(new Dimension(100, borderLabel.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(borderLabel).weight(0.2), row(
this.add(row(10, cell(borderLabel), row(
10, 10,
cell(borderButton), cell(borderButton)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

16
designer-realize/src/main/java/com/fr/design/condition/FontPane.java

@ -1,5 +1,7 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -13,6 +15,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -35,7 +38,7 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sytle_FRFont") + ":"); fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sytle_FRFont") + ":");
frFontPreviewPane = new FRFontPreviewArea(); frFontPreviewPane = new FRFontPreviewArea();
frFontPreviewPane.setBorder(BorderFactory.createTitledBorder("")); frFontPreviewPane.setBorder(BorderFactory.createTitledBorder(""));
frFontPreviewPane.setPreferredSize(new Dimension(80, 20)); frFontPreviewPane.setPreferredSize(FineUIScale.scale(new Dimension(80, 20)));
UIButton editFRFontButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); UIButton editFRFontButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
editFRFontButton.addActionListener(new ActionListener() { editFRFontButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -60,15 +63,14 @@ public class FontPane extends ConditionAttrSingleConditionPane<HighlightAction>
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") }); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont()); this.frFontPreviewPane.setFontObject(DesignUtils.getDefaultGUIFont());
fontLabel.setPreferredSize(new Dimension(100, fontLabel.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(fontLabel).weight(0.2), row(
this.add(row(10, cell(fontLabel), row(
10, 10,
cell(frFontPreviewPane), cell(frFontPreviewPane),
cell(editFRFontButton), cell(editFRFontButton),
cell(fontScopeComboBox), cell(fontScopeComboBox)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

14
designer-realize/src/main/java/com/fr/design/condition/ForeGroundPane.java

@ -1,5 +1,7 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
@ -26,21 +28,21 @@ public class ForeGroundPane extends ConditionAttrSingleConditionPane<HighlightAc
public ForeGroundPane(ConditionAttributesPane conditionAttributesPane) { public ForeGroundPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane); super(conditionAttributesPane);
foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground") + ":"); foregroundLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Foreground") + ":");
foregroundLabel.setPreferredSize(new Dimension(100, foregroundLabel.getHeight()));
this.foregroundColorPane = new ColorSelectBox(80); this.foregroundColorPane = new ColorSelectBox(80);
foregroundColorPane.setPreferredSize(new Dimension(100,foregroundColorPane.getHeight())); foregroundColorPane.setPreferredSize(new Dimension(FineUIScale.scale(100), foregroundColorPane.getHeight()));
this.foreScopeComboBox = new UIComboBox(new String[] { this.foreScopeComboBox = new UIComboBox(new String[] {
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Cell"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Row"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") }); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_Current_Column") });
this.foregroundColorPane.setSelectObject(Color.black); this.foregroundColorPane.setSelectObject(Color.black);
this.add(row(10, cell(foregroundLabel), row( this.setLayout(new BorderLayout());
this.add(row(10, cell(foregroundLabel).weight(0.2), row(
10, 10,
cell(foregroundColorPane), cell(foregroundColorPane),
cell(foreScopeComboBox), cell(foreScopeComboBox)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

2
designer-realize/src/main/java/com/fr/design/condition/HighLightConditionAttributesPane.java

@ -30,7 +30,6 @@ public class HighLightConditionAttributesPane extends ConditionAttributesPane<De
// 条件Panel // 条件Panel
liteConditionPane = new ObjectLiteConditionPane(); liteConditionPane = new ObjectLiteConditionPane();
this.add(liteConditionPane, BorderLayout.CENTER); this.add(liteConditionPane, BorderLayout.CENTER);
liteConditionPane.setPreferredSize(new Dimension(300, 300));
} }
protected void initActionList() { protected void initActionList() {
@ -83,7 +82,6 @@ public class HighLightConditionAttributesPane extends ConditionAttributesPane<De
checkConditionPane(); checkConditionPane();
updateMenuDef(); updateMenuDef();
resetWindow();
validate(); validate();
repaint(10); repaint(10);

14
designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
@ -19,7 +20,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -67,15 +68,14 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
useHyperlink = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_Links")); useHyperlink = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Use_Links"));
useHyperlink.addActionListener(l); useHyperlink.addActionListener(l);
hyperlinkLabel.setPreferredSize(new Dimension(100, hyperlinkLabel.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(hyperlinkLabel).weight(0.2), row(
this.add(row(10, cell(hyperlinkLabel), row(
10, 10,
cell(typeField), cell(typeField),
cell(hyperlinkButton), cell(hyperlinkButton),
cell(useHyperlink), cell(useHyperlink)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

13
designer-realize/src/main/java/com/fr/design/condition/NewRealValuePane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -7,7 +8,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.ValueHighlightAction; import com.fr.report.cell.cellattr.highlight.ValueHighlightAction;
import java.awt.Dimension; import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell; 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.row;
@ -25,12 +26,12 @@ public class NewRealValuePane extends ConditionAttrSingleConditionPane<Highlight
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value") + ":"); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Value") + ":");
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane(); valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
label.setPreferredSize(new Dimension(100, label.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(label).weight(0.2), row(
this.add(row(10, cell(label), row(
10, 10,
cell(valueEditor),cell(cancel)) cell(valueEditor)).weight(0.8)
).getComponent()); ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

14
designer-realize/src/main/java/com/fr/design/condition/PaddingPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.fun.IndentationUnitProcessor; import com.fr.design.fun.IndentationUnitProcessor;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -16,7 +17,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PaddingHighlightAction; import com.fr.report.cell.cellattr.highlight.PaddingHighlightAction;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import java.awt.Dimension; import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell; 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.column;
@ -65,15 +66,16 @@ public class PaddingPane extends ConditionAttrSingleConditionPane<HighlightActio
}); });
refreshIndentationUnit(); refreshIndentationUnit();
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sytle_Indentation")); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Sytle_Indentation"));
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, column(cell(label).weight(0.5), flex(0.5)), row( this.setLayout(new BorderLayout());
this.add(row(10, column(cell(label).weight(0.5), flex(0.5)).weight(0.2), row(
10, 10,
column(5, cell(paddingLeftSpinner).weight(0.5),cell(paddingLeft).weight(0.5)), column(5, cell(paddingLeftSpinner).weight(0.5),cell(paddingLeft).weight(0.5)),
column(5, cell(paddingRightSpinner).weight(0.5),cell(paddingRight).weight(0.5)), column(5, cell(paddingRightSpinner).weight(0.5),cell(paddingRight).weight(0.5)),
column(cell(paddingScopeComboBox).weight(0.5), flex(0.5)), column(5, cell(paddingScopeComboBox).weight(0.5), flex(0.5))).weight(0.8)
column(cell(cancel).weight(0.5), flex(0.5))) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent());
).getComponent());
this.add(column(5, cell(cancel).weight(0.5), flex(0.5)).getComponent(), BorderLayout.EAST);
} }
private void refreshIndentationUnit() { private void refreshIndentationUnit() {

14
designer-realize/src/main/java/com/fr/design/condition/PagePane.java

@ -1,12 +1,13 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PageHighlightAction; import com.fr.report.cell.cellattr.highlight.PageHighlightAction;
import java.awt.Dimension; import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell; 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.row;
@ -31,13 +32,12 @@ public class PagePane extends ConditionAttrSingleConditionPane<HighlightAction>
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_Before_Column") }); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cell_Write_Page_Before_Column") });
this.pageComboBox.setSelectedIndex(0); this.pageComboBox.setSelectedIndex(0);
pageLabel.setPreferredSize(new Dimension(100, pageLabel.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(pageLabel).weight(0.2), row(
this.add(row(10, cell(pageLabel), row(
10, 10,
cell(pageComboBox), cell(pageComboBox)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

13
designer-realize/src/main/java/com/fr/design/condition/PresentHighlightPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.present.Present; import com.fr.base.present.Present;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -15,7 +16,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.PresentHighlightAction; import com.fr.report.cell.cellattr.highlight.PresentHighlightAction;
import javax.swing.*; import javax.swing.*;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -85,14 +86,14 @@ public class PresentHighlightPane extends ConditionAttrSingleConditionPane<Highl
} }
} }
}); });
label.setPreferredSize(new Dimension(100, label.getHeight()));
this.add(row(10, cell(label), row( this.setLayout(new BorderLayout());
this.add(row(10, cell(label).weight(0.2), row(
10, 10,
cell(presentComboBox), cell(presentComboBox),
cell(valueEditor), cell(valueEditor)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

14
designer-realize/src/main/java/com/fr/design/condition/WHPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.fun.ReportLengthUNITProvider;
@ -12,7 +13,7 @@ import com.fr.stable.unit.UNIT;
import javax.swing.JSpinner; import javax.swing.JSpinner;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.math.BigDecimal; import java.math.BigDecimal;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
@ -37,14 +38,13 @@ public abstract class WHPane extends ConditionAttrSingleConditionPane<HighlightA
this.spinner.setValue(new Integer(0)); this.spinner.setValue(new Integer(0));
this.locString = locString; this.locString = locString;
label.setPreferredSize(new Dimension(100, label.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(label).weight(0.2), row(
this.add(row(10, cell(label), row(
10, 10,
cell(spinner), cell(spinner),
cell(unitLabel), cell(unitLabel)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

14
designer-realize/src/main/java/com/fr/design/condition/WidgetHighlightPane.java

@ -1,5 +1,6 @@
package com.fr.design.condition; package com.fr.design.condition;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -17,7 +18,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.WidgetHighlightAction; import com.fr.report.cell.cellattr.highlight.WidgetHighlightAction;
import javax.swing.*; import javax.swing.*;
import java.awt.Dimension; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -99,15 +100,14 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane<Highli
}); });
widgetLabel.setPreferredSize(new Dimension(100, widgetLabel.getHeight())); this.setLayout(new BorderLayout());
this.add(row(10, cell(widgetLabel).weight(0.2), row(
this.add(row(10, cell(widgetLabel), row(
10, 10,
cell(box), cell(box),
cell(widgetButton), cell(widgetButton),
cell(useWidget), cell(useWidget)).weight(0.8)
cell(cancel)) ).with(it -> it.setBorder(new ScaledEmptyBorder(5, 5, 5, 0))).getComponent(), BorderLayout.CENTER);
).getComponent()); this.add(cancel, BorderLayout.EAST);
} }
@Override @Override

7
designer-realize/src/main/java/com/fr/design/headerfooter/HFAttributesEditDialog.java

@ -3,6 +3,7 @@
*/ */
package com.fr.design.headerfooter; package com.fr.design.headerfooter;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.headerfooter.DateHFElement; import com.fr.base.headerfooter.DateHFElement;
import com.fr.base.headerfooter.FormulaHFElement; import com.fr.base.headerfooter.FormulaHFElement;
@ -72,7 +73,7 @@ public class HFAttributesEditDialog extends BasicPane {
JPanel topControlPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel topControlPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(topControlPane, BorderLayout.NORTH); centerPane.add(topControlPane, BorderLayout.NORTH);
JPanel topControlButtonPane =FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); JPanel topControlButtonPane = new JPanel(new FlowLayout(FlowLayout.RIGHT, 6, 0));
topControlPane.add(topControlButtonPane, BorderLayout.WEST); topControlPane.add(topControlButtonPane, BorderLayout.WEST);
@ -124,7 +125,7 @@ public class HFAttributesEditDialog extends BasicPane {
UIButton formulaButton = new UIButton("..."); UIButton formulaButton = new UIButton("...");
formulaPane.add(formulaButton); formulaPane.add(formulaButton);
formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "..."); formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Formula") + "...");
formulaButton.setPreferredSize(new Dimension(25, formulaContentField.getPreferredSize().height)); formulaButton.setPreferredSize(new Dimension(FineUIScale.scale(25), formulaContentField.getPreferredSize().height));
formulaButton.addActionListener(new ActionListener() { formulaButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
@ -212,7 +213,7 @@ public class HFAttributesEditDialog extends BasicPane {
this.revalidate(); this.revalidate();
add(column( add(column(
cell(centerPane), cell(centerPane),
cell(tabbedPaneBuilder.withHeadRatio(0.25f).build()) cell(tabbedPaneBuilder.withHeadRatio(0.13f).build()).weight(1)
).getComponent()); ).getComponent());
if (isInsert) { if (isInsert) {
this.moveLeftButton.setEnabled(false); this.moveLeftButton.setEnabled(false);

18
designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java

@ -4,6 +4,8 @@
package com.fr.design.headerfooter; package com.fr.design.headerfooter;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils;
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.base.GraphHelper; import com.fr.base.GraphHelper;
@ -102,6 +104,9 @@ public class HeaderFooterEditPane extends JPanel {
hfPreviewPane = new HFPreviewPane(); hfPreviewPane = new HFPreviewPane();
scrollPreviewPane = new JScrollPane(hfPreviewPane); scrollPreviewPane = new JScrollPane(hfPreviewPane);
scrollPreviewPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
scrollPreviewPane.getVerticalScrollBar().setOpaque(false);
scrollPreviewPane.getHorizontalScrollBar().setOpaque(false);
ChangeListener contentChangeListener = new ChangeListener() { ChangeListener contentChangeListener = new ChangeListener() {
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -136,14 +141,14 @@ public class HeaderFooterEditPane extends JPanel {
JPanel centerPane = JPanel centerPane =
column( column(
10, 10,
cell(createToolbar()).weight(0.07), cell(createToolbar()),
cell(controlContentPane).weight(0.3), cell(controlContentPane).weight(0.3),
column( column(
2, 2,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))).weight(0.1), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))).weight(0.1),
cell(scrollPreviewPane).weight(1.2) cell(scrollPreviewPane).weight(1.2).with(it -> it.setBorder(new FineRoundBorder()))
).weight(0.6) ).weight(0.75)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent(); ).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
@ -267,7 +272,9 @@ public class HeaderFooterEditPane extends JPanel {
titleLabel.setHorizontalAlignment(SwingConstants.LEFT); titleLabel.setHorizontalAlignment(SwingConstants.LEFT);
sectionPane.add(new JScrollPane(hfContainer), BorderLayout.CENTER); JScrollPane containerScroll = new JScrollPane(hfContainer);
containerScroll.setBorder(new FineRoundBorder());
sectionPane.add(containerScroll, BorderLayout.CENTER);
return sectionPane; return sectionPane;
} }
@ -414,7 +421,6 @@ public class HeaderFooterEditPane extends JPanel {
*/ */
private void setCurrentHFContainer(HFContainer hfContainer) { private void setCurrentHFContainer(HFContainer hfContainer) {
currentHFContainer = hfContainer; currentHFContainer = hfContainer;
currentHFContainer.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY));
} }
class HFPreviewPane extends JPanel implements Scrollable { class HFPreviewPane extends JPanel implements Scrollable {

18
designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterPane.java

@ -4,7 +4,10 @@
package com.fr.design.headerfooter; package com.fr.design.headerfooter;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.PaperSize; import com.fr.base.PaperSize;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
@ -56,6 +59,7 @@ public abstract class HeaderFooterPane extends BasicPane {
reportHFYypeList reportHFYypeList
.addListSelectionListener(reportHFTypeSelectionListener); .addListSelectionListener(reportHFTypeSelectionListener);
reportHFYypeList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); reportHFYypeList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
reportHFYypeList.setBorder(BorderFactory.createCompoundBorder(new FineRoundBorder(), new ScaledEmptyBorder(4, 4, 4, 4)));
JScrollPane hfTypeListScrollPane = new JScrollPane(reportHFYypeList); JScrollPane hfTypeListScrollPane = new JScrollPane(reportHFYypeList);
leftPane.add(hfTypeListScrollPane, BorderLayout.CENTER); leftPane.add(hfTypeListScrollPane, BorderLayout.CENTER);
@ -78,14 +82,13 @@ public abstract class HeaderFooterPane extends BasicPane {
centerPane.add(definePane, BorderLayout.NORTH); centerPane.add(definePane, BorderLayout.NORTH);
defineCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_HF_Whether_To_Define_The_Selected_Type"), true); //是否定义选中的类型 defineCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_HF_Whether_To_Define_The_Selected_Type"), true); //是否定义选中的类型
definePane.add(defineCheckBox); definePane.add(defineCheckBox, BorderLayout.WEST);
defineCheckBox.setBorder(new ScaledEmptyBorder(0,10,0,0));
defineCheckBox.addChangeListener(defineChangeListener); defineCheckBox.addChangeListener(defineChangeListener);
// HeaderFooterEditPane. // HeaderFooterEditPane.
headerFooterEditPane = new HeaderFooterEditPane(); headerFooterEditPane = new HeaderFooterEditPane();
centerPane.add(headerFooterEditPane, BorderLayout.CENTER); centerPane.add(headerFooterEditPane, BorderLayout.CENTER);
headerFooterEditPane.setBorder(BorderFactory
.createLineBorder(GUICoreUtils.getTitleLineBorderColor()));
} }
/** /**
@ -203,7 +206,7 @@ public abstract class HeaderFooterPane extends BasicPane {
if (value != null && value instanceof Integer) { if (value != null && value instanceof Integer) {
int reportHFType = (Integer) value; int reportHFType = (Integer) value;
this.setIcon(new LazyIcon("logo")); this.setIcon(new LazyIcon("cpt_icon"));
if (reportHFType == ReportConstants.REPORTPAGE_DEFAULT) { if (reportHFType == ReportConstants.REPORTPAGE_DEFAULT) {
this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Default_Page")); this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_HF_Default_Page"));
} else if (reportHFType == ReportConstants.REPORTPAGE_FIRST) { } else if (reportHFType == ReportConstants.REPORTPAGE_FIRST) {
@ -219,13 +222,18 @@ public abstract class HeaderFooterPane extends BasicPane {
if (reportHFHash != null) { if (reportHFHash != null) {
Object obj = reportHFHash.get(new Integer(reportHFType)); Object obj = reportHFHash.get(new Integer(reportHFType));
if (obj == null) { if (obj == null) {
this.setIcon(new LazyIcon("logo").disabled()); this.setIcon(new LazyIcon("cpt_icon").disabled());
} }
} }
} }
return this; return this;
} }
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, FineUIScale.scale(24));
}
}; };

13
designer-realize/src/main/java/com/fr/design/headerfooter/ImagePane.java

@ -45,14 +45,13 @@ public class ImagePane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(FRGUIPaneFactory.createM_BorderLayout());
//preview pane. //preview pane.
JPanel previewPane = new JPanel(new BorderLayout());
imagePreviewPane = new ImagePreviewPane(); imagePreviewPane = new ImagePreviewPane();
previewPane.add(new JScrollPane(imagePreviewPane)); JScrollPane previewPane = new JScrollPane(imagePreviewPane);
previewPane.setBorder(new FineRoundBorder()); previewPane.setBorder(new FineRoundBorder());
previewPane.setPreferredSize(new Dimension(FineUIScale.scale(500), FineUIScale.scale(400))); previewPane.setPreferredSize(new Dimension(FineUIScale.scale(500), FineUIScale.scale(400)));
previewPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); previewPane.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
imagePreviewPane.setOpaque(false);
previewPane.getViewport().setOpaque(false);
//select image //select image
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -65,14 +64,14 @@ public class ImagePane extends BasicPane {
imageFileChooser.setMultiSelectionEnabled(false); imageFileChooser.setMultiSelectionEnabled(false);
this.add(column( this.add(column(
3, 5,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"))),
row( row(
10, 10,
cell(previewPane).weight(0.9), cell(previewPane).weight(0.9),
cell(rightPane).weight(0.2) cell(rightPane).weight(0.2)
) ).weight(1)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); ).getComponent());
} }
@Override @Override

7
designer-realize/src/main/java/com/fr/design/mainframe/AuthorityToolBarPane.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.fine.theme.utils.FineUIScale;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -136,8 +136,8 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, PRE_GAP, 10, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, PRE_GAP, 10, 0));
title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Choose_Role")); title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Toolbar_Choose_Role"));
title.setHorizontalAlignment(SwingConstants.CENTER); title.setHorizontalAlignment(SwingConstants.LEFT);
title.setPreferredSize(new Dimension(120, 20)); title.setPreferredSize(new Dimension(FineUIScale.scale(120), title.getHeight()));
choseComboBox = new UIComboBox(CHOOSEITEM) { choseComboBox = new UIComboBox(CHOOSEITEM) {
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize(); Dimension dim = super.getPreferredSize();
@ -157,7 +157,6 @@ public class AuthorityToolBarPane<T extends WebContent> extends BasicBeanPane<Re
authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons()); authorityEditToolBarPane = new AuthorityEditToolBarPane(toolBarPane.getToolBarButtons());
authorityEditToolBarPane.setAuthorityToolBarPane(this); authorityEditToolBarPane.setAuthorityToolBarPane(this);
checkToolBarPaneEnable(); checkToolBarPaneEnable();
this.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
toolBarPane.setOpaque(false); toolBarPane.setOpaque(false);
this.add(row(10, cell(title), cell(choseComboBox), cell(toolBarPane)).getComponent()); this.add(row(10, cell(title), cell(choseComboBox), cell(toolBarPane)).getComponent());
} }

8
designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java

@ -44,7 +44,7 @@ public class NewReportBackgroundPane extends BasicPane {
public NewReportBackgroundPane() { public NewReportBackgroundPane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder()); setBorder(BorderFactory.createEmptyBorder());
setPreferredSize(new Dimension(600, 570)); setPreferredSize(FineUIScale.scale(new Dimension(600, 570)));
profilePane = new BackgroundProfilePane(); profilePane = new BackgroundProfilePane();
isPrintBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Background")); isPrintBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Print_Background"));
@ -56,7 +56,7 @@ public class NewReportBackgroundPane extends BasicPane {
private JPanel createBottomPane() { private JPanel createBottomPane() {
JPanel container = new JPanel(); JPanel container = new JPanel();
container.setPreferredSize(new Dimension(container.getPreferredSize().width, 30)); container.setPreferredSize(new Dimension(container.getPreferredSize().width, FineUIScale.scale(30)));
container.add(isExportBackgroundCheckBox); container.add(isExportBackgroundCheckBox);
container.add(isPrintBackgroundCheckBox); container.add(isPrintBackgroundCheckBox);
return container; return container;
@ -120,7 +120,7 @@ public class NewReportBackgroundPane extends BasicPane {
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill")); UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Background_Fill"));
uiLabel.setPreferredSize(FineUIScale.scale(new Dimension(24,24))); uiLabel.setPreferredSize(FineUIScale.scale(new Dimension(24,24)));
uiLabelPane.add(uiLabel, BorderLayout.NORTH); uiLabelPane.add(uiLabel, BorderLayout.NORTH);
uiLabelPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); uiLabelPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
backgroundPane = new ReportBackgroundSpecialPane(); backgroundPane = new ReportBackgroundSpecialPane();
backgroundPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 10)); backgroundPane.setBorder(new ScaledEmptyBorder(10, 0, 0, 10));
backgroundLabeledPane = TableLayoutHelper.createCommonTableLayoutPane( backgroundLabeledPane = TableLayoutHelper.createCommonTableLayoutPane(
@ -183,7 +183,7 @@ public class NewReportBackgroundPane extends BasicPane {
private JPanel createRightPane() { private JPanel createRightPane() {
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
container.setBorder(BorderFactory.createEmptyBorder()); container.setBorder(BorderFactory.createEmptyBorder());
container.setPreferredSize(new Dimension(263, 502)); container.setPreferredSize(FineUIScale.scale(new Dimension(263, 502)));
container.add(themePane, BorderLayout.NORTH); container.add(themePane, BorderLayout.NORTH);
return container; return container;
} }

8
designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java

@ -109,7 +109,7 @@ public class ReportColumnsPane extends BasicPane{
@Override @Override
protected void initButton(UIToggleButton labelButton, int index) { protected void initButton(UIToggleButton labelButton, int index) {
labelButton.setSize(new Dimension(60,20)); labelButton.setSize(new Dimension(60,20));
labelButton.setPreferredSize(new Dimension(60, 20)); labelButton.setPreferredSize(FineUIScale.scale(new Dimension(60, 20)));
super.initButton(labelButton, index); super.initButton(labelButton, index);
} }
}; };
@ -121,7 +121,7 @@ public class ReportColumnsPane extends BasicPane{
uiLabel.setHorizontalAlignment(SwingConstants.CENTER); uiLabel.setHorizontalAlignment(SwingConstants.CENTER);
int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont); int uiLabelWidth = GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns"), uiLableFont);
uiLabel.setPreferredSize(new Dimension(uiLabelWidth, 20)); uiLabel.setPreferredSize(FineUIScale.scale(new Dimension(uiLabelWidth, 20)));
north.add(uiLabel,BorderLayout.WEST); north.add(uiLabel,BorderLayout.WEST);
JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11)); JPanel buttonGroupPane = new JPanel(new FlowLayout(FlowLayout.CENTER, 23,11));
buttonGroupPane.add(onOffButtonGroup); buttonGroupPane.add(onOffButtonGroup);
@ -223,9 +223,9 @@ public class ReportColumnsPane extends BasicPane{
* 创建示例页面 * 创建示例页面
*/ */
private JPanel createSamplePane() { private JPanel createSamplePane() {
rowButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Horizontally")); // 行芬兰 rowButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Horizontally"));
rowButton.addActionListener(rowChangeListener); rowButton.addActionListener(rowChangeListener);
colButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Vertically")); //列芬兰 colButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportColumns_Columns_Vertically"));
colButton.addActionListener(colChangeListener); colButton.addActionListener(colChangeListener);
return row( return row(
row( row(

69
designer-realize/src/main/java/com/fr/design/report/SubReportPane.java

@ -1,5 +1,9 @@
package com.fr.design.report; package com.fr.design.report;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.core.KV; import com.fr.base.core.KV;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
@ -9,8 +13,6 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
@ -22,14 +24,18 @@ import com.fr.report.elementcase.ElementCase;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.io.File; import java.io.File;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class SubReportPane extends BasicPane { public class SubReportPane extends BasicPane {
private UITextField pathTextField; private UITextField pathTextField;
private FILE chooseFILE = null; private FILE chooseFILE = null;
@ -41,18 +47,43 @@ public class SubReportPane extends BasicPane {
} }
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); this.setLayout(new BorderLayout());
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = new JPanel(new BorderLayout(10, 0));
// northPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); UILabel locationLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location") + ":");
northPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sub_Report_Path"),null)); locationLabel.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
northPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Location") + ":"), BorderLayout.WEST); northPane.add(locationLabel, BorderLayout.WEST);
northPane.add(pathTextField = new UITextField(), BorderLayout.CENTER); northPane.add(pathTextField = new UITextField(), BorderLayout.CENTER);
pathTextField.setEditable(false); pathTextField.setEditable(false);
UIButton browseButton = new UIButton("..."); UIButton browseButton = initUIButton("...");
northPane.add(browseButton, BorderLayout.EAST); northPane.add(browseButton, BorderLayout.EAST);
browseButton.setPreferredSize(new java.awt.Dimension(20, 20));
kvPane = new ReportletParameterViewPane();
extend = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters"));
UITextArea description = new UITextArea(2, 1);
description.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sub_Report_Description"));
description.setEditable(false);
description.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
add(column(20,
cell(FineUIUtils.wrapComponentWithTitle(northPane, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sub_Report_Path"))),
cell(FineUIUtils.wrapComponentWithTitle(column(
10,
cell(kvPane).with(it -> it.setPreferredSize(new Dimension(it.getWidth(), FineUIScale.scale(300)))),
cell(extend),
cell(FineUIUtils.wrapComponentWithTitle(description, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention")))
).weight(1).getComponent(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Delivery_Parameter")))
).getComponent());
}
private UIButton initUIButton(String text) {
UIButton browseButton = new UIButton(text);
browseButton.setPreferredSize(FineUIScale.scale(new Dimension(48, 24)));
browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button")); browseButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Click_this_button"));
addListener(browseButton);
return browseButton;
}
private void addListener(UIButton browseButton) {
browseButton.addActionListener(new ActionListener() { browseButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
FILEChooserPane fileChooser = FILEChooserPane.getInstance(true, false); FILEChooserPane fileChooser = FILEChooserPane.getInstance(true, false);
@ -71,24 +102,6 @@ public class SubReportPane extends BasicPane {
} }
} }
}); });
this.add(northPane, BorderLayout.NORTH);
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
centerPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 5));
kvPane = new ReportletParameterViewPane();
centerPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Delivery_Parameter"),null));
JPanel kcPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
kcPane.add(kvPane);
extend = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Extends_Report_Parameters"));
kcPane.add(extend, BorderLayout.SOUTH);
centerPane.add(kcPane, BorderLayout.CENTER);
UITextArea description = new UITextArea(2, 1);
centerPane.add(description, BorderLayout.SOUTH);
description.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sub_Report_Description"));
description.setEditable(false);
description.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Attention"), null));
} }
@Override @Override

2
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -753,7 +753,7 @@ public class EditToolBar extends BasicPane {
super.setSelectedIndex(newSelectedIndex, fireChanged); super.setSelectedIndex(newSelectedIndex, fireChanged);
} }
}; };
bgColorButtonGroup.setPreferredSize(FineUIScale.scale(new Dimension(135, bgColorButtonGroup.getPreferredSize().height))); bgColorButtonGroup.setPreferredSize(new Dimension(FineUIScale.scale(135), bgColorButtonGroup.getPreferredSize().height));
return row(10, cell(headLabel).weight(0.15), cell(bgColorButtonGroup).weight(0.3), flex(0.55)).getComponent(); return row(10, cell(headLabel).weight(0.15), cell(bgColorButtonGroup).weight(0.3), flex(0.55)).getComponent();
} }
} }

Loading…
Cancel
Save