Browse Source

Merge remote-tracking branch 'origin/newui' into newui

newui
lemon 4 months ago
parent
commit
d001c198ca
  1. 155
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  2. 2
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  3. 13
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  4. 13
      designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java
  5. 6
      designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
  6. 99
      designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java
  7. 12
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  8. 116
      designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java
  9. 7
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java
  10. 58
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java
  11. 6
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  12. 313
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  13. 9
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallHeightPane.java
  14. 9
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallPane.java
  15. 82
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java
  16. 24
      designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java
  17. 27
      designer-base/src/main/java/com/fr/design/dialog/BasicPane.java
  18. 26
      designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java
  19. 93
      designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java
  20. 14
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  21. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  22. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java
  23. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  24. 5
      designer-base/src/main/java/com/fr/design/gui/ilable/FRExplainLabel.java
  25. 122
      designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java
  26. 42
      designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java
  27. 170
      designer-base/src/main/java/com/fr/design/report/WatermarkPane.java
  28. 2
      designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java
  29. 47
      designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java
  30. 25
      designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java
  31. 3
      designer-base/src/main/java/com/fr/design/report/fit/NewFitPreviewPane.java
  32. 51
      designer-base/src/main/java/com/fr/design/report/fit/ReportFitConfigPane.java
  33. 11
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  34. 42
      designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java
  35. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash.svg
  36. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash_disable.svg
  37. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton.svg
  38. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton_disable.svg
  39. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify.svg
  40. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify_disable.svg
  41. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/email.svg
  42. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/email_disable.svg
  43. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up.svg
  44. 11
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up_disable.svg
  45. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first.svg
  46. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first_disable.svg
  47. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last.svg
  48. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last_disbale.svg
  49. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi.svg
  50. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi_disable.svg
  51. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next.svg
  52. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next_disable.svg
  53. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous.svg
  54. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous_disable.svg
  55. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet.svg
  56. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet_disable.svg
  57. 6
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf.svg
  58. 6
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf_disable.svg
  59. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview.svg
  60. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview_disable.svg
  61. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset.svg
  62. 10
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset_disable.svg
  63. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale.svg
  64. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale_disable.svg
  65. 14
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  66. 9
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  67. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  68. 6
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  69. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/AbstractChartAttrPane.java
  70. 101
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  71. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  72. 128
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  73. 38
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java
  74. 33
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  75. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  76. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  77. 92
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  78. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  79. 102
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  80. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  81. 57
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  82. 39
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  83. 15
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  84. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java
  85. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java
  86. 51
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  87. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java
  88. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  89. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java
  90. 89
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  91. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/AbstractVanChartScrollPane.java
  92. 60
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  93. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  94. 39
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java
  95. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java
  96. 25
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java
  97. 121
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  98. 155
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  99. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  100. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java
  101. Some files were not shown because too many files have changed in this diff Show More

155
designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java

@ -0,0 +1,155 @@
package com.fine.theme.utils;
import com.fine.swing.ui.layout.Column;
import com.fine.swing.ui.layout.Layouts;
import com.fine.swing.ui.layout.Row;
import com.fine.swing.ui.layout.Spacer;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.collections.combination.Pair;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* 设计器典型布局构建器
*
* @author Levy.Xie
* @since 11.0
* Created on 2024/05/08
*/
public class FineLayoutBuilder {
/**
* 创建标准行列表格布局行内元素均匀分布
*
* @param elePerRow 每行元素数
* @param rowSpacing 行内间距
* @param colSpacing 列内间距
* @param componentList 组件
* @return 表格面板
*/
public static Column createCommonTableLayout(int elePerRow, int rowSpacing, int colSpacing, List<? extends Component> componentList) {
int rowNum = componentList.size() / elePerRow + 1;
Iterator<? extends Component> iterator = componentList.iterator();
Column column = new Column();
column.setSpacing(colSpacing);
Row currentRow;
for (int i = 0; i < rowNum; i++) {
currentRow = new Row();
currentRow.setSpacing(rowSpacing);
for (int j = 0; j < elePerRow; j++) {
Layouts.populate(currentRow, cell(
iterator.hasNext() ? iterator.next() : new Spacer(1)
).weight(1));
}
column.add(currentRow);
}
return column;
}
/**
* 兼容TableLayout配置项生成网格布局面板
*
* @param colSpacing 间距
* @param components 组件二维数组内部每个一维数组均为行内组件一维数组元素需与weight严格对应
* @param weight 行内权重列表形如[0.4,0.6] 即首个元素占比0.4第二个元素占比0.6
* @return 面板
*/
public static JPanel compatibleTableLayout(int colSpacing, Component[][] components, double[] weight) {
Column column = new Column();
column.setSpacing(colSpacing);
try {
for (Component[] componentArray : components) {
Row row = new Row();
List<Component> visibleComponents = Arrays.stream(componentArray)
.filter(com -> com != null && com.isVisible()).collect(Collectors.toList());
if (visibleComponents.size() >= 1) {
// 仅当存在可见组件时处理布局
dealWithVisibleComponents(weight, column, componentArray, row, visibleComponents);
}
}
return asBorderLayoutWrapped(column);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, "[Designer] create layout failed.");
}
return new JPanel();
}
private static void dealWithVisibleComponents(double[] weight, Column column, Component[] value, Row row, List<Component> components) {
if (components.size() == 1 && value[0] != null) {
// 仅存在首个元素,则该元素自适应占满整行
Layouts.populate(row, cell(components.get(0)).weight(1));
} else {
// 其他场景,按权重分配布局,以适配原TableLayout形式
for (int j = 0; j < value.length; j++) {
Component component = value[j];
if (component == null) {
component = new Spacer(1);
}
Layouts.populate(row, cell(component).weight(weight[j]));
}
}
column.add(row);
}
/**
* 创建竖向排列的扩展面板列表
*
* @param spacing 间距
* @param elements 面板元素含标题面板
* @return 竖向排列面板
*/
@SafeVarargs
public static Column createVerticalExpandPaneLayout(int spacing, Pair<String, JPanel>... elements) {
UIExpandablePane[] panes = IntStream.range(0, elements.length)
.mapToObj(i -> {
Pair<String, JPanel> pair = elements[i];
if (i != elements.length - 1) {
return new UIExpandablePane(pair.getFirst(), pair.getSecond(), true);
}
return new UIExpandablePane(pair.getFirst(), pair.getSecond());
})
.toArray(UIExpandablePane[]::new);
return createVerticalLayout(spacing, panes);
}
/**
* 创建垂直布局面板
*
* @param spacing 间距
* @param elements 面板元素
* @return 面板
*/
public static Column createVerticalLayout(int spacing, JPanel... elements) {
Column column = new Column();
column.setSpacing(spacing);
for (JPanel element : elements) {
column.add(element);
}
return column;
}
/**
* 组件包装于BorderLayout中
*
* @param component 组件
* @return 包装后的面板
*/
public static JPanel asBorderLayoutWrapped(Component component) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(component);
return panel;
}
}

2
designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java

@ -29,8 +29,10 @@ public interface FineUIStyle {
String BUTTON_TAB_ACTION = "tabAction";
String LABEL_BOLD = "boldLabel";
String LABEL_TIP = "tipLabel";
String LABEL_WARNING_TIP = "warningTipLabel";
String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton";
String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar";

13
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,5 +1,6 @@
package com.fr.design.actions.file;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
@ -15,7 +16,6 @@ import com.fr.design.dialog.DialogActionListener;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.gui.frpane.FineTabbedPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UINoThemeColorButton;
@ -54,7 +54,6 @@ import com.fr.io.attr.ImageExportAttr;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.logging.log4j.Level;
@ -299,7 +298,7 @@ public class PreferencePane extends BasicPane {
// 启动页配置
cell(createStartupPagePane())
).weight(1).getComponent();
UIScrollPane generalScrollPane = patchScroll(generalPane);
JPanel generalScrollPane = patchScroll(FineLayoutBuilder.asBorderLayoutWrapped(generalPane));
// 高级面板
JPanel advancePane = column(SETTING_V_GAP,
@ -327,7 +326,7 @@ public class PreferencePane extends BasicPane {
cell(createDesignerStartupPane())
).weight(1).getComponent();
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
UIScrollPane adviceScrollPane = patchScroll(advancePane);
JPanel adviceScrollPane = patchScroll(advancePane);
// 版本管理面板
//初始化vcs总面板
@ -339,7 +338,7 @@ public class PreferencePane extends BasicPane {
// vcsPane
createVcsSettingPane(vcsPane, vcsParentPane, cardLayout);
//添加滚动条
UIScrollPane vcsScrollPane = patchScroll(vcsPane);
JPanel vcsScrollPane = patchScroll(vcsPane);
//配置面板作为vcs总面板的一张卡片
vcsParentPane.add(vcsScrollPane, VcsMovePanel.SETTING);
@ -428,10 +427,10 @@ public class PreferencePane extends BasicPane {
}
@NotNull
private UIScrollPane patchScroll(JPanel generalPane) {
private JPanel patchScroll(JPanel generalPane) {
UIScrollPane uiScrollPane = new UIScrollPane(generalPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
uiScrollPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
return uiScrollPane;
return FineLayoutBuilder.asBorderLayoutWrapped(uiScrollPane);
}
private void createVcsSettingPane(JPanel generalPane, JPanel parentPane, CardLayout cardLayout) {

13
designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java

@ -2,7 +2,7 @@ package com.fr.design.actions.help;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
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.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
@ -46,11 +46,12 @@ public class AboutDialog extends JDialog implements ActionListener {
FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY);
okButton.addActionListener(this);
tabbedPane = new UITabbedPane();
sysPane = new SystemInfoPane();
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About"), aboutPanel);
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane);
tabbedPane = FineTabbedPane.builder()
.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About"), aboutPanel)
.addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane)
.build();
buttonPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
buttonPanel.add(okButton);
@ -79,7 +80,7 @@ public class AboutDialog extends JDialog implements ActionListener {
this.getRootPane().setDefaultButton(okButton);
this.setSize(FineUIScale.scale(new Dimension(defaultPane.getPreferredSize().width, 600)));
this.setSize(FineUIScale.scale(new Dimension(defaultPane.getPreferredSize().width, 620)));
GUICoreUtils.centerWindow(this);
}
@ -96,6 +97,6 @@ public class AboutDialog extends JDialog implements ActionListener {
private SystemInfoPane sysPane;
private JPanel buttonPanel;
private UITabbedPane tabbedPane;
private FineTabbedPane tabbedPane;
private UIButton okButton;
}

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

@ -435,7 +435,7 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
JPanel buttonPane = initButtonPane();
JScrollPane treeScrollPane = iniTreeScrollPane();
// 滚动面板不能直接加入row-col布局,需设定宽高
treeScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 250)));
treeScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 240)));
JPanel previewPane = column(
cell(northButtonPane),
row(
@ -571,8 +571,8 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
row(5,
cell(andRadioButton).weight(0.5),
cell(orRadioButton).weight(0.5)
).weight(0.25),
flex(0.5),
).weight(0.35),
flex(0.4),
row(5,
cell(addButton).weight(0.5),
cell(modifyButton).weight(0.5)

99
designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java

@ -1,6 +1,8 @@
package com.fr.design.data.datapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.RecursionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.preview.PreviewLabel;
import com.fr.design.data.datapane.preview.PreviewLabel.Previewable;
@ -18,19 +20,21 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
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;
public class TreeTableDataDictPane extends BasicPane implements Previewable {
private UILabel selectTableDataLabel;
@ -54,23 +58,28 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
}
public TreeTableDataDictPane(String treeName) {
this.setLayout(new BorderLayout(5, 30));
this.setBorder(BorderFactory.createEmptyBorder(20, 20, 0, 0));
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") + " :");
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
//请选择一个数据集
selectTableDataLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Select_One") );
setTableDataNameComboBox(treeName);
tableDataNameComboBox.setPreferredSize(new Dimension(180, 20));
JPanel tableFlowPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
tableFlowPane.add(selectTableDataLabel);
tableFlowPane.add(tableDataNameComboBox);
tableDataNameComboBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
tdChange(true);
}
});
tableFlowPane.add(new PreviewLabel(this));
this.add(tableFlowPane, BorderLayout.NORTH);
JPanel tableFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
tableFlowPane.add(row(LayoutConstants.HGAP_LARGE,
cell(selectTableDataLabel).weight(0.12),
row(LayoutConstants.HGAP_LARGE,
cell(tableDataNameComboBox).weight(0.9),
cell(new PreviewLabel(this)).weight(0.1)
).weight(0.3),
flex(0.58)
).getComponent());
//中心面板
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(centerPane, BorderLayout.CENTER);
parentMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Parent_Marked_Filed"), true);
lengthMarkRadio = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Build_Tree_Accord_Marked_Filed_Length"));
parentMarkRadio.addItemListener(new ItemListener() {
@ -95,45 +104,44 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
markButtonGroup.add(parentMarkRadio);
markButtonGroup.add(lengthMarkRadio);
originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT);
parentFieldLabel = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field") + " :", SwingConstants.RIGHT);
treeDataFieldLabel1 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT);
originFieldDependsOnLengthLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed") + " :", SwingConstants.RIGHT);
treeDataFieldLabel2 = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field") + " :", SwingConstants.RIGHT);
//原始标记字段
originFieldDependsOnParentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"));
//父标记字段
parentFieldLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parent_Marked_Field"));
treeDataFieldLabel1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"));
originFieldDependsOnLengthLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Original_Marked_Filed"));
treeDataFieldLabel2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Data_Field"));
// originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
// parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
// originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[] {new OldColumnIndexEditor(com.fr.design.i18n.Toolkit.i18nText("Columns"))});
originFieldDependsOnParentPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
parentFieldPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
originFieldDependsOnLengthPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
makeParentEnable();
JPanel p1 = createCenterFlowZeroGapBorderPane(originFieldDependsOnParentLabel, originFieldDependsOnParentPane);
JPanel p2 = createCenterFlowZeroGapBorderPane(parentFieldLabel, parentFieldPane);
JPanel border1 = new JPanel();
border1.setLayout(new BorderLayout(0, 10));
border1.add(p1, BorderLayout.NORTH);
border1.add(p2, BorderLayout.CENTER);
JPanel p4 = createCenterFlowZeroGapBorderPane(originFieldDependsOnLengthLabel, originFieldDependsOnLengthPane);
JPanel border2 = new JPanel();
border2.setLayout(new BorderLayout(0, 20));
border2.add(p4, BorderLayout.NORTH);
//树数据集面板
centerPane.add(column(10,
cell(parentMarkRadio),
row(LayoutConstants.HGAP_LARGE,
cell(originFieldDependsOnParentLabel).weight(0.12),
cell(originFieldDependsOnParentPane).weight(0.3),
flex(0.58)
),
row(LayoutConstants.HGAP_LARGE,
cell(parentFieldLabel).weight(0.12),
cell(parentFieldPane).weight(0.3),
flex(0.58)
),
cell(lengthMarkRadio),
row(LayoutConstants.HGAP_LARGE,
cell(originFieldDependsOnLengthLabel).weight(0.12),
cell(originFieldDependsOnLengthPane).weight(0.3),
flex(0.58)
)
).getComponent());
JPanel xx = FRGUIPaneFactory.createBorderLayout_S_Pane();
xx.add(parentMarkRadio, BorderLayout.NORTH);
xx.add(border1, BorderLayout.CENTER);
JPanel xxx = FRGUIPaneFactory.createBorderLayout_S_Pane();
xxx.add(lengthMarkRadio, BorderLayout.NORTH);
xxx.add(border2, BorderLayout.CENTER);
JPanel buildTreePanel = new JPanel(new BorderLayout(5, 30));
buildTreePanel.add(xx, BorderLayout.NORTH);
buildTreePanel.add(xxx, BorderLayout.CENTER);
centerPane.add(buildTreePanel, BorderLayout.NORTH);
JPanel previewPanel = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
//预览
JPanel previewPanel = new JPanel(new BorderLayout());
UIButton treeDataPreviewButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
previewPanel.add(treeDataPreviewButton);
previewPanel.add(treeDataPreviewButton, BorderLayout.WEST);
treeDataPreviewButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -163,7 +171,8 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable {
PreviewTablePane.previewTableData(rtd);
}
});
centerPane.add(previewPanel, BorderLayout.CENTER);
this.add(column(LayoutConstants.VERTICAL_GAP, cell(tableFlowPane),cell(centerPane), cell(previewPanel)).getComponent());
}
protected void setTableDataNameComboBox(String treeName) {

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

@ -69,8 +69,10 @@ import java.net.URI;
import java.util.concurrent.ExecutionException;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
* Database Connection pane.
@ -280,9 +282,13 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// ChartSet
String[] defaultEncode = new String[]{Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));
JPanel chartSetPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":"));
advancedPanel.add(chartSetPane);
JPanel chartSetPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
chartSetPane.add(row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset"))).weight(0.15),
cell(charSetComboBox).weight(0.3),
flex(0.55)
).getComponent());
advancedPanel.add(wrapComponentWithTitle(chartSetPane, Toolkit.i18nText("Fine-Design_Basic_Advanced")));
}
private void initJDBCLayout(JPanel corePane, JPanel advancedPanel) {

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

@ -1,38 +1,40 @@
package com.fr.design.data.datapane.connect;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import java.util.Properties;
import javax.naming.Context;
import javax.swing.BorderFactory;
import javax.swing.JDialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.design.border.UITitledBorder;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.FRExplainLabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class JNDIDefPane extends JPanel {
private static Map<String, String> jndiMap = new HashMap<String, String>();
@ -66,57 +68,51 @@ public class JNDIDefPane extends JPanel {
private JDialog otherAttrDialog;
public JNDIDefPane() {
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(UITitledBorder.createBorderWithTitle("JNDI" + ":"));
JPanel innerthis = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(innerthis);
// NorthPane
JPanel nContentPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
innerthis.add(nContentPane);
nContentPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_Name") + ":"));
jndiNameTextField = new UITextField(20);
nContentPane.add(jndiNameTextField, BorderLayout.NORTH);
// CenterPane
JPanel outcenterPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Context"));
innerthis.add(outcenterPane);
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
outcenterPane.add(centerPane);
this.setLayout(new BorderLayout());
jndiNameTextField = new UITextField(20);
JNDIFactoryComboBox = new UIComboBox(new String[] { "", "weblogic.jndi.WLInitialContextFactory", "com.ibm.websphere.naming.WsnInitialContextFactory",
"org.jboss.naming.HttpNamingContextFactory", "org.jnp.interfaces.NamingContextFactory", "com.caucho.burlap.BurlapContextFactory", });
JNDIFactoryComboBox.setEditable(true);
JNDIFactoryComboBox.addActionListener(jndiListener);
JNDIFactoryComboBox.setPreferredSize(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2));
// ContextPane
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = { p, p, p, p };
double[] columnSize = { f, f };
Component[][] comps = { { new UILabel("INITIAL_CONTEXT_FACTORY:", SwingConstants.RIGHT), JNDIFactoryComboBox },
{ new UILabel("PROVIDER_URL:", SwingConstants.RIGHT), PROVIDER_URL_TF }, { new UILabel("SECURITY_PRINCIPAL:", SwingConstants.RIGHT), SECURITY_PRINCIPAL_TF },
{ new UILabel("SECURITY_CREDENTIALS:", SwingConstants.RIGHT), SECURITY_CREDENTIALS_TF } };
centerPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2));
// ActionLabel
JPanel actionPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
centerPane.add(actionPane);
actionPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 6));
JNDIFactoryComboBox.setPreferredSize(FineUIScale.scale(new Dimension(30, JNDIFactoryComboBox.getPreferredSize().height + 2)));
// 上下文
JPanel contextPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contextPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("INITIAL_CONTEXT_FACTORY")).weight(0.35), cell(JNDIFactoryComboBox).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("PROVIDER_URL")).weight(0.35), cell(PROVIDER_URL_TF).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_PRINCIPAL")).weight(0.35), cell(SECURITY_PRINCIPAL_TF).weight(0.65)),
row(LayoutConstants.HORIZONTAL_GAP,cell(new UILabel("SECURITY_CREDENTIALS")).weight(0.35), cell(SECURITY_CREDENTIALS_TF).weight(0.65))
).getComponent());
//其他属性
JPanel otherAttributePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
ActionLabel actionLabel = new ActionLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Other_Attributes"));
actionPane.add(actionLabel, BorderLayout.EAST);
actionLabel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
//其他属性弹窗
JDialog wDialog = createJDialog();
wDialog.setVisible(true);
}
});
otherAttributePanel.add(actionLabel, BorderLayout.EAST);
//注意描述
JPanel jndiDesPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jndiDesPanel.add(new JScrollPane(new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_DES"))), BorderLayout.WEST);
//JNDI面板
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_Name"))).weight(0.15), cell(jndiNameTextField).weight(0.85)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Context"))).weight(0.15), cell(contextPane).weight(0.85)),
cell(otherAttributePanel),
cell(jndiDesPanel)
).getComponent();
this.add(wrapComponentWithTitle(centerPanel,"JNDI"));
}
// South Description
UILabel explainLabe11l = new FRExplainLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_JNDI_DES"));
innerthis.add(new JScrollPane(explainLabe11l));
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText)))
.with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
public void populate(JNDIDatabaseConnection jndiDatabase) {
@ -216,21 +212,23 @@ public class JNDIDefPane extends JPanel {
class OtherAttrPane extends BasicPane {
public OtherAttrPane() {
// JPanel northFlowPane
JPanel northFlowPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northFlowPane, BorderLayout.NORTH);
JPanel northFlowPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northFlowPane.setBorder(new ScaledEmptyBorder(10,10,10,10));
// ContextPane
double f = TableLayout.FILL;
double[] rowSize = { f, f, f, f, f, f, f, f, f, f, f };
double[] columnSize = { f, f };
Component[][] comps = { { new UILabel("OBJECT_FACTORIES:", SwingConstants.RIGHT), OBJECT_FACTORIES_TF },
{ new UILabel("STATE_FACTORIES:", SwingConstants.RIGHT), STATE_FACTORIES_TF }, { new UILabel("URL_PKG_PREFIXES:", SwingConstants.RIGHT), URL_PKG_PREFIXES_TF },
{ new UILabel("DNS_URL:", SwingConstants.RIGHT), DNS_URL_TF }, { new UILabel("AUTHORITATIVE:", SwingConstants.RIGHT), AUTHORITATIVE_TF },
{ new UILabel("BATCHSIZE:", SwingConstants.RIGHT), BATCHSIZE_TF }, { new UILabel("REFERRAL:", SwingConstants.RIGHT), REFERRAL_TF },
{ new UILabel("SECURITY_PROTOCOL:", SwingConstants.RIGHT), SECURITY_PROTOCOL_TF },
{ new UILabel("SECURITY_AUTHENTICATION:", SwingConstants.RIGHT), SECURITY_AUTHENTICATION_TF }, { new UILabel("LANGUAGE:", SwingConstants.RIGHT), LANGUAGE_TF },
{ new UILabel("APPLET:", SwingConstants.RIGHT), APPLET_TF } };
northFlowPane.add(TableLayoutHelper.createCommonTableLayoutPane(comps, rowSize, columnSize, 2));
northFlowPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("OBJECT_FACTORIES")).weight(0.35), cell(OBJECT_FACTORIES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("STATE_FACTORIES")).weight(0.35), cell(STATE_FACTORIES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("URL_PKG_PREFIXES")).weight(0.35), cell(URL_PKG_PREFIXES_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("DNS_URL")).weight(0.35), cell(DNS_URL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("AUTHORITATIVE")).weight(0.35), cell(AUTHORITATIVE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("BATCHSIZE")).weight(0.35), cell(BATCHSIZE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("REFERRAL")).weight(0.35), cell(REFERRAL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_PROTOCOL")).weight(0.35), cell(SECURITY_PROTOCOL_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("SECURITY_AUTHENTICATION")).weight(0.35), cell(SECURITY_AUTHENTICATION_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("LANGUAGE")).weight(0.35), cell(LANGUAGE_TF)).weight(0.65),
row(LayoutConstants.HORIZONTAL_GAP, cell(new UILabel("APPLET")).weight(0.35), cell(APPLET_TF)).weight(0.65)
).getComponent());
this.add(northFlowPane, BorderLayout.NORTH);
}
@Override

7
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewLabel.java

@ -5,7 +5,8 @@ import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIButton;
@ -16,7 +17,7 @@ public class PreviewLabel extends UIButton {
Previewable previewable;
public PreviewLabel(Previewable previewable) {
super(BaseUtils.readIcon("/com/fr/design/images/m_file/preview.png"));
super(new LazyIcon("preview"));
this.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
this.setCursor(new Cursor(Cursor.HAND_CURSOR));
this.previewable = previewable;
@ -27,7 +28,7 @@ public class PreviewLabel extends UIButton {
PreviewLabel.this.previewable.preview();
}
});
this.setPreferredSize(new Dimension(24, 20));
this.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
}
public static interface Previewable {

58
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ClassTableDataPane.java

@ -1,7 +1,9 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.data.impl.ClassTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
@ -11,8 +13,6 @@ import com.fr.design.gui.itableeditorpane.UITableEditAction;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.IOUtils;
import com.fr.script.Calculator;
import com.fr.stable.ParameterProvider;
@ -23,35 +23,29 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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;
public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
private UITextField classNameTextField;
private UITableEditorPane<ParameterProvider> editorPane;
public ClassTableDataPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));
// TableLayout
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, p};
//Reportlet.
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(36);
reportletNamePane.add(classNameTextField);
this.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
//类名
classNameTextField = new UITextField();
UIButton browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select"));
browserButton.setPreferredSize(new Dimension(
browserButton.getPreferredSize().width,
classNameTextField.getPreferredSize().height));
reportletNamePane.add(browserButton);
browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height));
browserButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
final ClassNameSelectPane bPane = new ClassNameSelectPane();
@ -69,15 +63,26 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
}
});
Component[][] components = {
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name") + ":"), reportletNamePane},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")},
{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")},
{null,new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME)))}
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel tipPanel = column(LayoutConstants.VERTICAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Function_The_Class_Must_Implement_The_Interface") + "\"com.fr.data.Tabledata\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Example") + ":\"com.fr.data.impl.ArrayTableData\"")),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Class_Location_Description", StableUtils.pathJoin(ProjectConstants.WEBINF_NAME, ProjectConstants.CLASSES_NAME))))
).getComponent();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.add(column(LayoutConstants.VERTICAL_GAP,
row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Class_Name"))).weight(0.12),
row(LayoutConstants.HGAP_LARGE,
cell(classNameTextField).weight(0.85),
cell(browserButton).weight(0.15)
).weight(0.58),
flex(0.3)
),
row(LayoutConstants.HGAP_LARGE, flex(0.12), cell(tipPanel).weight(0.88))
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0,10, 0))).getComponent());
this.add(northPane, BorderLayout.NORTH);
this.add(initSouthPanel(), BorderLayout.SOUTH);
this.add(initSouthPanel(), BorderLayout.CENTER);
}
private JPanel initSouthPanel() {
JPanel jpanel = new JPanel();
@ -95,7 +100,6 @@ public class ClassTableDataPane extends AbstractTableDataPane<ClassTableData> {
}, " " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_TableData_Default_Para"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
}

6
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.data.impl.EmbeddedTableData;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
@ -52,7 +53,8 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// additional methods
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
// prepare the data in this way as default if no arguments is passed in
dataJTable = new JTable(new EmbeddedTableModel(new EmbeddedTableData()));
@ -84,7 +86,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
// peter:控制Panel
JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH);
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
//northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 0));
// kel:在左上角加一个JLabel用来显示坐标,方便用户查看。
coordinatelabel = new UILabel("0/0,0/0");

313
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -1,6 +1,9 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fr.base.BaseUtils;
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.base.Parameter;
import com.fr.base.ParameterHelper;
import com.fr.base.Utils;
@ -12,6 +15,7 @@ import com.fr.data.impl.FileTableData;
import com.fr.data.impl.TextTableData;
import com.fr.data.impl.XMLTableData;
import com.fr.design.actions.UpdateAction;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.datapane.preview.PreviewTablePane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.FineJOptionPane;
@ -27,9 +31,6 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
@ -47,7 +48,6 @@ import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLableReader;
import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
@ -62,9 +62,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -80,6 +78,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
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;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private static final int TEXT = 0;
private static final int EXCEL = 1;
@ -104,8 +108,6 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIButton testConnection;
private XMLNodeTree xmlNodeTree;
private Parameter[] params;
private JPanel filePath;
private XMLNodeTreePane nodeTreePane;
private UICheckBox needColumnNameCheckBox;// 第一行是否作为标题
private UIRadioButton tableDismemberRadioButton;// 制表符
@ -116,41 +118,32 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
private UIComboBox charsetComboBox;
private UILabel encodeLabel;
private UILabel dismenberLabel;
private UILabel keyPointLaber;
private ExpandMutableTreeNode selectedNode = null;
private ExpandMutableTreeNode finalSelectedNode = null;
private ArrayList<String> xmlColumnsList = new ArrayList<String>();
private static final int SETPANELWIDTH = 337;
private static final int WIDTH = 317;
private static final int HEIGHT = 453;
private static final int GAP = 23;
private static final double LOCAL_WIDTH_RATIO = 0.62;
private static final double URL_WIDTH_RATIO = 0.56;
public FileTableDataPane() {
this(SETPANELWIDTH, WIDTH, HEIGHT, GAP);
this(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
public FileTableDataPane(int setPanelWidth, int width, int height, int gap) {
this.setLayout(new BorderLayout(gap, 0));
JPanel northPanel = new JPanel(new BorderLayout());
JPanel type = new JPanel();
type.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type") + ":"));
public FileTableDataPane(double localWidthRatio, double urlWidthRatio) {
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
//文件类型
JPanel fileType = new JPanel(new BorderLayout());
String[] item = {"TXT", "Excel", "XML"};
fileTypeComboBox = new UIComboBox(item);
fileTypeComboBox.setPreferredSize(new Dimension(100, 20));
type.add(fileTypeComboBox);
northPanel.add(type, BorderLayout.WEST);
// 最上面的pane,文件选择
JPanel centerPanel = new JPanel();
centerPanel.setPreferredSize(new Dimension(522, 200));
centerPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address")));
addToCenterPanel(centerPanel);
fileType.add(row(LayoutConstants.HGAP_LARGE,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Utils_File_Type"))).weight(0.12),
cell(fileTypeComboBox).weight(0.18),
flex(0.7)
).getComponent());
// 下面的pane,参数面板
//参数面板
ParameterTableModel model = new ParameterTableModel() {
@Override
public UITableEditAction[] createAction() {
@ -158,65 +151,75 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
};
editorPane = new UITableEditorPane<ParameterProvider>(model);
editorPane.setPreferredSize(new Dimension(355, 130));
centerPanel.add(editorPane, BorderLayout.SOUTH);
JPanel southPanel = new JPanel(new BorderLayout());
JPanel setPanel = new JPanel();
southPanel.add(setPanel, BorderLayout.CENTER);
setPanel.setPreferredSize(new Dimension(setPanelWidth, 460));
setPanel.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set")));
JPanel controlPane = textSetPanel(width, height);
setPanel.add(controlPane, BorderLayout.NORTH);
fileTypeComboBox.addActionListener(getFileTypeListener(setPanel, width, height));
this.add(northPanel, BorderLayout.NORTH);
this.add(centerPanel, BorderLayout.CENTER);
this.add(southPanel, BorderLayout.EAST);
editorPane.setBorder(new ScaledEmptyBorder(0,0,0,10));
editorPane.setPreferredSize(FineUIScale.scale(new Dimension(-1, 150)));
//左侧文件地址pane
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(column(
LayoutConstants.VERTICAL_GAP,
cell(getCenterPanel(localWidthRatio, urlWidthRatio)),
cell(editorPane)
).getComponent());
//右侧设定pane
JPanel rightPanel = new JPanel(new BorderLayout());
rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10));
rightPanel.add(getTextSetPanel());
fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel));
//文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局
this.add(column(LayoutConstants.VERTICAL_GAP,
cell(fileType),
row(20,
cell(wrapComponentWithTitle(leftPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File_Address"))).weight(0.5),
cell(wrapComponentWithTitle(rightPanel, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set"))).weight(0.5)
)
).getComponent());
}
private void addToCenterPanel(JPanel centerPanel) {
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File") + ":", true);
urlFileRadioButton = new UIRadioButton("URL:", false);
/**
* 文件地址上方的面板-文件选择
* @return
*/
private JPanel getCenterPanel(double localWidthRatio, double urlWidthRatio) {
// 本地文件/URL
localFileRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Local_File"), true);
urlFileRadioButton = new UIRadioButton("URL", false);
ButtonGroup bg = new ButtonGroup();
bg.add(localFileRadioButton);
bg.add(urlFileRadioButton);
localFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.addActionListener(radioActionListener);
urlFileRadioButton.setForeground(new Color(143, 142, 139));
localFileRadioButton.setForeground(Color.black);
localText = new UITextField();
localText.setPreferredSize(new Dimension(195, 20));
urlText = new UITextField();
urlText.setPreferredSize(new Dimension(195, 20));
urlText.setEditable(false);
// 选择按钮
chooseFile = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Selection"));
chooseFile.addActionListener(chooseFileListener);
// 测试连接按钮
testConnection = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
testConnection.setEnabled(false);
testConnection.addActionListener(testConnectionListener);// 测试连接按钮
JPanel textPanel = new JPanel(new GridLayout(2, 1, 15, 15));
JPanel textFieldPanel = new JPanel(new GridLayout(2, 1, 15, 15));
JPanel buttonPanel = new JPanel(new GridLayout(2, 1, 15, 15));
textPanel.add(localFileRadioButton);
textPanel.add(urlFileRadioButton);
textFieldPanel.add(localText);
textFieldPanel.add(urlText);
buttonPanel.add(chooseFile);
buttonPanel.add(testConnection);
filePath = FRGUIPaneFactory.createBorderLayout_S_Pane();
filePath.add(textPanel, BorderLayout.WEST);
filePath.add(textFieldPanel, BorderLayout.CENTER);
filePath.add(buttonPanel, BorderLayout.EAST);
centerPanel.add(filePath, BorderLayout.NORTH);
// 中间的pane,提示信息
testConnection.addActionListener(testConnectionListener);
// 提示信息
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + "txt" + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips = new UILabel(tipContent);
centerPanel.add(tips, BorderLayout.CENTER);
return column(
LayoutConstants.VERTICAL_GAP,
row(
LayoutConstants.HGAP_LARGE,
cell(localFileRadioButton).weight(0.25),
cell(localText).weight(localWidthRatio),
cell(chooseFile).weight(0.75 - localWidthRatio)
),
row(
LayoutConstants.HGAP_LARGE,
cell(urlFileRadioButton).weight(0.25),
cell(urlText).weight(urlWidthRatio),
cell(testConnection).weight(0.75 - urlWidthRatio)
),
cell(tips).weight(1)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,0,0,10))).getComponent();
}
private ActionListener testConnectionListener = new ActionListener() {
@ -249,7 +252,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
};
private void previewPanel(JPanel jPanel) {
private JPanel getPreviewPanel() {
JPanel previewPanel = new JPanel(new BorderLayout());
UIButton preview = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preview"));
preview.addActionListener(new ActionListener() {
@ -259,56 +262,33 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
});
previewPanel.add(preview, BorderLayout.EAST);
jPanel.add(previewPanel, BorderLayout.SOUTH);
return previewPanel;
}
private JPanel xmlSetPanel(int width, int height) {
/**
* XML设定Pane
* @return
*/
private JPanel getXmlSetPanel() {
// xml设置pane
JPanel controlPane = new JPanel();
JPanel northPane = new JPanel(new BorderLayout(8, 8));
JPanel northTopPane = new JPanel(new BorderLayout(8, 8));
JPanel southPane = new JPanel(new BorderLayout(8, 8));
JPanel southTopPane = new JPanel(new BorderLayout(8, 8));
controlPane.setLayout(new BorderLayout(8, 8));
controlPane.setPreferredSize(new Dimension(width, height));
JPanel comboboxPanel = new JPanel(new BorderLayout(8, 8));
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":");
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
encodingComboBox.setSelectedIndex(4);
encodingComboBox.setPreferredSize(new Dimension(90, 20));
JPanel treeContainerPane = new JPanel();
treeContainerPane.setLayout(new BorderLayout(8, 8));
nodeTreePane = new XMLNodeTreePane();
treeContainerPane.add(nodeTreePane, BorderLayout.CENTER);
comboboxPanel.add(encodeLabel, BorderLayout.WEST);
comboboxPanel.add(encodingComboBox, BorderLayout.CENTER);
northPane.add(comboboxPanel, BorderLayout.EAST);
northTopPane.add(northPane, BorderLayout.WEST);
southTopPane.add(southPane, BorderLayout.WEST);
southTopPane.add(treeContainerPane, BorderLayout.CENTER);
controlPane.add(northTopPane, BorderLayout.NORTH);
controlPane.add(southTopPane, BorderLayout.CENTER);
previewPanel(controlPane);
return controlPane;
return column(
LayoutConstants.VGAP_MEDIUM,
row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)),
cell(new XMLNodeTreePane()),
cell(getPreviewPanel())
).getComponent();
}
private JPanel excelSetPanel(int width, int height) {
// excel设置pane
int checkBoxWidth = width - EIGHT;
JPanel controlPane = new JPanel();
JPanel northPane = new JPanel(new BorderLayout(8, 8));
controlPane.setLayout(new BorderLayout());
controlPane.setPreferredSize(new Dimension(width, height));
/**
* Excel设定Pane
* @return
*/
private JPanel getExcelSetPanel() {
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false);
needColumnNameCheckBox.setPreferredSize(new Dimension(checkBoxWidth, 20));
northPane.add(needColumnNameCheckBox, BorderLayout.EAST);
controlPane.add(northPane, BorderLayout.NORTH);
previewPanel(controlPane);
return controlPane;
return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent();
}
private String getFilePathFromUrlOrLocal() {
@ -346,34 +326,31 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
// return (uri.matches("https*://.+|\\$\\{.+\\}.*"));
}
private JPanel textSetPanel(int width, int height) {
// text设置pane
JPanel controlPane = new JPanel();
controlPane.setLayout(new BorderLayout());
controlPane.setPreferredSize(new Dimension(width, height));
JPanel northPane = new JPanel(new BorderLayout(8, 8));
addToNorthPane(northPane);
controlPane.add(northPane, BorderLayout.WEST);
previewPanel(controlPane);
return controlPane;
/**
* TXT设定Pane
* @return
*/
private JPanel getTextSetPanel() {
initRatioButton();
//编码类型
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent();
}
private void addToNorthPane(JPanel northPane) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] columnSize = {f, p, p};
double[] rowSize = {B, B, B, B, B, B, B};
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true);
dismenberLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber") + ":");
/**
* 初始化Button
*/
private void initRatioButton(){
tableDismemberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"), false);
tableDismemberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Table_Dismember"));
spaceDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"), true);
spaceDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Space"));
commaDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"), false);
commaDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Comma_Dismenber"));
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other") + ":", false);
otherDismenberRadioButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"), false);
otherDismenberRadioButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Other"));
otherDismenberTextField = new UITextField(8);
otherDismenberTextField = new UITextField();
otherDismenberTextField.setEditable(false);
otherDismenberRadioButton.addChangeListener(new ChangeListener() {
@Override
@ -385,6 +362,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
}
}
});
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), true);
ButtonGroup bg2 = new ButtonGroup();
bg2.add(tableDismemberRadioButton);
bg2.add(spaceDismenberRadioButton);
@ -392,18 +370,38 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
bg2.add(otherDismenberRadioButton);
ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true);
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox);
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":");
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
Component[][] comps = {
{encodeLabel, charsetComboBox, null},
{needColumnNameCheckBox, null, null},
{dismenberLabel, tableDismemberRadioButton, null},
{null, spaceDismenberRadioButton, null},
{null, commaDismenberRadioButton, null},
{null, otherDismenberRadioButton, otherDismenberTextField},
{ignoreOneMoreDelimiterCheckBox, null, null}
};
northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize), BorderLayout.EAST);
}
/**
* 获取TXT中心Pane
* @return
*/
private JPanel getTxtCenterPane(){
//分隔符选项
JPanel separatorOptionsPanel = column(
LayoutConstants.VERTICAL_GAP,
cell(tableDismemberRadioButton),
cell(spaceDismenberRadioButton),
cell(commaDismenberRadioButton),
row(cell(otherDismenberRadioButton).weight(0.2), cell(otherDismenberTextField).weight(0.8))
).getComponent();
//TXT设定主要面板
return column(
LayoutConstants.VERTICAL_GAP,
row(10, cell(encodeLabel).weight(0.2), cell(charsetComboBox).weight(0.8)),
cell(needColumnNameCheckBox),
row(10,
cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Dismenber"))).weight(0.2),
cell(separatorOptionsPanel).weight(0.8)
),
cell(ignoreOneMoreDelimiterCheckBox)
).getComponent();
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText)))
.with(it-> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
private ActionListener radioActionListener = new ActionListener() {
@ -480,24 +478,24 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
return suffixToString;
}
private ActionListener getFileTypeListener(final JPanel setPanel, final int width, final int height) {
private ActionListener getFileTypeListener(final JPanel rightPanel) {
ActionListener fileTypeListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
setPanel.removeAll();
rightPanel.removeAll();
localText.setText("");
urlText.setText("");
if (fileTypeComboBox.getSelectedIndex() == XML) {
setPanel.add(xmlSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getXmlSetPanel());
} else if (fileTypeComboBox.getSelectedIndex() == EXCEL) {
setPanel.add(excelSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getExcelSetPanel());
} else {
setPanel.add(textSetPanel(width, height), BorderLayout.NORTH);
rightPanel.add(getTextSetPanel());
}
String tipContent = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Parameter") + "reportlets/excel/FineReport${abc}." + getFileSuffixToString() + "<br>"
+ "http://192.168.100.120:8080/XXServer/Report/excel${abc}.jsp<br>" + "&nbsp</body> </html> ";
tips.setText(tipContent);
setPanel.revalidate();
rightPanel.revalidate();
}
};
@ -507,7 +505,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private class RefreshAction extends UITableEditAction {
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override
@ -818,9 +816,10 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
JPanel toolbarPanel = new JPanel(new BorderLayout());
this.setLayout(new BorderLayout());
xmlNodeTree = new XMLNodeTree();
xmlNodeTree.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
this.add(new JScrollPane(xmlNodeTree));
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point") + ":");
keyPointLaber = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Key_Point"));
refreshAction = new RefreshParameterAction();
ToolBarDef toolbarDef = new ToolBarDef();
toolbarDef.addShortCut(refreshAction);
@ -840,7 +839,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
public RefreshParameterAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setMnemonic('r');
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override

9
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallHeightPane.java

@ -9,11 +9,10 @@ package com.fr.design.data.tabledata.tabledatapane;
*/
public class FileTableDataSmallHeightPane extends FileTableDataPane{
//wikky:文件数据集在模板数据集下面的界面参数。
private static final int SETPANELWIDTH = 265;
private static final int WIDTH = 245;
private static final int HEIGHT = 475;
private static final int GAP = 13;
private static final double LOCAL_WIDTH_RATIO = 0.58;
private static final double URL_WIDTH_RATIO = 0.51;
public FileTableDataSmallHeightPane(){
super(SETPANELWIDTH,WIDTH,HEIGHT,GAP);
super(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
}

9
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataSmallPane.java

@ -9,11 +9,10 @@ package com.fr.design.data.tabledata.tabledatapane;
*/
public class FileTableDataSmallPane extends FileTableDataPane{
//wikky:文件数据集在服务器数据集下面的界面参数。
private static final int SETPANELWIDTH = 265;
private static final int WIDTH = 245;
private static final int HEIGHT = 436;
private static final int GAP = 13;
private static final double LOCAL_WIDTH_RATIO = 0.59;
private static final double URL_WIDTH_RATIO = 0.52;
public FileTableDataSmallPane(){
super(SETPANELWIDTH,WIDTH,HEIGHT,GAP);
super(LOCAL_WIDTH_RATIO, URL_WIDTH_RATIO);
}
}

82
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MultiTDTableDataPane.java

@ -1,9 +1,13 @@
package com.fr.design.data.tabledata.tabledatapane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.*;
import com.fr.data.impl.ConditionTableData;
import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.UnionTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.data.tabledata.wrapper.TemplateTableDataWrapper;
@ -39,6 +43,10 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map.Entry;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData> {
private static final int MAX_LENTH_OF_DATASET = 130; //关联数据集面板最大显示的数据集长度,超出这个长度显示数据集名称+“...”
@ -52,28 +60,25 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
public MultiTDTableDataPane() {
this(StringUtils.EMPTY);
}
public MultiTDTableDataPane(String multiName) {
this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(10,10,10,10));
this.add(initNorthPane(multiName), BorderLayout.CENTER);
this.add(initSouthPanel(), BorderLayout.SOUTH);
}
private JPanel initNorthPane(String multiName) {
JPanel jpanel = new JPanel();
jpanel.setLayout(new BorderLayout());
JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
jpanel.setBorder(new ScaledEmptyBorder(0,0,10,0));
//选择要合并的数据集-预览
JPanel northPanel = new JPanel(new BorderLayout());
UILabel chooseTableData = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Select_To_Merge"));
UIButton previewButton = new UIButton();
previewButton.setIcon(BaseUtils.readIcon("/com/fr/web/images/preview.png"));
previewButton.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
UIButton previewButton = new UIButton(new LazyIcon("preview"));
previewButton.addActionListener(getPreviewActionListener());
northPanel.add(chooseTableData);
northPanel.add(previewButton);
northPanel.add(row(cell(chooseTableData), cell(previewButton)).getComponent());
centerPanel = new JPanel();
JScrollPane js = new JScrollPane(centerPanel);
@ -84,17 +89,19 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
jpanel.add(northPanel, BorderLayout.NORTH);
jpanel.add(js, BorderLayout.CENTER);
return jpanel;
}
private void initAllBarPane(String multiName) {
UILabel headLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Nam_Formula"));
setResMap();
int len = resMap.size();
// 10个正好不会出现滚动条
centerPanel.setLayout(new GridLayout(len < MIN_BAR_NUMBER ? MIN_BAR_NUMBER : len + 1, 1));
centerPanel.add(headLabel);
centerPanel.add(row(LayoutConstants.HORIZONTAL_GAP,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Name"))).weight(0.2),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Multi_Dataset_Conditions"))).weight(0.2),
flex(0.6)
).getComponent());
for (Entry<String, TableDataWrapper> stringTableDataWrapperEntry : resMap.entrySet()) {
TableDataWrapper tableDataWrappe = stringTableDataWrapperEntry.getValue();
@ -103,7 +110,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
centerPanel.add(new BarPanel(tmp, tableDataWrappe.getIcon()));
}
}
}
protected void setResMap() {
@ -131,14 +137,13 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}, StringUtils.BLANK + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tabledata_Default_Parameter"));
jpanel.add(editorPane, BorderLayout.CENTER);
return jpanel;
}
private class RefreshAction extends UITableEditAction {
public RefreshAction() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Refresh"));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/refresh.png"));
this.setSmallIcon(new LazyIcon("refresh"));
}
@Override
@ -249,9 +254,6 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
}
class BarPanel extends JPanel {
private static final int BAR_HEIGHT = 33;
private String name;
private Icon icon;
private UICheckBox chekbox;
@ -283,10 +285,7 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
private void initUI() {
String tmp = name;
this.setLayout(new FlowLayout(FlowLayout.LEFT));
JPanel leftPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
leftPanel.setPreferredSize(new Dimension(190, BAR_HEIGHT));
this.setLayout(new BorderLayout());
chekbox = new UICheckBox();
UILabel tabledataName = new UILabel(tmp);
while (tabledataName.getPreferredSize().width > MAX_LENTH_OF_DATASET) {
@ -299,25 +298,40 @@ public class MultiTDTableDataPane extends AbstractTableDataPane<MultiTDTableData
chekbox.addActionListener(tableDataCheckboxListener);
iconLabel.addMouseListener(chooseTableDataListener);
tabledataName.addMouseListener(chooseTableDataListener);
leftPanel.add(chekbox);
leftPanel.add(iconLabel);
leftPanel.add(tabledataName);
JPanel leftPanel = new JPanel(new BorderLayout());
leftPanel.add(row(LayoutConstants.HORIZONTAL_GAP, cell(chekbox), cell(iconLabel), cell(tabledataName)).getComponent());
JPanel rightPanel = new JPanel();
formulaContentTextField = new UITextField(BAR_HEIGHT);
formulaContentTextField = new UITextField();
formulaContentTextField.setEnabled(false);
formulaContentTextField.getDocument().addDocumentListener(documentListener);
formulaButton = new UIButton("...");
formulaButton.setEnabled(false);
formulaButton.setPreferredSize(new Dimension(25, 23));
formulaButton.setPreferredSize(FineUIScale.scale(new Dimension(24, 24)));
formulaButton.addActionListener(getFormulaActionListener());
rightPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + " ="));
rightPanel.add(formulaContentTextField);
rightPanel.add(formulaButton);
this.setPreferredSize(new Dimension(-1, BAR_HEIGHT));
this.add(leftPanel, BorderLayout.WEST);
this.add(rightPanel, BorderLayout.CENTER);
rightPanel.add(
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + "=")),
row(LayoutConstants.HGAP_LARGE, cell(formulaContentTextField), cell(formulaButton))
).getComponent()
);
JPanel linePanel = new JPanel(new BorderLayout());
linePanel.add(row(10,
row(10,
cell(chekbox),
cell(iconLabel),
cell(tabledataName)
).weight(0.2),
//条件公式
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Conditions_Formula") + "=")).weight(0.15),
row(5, cell(formulaContentTextField).weight(0.95), cell(formulaButton).weight(0.05)).weight(0.85)
).weight(0.77),
flex(0.03)
).getComponent());
linePanel.setBorder(new ScaledEmptyBorder(4, 0, 4, 0));
this.add(linePanel, BorderLayout.CENTER);
}
public void populate() {

24
designer-base/src/main/java/com/fr/design/dialog/AbstractTemplateServerSettingPane.java

@ -1,17 +1,21 @@
package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
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;
/**
* 封装了"为该模版单独设置、采用服务器设置"选项功能的设置面板
* Created by plough on 2018/11/7.
@ -36,16 +40,16 @@ public abstract class AbstractTemplateServerSettingPane extends BasicPane {
private void initComponents() {
chooseComboBox = new UIComboBox(CHOOSEITEM);
chooseComboBox.addItemListener(itemListener);
//以下设置,部分面板通用
UILabel belowSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Blow_Set"));
belowSetLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20));
buttonPane = GUICoreUtils.createFlowPane(new Component[] {
belowSetLabel, chooseComboBox}, FlowLayout.LEFT, 0, 0);
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 0));
buttonPane = row(
FineUIScale.scale(32),
cell(belowSetLabel),
cell(chooseComboBox)
).with(it -> it.setBorder(new ScaledEmptyBorder(0,10,0,0))).getComponent();
this.setLayout(new BorderLayout());
this.add(buttonPane, BorderLayout.NORTH);
this.contentPane = getContentPane();
this.add(contentPane, BorderLayout.CENTER);
this.add(column(cell(buttonPane), cell(contentPane)).getComponent());
}
/**

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

@ -1,6 +1,9 @@
package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.common.annotations.Open;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.DesignSizeI18nManager;
@ -17,6 +20,9 @@ import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Window;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
@Open
public abstract class BasicPane extends JPanel {
@ -299,16 +305,19 @@ public abstract class BasicPane extends JPanel {
private PropertyChangeAdapter changeListener;
public NamePane(BasicPane bPane) {
this.setLayout(new BorderLayout(4, 4));
nameTextField = new UITextField(30);
Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name") + ":");
JPanel northPane = new JPanel(new BorderLayout(4, 4));
northPane.add(Name, BorderLayout.WEST);
northPane.add(nameTextField, BorderLayout.CENTER);
northPane.add(showfield = new UILabel(" "), BorderLayout.EAST);
this.setLayout(new BorderLayout());
nameTextField = new UITextField();
Name = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Name"));
JPanel northPane = new JPanel(new BorderLayout());
northPane.setBorder(new ScaledEmptyBorder(0,10,0,10));
northPane.add(row(
LayoutConstants.HGAP_LARGE,
cell(Name).weight(0.12),
cell(nameTextField).weight(0.58),
cell(showfield = new UILabel(" ")).weight(0.3)
).getComponent());
showfield.setForeground(new Color(204, 0, 1));
showfield.setPreferredSize(new Dimension(220, showfield.getPreferredSize().height));
showfield.setPreferredSize(FineUIScale.scale(new Dimension(220, showfield.getPreferredSize().height)));
this.add(northPane, BorderLayout.NORTH);
this.centerPane = bPane;
this.add(bPane, BorderLayout.CENTER);

26
designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java

@ -1,12 +1,19 @@
package com.fr.design.foldablepane;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseAdapter;
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;
/**
* Created by MoMeak on 2017/7/5.
@ -31,18 +38,22 @@ public class UIExpandablePane extends JPanel {
this.headWidth = headWidth;
this.headHeight = headHeight;
this.contentPanel = contentPanel;
initComponents();
initComponents(false);
}
public UIExpandablePane(String title, JPanel contentPanel) {
this(title, contentPanel, false);
}
public UIExpandablePane(String title, JPanel contentPanel, boolean withUnderline) {
super();
this.title = title;
this.headHeight = headHeight;
this.contentPanel = contentPanel;
initComponents();
initComponents(withUnderline);
}
private void initComponents() {
private void initComponents(boolean withUnderline) {
this.setLayout(new BorderLayout());
headerPanel = new HeaderPane(title);
@ -50,6 +61,15 @@ public class UIExpandablePane extends JPanel {
setcontentPanelontentPanelBorder();
this.add(headerPanel, BorderLayout.NORTH);
this.add(contentPanel, BorderLayout.CENTER);
if (withUnderline) {
this.add(column(
cell(headerPanel), cell(contentPanel).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())))
.getComponent());
} else {
this.add(column(cell(headerPanel), cell(contentPanel)).getComponent());
}
setOpaque(false);
}

93
designer-base/src/main/java/com/fr/design/gui/frpane/EditingStringListPane.java

@ -1,27 +1,33 @@
package com.fr.design.gui.frpane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.JListUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.ListSelectionModel;
import javax.swing.JOptionPane;
import javax.swing.DefaultListCellRenderer;
import javax.swing.SwingUtilities;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@ -29,13 +35,17 @@ import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public abstract class EditingStringListPane extends BasicBeanPane<List<String>> {
private static final long serialVersionUID = 1L;
private DefaultListModel model;
private JList jlist;
private UIButton addButton;
private UIButton editButton;
private UIButton modifyButton;
private UIButton removeButton;
private UIButton moveUpButton;
private UIButton moveDownButton;
@ -43,6 +53,11 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
public EditingStringListPane() {
super();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
//按钮
JPanel buttonPane = initButtonPane();
buttonPane.setBorder(new ScaledEmptyBorder(0,0,10,0));
this.add(buttonPane, BorderLayout.NORTH);
//列表
model = new DefaultListModel();
jlist = new JList(model);
jlist.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
@ -56,34 +71,43 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
}
});
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"));
editButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"));
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"));
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"));
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"));
JPanel eastPane = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
eastPane.add(editButton);
eastPane.add(removeButton);
eastPane.add(moveUpButton);
eastPane.add(moveDownButton);
this.add(GUICoreUtils.createBorderPane(eastPane, BorderLayout.NORTH), BorderLayout.EAST);
JPanel centerPane = new JPanel(new BorderLayout(0, 5));
this.add(centerPane, BorderLayout.CENTER);
JPanel northcenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northcenterPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
northcenterPane.add(addButton, BorderLayout.EAST);
centerPane.add(northcenterPane, BorderLayout.NORTH);
centerPane.add(new JScrollPane(jlist), BorderLayout.CENTER);
jlist.setBackground(FlatUIUtils.getUIColor("fill.normal", Color.WHITE));
JScrollPane scrollPane = new JScrollPane(jlist);
scrollPane.setPreferredSize(FineUIScale.scale(new Dimension(620,350)));
scrollPane.setBorder(new FineRoundBorder());
this.add(scrollPane, BorderLayout.CENTER);
//统一加按钮事件
this.addListener();
this.addButton.setEnabled(false);
this.checkEnableState();
}
private JPanel initButtonPane() {
addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add"), new LazyIcon("add"));
addButton.setDisabledIcon(new LazyIcon("add").disabled());
modifyButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Modify"), new LazyIcon("edit"));
modifyButton.setDisabledIcon(new LazyIcon("edit").disabled());
removeButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Remove"), new LazyIcon("remove"));
removeButton.setDisabledIcon(new LazyIcon("remove").disabled());
moveUpButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Up"), new LazyIcon("move_up"));
moveUpButton.setDisabledIcon(new LazyIcon("move_up").disabled());
moveDownButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Move_Down"), new LazyIcon("move_down"));
moveDownButton.setDisabledIcon(new LazyIcon("move_down").disabled());
return row(LayoutConstants.HORIZONTAL_GAP,
flex(),
cell(addButton),
cell(modifyButton),
cell(removeButton),
cell(moveUpButton),
cell(moveDownButton)
).getComponent();
}
private void addListener() {
addListener1();
@ -119,7 +143,6 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void addListener1() {
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
String newvalue = getAddOrEditString();
@ -133,7 +156,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
}
}
});
editButton.addActionListener(new ActionListener() {
modifyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -152,9 +175,9 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
Object selected = jlist.getSelectedValue();
if (selected != null) {
int re = FineJOptionPane.showConfirmDialog(SwingUtilities.getWindowAncestor(EditingStringListPane.this),
Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete") + selected.toString() + "?",
Toolkit.i18nText("Fine-Design_Basic_Dialog_Prompt"),
JOptionPane.OK_CANCEL_OPTION);
Toolkit.i18nText("Fine-Design_Basic_Sure_To_Delete") + selected.toString() + "?",
Toolkit.i18nText("Fine-Design_Basic_Dialog_Prompt"),
JOptionPane.OK_CANCEL_OPTION);
if (re == JOptionPane.OK_OPTION) {
JListUtils.removeSelectedListItems(jlist);
}
@ -174,7 +197,7 @@ public abstract class EditingStringListPane extends BasicBeanPane<List<String>>
private void setEditEnabled(boolean enabled) {
this.removeButton.setEnabled(enabled);
this.editButton.setEnabled(enabled);
this.modifyButton.setEnabled(enabled);
this.moveUpButton.setEnabled(enabled);
this.moveDownButton.setEnabled(enabled);
}

14
designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java

@ -5,6 +5,7 @@ import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
@ -32,9 +33,9 @@ public class FineTabbedPane extends Column {
private JPanel centerPane;
private final float headRatio;
private final UIButtonGroup<String> tabGroup;
private final Map<String, Component> tabComponents;
private final Map<String, JComponent> tabComponents;
private FineTabbedPane(Map<String, Component> tabComponents, float headRatio, int[] tabLayout) {
private FineTabbedPane(Map<String, JComponent> tabComponents, float headRatio, int[] tabLayout) {
this.headRatio = headRatio;
this.tabComponents = tabComponents;
@ -60,7 +61,7 @@ public class FineTabbedPane extends Column {
public static class TabPaneBuilder {
private int[] tabLayout;
private float headRatio = 0.5f;
private final Map<String, Component> tabComponents = new LinkedHashMap<>();
private final Map<String, JComponent> tabComponents = new LinkedHashMap<>();
/**
* 设置头部居中比例0-1之间
@ -117,14 +118,17 @@ public class FineTabbedPane extends Column {
private void initLayout() {
cards = new CardLayout();
centerPane = new JPanel(cards);
tabComponents.forEach((key, value) -> centerPane.add(value, key));
tabComponents.forEach((key, value) -> {
value.setOpaque(false);
centerPane.add(value, key);
});
float flexRatio = (1 - headRatio) / 2;
add(
row(
flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)
),
fix(5),
cell(centerPane).with(it -> FineUIStyle.setStyle(it, FineUIStyle.LIGHT_GREY))
cell(centerPane).weight(1).with(it -> FineUIStyle.setStyle(it, FineUIStyle.LIGHT_GREY))
);
setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
}

7
designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java

@ -1,8 +1,7 @@
package com.fr.design.gui.frpane;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog;
@ -225,9 +224,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
}
protected void initAddButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setBorderType(UIButton.OTHER_BORDER);
addButton.setOtherBorder(UIConstants.BS, UIConstants.LINE_COLOR);
addButton = new UIButton(new LazyIcon("add"));
}
private void initAddButtonListener() {

4
designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java

@ -19,7 +19,7 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.table.TableCellEditor;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -212,7 +212,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
}
protected void initAddButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")) {
addButton = new UIButton(new LazyIcon("add")) {
public boolean shouldResponseChangeListener() {
return false;
}

1
designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxRenderer.java

@ -36,7 +36,6 @@ public class UIComboBoxRenderer extends DefaultListCellRenderer {
renderer.setForeground(list.getForeground());
renderer.setBackground(list.getBackground());
}
renderer.setText(" " + renderer.getText());
return renderer;
}
}

5
designer-base/src/main/java/com/fr/design/gui/ilable/FRExplainLabel.java

@ -1,10 +1,9 @@
package com.fr.design.gui.ilable;
import java.awt.Color;
import com.fine.theme.utils.FineUIStyle;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import com.fr.design.gui.ilable.UILabel;
public class FRExplainLabel extends UILabel {
@ -19,6 +18,6 @@ public class FRExplainLabel extends UILabel {
private void init(){
setIcon(icon);
setForeground(new Color(255, 0, 0));
FineUIStyle.setStyle(this, FineUIStyle.LABEL_WARNING_TIP);
}
}

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

@ -1,7 +1,10 @@
package com.fr.design.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils;
import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.base.TextFormat;
import com.fr.data.core.FormatField;
@ -10,7 +13,6 @@ import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver;
@ -18,26 +20,19 @@ import com.fr.design.gui.icombobox.TextFontComboBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.math.RoundingMode;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.Border;
import javax.swing.border.TitledBorder;
import java.awt.event.ItemEvent;
@ -53,13 +48,7 @@ import java.text.SimpleDateFormat;
*/
public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final long serialVersionUID = 724330854437726751L;
private static final int LABEL_X = 4;
private static final int LABEL_Y = 18;
private static final int LABEL_DELTA_WIDTH = 8;
private static final int LABEL_HEIGHT = 15; //标签背景的范围
private static final int CURRENCY_FLAG_POINT = 6;
private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0, 30, 0, 0);
private static final Integer[] TYPES = new Integer[]{
FormatContents.NULL, FormatContents.NUMBER,
@ -85,6 +74,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
private boolean isRightFormat;
private boolean isDate = false;
private GlobalNameListener globalNameListener = null;
private JPanel self = this;
/**
* Constructor.
@ -98,14 +88,10 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
}
protected void initComponents(Integer[] types) {
this.setLayout(new BorderLayout(0, 4));
this.setLayout(new BorderLayout());
initSampleLabel();
contentPane = new JPanel(new BorderLayout(0, 4)) {
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 65);
}
};
contentPane = new JPanel();
contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
typeComboBox = new UIComboBox(types);
UIComboBoxRenderer render = createComBoxRender();
typeComboBox.setRenderer(render);
@ -113,7 +99,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
typeComboBox.setGlobalName("typeComboBox");
contentPane.add(sampleLabel, BorderLayout.NORTH);
txtCenterPane = new JPanel(new BorderLayout());
txtCenterPane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
textField = new TextFontComboBox();
textField.addItemListener(textFieldItemListener);
textField.setEditable(true);
@ -122,58 +108,38 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
contentPane.add(txtCenterPane, BorderLayout.CENTER);
centerPane = new JPanel(new CardLayout());
centerPane.add(new JPanel(), "hide");
centerPane.setPreferredSize(new Dimension(0, 0));
centerPane.add(contentPane, "show");
centerPane = new JPanel(new BorderLayout());
centerPane.add(contentPane);
frFontPane = new FRFontPane();
UILabel font = new UILabel(Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT);
JPanel fontPane = new JPanel(new BorderLayout());
fontPane.add(font, BorderLayout.NORTH);
typeComboBox.setPreferredSize(new Dimension(155,20));
JPanel typePane = new JPanel(new BorderLayout());
typePane.add(typeComboBox, BorderLayout.CENTER);
typePane.setBorder(LEFT_BORDER);
// centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER);
JPanel option = new JPanel(new BorderLayout());
option.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Option"), SwingConstants.LEFT), BorderLayout.WEST);
roundingBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Base_Option_Half_Up"));
roundingBox.setBorder(BorderFactory.createEmptyBorder(0, 40, 0, 0));
roundingBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
}
});
roundingBox.setGlobalName("roundingBox");
option.add(roundingBox, BorderLayout.CENTER);
optionPane = new JPanel(new CardLayout());
optionPane.add(new JPanel(), "hide");
optionPane.setPreferredSize(new Dimension(0, 0));
optionPane.add(option, "show");
optionPane = new JPanel(new BorderLayout());
optionPane.add(option);
Component[][] components = getComponent(fontPane, centerPane, typePane);
this.add(createContentPane(components), BorderLayout.CENTER);
}
protected JPanel createContentPane (Component[][] components) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_MEDIUM);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Format")), typePane},
new Component[]{centerPane, null},
new Component[]{optionPane, null},
new Component[]{fontPane, frFontPane},
@ -194,41 +160,17 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
}
private void initSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, UIConstants.LINE_COLOR);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) {
@Override
public void paint(Graphics g) {
super.paint(g);
int width = getWidth();
Color original = g.getColor();
g.setColor(getBackground());
g.fillRect(LABEL_X, LABEL_Y, width - LABEL_DELTA_WIDTH, LABEL_HEIGHT);
g.setColor(UIConstants.LINE_COLOR);
FontMetrics cellFM = g.getFontMetrics();
int textWidth = cellFM.stringWidth(getText());
GraphHelper.drawString(g, getText(), (width - textWidth) / 2, 26);
g.setColor(original);
}
};
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, labelColor);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue());
sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(border);
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
}
@Override
/**
* 得到合适的大小
*/
public Dimension getPreferredSize() {
if (this.typeComboBox.getSelectedIndex() == FormatContents.NULL) {
return typeComboBox.getPreferredSize();
}
return super.getPreferredSize();
}
/**
* 弹出框标题
*
@ -340,7 +282,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
*/
private void refreshPreviewLabel() {
this.sampleLabel.setText(FormatField.getInstance().getFormatValue());
this.sampleLabel.setForeground(UIManager.getColor("Label.foreground"));
FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
try {
isRightFormat = true;
if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) {
@ -369,38 +311,30 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
if (e.getStateChange() == ItemEvent.SELECTED) {
int contents = getFormatContents();
String[] items = FormatField.getInstance().getFormatArray(contents, false);
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (isTextOrNull()) {
centerPane.setPreferredSize(new Dimension(0, 0));
cardLayout.show(centerPane, "hide");
centerPane.setVisible(false);
} else {
textField.removeAllItems();
textField.setItemArray(items);
textField.setSelectedIndex(0);
centerPane.setPreferredSize(new Dimension(270, 65));
cardLayout.show(centerPane, "show");
centerPane.setVisible(true);
}
CardLayout optionLayout = ((CardLayout) optionPane.getLayout());
if (getFormatContents() == FormatContents.PERCENT) {
optionPane.setPreferredSize(new Dimension(100, 20));
optionLayout.show(optionPane, "show");
optionPane.setVisible(true);
} else {
optionPane.setPreferredSize(new Dimension(0, 0));
optionLayout.show(optionPane, "hide");
optionPane.setVisible(false);
roundingBox.setSelected(false);
}
self.repaint();
}
}
};
ItemListener textFieldItemListener = new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
refreshPreviewLabel();
}
ItemListener textFieldItemListener = e -> {
if (e.getStateChange() == ItemEvent.SELECTED) {
refreshPreviewLabel();
}
};

42
designer-base/src/main/java/com/fr/design/parameter/ParameterPane.java

@ -1,18 +1,21 @@
package com.fr.design.parameter;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Parameter;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
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;
public class ParameterPane extends BasicBeanPane<Parameter> {
@ -34,27 +37,24 @@ public class ParameterPane extends BasicBeanPane<Parameter> {
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setLayout(new BorderLayout());
//名字
nameTextField = new UITextField(10);
nameTextField.setEditable(false);
JPanel textFieldPanel=FRGUIPaneFactory.createBorderLayout_S_Pane();
textFieldPanel.add(nameTextField,BorderLayout.CENTER);
//默认值
valueEditor = ValueEditorPaneFactory.createBasicValueEditorPane();
// richer:要排列显示的控件
Component[][] components = {{null},
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":"),textFieldPanel },
{ null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":"),valueEditor }
};
double p =TableLayout.PREFERRED;
double f =TableLayout.FILL;
double[] rowSize = {p, p, p, p};
double[] columnSize = {p, p, f, p, p};
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(
components, rowSize, columnSize, 20, 10);
JPanel centerPane = column(LayoutConstants.VERTICAL_GAP,
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Name") + ":")).weight(0.1),
cell(nameTextField).weight(0.8),
flex(0.1)),
row(20,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Default_Value") + ":")).weight(0.1),
cell(valueEditor).weight(0.8),
flex(0.1))
).getComponent();
centerPane.setBorder(new ScaledEmptyBorder(0, 20, 0, 0));
this.add(centerPane, BorderLayout.CENTER);
}

170
designer-base/src/main/java/com/fr/design/report/WatermarkPane.java

@ -1,46 +1,52 @@
package com.fr.design.report;
import com.fine.theme.light.ui.FineRoundBorder;
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.BaseFormula;
import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.editor.editor.FormulaEditor;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.UnsignedIntUISpinner;
import com.fr.design.gui.style.FRFontPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.NewColorSelectPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.SwingConstants;
import javax.swing.JComponent;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusEvent;
import java.awt.event.FocusListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.FocusAdapter;
import java.awt.Dialog;
import java.awt.FlowLayout;
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;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
/**
@ -57,7 +63,7 @@ public class WatermarkPane extends BasicPane {
private UIComboBox fontSizeComboBox;
//横向间距
private UISpinner horizontalGapSpinner;
//向间距
//向间距
private UISpinner verticalGapSpinner;
// 文字颜色
private NewColorSelectPane colorPane;
@ -69,7 +75,7 @@ public class WatermarkPane extends BasicPane {
//纵向间距最小值
public static final int VERTICAL_GAP_MIX = 50;
private static final Dimension SPINNER_DIMENSION = new Dimension(75, 20);
private JPanel leftPane;
public WatermarkPane() {
initComponents();
@ -77,26 +83,45 @@ public class WatermarkPane extends BasicPane {
private void initComponents() {
message = new UILabel();
this.setBorder(BorderFactory.createEmptyBorder(4, 4, -5, 4));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.add(contentPane, BorderLayout.CENTER);
// 预览
JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(leftPane, BorderLayout.CENTER);
leftPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"), null));
//左侧预览面板
JPanel previewPaneWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane();
leftPane.add(previewPaneWrapper, BorderLayout.CENTER);
previewPaneWrapper.setBorder(BorderFactory.createEmptyBorder(2, 8, 4, 8));
//预览外边框,宽度跟随全局权重
previewPaneWrapper.setBorder(new FineRoundBorder());
previewPaneWrapper.setPreferredSize(FineUIScale.scale(new Dimension(-1,415)));
previewPaneWrapper.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
watermarkPreviewPane = new WatermarkPreviewPane();
watermarkPreviewPane.setOpaque(false);
previewPaneWrapper.add(watermarkPreviewPane, BorderLayout.CENTER);
// 设置
JPanel rightPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
contentPane.add(rightPane, BorderLayout.EAST);
rightPane.add(initRightPane(), BorderLayout.NORTH);
leftPane = column(
LayoutConstants.VGAP_SMALL,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Style_Preview"))),
cell(previewPaneWrapper)
).getComponent();
// 分割线
JPanel separatorLine = new JPanel();
separatorLine.setBorder(FineBorderFactory.createDefaultUnderlineBorder());
//在预览与配置外创建一个大的外边框并设置边距
JPanel innerPanel = row(
LayoutConstants.HORIZONTAL_GAP,
cell(leftPane).weight(0.55),
cell(wrapComponentWithTitle(getRightPane(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"))).weight(0.45)
).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent();
JPanel outerPanel = new JPanel(new BorderLayout());
outerPanel.setBorder(new FineRoundBorder());
outerPanel.setBackground(FineUIUtils.getUIColor("fill.gray", "defaultBorderColor"));
outerPanel.add(innerPanel);
// 分割线下方,左侧预览,右侧配置
JPanel centerPanel = column(LayoutConstants.VERTICAL_GAP,
cell(separatorLine),
cell(outerPanel)
).getComponent();
centerPanel.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.add(centerPanel, BorderLayout.CENTER);
}
public void populate(WatermarkAttr watermark) {
@ -129,60 +154,59 @@ public class WatermarkPane extends BasicPane {
this.formulaPane = formulaPane;
}
protected UIScrollPane initRightPane() {
/**
* 配置Pane
* @return
*/
protected JPanel getRightPane() {
// 文字
formulaPane = new FormulaEditor(Toolkit.i18nText("Fine-Design_Report_Parameter_Formula"));
// 字号
fontSizeComboBox = new UIComboBox(FRFontPane.FONT_SIZES);
fontSizeComboBox.setEditable(true);
//水印间距
horizontalGapSpinner = new UnsignedIntUISpinner(100, Integer.MAX_VALUE, 1, 200);
verticalGapSpinner = new UnsignedIntUISpinner(50, Integer.MAX_VALUE, 1, 100);
horizontalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
verticalGapSpinner.setPreferredSize(SPINNER_DIMENSION);
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
//失去焦点时要判断是否要弹出提示
horizontalGapSpinner.getTextField().addFocusListener(
createFocusListener4GapNumberField(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning")));
verticalGapSpinner.getTextField().addFocusListener(createFocusListener4GapNumberField(verticalGapSpinner, VERTICAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Vertical_Gap_Over_Warning")));
//next 按钮 释放时也要判断是否要弹出提示
horizontalGapSpinner.getNextButton().addMouseListener(createMouseListener4GapNextButton(horizontalGapSpinner, HORIZONTAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Horizontal_Gap_Over_Warning")));
verticalGapSpinner.getNextButton().addMouseListener(createMouseListener4GapNextButton(verticalGapSpinner, VERTICAL_GAP_MIX, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Vertical_Gap_Over_Warning")));
JPanel fontSizeTypePane = new JPanel(new BorderLayout(10, 0));
fontSizeTypePane.add(fontSizeComboBox, BorderLayout.CENTER);
//水印间距面板
JPanel watermarkGapPane = new JPanel(new BorderLayout(10, 0));
JPanel jp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0);
jp.add(horizontalGapSpinner);
jp.add(verticalGapSpinner);
watermarkGapPane.add(jp, BorderLayout.CENTER);
JPanel watermarkGapTipsPane = new JPanel(new BorderLayout());
JPanel tipsJp = FRGUIPaneFactory.createNColumnGridInnerContainer_Pane(2, 10, 0);
tipsJp.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), SwingConstants.CENTER));
tipsJp.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), SwingConstants.CENTER));
watermarkGapTipsPane.add(tipsJp, BorderLayout.CENTER);
//水印间距提示居中布局
JPanel watermarkGapTipsPane = row(LayoutConstants.HGAP_LARGE,
flex(0.15),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"))).weight(0.2),
flex(0.3),
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"))).weight(0.2),
flex(0.15)
).getComponent();
//水印间距排列
JPanel watermarkGapPane = column(
row(LayoutConstants.HGAP_LARGE,
cell(horizontalGapSpinner).weight(0.5),
cell(verticalGapSpinner).weight(0.5)
),
cell(watermarkGapTipsPane)
).getComponent();
// 颜色选择器
colorPane = new NewColorSelectPane(false);
JPanel colorLabelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
colorLabelPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text_Color")), BorderLayout.NORTH);
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, MAX_WIDTH};
JPanel rightContentPane = TableLayoutHelper.createCommonTableLayoutPane(new JComponent[][]{
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Watermark_Text")), formulaPane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Size")), fontSizeTypePane},
{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Watermark_Gap")), watermarkGapPane},
{null, watermarkGapTipsPane},
{colorLabelPane, colorPane},
}, rowSize, columnSize, 10);
rightContentPane.setBorder(BorderFactory.createEmptyBorder(15, 12, 10, 12));
UIScrollPane configPane = new UIScrollPane(rightContentPane);
configPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Config"), null));
return configPane;
// 配置面板排列布局
JPanel rightContentPane = column(LayoutConstants.VERTICAL_GAP,
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Watermark_Text"))).weight(0.3), cell(formulaPane).weight(0.7)),
row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Font_Size"))).weight(0.3), cell(fontSizeComboBox).weight(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Watermark_Gap"))).weight(0.3), cell(watermarkGapPane).weight(0.7)),
row(cell(getTopAlignLabelPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Text_Color"))).weight(0.3), cell(colorPane).weight(0.7))
).getComponent();
rightContentPane.setOpaque(false);
return rightContentPane;
}
private JPanel getTopAlignLabelPane(String labelText) {
return column(LayoutConstants.VERTICAL_GAP, cell(new UILabel(labelText))).
with(it -> it.setBorder(new ScaledEmptyBorder(2,0,0,0))).getComponent();
}
protected void populateFontSize(int fontSize) {

2
designer-base/src/main/java/com/fr/design/report/WatermarkSettingPane.java

@ -20,7 +20,7 @@ public class WatermarkSettingPane extends AbstractTemplateServerSettingPane {
}
private void initComponents() {
buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
//buttonPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 0, 0));
}
@Override

47
designer-base/src/main/java/com/fr/design/report/fit/BaseFitAttrPane.java

@ -1,12 +1,12 @@
package com.fr.design.report.fit;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.provider.FitAttrModelProvider;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.*;
@ -17,6 +17,8 @@ import java.util.Comparator;
import java.util.Set;
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;
public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
@ -26,26 +28,23 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected UIComboBox itemChoose;
protected java.util.List<FitAttrModel> fitAttrModelList = new ArrayList<>();
private ReportFitConfigPane fitConfigPane;
public FitAttrModel fitAttrModel;
private static final int BELOW_SET_COMPONENT_HSPACE = 8;
protected BaseFitAttrPane() {
initFitAttrModel();
}
private void initFitAttrModel() {
//旧决策报表
fitAttrModelList.add(new FrmFitAttrModel());
//普通报表
fitAttrModelList.add(new CptFitAttrModel());
//决策报表
fitAttrModelList.add(new AdaptiveFrmFitAttrModel());
Set<FitAttrModelProvider> fitAttrModelProviders = ExtraDesignClassManager.getInstance().getArray(FitAttrModelProvider.XML_TAG);
for (FitAttrModelProvider fitAttrModelProvider : fitAttrModelProviders) {
fitAttrModelList.add(fitAttrModelProvider);
}
fitAttrModelList = fitAttrModelList.stream().sorted(Comparator.comparing(FitAttrModel::getPriority).reversed()).collect(Collectors.toList());
}
@ -55,6 +54,7 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
contentJPanel.remove(fitConfigPane);
}
this.fitConfigPane = fitAttrModel instanceof CptFitAttrModel ? new ReportFitConfigPane(fitAttrModel, true) : new FormFitConfigPane(fitAttrModel, true);
//添加自适应面板
contentJPanel.add(fitConfigPane);
}
@ -82,34 +82,33 @@ public abstract class BaseFitAttrPane extends BasicBeanPane<ReportFitAttr> {
protected abstract String[] getItemNames();
protected void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
this.add(contentJPanel);
//添加以下设置
initItemChoose();
//服务器配置-PC端自适应属性面板中需要添加提示
initPrompt();
this.setLayout(new BorderLayout());
this.add(contentJPanel);
}
/**
* 以下设置Pane
*/
private void initItemChoose() {
JPanel chooseJPanel = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
ItemListener itemListener = getItemListener();
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
itemChoose = new UIComboBox(getItemNames());
ItemListener itemListener = getItemListener();
itemChoose.addItemListener(itemListener);
belowSetLabel = new UILabel(i18nText("Fine-Design_Report_Blow_Set"));
JPanel hSpaceLabel = new JPanel();
hSpaceLabel.setSize(BELOW_SET_COMPONENT_HSPACE, 0);
JPanel buttonPane = GUICoreUtils.createFlowPane(new Component[]{
belowSetLabel, hSpaceLabel, itemChoose}, FlowLayout.LEFT);
chooseJPanel.add(buttonPane);
chooseJPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
contentJPanel.add(chooseJPanel);
//以下设置横向布局
JPanel buttonPane = row(20, cell(belowSetLabel), cell(itemChoose)).getComponent();
buttonPane.setBorder(new ScaledEmptyBorder(0,5,5,0));
//整体面板添加‘以下设置Pane’
contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
contentJPanel.setBorder(new ScaledEmptyBorder(5,10,5,10));
contentJPanel.add(buttonPane);
}
protected abstract ItemListener getItemListener();
public void populate(ReportFitAttr reportFitAttr) {
}

25
designer-base/src/main/java/com/fr/design/report/fit/FormFitConfigPane.java

@ -1,11 +1,12 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.svg.SVGLoader;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.report.fit.menupane.FitRadioGroup;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
@ -23,13 +24,16 @@ import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
public class FormFitConfigPane extends ReportFitConfigPane {
private static final int ICON_OFFSET_X = 25;
private static final int ICON_OFFSET_Y = 3;
private static final int ICON_SIZE = 16;
//待调整
private static final Image HOVER_IMAGE = SVGLoader.load("/com/fr/design/icon/icon_ec_default_fit.svg");
private static final int DEFAULT_ITEM = 0;
private static final int CUSTOM_ITEM = 1;
public FormFitConfigPane(FitAttrModel fitAttrModel) {
@ -41,12 +45,11 @@ public class FormFitConfigPane extends ReportFitConfigPane {
}
protected JPanel initECConfigPane() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel jPanel = new JPanel(new BorderLayout());
if (fitAttrModel.getFitTypeNames().length != 0) {
Component[] ecComponents = new Component[fitAttrModel.getFitTypeNames().length + 1];
initRadioGroup(ecConfigRadioGroup, fitAttrModel.getFitName(), fitAttrModel.getFitTypeNames(), ecComponents);
jPanel.add(createSubAttrPane(ecComponents), BorderLayout.CENTER);
jPanel.add(createTipPane(), BorderLayout.SOUTH);
jPanel.add(column(10, cell(createSubAttrPane(ecComponents)), cell(createTipPane())).getComponent());
}
return jPanel;
}
@ -79,7 +82,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
UIPopupMenu uiPopupMenu = new UIPopupMenu() {
@Override
protected void paintBorder(Graphics g) {
}
};
uiPopupMenu.setLayout(new BorderLayout(0, 0));
@ -107,7 +109,6 @@ public class FormFitConfigPane extends ReportFitConfigPane {
} else {
hidePreviewPane();
}
}
});
}
@ -138,13 +139,12 @@ public class FormFitConfigPane extends ReportFitConfigPane {
}
private JPanel createTipPane() {
JPanel jPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true);
JPanel jPanel = new JPanel(new BorderLayout());
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip1"));
jPanel.add(label1);
label1.setForeground(Color.lightGray);
FineUIStyle.setStyle(label1, FineUIStyle.LABEL_TIP);
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Form_PC_FIT_Config_Tip2"));
jPanel.add(label2);
label2.setForeground(Color.lightGray);
FineUIStyle.setStyle(label2, FineUIStyle.LABEL_TIP);
jPanel.add(column(LayoutConstants.HORIZONTAL_GAP, cell(label1), cell(label2)).getComponent());
return jPanel;
}
@ -159,5 +159,4 @@ public class FormFitConfigPane extends ReportFitConfigPane {
protected void updateECConfigRadioGroup(ReportFitAttr reportFitAttr) {
reportFitAttr.setFitStateInPC(ecConfigRadioGroup.getSelectRadioIndex());
}
}

3
designer-base/src/main/java/com/fr/design/report/fit/NewFitPreviewPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper;
import com.fr.general.FRFont;
@ -17,7 +18,7 @@ public class NewFitPreviewPane extends JPanel {
private static final Color DEFAULT_PAINT_COLOR = Color.decode("#419BF9");
private static final int FIT_FONT_SIZE = 15;
private static final int NO_FIT_FONT_SIZE = 10;
private static final Dimension NO_FIT_CONTAINER_DIMENSION = new Dimension(230, 80);
private static final Dimension NO_FIT_CONTAINER_DIMENSION = FineUIScale.scale(new Dimension(230, 80));
public NewFitPreviewPane(){

51
designer-base/src/main/java/com/fr/design/report/fit/ReportFitConfigPane.java

@ -1,5 +1,6 @@
package com.fr.design.report.fit;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
@ -10,15 +11,16 @@ import com.fr.design.report.fit.menupane.FontRadioGroup;
import com.fr.general.ComparatorUtils;
import com.fr.report.fit.ReportFitAttr;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.i18n.Toolkit.i18nText;
public class ReportFitConfigPane extends JPanel {
@ -36,21 +38,24 @@ public class ReportFitConfigPane extends JPanel {
}
private void initComponent() {
JPanel contentJPanel = FRGUIPaneFactory.createVerticalFlowLayout_Pane(false, FlowLayout.LEFT, 0, 0);
this.add(contentJPanel);
fontRadioGroup = new FontRadioGroup();
ecConfigRadioGroup = new FitRadioGroup();
contentJPanel.add(initAttrJPanel());
contentJPanel.add(initPreviewJPanel());
this.add(initContentPanel());
}
private JPanel initAttrJPanel() {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
private JPanel initContentPanel() {
//字体
Component[] fontComponents = new Component[3];
initRadioGroup(fontRadioGroup, i18nText("Fine-Designer_Fit-Font"), new String[]{i18nText("Fine-Designer_Fit"), i18nText("Fine-Designer_Fit-No")}, fontComponents);
jPanel.add(createSubAttrPane(fontComponents), BorderLayout.NORTH);
jPanel.add(initECConfigPane(), BorderLayout.CENTER);
return jPanel;
//预览区域
previewJPanel = new NewFitPreviewPane();
previewJPanel.setPreferredSize(FineUIScale.scale(new Dimension(300, 204)));
//面板布局 字体-(null/报表块/表格)-预览区域
return column(10,
cell(createSubAttrPane(fontComponents)),
cell(initECConfigPane()),
cell(previewJPanel)
).getComponent();
}
protected JPanel initECConfigPane() {
@ -61,21 +66,14 @@ public class ReportFitConfigPane extends JPanel {
return jPanel;
}
protected JPanel createSubAttrPane(Component[] components) {
double[] rowSize = new double[]{20};
double[] columnSize = new double[components.length];
for (int i = 0; i < columnSize.length; i++) {
if (i == 0) {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth();
} else {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth();
}
for (int i = 1; i < columnSize.length; i++) {
columnSize[i] = DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.column").getWidth();
}
JPanel attrJPanel = TableLayoutHelper.createTableLayoutPane(new Component[][]{components}, rowSize, columnSize);
attrJPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
return attrJPanel;
return row(cell(components[0]).weight(0.16),cell(attrJPanel).weight(0.84)).getComponent();
}
protected void initRadioGroup(FitRadioGroup fitRadioGroup, String name, String[] options, Component[] components) {
@ -110,17 +108,6 @@ public class ReportFitConfigPane extends JPanel {
previewJPanel.refreshPreview(fontRadioGroup.isFontFit(), FitType.parse(updateBean()));
}
private JPanel initPreviewJPanel() {
JPanel wrapperPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
previewJPanel = new NewFitPreviewPane();
wrapperPane.add(previewJPanel, BorderLayout.CENTER);
int leftIndent = globalConfig ? (int) DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.report.fit.firstColumn").getWidth() : 0;
wrapperPane.setBorder(BorderFactory.createEmptyBorder(0, leftIndent, 0, 0));
wrapperPane.setPreferredSize(new Dimension(300 + leftIndent, 204));
return wrapperPane;
}
public void populateBean(ReportFitAttr ob) {
fontRadioGroup.selectIndexButton(ob.isFitFont() ? 0 : 1);
populateECConfigRadioGroup(ob.fitStateInPC());

11
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -16,6 +16,7 @@ import com.fr.data.util.function.SumFunction;
import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.DefaultValueAdjustProvider;
import com.fr.design.gui.ibutton.UIButton;
@ -90,6 +91,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
// Noninstantiable utility class
public final class GUICoreUtils {
@ -992,12 +996,7 @@ public final class GUICoreUtils {
dynamicPane.setVisible(e.getStateChange() == visibleState);
}
});
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(checkBox, BorderLayout.NORTH);
JPanel dynamicPaneWrapper = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
dynamicPaneWrapper.add(dynamicPane);
panel.add(dynamicPaneWrapper, BorderLayout.CENTER);
return panel;
return column(LayoutConstants.VERTICAL_GAP, cell(checkBox), cell(dynamicPane)).getComponent();
}
/**

42
designer-base/src/main/java/com/fr/design/widget/IconDefinePane.java

@ -1,40 +1,38 @@
package com.fr.design.widget;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.web.CustomIconPane;
import com.fr.form.ui.WidgetInfoConfig;
import javax.swing.*;
import java.awt.*;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.ImageIcon;
import java.awt.Image;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class IconDefinePane extends BasicPane {
private UILabel showIconImageLable;
private UIButton editIconButton;
private UIButton removeIconButton;
private String curIconName;
private Icon curIcon;
public IconDefinePane() {
JPanel iconPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel labelPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPane.setLayout(new /**/ FlowLayout(FlowLayout.LEFT, 20, 0));
showIconImageLable = new UILabel();
showIconImageLable.setPreferredSize(new Dimension(20, 20));
editIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
JPanel iconButtonPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelPane.add(showIconImageLable);
iconPane.add(labelPane, BorderLayout.WEST);
iconPane.add(iconButtonPane, BorderLayout.EAST);
iconButtonPane.add(editIconButton);
editIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -54,7 +52,6 @@ public class IconDefinePane extends BasicPane {
});
removeIconButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Delete"));
iconButtonPane.add(removeIconButton);
removeIconButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
curIconName = null;
@ -62,9 +59,10 @@ public class IconDefinePane extends BasicPane {
}
});
this.add(this.showIconImageLable);
this.add(this.editIconButton);
this.add(this.removeIconButton);
JPanel iconButtonPane = row(LayoutConstants.HORIZONTAL_GAP, cell(this.showIconImageLable), cell(this.editIconButton), cell(this.removeIconButton)).getComponent();
iconButtonPane.setBorder(new ScaledEmptyBorder(0,0,0,0));
this.setLayout(new BorderLayout());
this.add(iconButtonPane, BorderLayout.CENTER);
}
@Override
@ -86,6 +84,16 @@ public class IconDefinePane extends BasicPane {
setShowIconImage();
}
/**
* 直接更新icon
* @param iconName
* @param icon
*/
public void populateIcon(String iconName, Icon icon) {
this.curIconName = iconName;
showIconImageLable.setIcon(icon);
}
public String update() {
return this.curIconName;
}

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash.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="M9 4V6H3C2.44772 6 2 6.44772 2 7C2 7.55228 2.44771 8 3 8H5V28C5 29.1046 5.89543 30 7 30H25C26.1046 30 27 29.1046 27 28V8H29C29.5523 8 30 7.55228 30 7C30 6.44772 29.5523 6 29 6H23V4C23 2.89543 22.1046 2 21 2H11C9.89543 2 9 2.89543 9 4ZM21 4H11V6H21V4ZM7 28L7 8H25V28H7ZM10.707 12.7071C11.0975 12.3166 11.7306 12.3166 12.1212 12.7071L16.0862 16.6721L20.0512 12.7071C20.4417 12.3166 21.0749 12.3166 21.4654 12.7071C21.8559 13.0976 21.8559 13.7308 21.4654 14.1213L17.5004 18.0863L21.4034 21.9893C21.7939 22.3798 21.7939 23.013 21.4034 23.4035C21.0129 23.7941 20.3797 23.7941 19.9892 23.4035L16.0862 19.5005L12.1213 23.4654C11.7308 23.8559 11.0976 23.8559 10.7071 23.4654C10.3166 23.0749 10.3166 22.4417 10.7071 22.0512L14.672 18.0863L10.707 14.1213C10.3164 13.7308 10.3164 13.0976 10.707 12.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 982 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/clearStash_disable.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="M9 4V6H3C2.44772 6 2 6.44772 2 7C2 7.55228 2.44771 8 3 8H5V28C5 29.1046 5.89543 30 7 30H25C26.1046 30 27 29.1046 27 28V8H29C29.5523 8 30 7.55228 30 7C30 6.44772 29.5523 6 29 6H23V4C23 2.89543 22.1046 2 21 2H11C9.89543 2 9 2.89543 9 4ZM21 4H11V6H21V4ZM7 28L7 8H25V28H7ZM10.707 12.7071C11.0975 12.3166 11.7306 12.3166 12.1212 12.7071L16.0862 16.6721L20.0512 12.7071C20.4417 12.3166 21.0749 12.3166 21.4654 12.7071C21.8559 13.0976 21.8559 13.7308 21.4654 14.1213L17.5004 18.0863L21.4034 21.9893C21.7939 22.3798 21.7939 23.013 21.4034 23.4035C21.0129 23.7941 20.3797 23.7941 19.9892 23.4035L16.0862 19.5005L12.1213 23.4654C11.7308 23.8559 11.0976 23.8559 10.7071 23.4654C10.3166 23.0749 10.3166 22.4417 10.7071 22.0512L14.672 18.0863L10.707 14.1213C10.3164 13.7308 10.3164 13.0976 10.707 12.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 983 B

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63505)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 16C30 23.732 23.732 30 16 30C8.26801 30 2 23.732 2 16C2 8.26801 8.26801 2 16 2C23.732 2 30 8.26801 30 16ZM32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM8 24.3492C8 24.6254 8.22386 24.8492 8.5 24.8492H10.8284L22.412 13.2657L19.5836 10.4372L8 22.0208V24.3492ZM24.2635 11.4142L23.8262 11.8514L20.9978 9.02302L21.435 8.58579C22.2161 7.80474 23.4824 7.80474 24.2635 8.58579C25.0445 9.36684 25.0445 10.6332 24.2635 11.4142Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63505">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 826 B

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/customButton_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170904)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M30 16C30 23.732 23.732 30 16 30C8.26801 30 2 23.732 2 16C2 8.26801 8.26801 2 16 2C23.732 2 30 8.26801 30 16ZM32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM8 24.3492C8 24.6254 8.22386 24.8492 8.5 24.8492H10.8284L22.412 13.2657L19.5836 10.4372L8 22.0208V24.3492ZM24.2635 11.4142L23.8262 11.8514L20.9978 9.02302L21.435 8.58579C22.2161 7.80474 23.4824 7.80474 24.2635 8.58579C25.0445 9.36684 25.0445 10.6332 24.2635 11.4142Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170904">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 829 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/dataVerify.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 4H27V14H29V4C29 2.89543 28.1046 2 27 2H4C2.89543 2 2 2.89543 2 4V26C2 27.1046 2.89543 28 4 28H14V26H4L4 4ZM12.538 11.7933L17.9256 13.2369C18.2459 13.4164 18.6441 13.4059 18.9553 13.2052C19.0696 13.1383 19.1707 13.0488 19.2514 12.941L24.071 8.12128C24.4615 7.73078 24.4615 7.09765 24.071 6.70715C23.6805 6.31665 23.0473 6.31665 22.6568 6.70716L18.1403 11.2238L12.5128 9.71597C12.1313 9.61375 11.7422 9.74654 11.4992 10.0256C11.4517 10.0588 11.4065 10.0966 11.3641 10.1389L6.41437 15.0888C6.02388 15.4793 6.02388 16.1124 6.41438 16.5029C6.80489 16.8934 7.43803 16.8934 7.82853 16.5029L12.538 11.7933ZM18 22.1691V18.951C19.8448 18.7698 21.5473 18.0931 23 17.0613C24.4526 18.0932 26.1551 18.7699 28 18.9511V22.1691C28 24.1722 27.4739 26.2475 26.533 27.7559C25.6137 29.2296 24.4296 30 23 30C21.5704 30 20.3863 29.2296 19.467 27.7559C18.5261 26.2475 18 24.1722 18 22.1691ZM16 22.1691V18.9509V17.9413C16 17.4086 16.4673 16.9999 17 16.9999C17.338 16.9999 17.6717 16.9792 18 16.9389C19.5787 16.745 21.0343 16.0974 22.2588 15.1161C22.6881 14.7721 23.3118 14.7721 23.7411 15.1161C24.9657 16.0974 26.4213 16.745 28 16.9389C28.3283 16.9793 28.662 17 29 17C29.5327 17 30 17.4087 30 17.9414V18.951V22.1691C30 26.7821 27.613 32 23 32C18.387 32 16 26.7821 16 22.1691Z" 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/dataVerify_disable.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 4H27V14H29V4C29 2.89543 28.1046 2 27 2H4C2.89543 2 2 2.89543 2 4V26C2 27.1046 2.89543 28 4 28H14V26H4L4 4ZM12.538 11.7933L17.9256 13.2369C18.2459 13.4164 18.6441 13.4059 18.9553 13.2052C19.0696 13.1383 19.1707 13.0488 19.2514 12.941L24.071 8.12128C24.4615 7.73078 24.4615 7.09765 24.071 6.70715C23.6805 6.31665 23.0473 6.31665 22.6568 6.70716L18.1403 11.2238L12.5128 9.71597C12.1313 9.61375 11.7422 9.74654 11.4992 10.0256C11.4517 10.0588 11.4065 10.0966 11.3641 10.1389L6.41437 15.0888C6.02388 15.4793 6.02388 16.1124 6.41438 16.5029C6.80489 16.8934 7.43803 16.8934 7.82853 16.5029L12.538 11.7933ZM18 22.1691V18.951C19.8448 18.7698 21.5473 18.0931 23 17.0613C24.4526 18.0932 26.1551 18.7699 28 18.9511V22.1691C28 24.1722 27.4739 26.2475 26.533 27.7559C25.6137 29.2296 24.4296 30 23 30C21.5704 30 20.3863 29.2296 19.467 27.7559C18.5261 26.2475 18 24.1722 18 22.1691ZM16 22.1691V18.9509V17.9413C16 17.4086 16.4673 16.9999 17 16.9999C17.338 16.9999 17.6717 16.9792 18 16.9389C19.5787 16.745 21.0343 16.0974 22.2588 15.1161C22.6881 14.7721 23.3118 14.7721 23.7411 15.1161C24.9657 16.0974 26.4213 16.745 28 16.9389C28.3283 16.9793 28.662 17 29 17C29.5327 17 30 17.4087 30 17.9414V18.951V22.1691C30 26.7821 27.613 32 23 32C18.387 32 16 26.7821 16 22.1691Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/email.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.3942 6H4.39882L15.1417 16.9833C15.5339 17.3841 16.179 17.3841 16.5712 16.9833L23.9038 9.49036L23.9114 9.48262L23.9114 9.48266L27.3942 6ZM4 8.45251V26L28 26V8.22259L25.3295 10.8931L18.0006 18.3822C16.824 19.5845 14.8889 19.5845 13.7123 18.3822L13.7121 18.382L4 8.45251ZM2 6C2 4.89543 2.89543 4 4 4H28C29.1046 4 30 4.89543 30 6V26C30 27.1046 29.1046 28 28 28H4C2.89543 28 2 27.1046 2 26V6Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 581 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/email_disable.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.3942 6H4.39882L15.1417 16.9833C15.5339 17.3841 16.179 17.3841 16.5712 16.9833L23.9038 9.49036L23.9114 9.48262L23.9114 9.48266L27.3942 6ZM4 8.45251V26L28 26V8.22259L25.3295 10.8931L18.0006 18.3822C16.824 19.5845 14.8889 19.5845 13.7123 18.3822L13.7121 18.382L4 8.45251ZM2 6C2 4.89543 2.89543 4 4 4H28C29.1046 4 30 4.89543 30 6V26C30 27.1046 29.1046 28 28 28H4C2.89543 28 2 27.1046 2 26V6Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 582 B

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up.svg

@ -1,3 +1,10 @@
<svg width="10" height="14" viewBox="0 0 10 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M4.49999 2.4142L1.45707 5.45711C1.26181 5.65238 0.945224 5.65238 0.749962 5.45711C0.5547 5.26185 0.5547 4.94527 0.749962 4.75001L4.99997 0.5L9.24998 4.75001C9.44524 4.94527 9.44524 5.26185 9.24998 5.45711C9.05472 5.65238 8.73813 5.65238 8.54287 5.45711L5.49999 2.41423V12.7071C5.49999 12.9832 5.27613 13.2071 4.99999 13.2071C4.72384 13.2071 4.49999 12.9832 4.49999 12.7071V2.4142Z" fill="#0A1C38" fill-opacity="0.9"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4811_12126)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.8284L8.91414 12.9142C8.52361 13.3048 7.89045 13.3048 7.49992 12.9142C7.1094 12.5237 7.1094 11.8905 7.49992 11.5L15.9999 3L24.5 11.5C24.8905 11.8905 24.8905 12.5237 24.5 12.9142C24.1094 13.3048 23.4763 13.3048 23.0857 12.9142L17 6.82846V27.4142C17 27.9664 16.5523 28.4142 16 28.4142C15.4477 28.4142 15 27.9664 15 27.4142V6.8284Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_4811_12126">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 581 B

After

Width:  |  Height:  |  Size: 671 B

11
designer-base/src/main/resources/com/fine/theme/icon/toolbar/move_up_disable.svg

@ -1,3 +1,10 @@
<svg width="18" height="26" viewBox="0 0 18 26" fill="none" xmlns="http://www.w3.org/2000/svg">
<path id="Union" fill-rule="evenodd" clip-rule="evenodd" d="M7.99997 4.41421L1.91414 10.5C1.52361 10.8906 0.890449 10.8906 0.499924 10.5C0.1094 10.1095 0.1094 9.47635 0.499924 9.08583L8.99994 0.585815L17.5 9.08583C17.8905 9.47636 17.8905 10.1095 17.5 10.5C17.1094 10.8906 16.4763 10.8906 16.0857 10.5L9.99997 4.41427V25C9.99997 25.5523 9.55226 26 8.99997 26C8.44769 26 7.99997 25.5523 7.99997 25V4.41421Z" fill="#0A1C38" fill-opacity="0.29"/>
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_162212)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 6.41421L8.91414 12.5C8.52361 12.8906 7.89045 12.8906 7.49992 12.5C7.1094 12.1095 7.1094 11.4764 7.49992 11.0858L15.9999 2.58582L24.5 11.0858C24.8905 11.4764 24.8905 12.1095 24.5 12.5C24.1094 12.8906 23.4763 12.8906 23.0857 12.5L17 6.41427V27C17 27.5523 16.5523 28 16 28C15.4477 28 15 27.5523 15 27V6.41421Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_162212">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 546 B

After

Width:  |  Height:  |  Size: 651 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first.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="M23.3366 5.18683L13.2306 15.2929C12.84 15.6834 12.84 16.3166 13.2306 16.7071L23.3366 26.8132C23.7857 27.2623 24.5139 27.2623 24.963 26.8132C25.4121 26.3641 25.4121 25.6359 24.963 25.1868L15.7762 16L24.963 6.81318C25.4121 6.36408 25.4121 5.63594 24.963 5.18683C24.5139 4.73773 23.7857 4.73773 23.3366 5.18683ZM7.62639 5.00001C8.26152 5.00001 8.77639 5.51488 8.77639 6.15001V25.85C8.77639 26.4851 8.26152 27 7.62639 27C6.99126 27 6.47639 26.4851 6.47639 25.85V6.15001C6.47639 5.51488 6.99126 5.00001 7.62639 5.00001Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 704 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_first_disable.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="M23.3366 5.18683L13.2306 15.2929C12.84 15.6834 12.84 16.3166 13.2306 16.7071L23.3366 26.8132C23.7857 27.2623 24.5139 27.2623 24.963 26.8132C25.4121 26.3641 25.4121 25.6359 24.963 25.1868L15.7762 16L24.963 6.81318C25.4121 6.36408 25.4121 5.63594 24.963 5.18683C24.5139 4.73773 23.7857 4.73773 23.3366 5.18683ZM7.62639 5.00001C8.26152 5.00001 8.77639 5.51488 8.77639 6.15001V25.85C8.77639 26.4851 8.26152 27 7.62639 27C6.99126 27 6.47639 26.4851 6.47639 25.85V6.15001C6.47639 5.51488 6.99126 5.00001 7.62639 5.00001Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 705 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last.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="M8.43973 5.18683L18.5458 15.2929C18.9363 15.6834 18.9363 16.3166 18.5458 16.7071L8.43973 26.8132C7.99063 27.2623 7.26249 27.2623 6.81339 26.8132C6.36429 26.3641 6.36429 25.6359 6.81339 25.1868L16.0002 16L6.81339 6.81318C6.36429 6.36408 6.36429 5.63594 6.81339 5.18683C7.26249 4.73773 7.99063 4.73773 8.43973 5.18683ZM24.15 5.00001C23.5148 5.00001 23 5.51488 23 6.15001V25.85C23 26.4851 23.5148 27 24.15 27C24.7851 27 25.3 26.4851 25.3 25.85V6.15001C25.3 5.51488 24.7851 5.00001 24.15 5.00001Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 682 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_last_disbale.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="M8.43973 5.18683L18.5458 15.2929C18.9363 15.6834 18.9363 16.3166 18.5458 16.7071L8.43973 26.8132C7.99063 27.2623 7.26249 27.2623 6.81339 26.8132C6.36429 26.3641 6.36429 25.6359 6.81339 25.1868L16.0002 16L6.81339 6.81318C6.36429 6.36408 6.36429 5.63594 6.81339 5.18683C7.26249 4.73773 7.99063 4.73773 8.43973 5.18683ZM24.15 5.00001C23.5148 5.00001 23 5.51488 23 6.15001V25.85C23 26.4851 23.5148 27 24.15 27C24.7851 27 25.3 26.4851 25.3 25.85V6.15001C25.3 5.51488 24.7851 5.00001 24.15 5.00001Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 683 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi.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 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>

After

Width:  |  Height:  |  Size: 3.2 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_navi_disable.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 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.29"/>
</svg>

After

Width:  |  Height:  |  Size: 3.2 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next.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="M23.2929 16.7071C23.6834 16.3166 23.6834 15.6834 23.2929 15.2929L13.1868 5.18683C12.7377 4.73773 12.0096 4.73773 11.5605 5.18683C11.1114 5.63593 11.1114 6.36407 11.5605 6.81317L20.7473 16L11.5605 25.1868C11.1114 25.6359 11.1114 26.3641 11.5605 26.8132C12.0096 27.2623 12.7377 27.2623 13.1868 26.8132L23.2929 16.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_next_disable.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="M23.2929 16.7071C23.6834 16.3166 23.6834 15.6834 23.2929 15.2929L13.1868 5.18683C12.7377 4.73773 12.0096 4.73773 11.5605 5.18683C11.1114 5.63593 11.1114 6.36407 11.5605 6.81317L20.7473 16L11.5605 25.1868C11.1114 25.6359 11.1114 26.3641 11.5605 26.8132C12.0096 27.2623 12.7377 27.2623 13.1868 26.8132L23.2929 16.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 507 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous.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="M8.70711 16.7071C8.31658 16.3166 8.31658 15.6834 8.70711 15.2929L18.8132 5.18683C19.2623 4.73773 19.9904 4.73773 20.4395 5.18683C20.8886 5.63593 20.8886 6.36407 20.4395 6.81317L11.2527 16L20.4395 25.1868C20.8886 25.6359 20.8886 26.3641 20.4395 26.8132C19.9904 27.2623 19.2623 27.2623 18.8132 26.8132L8.70711 16.7071Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/page_previous_disable.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="M8.70711 16.7071C8.31658 16.3166 8.31658 15.6834 8.70711 15.2929L18.8132 5.18683C19.2623 4.73773 19.9904 4.73773 20.4395 5.18683C20.8886 5.63593 20.8886 6.36407 20.4395 6.81317L11.2527 16L20.4395 25.1868C20.8886 25.6359 20.8886 26.3641 20.4395 26.8132C19.9904 27.2623 19.2623 27.2623 18.8132 26.8132L8.70711 16.7071Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 507 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet.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="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H15.3644C14.5119 30.4332 13.736 29.7602 13.0556 29H10V25V23V22H10.0411C10.0139 21.6703 10 21.3368 10 21C10 20.6632 10.0139 20.3297 10.0411 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.2521C29.7329 11.7793 30.4039 12.3871 31 13.0625V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM5 14C5 13.4477 5.44772 13 6 13H10C10.5523 13 11 13.4477 11 14C11 14.5523 10.5523 15 10 15H6C5.44772 15 5 14.5523 5 14ZM21 19V23C21 23.5523 20.5523 24 20 24C19.4477 24 19 23.5523 19 23C19 22.4477 19.4477 22 20 22V20C18.3431 20 17 21.3431 17 23C17 24.6569 18.3431 26 20 26C21.6569 26 23 24.6569 23 23V19V19C23 18.4477 23.4477 18 24 18C24.5523 18 25 18.4477 25 19C25 19.5523 24.5523 20 24 20H24V22H24C25.6569 22 27 20.6569 27 19C27 17.3431 25.6569 16 24 16C22.3431 16 21 17.3431 21 19V19ZM30 21C30 25.4183 26.4183 29 22 29C17.5817 29 14 25.4183 14 21C14 16.5817 17.5817 13 22 13C26.4183 13 30 16.5817 30 21ZM32 21C32 26.5228 27.5228 31 22 31C16.4772 31 12 26.5228 12 21C12 15.4772 16.4772 11 22 11C27.5228 11 32 15.4772 32 21Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printApplet_disable.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="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H15.3644C14.5119 30.4332 13.736 29.7602 13.0556 29H10V25V23V22H10.0411C10.0139 21.6703 10 21.3368 10 21C10 20.6632 10.0139 20.3297 10.0411 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.2521C29.7329 11.7793 30.4039 12.3871 31 13.0625V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM5 14C5 13.4477 5.44772 13 6 13H10C10.5523 13 11 13.4477 11 14C11 14.5523 10.5523 15 10 15H6C5.44772 15 5 14.5523 5 14ZM21 19V23C21 23.5523 20.5523 24 20 24C19.4477 24 19 23.5523 19 23C19 22.4477 19.4477 22 20 22V20C18.3431 20 17 21.3431 17 23C17 24.6569 18.3431 26 20 26C21.6569 26 23 24.6569 23 23V19V19C23 18.4477 23.4477 18 24 18C24.5523 18 25 18.4477 25 19C25 19.5523 24.5523 20 24 20H24V22H24C25.6569 22 27 20.6569 27 19C27 17.3431 25.6569 16 24 16C22.3431 16 21 17.3431 21 19V19ZM30 21C30 25.4183 26.4183 29 22 29C17.5817 29 14 25.4183 14 21C14 16.5817 17.5817 13 22 13C26.4183 13 30 16.5817 30 21ZM32 21C32 26.5228 27.5228 31 22 31C16.4772 31 12 26.5228 12 21C12 15.4772 16.4772 11 22 11C27.5228 11 32 15.4772 32 21Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00006 26H3.00006C1.8955 26 1.00006 25.1046 1.00006 24L1 10C0.999995 8.89544 1.89543 8 3 8L8.00006 8L8.00005 3.00001C8.00005 1.89544 8.89548 1 10.0001 1L22.0001 1C23.1046 1 24.0001 1.89543 24.0001 3V8L29.0001 8C30.1046 8 31.0001 8.89543 31 10L31 24C31 25.1046 30.1046 26 29 26H24.0001V30C24.0001 31.1046 23.1046 32 22.0001 32H10C8.89545 32 8.00001 31.1045 8.00003 30L8.00006 26ZM8.00006 24C8.00004 22.8954 8.00006 22 8.00006 22H24.0001C24.0001 22 24.0001 22.8954 24.0001 24H29.0001V9.99996H3.00004V24H8.00006ZM10 3V8H22.0001V3H10ZM10 24V30H22.0001V24H10Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 13C5 12.4477 5.44771 12 6 12H8.50021C9.88092 12 11.0002 13.1193 11.0002 14.5C11.0002 15.8807 9.88092 17 8.50021 17H6.5V19.25C6.5 19.6642 6.16422 20 5.75 20C5.33579 20 5 19.6642 5 19.25V17L5 13ZM6.50022 13.5H8.50021C9.0525 13.5 9.50021 13.9477 9.50021 14.5C9.50021 15.0523 9.0525 15.5 8.50021 15.5H6.50022V13.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0833 12C13.4832 12 12.9975 12.49 13 13.0928L13.0244 18.9204C13.0269 19.5174 13.5093 20 14.1036 20H15.518C17.7172 20 19.5 18.2091 19.5 16C19.5 13.7909 17.7172 12 15.518 12H14.0833ZM15.518 13.5H14.5225V18.5H15.518C16.8925 18.5 18.0028 17.3807 18.0028 16C18.0028 14.6193 16.8925 13.5 15.518 13.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 12.75C21.5 12.3358 21.8358 12 22.25 12H26.25C26.6642 12 27 12.3358 27 12.75C27 13.1642 26.6642 13.5 26.25 13.5H23L23 15.5H26.25C26.6642 15.5 27 15.8358 27 16.25C27 16.6642 26.6642 17 26.25 17H23L23 19.25C23 19.6642 22.6642 20 22.25 20C21.8358 20 21.5 19.6642 21.5 19.25V16.25V12.75Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

6
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPdf_disable.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8.00006 26H3.00006C1.8955 26 1.00006 25.1046 1.00006 24L1 10C0.999995 8.89544 1.89543 8 3 8L8.00006 8L8.00005 3.00001C8.00005 1.89544 8.89548 1 10.0001 1L22.0001 1C23.1046 1 24.0001 1.89543 24.0001 3V8L29.0001 8C30.1046 8 31.0001 8.89543 31 10L31 24C31 25.1046 30.1046 26 29 26H24.0001V30C24.0001 31.1046 23.1046 32 22.0001 32H10C8.89545 32 8.00001 31.1045 8.00003 30L8.00006 26ZM8.00006 24C8.00004 22.8954 8.00006 22 8.00006 22H24.0001C24.0001 22 24.0001 22.8954 24.0001 24H29.0001V9.99996H3.00004V24H8.00006ZM10 3V8H22.0001V3H10ZM10 24V30H22.0001V24H10Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 13C5 12.4477 5.44771 12 6 12H8.50021C9.88092 12 11.0002 13.1193 11.0002 14.5C11.0002 15.8807 9.88092 17 8.50021 17H6.5V19.25C6.5 19.6642 6.16422 20 5.75 20C5.33579 20 5 19.6642 5 19.25V17L5 13ZM6.50022 13.5H8.50021C9.0525 13.5 9.50021 13.9477 9.50021 14.5C9.50021 15.0523 9.0525 15.5 8.50021 15.5H6.50022V13.5Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.0833 12C13.4832 12 12.9975 12.49 13 13.0928L13.0244 18.9204C13.0269 19.5174 13.5093 20 14.1036 20H15.518C17.7172 20 19.5 18.2091 19.5 16C19.5 13.7909 17.7172 12 15.518 12H14.0833ZM15.518 13.5H14.5225V18.5H15.518C16.8925 18.5 18.0028 17.3807 18.0028 16C18.0028 14.6193 16.8925 13.5 15.518 13.5Z" fill="#0A1C38" fill-opacity="0.29"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.5 12.75C21.5 12.3358 21.8358 12 22.25 12H26.25C26.6642 12 27 12.3358 27 12.75C27 13.1642 26.6642 13.5 26.25 13.5H23L23 15.5H26.25C26.6642 15.5 27 15.8358 27 16.25C27 16.6642 26.6642 17 26.25 17H23L23 19.25C23 19.6642 22.6642 20 22.25 20C21.8358 20 21.5 19.6642 21.5 19.25V16.25V12.75Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5532_17947)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H18.411C17.3151 30.4963 16.3163 29.8177 15.4501 29H10V25V23V22H12.0448C12.0152 21.6706 12 21.3371 12 21C12 20.6629 12.0152 20.3294 12.0448 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.7789C29.7316 12.2559 30.4029 12.8176 31 13.4501V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM23 27C26.3137 27 29 24.3137 29 21C29 17.6863 26.3137 15 23 15C19.6863 15 17 17.6863 17 21C17 24.3137 19.6863 27 23 27ZM23 29C24.187 29 25.3135 28.7415 26.3265 28.2777C26.3933 28.2472 26.4596 28.2157 26.5253 28.1834C26.7922 28.0522 27.0506 27.9066 27.2997 27.7475C27.3132 27.7716 27.3279 27.7953 27.3436 27.8185C27.3487 27.8259 27.3538 27.8333 27.3591 27.8406C27.3903 27.884 27.4254 27.9254 27.4645 27.9645L30.2929 30.7929C30.6834 31.1834 31.3166 31.1834 31.7071 30.7929C32.0976 30.4024 32.0976 29.7692 31.7071 29.3787L28.8787 26.5502C28.8585 26.5301 28.8377 26.5109 28.8163 26.4928C29.0066 26.2913 29.1867 26.0799 29.3555 25.8595L29.3903 25.8137C30.4008 24.4743 31 22.8071 31 21C31 16.5817 27.4183 13 23 13C18.5817 13 15 16.5817 15 21C15 25.4183 18.5817 29 23 29ZM8 14C8 13.4477 8.44772 13 9 13H15C15.5523 13 16 13.4477 16 14C16 14.5523 15.5523 15 15 15H9C8.44772 15 8 14.5523 8 14Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5532_17947">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printPreview_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170304)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M22 3H10V7H22V3ZM8 3V7H3C1.89543 7 1 7.89543 1 9V23C1 24.1046 1.89543 25 3 25H6H8V27V29C8 30.1046 8.89543 31 10 31H18.411C17.3151 30.4963 16.3163 29.8177 15.4501 29H10V25V23V22H12.0448C12.0152 21.6706 12 21.3371 12 21C12 20.6629 12.0152 20.3294 12.0448 20H10H8V21V22V23H6H5H3V21L3 11V9H5H10H22H27H29V11V11.7789C29.7316 12.2559 30.4029 12.8176 31 13.4501V9C31 7.89543 30.1046 7 29 7H24V3C24 1.89543 23.1046 1 22 1H10C8.89543 1 8 1.89543 8 3ZM23 27C26.3137 27 29 24.3137 29 21C29 17.6863 26.3137 15 23 15C19.6863 15 17 17.6863 17 21C17 24.3137 19.6863 27 23 27ZM23 29C24.187 29 25.3135 28.7415 26.3265 28.2777C26.3933 28.2472 26.4596 28.2157 26.5253 28.1834C26.7922 28.0522 27.0506 27.9066 27.2997 27.7475C27.3132 27.7716 27.3279 27.7953 27.3436 27.8185C27.3487 27.8259 27.3538 27.8333 27.3591 27.8406C27.3903 27.884 27.4254 27.9254 27.4645 27.9645L30.2929 30.7929C30.6834 31.1834 31.3166 31.1834 31.7071 30.7929C32.0976 30.4024 32.0976 29.7692 31.7071 29.3787L28.8787 26.5502C28.8585 26.5301 28.8377 26.5109 28.8163 26.4928C29.0066 26.2913 29.1867 26.0799 29.3555 25.8595L29.3903 25.8137C30.4008 24.4743 31 22.8071 31 21C31 16.5817 27.4183 13 23 13C18.5817 13 15 16.5817 15 21C15 25.4183 18.5817 29 23 29ZM8 14C8 13.4477 8.44772 13 9 13H15C15.5523 13 16 13.4477 16 14C16 14.5523 15.5523 15 15 15H9C8.44772 15 8 14.5523 8 14Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170304">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5516_63052)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.534 0.170568C12.7914 -0.0568564 13.2086 -0.056856 13.4659 0.170569L17.8057 4.00585C18.2208 4.37272 17.9268 5 17.3397 5L14 5V15H27V11.6603C27 11.0732 27.6273 10.7792 27.9941 11.1943L31.8294 15.534C32.0569 15.7914 32.0569 16.2086 31.8294 16.466L27.9941 20.8057C27.6273 21.2208 27 20.9268 27 20.3397V17H14V27H17.3397C17.9268 27 18.2208 27.6273 17.8057 27.9941L13.466 31.8294C13.2086 32.0569 12.7914 32.0569 12.534 31.8294L8.19432 27.9941C7.77921 27.6273 8.07321 27 8.66028 27H12V17H5L5 20.3397C5 20.9268 4.37272 21.2208 4.00585 20.8057L0.170568 16.466C-0.0568565 16.2086 -0.056856 15.7914 0.170569 15.534L4.00585 11.1943C4.37272 10.7792 5 11.0732 5 11.6603V15H12V5L8.66027 5C8.07321 5 7.77921 4.37272 8.19432 4.00585L12.534 0.170568Z" fill="#0A1C38" fill-opacity="0.9"/>
</g>
<defs>
<clipPath id="clip0_5516_63052">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

10
designer-base/src/main/resources/com/fine/theme/icon/toolbar/printerOffset_disable.svg

@ -0,0 +1,10 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_5830_170338)">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.534 0.170568C12.7914 -0.0568564 13.2086 -0.056856 13.4659 0.170569L17.8057 4.00585C18.2208 4.37272 17.9268 5 17.3397 5L14 5V15H27V11.6603C27 11.0732 27.6273 10.7792 27.9941 11.1943L31.8294 15.534C32.0569 15.7914 32.0569 16.2086 31.8294 16.466L27.9941 20.8057C27.6273 21.2208 27 20.9268 27 20.3397V17H14V27H17.3397C17.9268 27 18.2208 27.6273 17.8057 27.9941L13.466 31.8294C13.2086 32.0569 12.7914 32.0569 12.534 31.8294L8.19432 27.9941C7.77921 27.6273 8.07321 27 8.66028 27H12V17H5L5 20.3397C5 20.9268 4.37272 21.2208 4.00585 20.8057L0.170568 16.466C-0.0568565 16.2086 -0.056856 15.7914 0.170569 15.534L4.00585 11.1943C4.37272 10.7792 5 11.0732 5 11.6603V15H12V5L8.66027 5C8.07321 5 7.77921 4.37272 8.19432 4.00585L12.534 0.170568Z" fill="#0A1C38" fill-opacity="0.29"/>
</g>
<defs>
<clipPath id="clip0_5830_170338">
<rect width="32" height="32" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale.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="M13.2937 11.7929L5.50076 4L12.1643 4C12.7165 4 13.1643 3.55228 13.1643 3C13.1643 2.44771 12.7165 2 12.1643 2H3.00015C2.93001 2 2.86156 2.00722 2.79549 2.02096C2.34129 2.11535 2 2.51784 2 3.00003L2 12.1641C2 12.7164 2.44772 13.1641 3 13.1641C3.55229 13.1641 4 12.7164 4 12.1641L4 5.32756L11.8795 13.2071C12.27 13.5976 12.9031 13.5976 13.2937 13.2071C13.6842 12.8166 13.6842 12.1835 13.2937 11.7929ZM27.9992 26.5848L20.1216 18.7071C19.731 18.3166 19.0979 18.3166 18.7074 18.7071C18.3169 19.0976 18.3169 19.7307 18.7074 20.1212L26.586 27.9999H19.8359C19.2836 27.9999 18.8359 28.4476 18.8359 28.9999C18.8359 29.5522 19.2836 29.9999 19.8359 29.9999L28.9855 29.9999L28.9992 30C29.0371 30 29.0745 29.9979 29.1113 29.9937C29.6112 29.9384 30 29.5145 30 28.9999C30 28.9861 29.9997 28.9725 29.9992 28.9589L29.9992 19.8358C29.9992 19.2836 29.5515 18.8358 28.9992 18.8358C28.4469 18.8359 27.9992 19.2836 27.9992 19.8359L27.9992 26.5848ZM13.5954 19.9047L5.50011 28H12.1643C12.7165 28 13.1643 28.4477 13.1643 29C13.1643 29.5522 12.7165 30 12.1643 30L3.00016 30C2.94838 30 2.89752 29.996 2.84787 29.9884C2.83131 29.9859 2.81489 29.983 2.79862 29.9797C2.34286 29.8865 2 29.4832 2 28.9999L2 19.8358C2 19.2835 2.44771 18.8358 3 18.8358C3.55228 18.8358 4 19.2835 4 19.8358L4 26.6717L12.1813 18.4905C12.5718 18.1 13.2049 18.1 13.5955 18.4905C13.986 18.881 13.986 19.5142 13.5954 19.9047ZM29 2C29.0658 2 29.1302 2.00636 29.1924 2.0185C29.6527 2.10815 30.0001 2.51352 30.0001 3.00003V12.1641C30.0001 12.7164 29.5524 13.1641 29.0001 13.1641C28.4479 13.1641 28.0001 12.7164 28.0001 12.1641V5.32816L20.1211 13.2071C19.7306 13.5976 19.0975 13.5976 18.7069 13.2071C18.3164 12.8166 18.3164 12.1835 18.7069 11.793L26.5 4L19.8359 4C19.2836 4 18.8359 3.55229 18.8359 3C18.8359 2.44772 19.2836 2 19.8359 2L29 2Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/scale_disable.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="M13.2937 11.7929L5.50076 4L12.1643 4C12.7165 4 13.1643 3.55228 13.1643 3C13.1643 2.44771 12.7165 2 12.1643 2H3.00015C2.93001 2 2.86156 2.00722 2.79549 2.02096C2.34129 2.11535 2 2.51784 2 3.00003L2 12.1641C2 12.7164 2.44772 13.1641 3 13.1641C3.55229 13.1641 4 12.7164 4 12.1641L4 5.32756L11.8795 13.2071C12.27 13.5976 12.9031 13.5976 13.2937 13.2071C13.6842 12.8166 13.6842 12.1835 13.2937 11.7929ZM27.9992 26.5848L20.1216 18.7071C19.731 18.3166 19.0979 18.3166 18.7074 18.7071C18.3169 19.0976 18.3169 19.7307 18.7074 20.1212L26.586 27.9999H19.8359C19.2836 27.9999 18.8359 28.4476 18.8359 28.9999C18.8359 29.5522 19.2836 29.9999 19.8359 29.9999L28.9855 29.9999L28.9992 30C29.0371 30 29.0745 29.9979 29.1113 29.9937C29.6112 29.9384 30 29.5145 30 28.9999C30 28.9861 29.9997 28.9725 29.9992 28.9589L29.9992 19.8358C29.9992 19.2836 29.5515 18.8358 28.9992 18.8358C28.4469 18.8359 27.9992 19.2836 27.9992 19.8359L27.9992 26.5848ZM13.5954 19.9047L5.50011 28H12.1643C12.7165 28 13.1643 28.4477 13.1643 29C13.1643 29.5522 12.7165 30 12.1643 30L3.00016 30C2.94838 30 2.89752 29.996 2.84787 29.9884C2.83131 29.9859 2.81489 29.983 2.79862 29.9797C2.34286 29.8865 2 29.4832 2 28.9999L2 19.8358C2 19.2835 2.44771 18.8358 3 18.8358C3.55228 18.8358 4 19.2835 4 19.8358L4 26.6717L12.1813 18.4905C12.5718 18.1 13.2049 18.1 13.5955 18.4905C13.986 18.881 13.986 19.5142 13.5954 19.9047ZM29 2C29.0658 2 29.1302 2.00636 29.1924 2.0185C29.6527 2.10815 30.0001 2.51352 30.0001 3.00003V12.1641C30.0001 12.7164 29.5524 13.1641 29.0001 13.1641C28.4479 13.1641 28.0001 12.7164 28.0001 12.1641V5.32816L20.1211 13.2071C19.7306 13.5976 19.0975 13.5976 18.7069 13.2071C18.3164 12.8166 18.3164 12.1835 18.7069 11.793L26.5 4L19.8359 4C19.2836 4 18.8359 3.55229 18.8359 3C18.8359 2.44772 19.2836 2 19.8359 2L29 2Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

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

@ -187,7 +187,12 @@
"reportFit": "toolbar/reportFit.svg",
"mobileAttr": "toolbar/mobileAttr.svg",
"watermark": "toolbar/watermark.svg",
"dataVerify": "toolbar/dataVerify.svg",
"clearStash": "toolbar/clearStash.svg",
"print": "toolbar/print.svg",
"printPdf": "toolbar/printPdf.svg",
"printApplet": "toolbar/printApplet.svg",
"printPreview": "toolbar/printPreview.svg",
"pageSetup": "toolbar/pageSetup.svg",
"reportHeader": "toolbar/reportHeader.svg",
"reportFooter": "toolbar/reportFooter.svg",
@ -223,6 +228,15 @@
"workOrderCenter": "toolbar/workOrderCenter.svg",
"actCenter": "toolbar/actCenter.svg",
"sign": "toolbar/sign.svg",
"page_first": "toolbar/page_first.svg",
"page_next": "toolbar/page_next.svg",
"page_previous": "toolbar/page_previous.svg",
"page_last": "toolbar/page_last.svg",
"page_navi": "toolbar/page_navi.svg",
"email": "toolbar/email.svg",
"scale": "toolbar/scale.svg",
"printerOffset": "toolbar/printerOffset.svg",
"customButton": "toolbar/customButton.svg",
"cellelement_small": "cellelement.svg",
"forbid": "expand/forbid.svg",
"horizontal_expand": "expand/horizontal.svg",

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

@ -399,6 +399,7 @@ Label.tipColor = @BrandTipColor
Label.borderColor = $defaultBorderColor
Label.hyperLinkColor = #2576EF
Label.strongHintColor = #FF0000
Label.warningColor = #F1393C
#---- HelpButton ----
@ -1305,9 +1306,15 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Label.tipLabel = \
foreground: $Label.tipColor
[style]Label.warningTipLabel = \
foreground: $Label.warningColor
[style]Button.plainButton = \
border: null; \
background: null; \
hoverBackground : null; \
selectedBackground : null; \
pressedBackground : null
pressedBackground : null
[style]ToggleButton.compactButton = \
margin: 2,0,2,0

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -9,7 +9,7 @@ com.fr.design.version.detail.label=450*30
com.fr.design.version.detail.dialog=600*500
com.fr.env.SyncFailedPluginsDialog.messageWithLink=316*20
com.fr.design.web.pane.text.field=450*20
com.fr.design.actions.server.dialog=700*630
com.fr.design.actions.server.dialog=660*600
com.fr.design.report.fit.templatePane.dialog=600*400
com.fr.design.report.fit.firstColumn=80*20
com.fr.design.report.fit.column=100*20
@ -22,7 +22,7 @@ com.fr.design.ds.column.sort.pane=220*150
com.fr.design.sort.expand.header.pane=108*10
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.dialog=600*500
com.fr.design.plugin.remind.PluginInvalidateRemindDialog.centerPane=580*369
com.fr.design.report.WatermarkSettingPane=720*600
com.fr.design.report.WatermarkSettingPane=660*600
com.fr.design.file.MultiTemplateTabPane.popUpMenu=170*65
com.fr.design.formula.FormulaPane=900*600
com.fr.design.formula.FormulaPaneWhenReserveFormula=900*600

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

@ -4,6 +4,7 @@
package com.fr.design.mainframe;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils;
import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection;
@ -21,8 +22,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.*;
public class ChartPropertyPane extends BaseChartPropertyPane {
@ -44,6 +44,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected void initComponent() {
this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
// 外部轮廓大小固定,适配滚动面板
this.setPreferredSize(FineUIScale.scale(new Dimension(getWidth(), 900)));
}
@Override

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/AbstractChartAttrPane.java

@ -4,8 +4,7 @@ package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*;
import java.awt.*;
import java.awt.BorderLayout;
public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
public abstract void populate(ChartCollection collection);
@ -30,7 +29,6 @@ public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
protected void initContentPane() {
leftContentPane = createContentPane();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original));
this.add(leftContentPane, BorderLayout.CENTER);
}

101
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -1,5 +1,8 @@
package com.fr.design.mainframe.chart.gui;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.ChartCollection;
@ -24,15 +27,12 @@ import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.StringUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
@ -46,7 +46,15 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
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;
/**
* 图表 类型 增删 控制按钮界面.
@ -103,38 +111,32 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
this.setLayout(new BorderLayout());
initButton();
buttonPane = new JPanel();
this.add(buttonPane, BorderLayout.CENTER);
JPanel northPane = new JPanel();
this.add(northPane, BorderLayout.NORTH);
northPane.setLayout(new BorderLayout());
northPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
JPanel button = new JPanel();
button.setPreferredSize(new Dimension(89, 20));
button.setLayout(new GridLayout(1, 4, 3, 0));
button.add(addButton);
button.add(copyButton);
button.add(moveForwardButton);
button.add(moveBackButton);
northPane.add(button, BorderLayout.WEST);
northPane.add(configButton, BorderLayout.EAST);
buttonPane = new JPanel(new BorderLayout());
this.add(column(10,
row(5,
cell(addButton).weight(0.5),
cell(copyButton).weight(0.5),
cell(moveForwardButton).weight(0.5),
cell(moveBackButton).weight(0.5),
flex(2),
cell(configButton).weight(0.5)
),
cell(buttonPane)
).getComponent()
);
initConfigCreator();
// Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK);
}
private void initButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
configButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
copyButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png"));
addButton = new UIButton(new LazyIcon("add"));
configButton = new UIButton(new LazyIcon("tool_config"));
copyButton = new UIButton(new LazyIcon("tool_copy"));
copyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Action_Copy"));
moveForwardButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/left.png"));
moveForwardButton = new UIButton(new LazyIcon("move_left"));
moveForwardButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_HF_Move_Left"));
moveBackButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/control/right.png"));
moveBackButton = new UIButton(new LazyIcon("move_right"));
moveBackButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_HF_Move_Right"));
initAddButton();
initConfigButton();
@ -151,7 +153,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private void initAddButton() {
addButton.setPreferredSize(new Dimension(20, 20));
addButton.addActionListener((e) -> {
String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart();
@ -168,12 +169,10 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private void initConfigButton() {
configButton.setPreferredSize(new Dimension(20, 20));
configButton.addActionListener((e) -> showConfigDialog());
}
private void initCopyButton() {
copyButton.setPreferredSize(new Dimension(20, 20));
copyButton.addActionListener((e) -> {
String name = getCopyChartName();
ChartProvider chart = getCopyChart();
@ -182,8 +181,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
private void initMoveButton() {
moveForwardButton.setPreferredSize(new Dimension(20, 20));
moveBackButton.setPreferredSize(new Dimension(20, 20));
moveForwardButton.addActionListener((e) -> moveForwardChart());
moveBackButton.addActionListener((e) -> moveBackChart());
}
@ -335,18 +332,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
return;
}
northPane.removeAll();
northPane.setLayout(new BoxLayout(northPane, BoxLayout.Y_AXIS));
JPanel pane = null;
for (int i = 0; i < indexList.size(); i++) {
if (i % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT));
northPane.add(pane);
}
pane.add(indexList.get(i));
}
northPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList));
this.revalidate();
}
@ -355,22 +341,12 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
return;
}
northPane.removeAll();
northPane.setLayout(new BoxLayout(northPane, BoxLayout.Y_AXIS));
JPanel pane = null;
for (int i = 0; i < indexList.size(); i++) {
if (i % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT));
northPane.add(pane);
}
if (i != index) {
pane.add(indexList.get(i));
} else {
pane.add(currentEditingEditor);
}
}
List<Component> components = IntStream.range(0, indexList.size())
.mapToObj(i -> i == index ? currentEditingEditor : indexList.get(i))
.collect(Collectors.toList());
northPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, components));
this.revalidate();
}
/**
@ -518,6 +494,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
}
}
});
FineUIStyle.setStyle(this, FineUIStyle.COMPACT_BUTTON);
}
public String getButtonName() {
@ -530,10 +507,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
buttonName = name;
}
public Dimension getPreferredSize() {
return new Dimension(B_W, B_H);
}
private void paintDeleteButton(Graphics g2d) {
Rectangle2D bounds = this.getBounds();

6
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.chart.gui;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider;
@ -58,8 +60,8 @@ public class ChartTypePane extends AbstractChartAttrPane {
@Override
protected JPanel createContentPane() {
initButtonListener();
JPanel content = new JPanel(new BorderLayout());
JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
content.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
buttonPane = new ChartTypeButtonPane(this);
buttonPane.refreshChartInForm(inForm);
content.add(buttonPane, BorderLayout.NORTH);

128
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.data;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
@ -10,23 +11,20 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
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;
/**
* 图表数据 分类 系列 过滤界面.
@ -57,20 +55,15 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected void initTabPane() {
super.initTabPane();
tabPane.setPreferredSize(new Dimension(221, 25));
}
protected void initLayout() {
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) {
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
centerPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
this.add(tabPane, BorderLayout.NORTH);
}
centerPane.setBorder(null);
}
this.add(centerPane, BorderLayout.CENTER);
}
@ -129,8 +122,6 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
this.removeAll();
paneList = initPaneList4NoPresent(plot4Pane, parentPane);
initAllPane();
tabPane.setPreferredSize(new Dimension(221, 25));
centerPane.setPreferredSize(new Dimension(getContentPaneWidth(), 200));
this.validate();
}
@ -213,19 +204,10 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected void layoutContentPane() {
super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
}
public void reloaPane(JPanel pane){
super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = FIL_HEIGHT;
return dim;
}
@Override
@ -238,51 +220,37 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField();
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p,f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{label,preDataNum},
new Component[]{combineOther,null}
};
preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
preDataNumPane.setBorder(BorderFactory.createEmptyBorder(10,15,0,0));
//默认不显示
preDataNumPane = column(10,
row(cell(label).weight(1.2), cell(preDataNum).weight(3)),
cell(combineOther)
).getComponent();
preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
checkBoxUse();
}
});
onlyPreData.addChangeListener(e -> checkBoxUse());
present = new PresentComboBox() {
protected void fireChange() {
fire();
}
};
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f};
double[] row = {p, p};
Component[][] coms = new Component[][]{
new Component[]{panel1},
new Component[]{panel2}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column);
presentPane = row(
cell(
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present"))
).weight(1.2), cell(present).weight(3)
).getComponent();
return column(10,
cell(onlyPreData),
cell(preDataNumPane),
cell(notShowNull),
cell(presentPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent();
}
@ -394,12 +362,10 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected void layoutContentPane() {
super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
}
public void reloaPane(JPanel pane){
super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
}
@Override
@ -413,51 +379,37 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records"));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel panel2 = new JPanel(new BorderLayout());
panel1.add(onlyPreData, BorderLayout.NORTH);
preDataNum = new UITextField();
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {p,f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{label,preDataNum},
new Component[]{combineOther,null}
};
preDataNumPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
preDataNumPane.setBorder(BorderFactory.createEmptyBorder(10,15,0,0));
//默认不显示
preDataNumPane = column(10,
row(cell(label).weight(1.2), cell(preDataNum).weight(3)),
cell(combineOther)
).getComponent();
preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
checkBoxUse();
}
});
onlyPreData.addChangeListener(e -> checkBoxUse());
present = new PresentComboBox() {
protected void fireChange() {
fire();
}
};
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present);
panel2.add(presentPane, BorderLayout.SOUTH);
double[] column = {f};
double[] row = {p, p};
Component[][] coms = new Component[][]{
new Component[]{panel1},
new Component[]{panel2}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column);
presentPane = row(
cell(
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present"))
).weight(1.2), cell(present).weight(3)
).getComponent();
return column(10,
cell(onlyPreData),
cell(preDataNumPane),
cell(notShowNull),
cell(presentPane)
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent();
}

38
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

@ -1,28 +1,26 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.TableData;
import com.fr.data.impl.NameTableData;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.LineBorder;
import java.awt.BorderLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class DatabaseTableDataPane extends BasicPane{
private static final long serialVersionUID = 5316016202202932242L;
private TableDataComboBox tableNameCombox;
@ -38,21 +36,16 @@ public class DatabaseTableDataPane extends BasicPane{
initTableCombox();
initReviewButton();
this.setLayout(new BorderLayout(0,0));
if (label != null) {
this.add(label, BorderLayout.WEST);
}
JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0));
pane.add(tableNameCombox,BorderLayout.CENTER);
pane.add(reviewButton,BorderLayout.EAST);
this.add(UIComponentUtils.wrapWithBorderLayoutPane(pane),BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(
row(
cell(label).weight(1.2), cell(tableNameCombox).weight(2.4), flex(0.1), cell(reviewButton).weight(0.5)
).getComponent(), BorderLayout.CENTER
);
setBorder();
}
protected void setBorder () {
this.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
}
/**
* 返回选中的数据源.
@ -101,15 +94,14 @@ public class DatabaseTableDataPane extends BasicPane{
}
private void initReviewButton() {
reviewButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/search.png"));
reviewButton.setBorder(new LineBorder(UIConstants.LINE_COLOR));
reviewButton = new UIButton(new LazyIcon("search"));
reviewButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseReleased(MouseEvent e) {
TableDataWrapper tableDataWrappe = tableNameCombox.getSelectedItem();
if ( tableDataWrappe != null) {
TableDataWrapper tableDataWrapper = tableNameCombox.getSelectedItem();
if ( tableDataWrapper != null) {
try {
tableDataWrappe.previewData();
tableDataWrapper.previewData();
} catch (Exception e1) {
FineLoggerFactory.getLogger().error(e1.getMessage(), e1);
}

33
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java

@ -1,25 +1,26 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chartx.data.DataLayoutHelper;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.constants.LayoutConstants.LEFT_WEIGHT;
import static com.fr.design.constants.LayoutConstants.RIGHT_WEIGHT;
/**
* 一般数据界面
* @author kunsnat E-mail:kunsnat@gmail.com
@ -62,19 +63,14 @@ public class NormalChartDataPane extends DataContentsPane {
JPanel contentPane = new JPanel(new BorderLayout());
dataPane = new UIComboBoxPane<ChartCollection>() {
protected void initLayout() {
this.setLayout(new BorderLayout(ChartEditContext.normalMode() ? LayoutConstants.HGAP_LARGE : 0,6));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
if (ChartEditContext.supportReportData()) {
JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0));
northPane.add(jcb, BorderLayout.CENTER);
UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source"));
label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null}));
if (ChartEditContext.normalMode()) {
northPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 8));
} else {
northPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
}
this.add(northPane, BorderLayout.NORTH);
UILabel dataSourceLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source"));
this.add(row(
cell(dataSourceLabel).weight(LEFT_WEIGHT),
cell(jcb).weight(RIGHT_WEIGHT)
).getComponent(), BorderLayout.NORTH);
}
this.add(cardPane, BorderLayout.CENTER);
@ -95,7 +91,6 @@ public class NormalChartDataPane extends DataContentsPane {
}
};
contentPane.add(dataPane, BorderLayout.CENTER);
dataPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0));
return contentPane;
}

17
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.TableData;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
@ -9,23 +10,16 @@ import com.fr.data.impl.NameTableData;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import java.awt.BorderLayout;
import java.awt.Dimension;
public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private static final long serialVersionUID = 4740461028440155147L;
private static final int TOP = -5;
private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65;
private static final int TABLE_DATA_PANE_WIDTH = 246;
private DatabaseTableDataPane tableDataPane;
private AbstractTableDataContentPane dataContentPane;
@ -37,14 +31,12 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
public TableDataPane(ChartDataPane parent) {
this.parent = parent;
setLayout(new BorderLayout(0, FineUIScale.scale(10)));
initDataPane();
}
private void initDataPane() {
UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"));
UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH);
UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH);
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"));
tableDataPane = new DatabaseTableDataPane(label) {
@Override
protected void userEvent() {
@ -52,9 +44,6 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
checkBoxUse();
}
};
tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH , tableDataPane.getPreferredSize().height));
this.setBorder(BorderFactory.createEmptyBorder(TOP,0,0,0));
this.add(tableDataPane, BorderLayout.NORTH);
}

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java

@ -53,7 +53,6 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
initSeriesPane();
JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.add(seriesPane);
this.add(panel, "0,2,2,2");
}
@ -210,4 +209,7 @@ public abstract class AbstractReportDataContentPane extends BasicBeanPane<ChartC
return BorderFactory.createEmptyBorder(10,5,0,5);
}
public UICorrelationPane getSeriesPane() {
return seriesPane;
}
}

92
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -1,6 +1,8 @@
package com.fr.design.mainframe.chart.gui.data.report;
import com.fr.base.BaseUtils;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
@ -9,26 +11,24 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
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;
/**
* 多分类 单元格数据集 界面.
@ -56,38 +56,24 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
initEveryPane();
categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
JPanel catePane = new JPanel();
catePane.setLayout(new BorderLayout(2, 2));
catePane.add(categoryName);
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, 20));
catePane.add(addButton, BorderLayout.EAST);
addButton = new UIButton(new LazyIcon("add"));
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
boxPane = new Column();
boxPane.setBackground(Color.red);
JPanel catePane = column(
row(cell(categoryName).weight(3.7), flex(0.1), cell(addButton).weight(0.4)),
cell(boxPane)
).getComponent();
catePane.add(boxPane, BorderLayout.SOUTH);
catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,20));
this.add(catePane, "0,0,2,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,1,4");
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
addNewCatePane();
}
});
this.setLayout(new BorderLayout());
this.add(column(10,
cell(catePane),
cell(getSeriesPane()),
cell(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane))
).getComponent());
addButton.addActionListener(e -> addNewCatePane());
}
/**
@ -100,37 +86,29 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
}
private TinyFormulaPane addNewCatePane() {
final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY);
pane.setPreferredSize(new Dimension(100, 16));
pane.registerChangeListener(uiobListener);
formualList.add(pane);
final TinyFormulaPane formulaPane = initCategoryBox(StringUtils.EMPTY);
final JPanel newButtonPane = new JPanel();
newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
newButtonPane.add(pane);
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
newButtonPane.add(delButton);
formulaPane.registerChangeListener(uiobListener);
formualList.add(formulaPane);
UIButton delButton = new UIButton(new LazyIcon("close"));
JPanel newButtonPane = row(
cell(formulaPane).weight(3.7), flex(0.1), cell(delButton).weight(0.4)
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent();
boxPane.add(newButtonPane);
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane);
formualList.remove(pane);
checkComponent();
relayoutPane();
}
delButton.addActionListener(e -> {
boxPane.remove(newButtonPane);
formualList.remove(formulaPane);
checkComponent();
relayoutPane();
});
delButton.registerChangeListener(uiobListener);
checkComponent();
relayoutPane();
return pane;
return formulaPane;
}
private void checkAddButton() {

44
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java

@ -5,25 +5,27 @@ import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.SeriesDefinition;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
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;
public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane {
protected static final int PRE_WIDTH = 210;
protected TinyFormulaPane categoryName;
protected ChartDataFilterPane filterPane;
@ -35,30 +37,24 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
public CategoryPlotReportDataContentPane(ChartDataPane parent) {
initEveryPane();
categoryName = initCategoryBox(Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
categoryName.setPreferredSize(new Dimension(236,30));
categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,20));
this.add(categoryName, "0,0,1,0");
this.setLayout(new BorderLayout());
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane);
panel.setBorder(getSidesBorder());
filterPane.setBorder(getFilterPaneBorder());
this.add(panel, "0,6,1,4"); }
this.add(column(
cell(categoryName),
fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane))
).getComponent());
}
protected TinyFormulaPane initCategoryBox(final String leftLabel) {
TinyFormulaPane categoryName = new DefaultTinyFormulaPane() {
@Override
protected void initLayout() {
this.setLayout(new BorderLayout(4, 0));
if(StringUtils.isNotEmpty(leftLabel)) {
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
label1.setPreferredSize(new Dimension(75, 20));
this.add(label1, BorderLayout.WEST);
}
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
UILabel label = new UILabel(leftLabel);
this.setLayout(new BorderLayout());
this.add(row(
cell(label).weight(1.2), cell(formulaTextField).weight(2), flex(0.1), cell(formulaTextFieldButton).weight(0.4)
).getComponent());
}
public void okEvent() {

102
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -1,28 +1,25 @@
package com.fr.design.mainframe.chart.gui.data.table;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
@ -30,6 +27,11 @@ import java.awt.event.ItemListener;
import java.util.ArrayList;
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;
/**
* 多分类轴 的数据集定义界面.
*
@ -38,9 +40,6 @@ import java.util.List;
*/
public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableDataContentPane implements UIObserver {
private static final long serialVersionUID = -3305681053750642843L;
private static final int COMBOX_GAP = 8;
private static final int COMBOX_WIDTH = 95;
private static final int COMBOX_HEIGHT = 20;
private JPanel boxPane;
@ -59,40 +58,37 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public CategoryPlotMoreCateTableDataContentPane(ChartDataPane parent) {
categoryCombox = new UIComboBox();
categoryCombox.setPreferredSize(new Dimension(COMBOX_WIDTH,COMBOX_HEIGHT));
JPanel categoryPane = new JPanel(new BorderLayout(4, 0));
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel categoryLabel = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
categoryLabel.setPreferredSize(new Dimension(85,COMBOX_HEIGHT));
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
addButton.setPreferredSize(new Dimension(20, COMBOX_HEIGHT));
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox, addButton, null, categoryLabel, null}));
categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15));
UILabel categoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
addButton = new UIButton(new LazyIcon("add"));
boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
categoryPane.add(boxPane, BorderLayout.SOUTH);
JPanel categoryPane = column(10,
row(
cell(categoryLabel).weight(1.2),
cell(categoryCombox).weight(2.4),
flex(0.1),
cell(addButton).weight(0.5)
),
cell(boxPane)
).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())).getComponent();
this.setLayout(new BorderLayout());
this.add(categoryPane, BorderLayout.NORTH);
this.add(getJSeparator());
seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot());
this.add(seriesTypeComboxPane, BorderLayout.SOUTH);
this.add(FineLayoutBuilder.createVerticalLayout(10, categoryPane, seriesTypeComboxPane));
addButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (boxList.size() < 2) {
addNewCombox();
addNewComboBox();
relayoutPane();
}
checkSeriseUse(categoryCombox.getSelectedItem() != null);
checkComponent();
}
});
@ -112,49 +108,39 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
addButton.setEnabled(hasUse);
}
private UIComboBox addNewCombox() {
final JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
final UIComboBox combox = new UIComboBox();
combox.setPreferredSize(new Dimension(COMBOX_WIDTH, COMBOX_HEIGHT));
private UIComboBox addNewComboBox() {
final UIComboBox comboBox = new UIComboBox();
int count = categoryCombox.getItemCount();
for (int i = 0; i < count; i++) {
combox.addItem(categoryCombox.getItemAt(i));
comboBox.addItem(categoryCombox.getItemAt(i));
}
combox.registerChangeListener(uiobListener);
combox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
makeToolTipUse(combox);
}
});
comboBox.registerChangeListener(uiobListener);
comboBox.addItemListener(e -> makeToolTipUse(comboBox));
comboBox.setSelectedItem(categoryCombox.getItemAt(0));
makeToolTipUse(comboBox);
combox.setSelectedItem(categoryCombox.getItemAt(0));
makeToolTipUse(combox);
UIButton delButton = new UIButton(new LazyIcon("close"));
JPanel buttonPane = row(
flex(1.2), cell(comboBox).weight(2.4), flex(0.1), cell(delButton).weight(0.5)
).with(it -> it.setBorder(new ScaledEmptyBorder(0, 0, 10, 0))).getComponent();
buttonPane.add(combox);
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
buttonPane.add(delButton);
boxPane.add(buttonPane);
boxList.add(combox);
boxList.add(comboBox);
checkComponent();
delButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane);
boxList.remove(combox);
checkComponent();
relayoutPane();
}
delButton.addActionListener(e -> {
boxPane.remove(buttonPane);
boxList.remove(comboBox);
checkComponent();
relayoutPane();
});
delButton.registerChangeListener(uiobListener);
return combox;
return comboBox;
}
private void checkAddButton() {
@ -223,7 +209,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
int size = normal.getMoreCateSize();
for (int i = 0; i < size; i++) {
UIComboBox box = addNewCombox();
UIComboBox box = addNewComboBox();
box.setSelectedItem(normal.getMoreCateWithIndex(i));
}
}

44
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java

@ -6,22 +6,21 @@ import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.BorderLayout;
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;
/**
* 属性表, 矩形类的 数据集 数据界面.
* @author kunsnat E-mail:kunsnat@gmail.com
@ -40,29 +39,24 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
public CategoryPlotTableDataContentPane(ChartDataPane parent) {
categoryCombox = new UIComboBox();
JPanel categoryPane = new JPanel(new BorderLayout(4,0));
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label1 = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ;
label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
categoryCombox.setPreferredSize(new Dimension(100,20));
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ;
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox,null,null,label1,null}));
categoryPane.setPreferredSize(new Dimension(246,30));
categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15));
this.setLayout(new BorderLayout());
this.add(categoryPane, BorderLayout.NORTH);
this.add(getJSeparator());
seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot());
this.add(seriesTypeComboxPane, BorderLayout.SOUTH);
categoryCombox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
}
this.setLayout(new BorderLayout());
this.add(column(10,
row(
cell(label).weight(1.2), cell(categoryCombox).weight(3)
),
cell(seriesTypeComboxPane)
).getComponent()
);
categoryCombox.addItemListener(e -> {
checkSeriseUse(categoryCombox.getSelectedItem() != null);
makeToolTipUse(categoryCombox);
});
}

57
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java

@ -6,17 +6,14 @@ import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.data.util.function.AbstractDataFunction;
import com.fr.data.util.function.NoneFunction;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.extended.chart.UIComboBoxWithNone;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.List;
import java.awt.BorderLayout;
@ -25,6 +22,11 @@ import java.awt.Dimension;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
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.row;
/**
* 属性表 数据集 系列名使用 系列值 界面.
*
@ -45,9 +47,6 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
calculateCombox = new CalculateComboBox();
calculateCombox.reset();
isNeedSummary = true;
seriesName.setPreferredSize(new Dimension(100, 75));
seriesValue.setPreferredSize(new Dimension(100, 75));
calculateCombox.setPreferredSize(new Dimension(100, 75));
seriesName.addItemListener(new ItemListener() {
@Override
@ -76,39 +75,37 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
}
private void initCenterPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p};
UILabel Label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
Component[][] components = getUseComponent(Label1, Label2, Label3);
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6);
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
centerPane = column(10,
row(
cell(Label1).weight(1), cell(seriesName).weight(2)
),
row(
cell(Label2).weight(1), cell(seriesValue).weight(2)
),
row(
cell(Label3).weight(1), cell(calculateCombox).weight(2)
),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))
).getComponent();
this.setLayout(new BorderLayout());
this.add(centerPane, BorderLayout.CENTER);
}
private void initCenterPaneWithOutCaculateSummary() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p, p};
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
label1.setPreferredSize(getLabelDimension());
UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
label2.setPreferredSize(getLabelDimension());
UILabel label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
label3.setPreferredSize(getLabelDimension());
Component[][] components = getUseComponentWithOutSummary(label1, label2, label3);
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6);
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
centerPane = column(10,
row(
cell(label1).weight(1), cell(seriesName).weight(2)
),
row(
cell(label2).weight(1), cell(seriesValue).weight(2)
),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))
).getComponent();
this.setLayout(new BorderLayout());
this.add(centerPane, BorderLayout.CENTER);
}

39
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -1,30 +1,32 @@
package com.fr.design.mainframe.chart.gui.data.table;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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.row;
/**
* 属性表: 柱形, 饼图 数据集界面, "系列名使用"界面.
*
@ -98,32 +100,21 @@ public class SeriesTypeUseComboxPane extends BasicBeanPane<ChartCollection> {
}
protected void initLayout() {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM));
JPanel northPane = new JPanel(new BorderLayout(4, 0));
this.setLayout(new BorderLayout());
//使用系列名/系列值选项面板
UILabel seriesLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"));
seriesLabel.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
JPanel borderLayoutPane = GUICoreUtils.createBorderLayoutPane(new Component[]{content, null, null, seriesLabel, null});
northPane.add(borderLayoutPane);
northPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 16));
this.add(northPane, BorderLayout.NORTH);
//系列名/系列值配置面板
cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
this.add(cardPane, BorderLayout.CENTER);
//数据筛选
dataScreeningPane = new ChartDataFilterPane(this.initplot, parent);
JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 250, 24, dataScreeningPane);
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(panel, BorderLayout.SOUTH);
}
public Dimension getPreferredSize() {
Dimension preferredSize = super.getPreferredSize();
return new Dimension(246, (int) preferredSize.getHeight());
this.add(column(
row(
cell(seriesLabel).weight(1), cell(content).weight(2)
),
fix(10),
cell(cardPane),
cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), dataScreeningPane))
).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent());
}
/**

15
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fr.base.BaseUtils;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.FRContext;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
@ -18,7 +18,6 @@ import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.GeneralUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
@ -193,8 +192,8 @@ public class ChartTextAttrPane extends BasicPane {
protected void initState() {
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel());
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(new LazyIcon("italic"));
initFontColorState();
}
@ -217,11 +216,7 @@ public class ChartTextAttrPane extends BasicPane {
}
protected JPanel getContentPane(JPanel buttonPane) {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
}
protected double[] getRowSize() {

5
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.TextAttr;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
@ -7,7 +8,6 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
@ -33,7 +33,7 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
}
protected JPanel getContentPane(JPanel buttonPane) {
JPanel panel = new JPanel(new BorderLayout(0, 10));
JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
@ -46,7 +46,6 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
panel.add(preButtonPane, BorderLayout.CENTER);
panel.add(textFontPane, BorderLayout.SOUTH);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel;
}

16
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
@ -7,13 +8,10 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -40,7 +38,7 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
private void initContent() {
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color"), SwingConstants.LEFT);
UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color"));
Component[][] components = ChartEditContext.supportTheme() ? new Component[][]{
new Component[]{text, preButton},
new Component[]{null, colorSelectBox},
@ -48,23 +46,17 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
new Component[]{text, colorSelectBox}
};
JPanel gapTableLayoutPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components);
JPanel gapTableLayoutPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(gapTableLayoutPane, BorderLayout.CENTER);
}
private void initListener() {
preButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkPreButton();
}
});
preButton.addActionListener(e -> checkPreButton());
}
private void checkPreButton() {
colorSelectBox.setVisible(preButton.getSelectedIndex() == CUSTOM);
this.setPreferredSize(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23));
}
public String title4PopupWindow() {

51
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java

@ -3,29 +3,18 @@ package com.fr.design.mainframe.chart.gui.style;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JPanel;
import javax.swing.border.Border;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L;
private static final int MIN_TAB_HEIGHT = 25;
protected UIButtonGroup tabPane;
protected String[] nameArray;
public JPanel centerPane;
@ -57,54 +46,18 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
if (!paneList.isEmpty()) {
tabPane = new UIButtonGroup(nameArray);
tabPane.setSelectedIndex(0);
int prefHeight = tabPane.getPreferredSize().height;
int prefWidth = tabPane.getPreferredSize().width + 20; // 暂且加一个偏移量
int minWidth = 60 * nameArray.length;
tabPane.setPreferredSize(
new Dimension(prefWidth > minWidth ? prefWidth : minWidth,
prefHeight > MIN_TAB_HEIGHT ? prefHeight : MIN_TAB_HEIGHT));
tabPane.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
cardLayout.show(centerPane, nameArray[tabPane.getSelectedIndex()]);
}
});
centerPane.setBorder(myBorder);
tabPane.addActionListener(e -> cardLayout.show(centerPane, nameArray[tabPane.getSelectedIndex()]));
}
}
protected void initLayout() {
this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
this.add(tabPane, BorderLayout.NORTH);
}
this.add(centerPane, BorderLayout.CENTER);
}
private Border myBorder = new Border() {
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width,int height) {
Graphics2D g2d = (Graphics2D)g;
g2d.setColor(UIConstants.LINE_COLOR);
g2d.drawLine(0, 0, 0, height);
g2d.drawLine(tabPane.getPreferredSize().width - 1, 0, width - 2, 0);
g2d.drawLine(0, height - 1, width - 2, height - 1);
}
@Override
public boolean isBorderOpaque() {
return false;
}
@Override
public Insets getBorderInsets(Component c) {
return new Insets(2, 2, 2, 2);
}
};
/**
*
* @return 中间的内容面板的指定宽度

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java

@ -18,7 +18,6 @@ import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
@ -134,7 +133,6 @@ public class ChartCategoryPane extends ChartAxisUsePane<Axis>{
@Override
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(5, 10, 5, 0, original));
this.add(leftcontentPane);
}

1
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java

@ -70,7 +70,6 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return panel;
}

11
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java

@ -1,5 +1,7 @@
package com.fr.design.mainframe.chart.gui.type;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.chartattr.Chart;
import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.ibutton.UIToggleButton;
@ -7,8 +9,9 @@ import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane;
import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Graphics;
/**
* Created by Mitisky on 16/3/9.
@ -21,9 +24,9 @@ public abstract class ChartTabPane extends MultiTabPane<Chart> {
@Override
protected void initLayout() {
JPanel tabPanel = new JPanel(new BorderLayout());
tabPanel.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, getBackground()));
tabPanel.add(tabPane, BorderLayout.CENTER);
this.setLayout(new BorderLayout(0, 4));
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
this.add(tabPanel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER);
}

89
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java

@ -1,8 +1,10 @@
package com.fr.van.chart.column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.background.ImageBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup;
@ -10,28 +12,19 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartBeautyPane;
import com.fr.van.chart.designer.component.VanChartBeautyPaneWithGradientBar;
import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 新条形图系列界面
@ -52,20 +45,13 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{f,e})},
new Component[]{createBorderPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
contentPane = FineLayoutBuilder.createVerticalLayout(0,
createSeriesStylePane(),
createBorderPane(),
createStackedAndAxisPane(),
createTrendLinePane()
);
contentPane = FineLayoutBuilder.asBorderLayoutWrapped(contentPane);
return contentPane;
}
@ -74,55 +60,26 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
return new VanChartBorderWithRadiusPane(true);
}
private JPanel createSeriesStylePane(double[] row, double[] col) {
isFixedWidth = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
private JPanel createSeriesStylePane() {
isFixedWidth = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
columnWidth = new UISpinnerWithPx(0,1000,1,0);
columnWidth.setBorder(BorderFactory.createEmptyBorder(0, (int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0));
seriesGap = new UINumberDragPaneWithPercent(-100, 100);
categoryGap = new UINumberDragPaneWithPercent(0, 100);
isFillWithImage = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
isFillWithImage = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")});
imagePane = new ImageBackgroundQuickPane(false);
imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0));
JPanel panel1 = new JPanel(new BorderLayout());
JPanel isFixedWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Fixed_Column_Width"),isFixedWidth);
isFixedWidthPane.setBorder(BorderFactory.createEmptyBorder(0,0,6,0));
panel1.add(isFixedWidthPane, BorderLayout.NORTH);
panel1.add(columnWidth, BorderLayout.CENTER);
Component[][] components2 = new Component[][]{
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Series")),seriesGap},
new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Category")),categoryGap},
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Fixed_Column_Width")), isFixedWidth},
new Component[]{null, columnWidth},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Series")), seriesGap},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Category")), categoryGap},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), isFillWithImage},
new Component[]{null, imagePane}
};
JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, row, col);
JPanel borderPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
UILabel fillImageLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"));
Component[][] components3 = new Component[][]{
new Component[]{fillImageLabel, UIComponentUtils.wrapWithBorderLayoutPane(isFillWithImage)},
};
JPanel panel3 = TableLayout4VanChartHelper.createGapTableLayoutPane(components3, row, col);
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(panel1, BorderLayout.NORTH);
panel.add(panel2, BorderLayout.CENTER);
panel.add(panel3, BorderLayout.SOUTH);
JPanel borderPane = new JPanel(new BorderLayout());
borderPane.add(panel, BorderLayout.NORTH);
borderPane.add(imagePane, BorderLayout.CENTER);
isFixedWidth.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkColumnWidth();
}
});
isFillWithImage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkImagePane();
}
});
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), borderPane);
isFixedWidth.addActionListener(e -> checkColumnWidth());
isFillWithImage.addActionListener(e -> checkImagePane());
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"), borderPane);
}
private void checkAll() {

14
designer-chart/src/main/java/com/fr/van/chart/designer/AbstractVanChartScrollPane.java

@ -14,23 +14,9 @@ public abstract class AbstractVanChartScrollPane<T> extends BasicScrollPane<T> {
protected void layoutContentPane() {
leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original));
this.add(leftcontentPane);
}
protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) {
int width = parent.getWidth();
int height = parent.getHeight();
if (leftcontentPane.getPreferredSize().height > maxheight) {
scrollBar.setBounds(width - scrollBar.getWidth() - 1, 0, 6, height);
leftcontentPane.setBounds(0, -beginY, width - 6, height + beginY);
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 4, 0, 4, original));
} else {
leftcontentPane.setBounds(0, 0, width, height);
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 4, 0, 10, original));
}
}
public void reloaPane(JPanel pane){
super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());

60
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -1,15 +1,16 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.jxbrowser.JxUIPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.general.ComparatorUtils;
@ -22,7 +23,6 @@ import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox;
@ -52,6 +52,10 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
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;
/**
* 数据点提示内容界面含有通用设置富文本编辑器自定义JS界面
*/
@ -191,7 +195,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
initDetailPane();
initCenterPane();
JPanel content = new JPanel(new BorderLayout());
JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
content.add(createButtonPane(), BorderLayout.NORTH);
content.add(centerPanel, BorderLayout.CENTER);
@ -267,12 +271,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
private JPanel createButtonPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {f, p};
double[] row = {p, p};
if (supportRichEditor()) {
content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Common"),
@ -291,22 +289,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
new Component[]{content, null}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
}
protected JPanel createCommonFormatPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), getRowSize(p), new double[]{f, p});
JPanel formatContent = FineLayoutBuilder.compatibleTableLayout(10, getPaneComponents(), new double[]{1.2, 3});
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(getLabelContentTitle()), formatContent}
};
return TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p}, new double[]{f, e});
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
}
public JPanel createCommonStylePane() {
@ -316,13 +310,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
});
textAttrPane = createChartTextAttrPane();
JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton);
JPanel stylePanel = new JPanel(new BorderLayout());
stylePanel.add(buttonPane, BorderLayout.CENTER);
stylePanel.add(textAttrPane, BorderLayout.SOUTH);
stylePanel = column(10,
row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"))).weight(1.2), cell(styleButton).weight(3)
),
cell(textAttrPane)
).getComponent();
initStyleButtonListener();
return stylePanel;
@ -360,19 +353,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
private JPanel createRichEditorPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content_Style")), createRichEditorButton()}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private JComponent createRichEditorButton() {
@ -485,12 +471,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
private JPanel createHtmlPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {f, p};
double[] row = {p, p};
htmlLabelPane = createHtmlLabelPane();
htmlLabelPane.setParent(parent);
@ -499,7 +479,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
new Component[]{htmlLabelPane, null}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(htmlComponents, row, column);
return FineLayoutBuilder.compatibleTableLayout(10, htmlComponents, new double[]{1.2, 3});
}
protected VanChartHtmlLabelPane createHtmlLabelPane() {
@ -514,7 +494,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel);
return new UIExpandablePane(title, panel, true);
}
protected double[] getRowSize(double p) {

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component;
import com.fine.theme.light.ui.FineButtonBorder;
import com.fr.chart.chartattr.Plot;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
@ -50,6 +51,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
public VanChartUIListControlPane() {
super();
this.setBorder(null);
getToolBar().setBorder(new FineButtonBorder());
iniListener();
}

39
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component.border;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.dialog.BasicPane;
@ -13,15 +14,18 @@ import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
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;
//线型 + 颜色
public class VanChartBorderPane extends BasicPane {
private static final long serialVersionUID = -7770029552989609464L;
@ -53,36 +57,24 @@ public class VanChartBorderPane extends BasicPane {
}
protected void initContent() {
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
Component[][] components = getUseComponent();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, getUseComponent(), new double[]{1.2, 3});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
}
protected void initColorPanel() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize;
UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color"));
Component[][] components;
if (autoButton != null) {
rowSize = new double[]{p, p};
components = new Component[][]{
new Component[]{colorLabel, autoButton},
new Component[]{null, currentLineColorPane}
};
colorPanel = column(10,
row(cell(colorLabel).weight(1.2), cell(autoButton).weight(3)),
row(flex(1.2), cell(currentLineColorPane).weight(3))
).getComponent();
} else {
rowSize = new double[]{p};
components = new Component[][]{
new Component[]{colorLabel, currentLineColorPane}
};
colorPanel = row(
cell(colorLabel).weight(1.2), cell(currentLineColorPane).weight(3)
).getComponent();
}
colorPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
}
protected double[] getRowSize() {
@ -111,7 +103,6 @@ public class VanChartBorderPane extends BasicPane {
private void checkPreButton() {
currentLineColorPane.setVisible(autoButton.getSelectedIndex() == 1);
currentLineColorPane.setPreferredSize(autoButton.getSelectedIndex() == 1 ? new Dimension(0, 20) : new Dimension(0, 0));
}
/**

14
designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java

@ -1,13 +1,10 @@
package com.fr.van.chart.designer.component.format;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout;
import java.awt.Component;
@ -30,19 +27,14 @@ public class FormatPaneWithNormalType extends FormatPaneWithOutFont {
}
protected void setTypeComboBoxPane(UIComboBox typeComboBox) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p};
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getTypeComboBoxComponent(typeComboBox), rowSize, columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, getTypeComboBoxComponent(typeComboBox), new double[]{1.2, 3});
this.add(panel, BorderLayout.NORTH);
}
protected Component[][] getTypeComboBoxComponent (UIComboBox typeComboBox) {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_DataType"), SwingConstants.LEFT), typeComboBox},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_DataType")), typeComboBox},
};
}

25
designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java

@ -1,47 +1,28 @@
package com.fr.van.chart.designer.component.format;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by mengao on 2017/8/28.
* 只有文本格式设置没有字体设置
*/
public class FormatPaneWithOutFont extends FormatPane {
private static final int HEIGHT = 30;
protected JPanel createContentPane(Component[][] components) {
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] rowSize = {p, p, p};
double[] columnSize = {f, e};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
typePane.setBorder(BorderFactory.createEmptyBorder());
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format")), typePane},
new Component[]{null, centerPane},
};
}
public Dimension getPreferredSize() {
//todo @mango
if (getTypeComboBox().getSelectedIndex() == 0) {
return new Dimension((int)getTypeComboBox().getPreferredSize().getWidth(), HEIGHT);
}
return new Dimension((int)super.getPreferredSize().getWidth(), (int)super.getPreferredSize().getHeight());
}
}

121
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -1,5 +1,8 @@
package com.fr.van.chart.designer.style;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
@ -11,8 +14,6 @@ import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
@ -21,14 +22,13 @@ import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType;
import com.fr.stable.Constants;
import com.fr.stable.collections.combination.Pair;
import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
@ -41,6 +41,10 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
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.row;
/**
* 属性表, 图表样式-图例 界面.
*/
@ -113,16 +117,12 @@ public class VanChartPlotLegendPane extends BasicPane {
isLegendVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Legend_Visible"));
legendPane = createLegendPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p, p};
Component[][] components = new Component[][]{
new Component[]{isLegendVisible},
new Component[]{legendPane},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
@ -141,20 +141,14 @@ public class VanChartPlotLegendPane extends BasicPane {
borderPane = new VanChartBorderWithRadiusPane();
backgroundPane = creatBackgroundPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createTitleStylePane(), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy()), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
Column column = FineLayoutBuilder.createVerticalExpandPaneLayout(0,
new Pair<>(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), createTitlePositionPane()),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), createTitleStylePane()),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy())
);
return FineLayoutBuilder.asBorderLayoutWrapped(column);
}
protected VanChartBackgroundPane creatBackgroundPane(){
@ -166,27 +160,21 @@ public class VanChartPlotLegendPane extends BasicPane {
backgroundPane = creatBackgroundPane();
fixedCheckPane = createFixedCheckPane();
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
panel.add(createDisplayStrategy(), BorderLayout.CENTER);
panel.add(fixedCheckPane, BorderLayout.SOUTH);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null},
new Component[]{createTitleStylePane(), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel), null},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
Column column = FineLayoutBuilder.createVerticalExpandPaneLayout(0,
new Pair<>(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), createTitlePositionPane()),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), createTitleStylePane()),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel)
);
return FineLayoutBuilder.asBorderLayoutWrapped(column);
}
private JPanel createTitlePositionPane(double[] row, double[] col) {
private JPanel createTitlePositionPane() {
String[] textArray = {
Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"),
Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"),
@ -213,7 +201,6 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setEventBannded(true);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), location},
new Component[]{null, customFloatPositionButton}
};
@ -223,13 +210,12 @@ public class VanChartPlotLegendPane extends BasicPane {
initPositionListener();
JPanel positionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
JPanel positionPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel panel = new JPanel(new BorderLayout());
panel.add(positionPane, BorderLayout.NORTH);
panel.add(layoutPane, BorderLayout.CENTER);
return column(10,
cell(positionPane), cell(layoutPane)
).getComponent();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel);
}
private JPanel createLayoutPane() {
@ -237,16 +223,11 @@ public class VanChartPlotLegendPane extends BasicPane {
new String[]{Toolkit.i18nText("Fine-Design_Chart_Layout_Flow"), Toolkit.i18nText("Fine-Design_Chart_Layout_Aligned")},
new LayoutType[]{LayoutType.FLOW, LayoutType.ALIGNED});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrange")), layoutButton}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p, p}, new double[]{f, e});
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private void initPositionListener() {
@ -290,48 +271,34 @@ public class VanChartPlotLegendPane extends BasicPane {
private JPanel createTitleStylePane() {
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
return textAttrPane;
}
private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
customSize = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")});
maxProportionPane = row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"))).weight(1.2),
cell(maxProportion).weight(3)
).getComponent();
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Area_Size"), customSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
customSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane(false);
// return limitPane;
customSize.addActionListener(e -> checkMaxProPortionUse());
Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Size")), customSize},
new Component[]{maxProportionPane, null}
};
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
}
private JPanel createFixedCheckPane() {
fixedCheck = new UICheckBox(Toolkit.i18nText("Fine-Engine_Chart_Open_Fixed_Display"));
fixedCheckLabel = new UILabel(Toolkit.i18nText("Fine-Engine_Chart_Fixed_Display"));
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{fixedCheckLabel, fixedCheck}
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
}
protected void checkAllUse() {

155
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -1,10 +1,13 @@
package com.fr.van.chart.designer.style;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr;
import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane;
@ -15,8 +18,6 @@ import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
@ -29,25 +30,24 @@ import com.fr.stable.Constants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
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.row;
// 属性表-样式 标题界面
public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private static final long serialVersionUID = -2438898431228882682L;
@ -96,131 +96,108 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private void initComponents() {
isTitleVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Title_Visible"));
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Title_Tooltip") + "</html>");
tooltipLabel.setForeground(Color.gray);
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
FineUIStyle.setStyle(tooltipLabel, FineUIStyle.LABEL_TIP);
tooltipLabel.setVisible(false);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(isTitleVisible, BorderLayout.NORTH);
panel.add(tooltipLabel, BorderLayout.CENTER);
titlePane = createTitlePane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{panel},
new Component[]{titlePane}
};
JPanel panel1 = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel1, BorderLayout.CENTER);
this.add(column(
cell(isTitleVisible),
cell(tooltipLabel),
cell(titlePane)
).getComponent(), BorderLayout.CENTER);
isTitleVisible.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
checkTitlePaneUse();
}
});
isTitleVisible.addActionListener(e -> checkTitlePaneUse());
}
}
private JPanel createTitlePane() {
backgroundPane = createBackgroundPane();
return column(
cell(createTitleContentPane()),
fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(createTitlePositionPane()),
fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(createTitleStylePane()),
fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane)),
fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
cell(createDisplayStrategy())
).getComponent();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {p, f};
double[] column = {f, e};
double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{createTitleContentPane(new double[]{p, p, p}, column), null},
new Component[]{createTitlePositionPane(new double[]{p, p, p}, column), null},
new Component[]{createTitleStylePane(), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane), null},
new Component[]{createDisplayStrategy(), null}
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
}
protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() {
return new VanChartBackgroundWithOutShadowWithRadiusPane();
}
private JPanel createTitleContentPane(double[] row, double[] col) {
private JPanel createTitleContentPane() {
titleContent = new DefaultTinyFormulaPane();
useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(useHtml);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT), titleContent},
new Component[]{null, useHtml},
};
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), panel);
JPanel titleContentPane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT)).weight(1.2),
cell(titleContent).weight(3)
)).getComponent();
return new UIExpandablePane(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), titleContentPane);
}
private JPanel createTitlePositionPane(double[] row, double[] col) {
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"),
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")};
private JPanel createTitlePositionPane() {
Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
{new LazyIcon("h_center"), new LazyIcon("h_center").white()},
{new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
alignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment);
alignmentPane = new UIButtonGroup<>(hAlignmentIconArray, alignment);
customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position"));
UIComponentUtils.setLineWrap(customFloatPositionButton);
customFloatPositionButton.setEventBannded(true);
Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_BorderLayout_Constraints"), SwingConstants.LEFT), alignmentPane},
new Component[]{null, customFloatPositionButton}
};
customFloatPositionPane = new VanChartFloatPositionPane();
initPositionListener();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel);
JPanel titlePositionPane = column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_BorderLayout_Constraints"))).weight(1.2),
cell(alignmentPane).weight(3)
),
cell(customFloatPositionButton)
).getComponent();
return new UIExpandablePane(
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), titlePositionPane);
}
private JPanel createTitleStylePane() {
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane);
}
private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
limitSize = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
limitSize = new UIButtonGroup<>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Limit"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Not_Limit")});
maxProportionPane = row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"))).weight(1.2),
cell(maxProportion).weight(3)
).getComponent();
JPanel limitSizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"), limitSize);
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH);
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0));
JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH);
panel.add(maxProportionPane, BorderLayout.CENTER);
panel.add(column(10,
row(
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Size"))).weight(1.2),
cell(limitSize).weight(3)
),
cell(maxProportionPane)
limitSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
).getComponent());
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
limitSize.addActionListener(e -> checkMaxProPortionUse());
//区域显示策略 恢复用注释。结束删除。
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane();
// return limitPane;
}
private void initPositionListener() {

26
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java

@ -1,16 +1,15 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithThemeStyle;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
@ -52,16 +51,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
} else {
chartBackgroundPane = ChartEditContext.supportTheme() ? new VanChartBackgroundPaneWithThemeStyle() : new VanChartBackgroundPane();
}
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)},
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane, true)},
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)},
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
contentPane.add(panel, BorderLayout.CENTER);
if (!isPlot) {
@ -79,10 +73,6 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
chartBorderPane = new VanChartBorderWithRadiusPane();
chartBackgroundPane = new VanChartBackgroundPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components;
if (plot.isSupportBorder()) {//有边框和背景
@ -97,7 +87,7 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
};
}
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
contentPane.add(panel, BorderLayout.CENTER);
parent.initAllListeners();
@ -109,8 +99,8 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
protected Component[][] initComponents() {
return new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane)},
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane, true)},
new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Background"), chartBackgroundPane, true)},
new Component[]{chartAxisAreaPane}
};
}

14
designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot;
import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
@ -11,12 +12,11 @@ import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
/**
* 属性表, 图表样式-背景界面.
@ -35,16 +35,12 @@ public class VanChartAreaPane extends ThirdTabPane<VanChart> implements AutoSele
protected void initLayout() {
this.setLayout(new BorderLayout());
this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) {
pane.add(tabPane);
tabPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(pane, BorderLayout.NORTH);
this.add(cell(tabPane).getComponent(), BorderLayout.NORTH);
}
}
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(centerPane, BorderLayout.CENTER);
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save