Browse Source

Pull request #14255: REPORT-113994 【NewUI】设计器样式翻新-图表

Merge in DESIGN/design from ~LEVY.XIE/design:newui to newui

* commit '462452de1a3dd750797c32d05045364e518b2ad1':
  REPORT-113994 【NewUI】设计器样式翻新-图表
newui
Levy.Xie-解安森 4 months ago
parent
commit
6689795fef
  1. 2
      build.gradle
  2. 155
      designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java
  3. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  4. 13
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  5. 13
      designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java
  6. 6
      designer-base/src/main/java/com/fr/design/condition/LiteConditionPane.java
  7. 26
      designer-base/src/main/java/com/fr/design/foldablepane/UIExpandablePane.java
  8. 14
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  9. 7
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java
  10. 4
      designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationPane.java
  11. 1
      designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBoxRenderer.java
  12. 122
      designer-base/src/main/java/com/fr/design/gui/style/FormatPane.java
  13. 5
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  14. 6
      designer-chart/src/main/java/com/fr/design/mainframe/ChartPropertyPane.java
  15. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/AbstractChartAttrPane.java
  16. 101
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  17. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  18. 128
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java
  19. 38
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java
  20. 33
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  21. 17
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  22. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/AbstractReportDataContentPane.java
  23. 92
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  24. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java
  25. 102
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  26. 44
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  27. 57
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  28. 39
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  29. 15
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  30. 5
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java
  31. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ColorSelectBoxWithThemeStyle.java
  32. 51
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  33. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/axis/ChartCategoryPane.java
  34. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  35. 11
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java
  36. 89
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  37. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/AbstractVanChartScrollPane.java
  38. 60
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  39. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  40. 39
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java
  41. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithNormalType.java
  42. 25
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/FormatPaneWithOutFont.java
  43. 121
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  44. 155
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  45. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaBackgroundPane.java
  46. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java
  47. 43
      designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java
  48. 8
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java
  49. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  50. 21
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java
  51. 36
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  52. 37
      designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java
  53. 3
      designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java
  54. 1
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java

2
build.gradle

@ -90,7 +90,7 @@ allprojects {
implementation 'com.github.weisj:jsvg:1.2.0' implementation 'com.github.weisj:jsvg:1.2.0'
implementation 'com.formdev:flatlaf:3.4' implementation 'com.formdev:flatlaf:3.4'
implementation 'com.formdev:flatlaf-extras:3.4' implementation 'com.formdev:flatlaf-extras:3.4'
implementation 'com.fanruan.vito:gui-inspector:1.0.1' implementation 'com.fanruan.vito:gui-inspector:1.0.2'
implementation 'com.fine.swing.ui:layout:1.0-SNAPSHOT' implementation 'com.fine.swing.ui:layout:1.0-SNAPSHOT'
testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1'

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;
}
}

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

@ -31,6 +31,7 @@ public interface FineUIStyle {
String LABEL_TIP = "tipLabel"; String LABEL_TIP = "tipLabel";
String PLAIN_BUTTON = "plainButton"; String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup"; String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton";
String MENU_TOOL_BAR = "menuToolBar"; String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar"; 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; package com.fr.design.actions.file;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.fine.theme.utils.FineUIUtils; 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.editor.editor.IntegerEditor;
import com.fr.design.file.SaveSomeTemplatePane; import com.fr.design.file.SaveSomeTemplatePane;
import com.fr.design.gui.frpane.FineTabbedPane; 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.UIButton;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UINoThemeColorButton; 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.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager; import com.fr.report.ReportConfigManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.logging.log4j.Level; import com.fr.third.apache.logging.log4j.Level;
@ -299,7 +298,7 @@ public class PreferencePane extends BasicPane {
// 启动页配置 // 启动页配置
cell(createStartupPagePane()) cell(createStartupPagePane())
).weight(1).getComponent(); ).weight(1).getComponent();
UIScrollPane generalScrollPane = patchScroll(generalPane); JPanel generalScrollPane = patchScroll(FineLayoutBuilder.asBorderLayoutWrapped(generalPane));
// 高级面板 // 高级面板
JPanel advancePane = column(SETTING_V_GAP, JPanel advancePane = column(SETTING_V_GAP,
@ -327,7 +326,7 @@ public class PreferencePane extends BasicPane {
cell(createDesignerStartupPane()) cell(createDesignerStartupPane())
).weight(1).getComponent(); ).weight(1).getComponent();
useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager")); useUniverseDBMCheckbox = new UICheckBox(i18nText("Fine-Design_Basic_Use_Universe_Database_Manager"));
UIScrollPane adviceScrollPane = patchScroll(advancePane); JPanel adviceScrollPane = patchScroll(advancePane);
// 版本管理面板 // 版本管理面板
//初始化vcs总面板 //初始化vcs总面板
@ -339,7 +338,7 @@ public class PreferencePane extends BasicPane {
// vcsPane // vcsPane
createVcsSettingPane(vcsPane, vcsParentPane, cardLayout); createVcsSettingPane(vcsPane, vcsParentPane, cardLayout);
//添加滚动条 //添加滚动条
UIScrollPane vcsScrollPane = patchScroll(vcsPane); JPanel vcsScrollPane = patchScroll(vcsPane);
//配置面板作为vcs总面板的一张卡片 //配置面板作为vcs总面板的一张卡片
vcsParentPane.add(vcsScrollPane, VcsMovePanel.SETTING); vcsParentPane.add(vcsScrollPane, VcsMovePanel.SETTING);
@ -428,10 +427,10 @@ public class PreferencePane extends BasicPane {
} }
@NotNull @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 uiScrollPane = new UIScrollPane(generalPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
uiScrollPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10)); uiScrollPane.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
return uiScrollPane; return FineLayoutBuilder.asBorderLayoutWrapped(uiScrollPane);
} }
private void createVcsSettingPane(JPanel generalPane, JPanel parentPane, CardLayout cardLayout) { 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.FineUIScale;
import com.fine.theme.utils.FineUIStyle; 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.gui.ibutton.UIButton;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -46,11 +46,12 @@ public class AboutDialog extends JDialog implements ActionListener {
FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY); FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY);
okButton.addActionListener(this); okButton.addActionListener(this);
tabbedPane = new UITabbedPane();
sysPane = new SystemInfoPane(); sysPane = new SystemInfoPane();
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_About"), aboutPanel); tabbedPane = FineTabbedPane.builder()
tabbedPane.addTab(com.fr.design.i18n.Toolkit.i18nText("FIne-Design_Basic_System"), sysPane); .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 = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane();
buttonPanel.add(okButton); buttonPanel.add(okButton);
@ -79,7 +80,7 @@ public class AboutDialog extends JDialog implements ActionListener {
this.getRootPane().setDefaultButton(okButton); 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); GUICoreUtils.centerWindow(this);
} }
@ -96,6 +97,6 @@ public class AboutDialog extends JDialog implements ActionListener {
private SystemInfoPane sysPane; private SystemInfoPane sysPane;
private JPanel buttonPanel; private JPanel buttonPanel;
private UITabbedPane tabbedPane; private FineTabbedPane tabbedPane;
private UIButton okButton; 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(); JPanel buttonPane = initButtonPane();
JScrollPane treeScrollPane = iniTreeScrollPane(); JScrollPane treeScrollPane = iniTreeScrollPane();
// 滚动面板不能直接加入row-col布局,需设定宽高 // 滚动面板不能直接加入row-col布局,需设定宽高
treeScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 250))); treeScrollPane.setPreferredSize(FineUIScale.scale(new Dimension(600, 240)));
JPanel previewPane = column( JPanel previewPane = column(
cell(northButtonPane), cell(northButtonPane),
row( row(
@ -571,8 +571,8 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
row(5, row(5,
cell(andRadioButton).weight(0.5), cell(andRadioButton).weight(0.5),
cell(orRadioButton).weight(0.5) cell(orRadioButton).weight(0.5)
).weight(0.25), ).weight(0.35),
flex(0.5), flex(0.4),
row(5, row(5,
cell(addButton).weight(0.5), cell(addButton).weight(0.5),
cell(modifyButton).weight(0.5) cell(modifyButton).weight(0.5)

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

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

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.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -32,9 +33,9 @@ public class FineTabbedPane extends Column {
private JPanel centerPane; private JPanel centerPane;
private final float headRatio; private final float headRatio;
private final UIButtonGroup<String> tabGroup; 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.headRatio = headRatio;
this.tabComponents = tabComponents; this.tabComponents = tabComponents;
@ -60,7 +61,7 @@ public class FineTabbedPane extends Column {
public static class TabPaneBuilder { public static class TabPaneBuilder {
private int[] tabLayout; private int[] tabLayout;
private float headRatio = 0.5f; private float headRatio = 0.5f;
private final Map<String, Component> tabComponents = new LinkedHashMap<>(); private final Map<String, JComponent> tabComponents = new LinkedHashMap<>();
/** /**
* 设置头部居中比例0-1之间 * 设置头部居中比例0-1之间
@ -117,14 +118,17 @@ public class FineTabbedPane extends Column {
private void initLayout() { private void initLayout() {
cards = new CardLayout(); cards = new CardLayout();
centerPane = new JPanel(cards); 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; float flexRatio = (1 - headRatio) / 2;
add( add(
row( row(
flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio) flex(flexRatio), cell(tabGroup).weight(headRatio), flex(flexRatio)
), ),
fix(5), 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)); 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; 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.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.DialogActionListener;
import com.fr.design.dialog.UIDialog; import com.fr.design.dialog.UIDialog;
@ -225,9 +224,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver {
} }
protected void initAddButton() { protected void initAddButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); addButton = new UIButton(new LazyIcon("add"));
addButton.setBorderType(UIButton.OTHER_BORDER);
addButton.setOtherBorder(UIConstants.BS, UIConstants.LINE_COLOR);
} }
private void initAddButtonListener() { 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.event.ChangeListener;
import javax.swing.table.TableCellEditor; 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.constants.UIConstants;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -212,7 +212,7 @@ public class UICorrelationPane extends JPanel implements UIObserver {
} }
protected void initAddButton() { protected void initAddButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")) { addButton = new UIButton(new LazyIcon("add")) {
public boolean shouldResponseChangeListener() { public boolean shouldResponseChangeListener() {
return false; 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.setForeground(list.getForeground());
renderer.setBackground(list.getBackground()); renderer.setBackground(list.getBackground());
} }
renderer.setText(" " + renderer.getText());
return renderer; return renderer;
} }
} }

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

@ -1,7 +1,10 @@
package com.fr.design.gui.style; 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.CoreDecimalFormat;
import com.fr.base.GraphHelper;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.data.core.FormatField; 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.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; 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.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel; 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.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.math.RoundingMode; import java.math.RoundingMode;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JLabel; import javax.swing.JLabel;
import javax.swing.JList; import javax.swing.JList;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.UIManager;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -53,13 +48,7 @@ import java.text.SimpleDateFormat;
*/ */
public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver { public class FormatPane extends AbstractBasicStylePane implements GlobalNameObserver {
private static final long serialVersionUID = 724330854437726751L; 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 int CURRENCY_FLAG_POINT = 6;
private static final Border LEFT_BORDER = BorderFactory.createEmptyBorder(0, 30, 0, 0);
private static final Integer[] TYPES = new Integer[]{ private static final Integer[] TYPES = new Integer[]{
FormatContents.NULL, FormatContents.NUMBER, FormatContents.NULL, FormatContents.NUMBER,
@ -85,6 +74,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
private boolean isRightFormat; private boolean isRightFormat;
private boolean isDate = false; private boolean isDate = false;
private GlobalNameListener globalNameListener = null; private GlobalNameListener globalNameListener = null;
private JPanel self = this;
/** /**
* Constructor. * Constructor.
@ -98,14 +88,10 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
} }
protected void initComponents(Integer[] types) { protected void initComponents(Integer[] types) {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout());
initSampleLabel(); initSampleLabel();
contentPane = new JPanel(new BorderLayout(0, 4)) { contentPane = new JPanel();
@Override contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 65);
}
};
typeComboBox = new UIComboBox(types); typeComboBox = new UIComboBox(types);
UIComboBoxRenderer render = createComBoxRender(); UIComboBoxRenderer render = createComBoxRender();
typeComboBox.setRenderer(render); typeComboBox.setRenderer(render);
@ -113,7 +99,7 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
typeComboBox.setGlobalName("typeComboBox"); typeComboBox.setGlobalName("typeComboBox");
contentPane.add(sampleLabel, BorderLayout.NORTH); contentPane.add(sampleLabel, BorderLayout.NORTH);
txtCenterPane = new JPanel(new BorderLayout()); txtCenterPane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
textField = new TextFontComboBox(); textField = new TextFontComboBox();
textField.addItemListener(textFieldItemListener); textField.addItemListener(textFieldItemListener);
textField.setEditable(true); textField.setEditable(true);
@ -122,58 +108,38 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
contentPane.add(txtCenterPane, BorderLayout.CENTER); contentPane.add(txtCenterPane, BorderLayout.CENTER);
centerPane = new JPanel(new CardLayout()); centerPane = new JPanel(new BorderLayout());
centerPane.add(new JPanel(), "hide"); centerPane.add(contentPane);
centerPane.setPreferredSize(new Dimension(0, 0));
centerPane.add(contentPane, "show");
frFontPane = new FRFontPane(); frFontPane = new FRFontPane();
UILabel font = new UILabel(Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT); UILabel font = new UILabel(Toolkit.i18nText("Fine-Design_Form_FR_Font"), SwingConstants.LEFT);
JPanel fontPane = new JPanel(new BorderLayout()); JPanel fontPane = new JPanel(new BorderLayout());
fontPane.add(font, BorderLayout.NORTH); fontPane.add(font, BorderLayout.NORTH);
typeComboBox.setPreferredSize(new Dimension(155,20));
JPanel typePane = new JPanel(new BorderLayout()); JPanel typePane = new JPanel(new BorderLayout());
typePane.add(typeComboBox, BorderLayout.CENTER); typePane.add(typeComboBox, BorderLayout.CENTER);
typePane.setBorder(LEFT_BORDER);
// centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER);
JPanel option = new JPanel(new BorderLayout()); JPanel option = new JPanel(new BorderLayout());
option.add(new UILabel(Toolkit.i18nText("Fine-Design_Report_Base_Option"), SwingConstants.LEFT), BorderLayout.WEST); 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 = 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"); roundingBox.setGlobalName("roundingBox");
option.add(roundingBox, BorderLayout.CENTER); option.add(roundingBox, BorderLayout.CENTER);
optionPane = new JPanel(new CardLayout()); optionPane = new JPanel(new BorderLayout());
optionPane.add(new JPanel(), "hide"); optionPane.add(option);
optionPane.setPreferredSize(new Dimension(0, 0));
optionPane.add(option, "show");
Component[][] components = getComponent(fontPane, centerPane, typePane); Component[][] components = getComponent(fontPane, centerPane, typePane);
this.add(createContentPane(components), BorderLayout.CENTER); this.add(createContentPane(components), BorderLayout.CENTER);
} }
protected JPanel createContentPane (Component[][] components) { protected JPanel createContentPane (Component[][] components) {
double f = TableLayout.FILL; return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
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);
} }
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, 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[]{centerPane, null},
new Component[]{optionPane, null}, new Component[]{optionPane, null},
new Component[]{fontPane, frFontPane}, new Component[]{fontPane, frFontPane},
@ -194,41 +160,17 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
} }
private void initSampleLabel() { private void initSampleLabel() {
Color labelColor = FineUIUtils.getUIColor("Label.tipColor", "inactiveCaption");
Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); Border interBorder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample"); String title = Toolkit.i18nText("Fine-Design_Report_Base_StyleFormat_Sample");
Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, UIConstants.LINE_COLOR); Border border = BorderFactory.createTitledBorder(interBorder, title, TitledBorder.LEFT, 0, null, labelColor);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) { 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);
}
};
sampleLabel.setHorizontalAlignment(UILabel.CENTER); sampleLabel.setHorizontalAlignment(UILabel.CENTER);
sampleLabel.setBorder(border); 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() { private void refreshPreviewLabel() {
this.sampleLabel.setText(FormatField.getInstance().getFormatValue()); this.sampleLabel.setText(FormatField.getInstance().getFormatValue());
this.sampleLabel.setForeground(UIManager.getColor("Label.foreground")); FineUIStyle.setStyle(sampleLabel, FineUIStyle.LABEL_TIP);
try { try {
isRightFormat = true; isRightFormat = true;
if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) { if (StringUtils.isEmpty(String.valueOf(textField.getSelectedItem()))) {
@ -369,38 +311,30 @@ public class FormatPane extends AbstractBasicStylePane implements GlobalNameObse
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
int contents = getFormatContents(); int contents = getFormatContents();
String[] items = FormatField.getInstance().getFormatArray(contents, false); String[] items = FormatField.getInstance().getFormatArray(contents, false);
CardLayout cardLayout = (CardLayout) centerPane.getLayout();
if (isTextOrNull()) { if (isTextOrNull()) {
centerPane.setPreferredSize(new Dimension(0, 0)); centerPane.setVisible(false);
cardLayout.show(centerPane, "hide");
} else { } else {
textField.removeAllItems(); textField.removeAllItems();
textField.setItemArray(items); textField.setItemArray(items);
textField.setSelectedIndex(0); textField.setSelectedIndex(0);
centerPane.setPreferredSize(new Dimension(270, 65)); centerPane.setVisible(true);
cardLayout.show(centerPane, "show");
} }
CardLayout optionLayout = ((CardLayout) optionPane.getLayout());
if (getFormatContents() == FormatContents.PERCENT) { if (getFormatContents() == FormatContents.PERCENT) {
optionPane.setPreferredSize(new Dimension(100, 20)); optionPane.setVisible(true);
optionLayout.show(optionPane, "show");
} else { } else {
optionPane.setPreferredSize(new Dimension(0, 0)); optionPane.setVisible(false);
optionLayout.show(optionPane, "hide");
roundingBox.setSelected(false); roundingBox.setSelected(false);
} }
self.repaint();
} }
} }
}; };
ItemListener textFieldItemListener = new ItemListener() { ItemListener textFieldItemListener = e -> {
@Override if (e.getStateChange() == ItemEvent.SELECTED) {
public void itemStateChanged(ItemEvent e) { refreshPreviewLabel();
if (e.getStateChange() == ItemEvent.SELECTED) {
refreshPreviewLabel();
}
} }
}; };

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

@ -1310,4 +1310,7 @@ CellOtherSetPane.height=$Component.defaultHeight
background: null; \ background: null; \
hoverBackground : null; \ hoverBackground : null; \
selectedBackground : null; \ selectedBackground : null; \
pressedBackground : null pressedBackground : null
[style]ToggleButton.compactButton = \
margin: 2,0,2,0

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

@ -4,6 +4,7 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
@ -21,8 +22,7 @@ import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Component;
public class ChartPropertyPane extends BaseChartPropertyPane { public class ChartPropertyPane extends BaseChartPropertyPane {
@ -44,6 +44,8 @@ public class ChartPropertyPane extends BaseChartPropertyPane {
protected void initComponent() { protected void initComponent() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
// 外部轮廓大小固定,适配滚动面板
this.setPreferredSize(FineUIScale.scale(new Dimension(getWidth(), 900)));
} }
@Override @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.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*;
public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane { public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
public abstract void populate(ChartCollection collection); public abstract void populate(ChartCollection collection);
@ -30,7 +29,6 @@ public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
protected void initContentPane() { protected void initContentPane() {
leftContentPane = createContentPane(); leftContentPane = createContentPane();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original));
this.add(leftContentPane, BorderLayout.CENTER); 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; 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.base.BaseUtils;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.chartattr.ChartCollection; 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.stable.StringUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image; import java.awt.Image;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
@ -46,7 +46,15 @@ import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashSet; import java.util.HashSet;
import java.util.List;
import java.util.Set; 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()); this.setLayout(new BorderLayout());
initButton(); initButton();
buttonPane = new JPanel(); buttonPane = new JPanel(new BorderLayout());
this.add(buttonPane, BorderLayout.CENTER); this.add(column(10,
row(5,
JPanel northPane = new JPanel(); cell(addButton).weight(0.5),
this.add(northPane, BorderLayout.NORTH); cell(copyButton).weight(0.5),
cell(moveForwardButton).weight(0.5),
northPane.setLayout(new BorderLayout()); cell(moveBackButton).weight(0.5),
northPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); flex(2),
cell(configButton).weight(0.5)
JPanel button = new JPanel(); ),
button.setPreferredSize(new Dimension(89, 20)); cell(buttonPane)
button.setLayout(new GridLayout(1, 4, 3, 0)); ).getComponent()
button.add(addButton); );
button.add(copyButton);
button.add(moveForwardButton);
button.add(moveBackButton);
northPane.add(button, BorderLayout.WEST);
northPane.add(configButton, BorderLayout.EAST);
initConfigCreator(); initConfigCreator();
// Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK);
} }
private void initButton() { private void initButton() {
addButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); addButton = new UIButton(new LazyIcon("add"));
configButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png")); configButton = new UIButton(new LazyIcon("tool_config"));
copyButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/m_edit/copy.png")); copyButton = new UIButton(new LazyIcon("tool_copy"));
copyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Action_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")); 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")); moveBackButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_HF_Move_Right"));
initAddButton(); initAddButton();
initConfigButton(); initConfigButton();
@ -151,7 +153,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
private void initAddButton() { private void initAddButton() {
addButton.setPreferredSize(new Dimension(20, 20));
addButton.addActionListener((e) -> { addButton.addActionListener((e) -> {
String name = getNewChartName(); String name = getNewChartName();
ChartProvider chart = getChangeStateNewChart(); ChartProvider chart = getChangeStateNewChart();
@ -168,12 +169,10 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
private void initConfigButton() { private void initConfigButton() {
configButton.setPreferredSize(new Dimension(20, 20));
configButton.addActionListener((e) -> showConfigDialog()); configButton.addActionListener((e) -> showConfigDialog());
} }
private void initCopyButton() { private void initCopyButton() {
copyButton.setPreferredSize(new Dimension(20, 20));
copyButton.addActionListener((e) -> { copyButton.addActionListener((e) -> {
String name = getCopyChartName(); String name = getCopyChartName();
ChartProvider chart = getCopyChart(); ChartProvider chart = getCopyChart();
@ -182,8 +181,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
private void initMoveButton() { private void initMoveButton() {
moveForwardButton.setPreferredSize(new Dimension(20, 20));
moveBackButton.setPreferredSize(new Dimension(20, 20));
moveForwardButton.addActionListener((e) -> moveForwardChart()); moveForwardButton.addActionListener((e) -> moveForwardChart());
moveBackButton.addActionListener((e) -> moveBackChart()); moveBackButton.addActionListener((e) -> moveBackChart());
} }
@ -335,18 +332,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
return; return;
} }
northPane.removeAll(); northPane.removeAll();
northPane.setLayout(new BoxLayout(northPane, BoxLayout.Y_AXIS)); northPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList));
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));
}
this.revalidate(); this.revalidate();
} }
@ -355,22 +341,12 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
return; return;
} }
northPane.removeAll(); northPane.removeAll();
northPane.setLayout(new BoxLayout(northPane, BoxLayout.Y_AXIS)); List<Component> components = IntStream.range(0, indexList.size())
.mapToObj(i -> i == index ? currentEditingEditor : indexList.get(i))
JPanel pane = null; .collect(Collectors.toList());
northPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, components));
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);
}
}
this.revalidate(); this.revalidate();
} }
/** /**
@ -518,6 +494,7 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
} }
}); });
FineUIStyle.setStyle(this, FineUIStyle.COMPACT_BUTTON);
} }
public String getButtonName() { public String getButtonName() {
@ -530,10 +507,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
buttonName = name; buttonName = name;
} }
public Dimension getPreferredSize() {
return new Dimension(B_W, B_H);
}
private void paintDeleteButton(Graphics g2d) { private void paintDeleteButton(Graphics g2d) {
Rectangle2D bounds = this.getBounds(); 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; 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.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.chartx.attr.ChartProvider; import com.fr.chartx.attr.ChartProvider;
@ -58,8 +60,8 @@ public class ChartTypePane extends AbstractChartAttrPane {
@Override @Override
protected JPanel createContentPane() { protected JPanel createContentPane() {
initButtonListener(); 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 = new ChartTypeButtonPane(this);
buttonPane.refreshChartInForm(inForm); buttonPane.refreshChartInForm(inForm);
content.add(buttonPane, BorderLayout.NORTH); 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; package com.fr.design.mainframe.chart.gui.data;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection; 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.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit; 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.ChartDataPane;
import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane;
import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension; 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() { protected void initTabPane() {
super.initTabPane(); super.initTabPane();
tabPane.setPreferredSize(new Dimension(221, 25));
} }
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) { if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) { if (nameArray.length > 1) {
pane.add(tabPane); this.add(tabPane, BorderLayout.NORTH);
this.add(pane, BorderLayout.NORTH);
centerPane.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
} }
centerPane.setBorder(null);
} }
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
@ -129,8 +122,6 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
this.removeAll(); this.removeAll();
paneList = initPaneList4NoPresent(plot4Pane, parentPane); paneList = initPaneList4NoPresent(plot4Pane, parentPane);
initAllPane(); initAllPane();
tabPane.setPreferredSize(new Dimension(221, 25));
centerPane.setPreferredSize(new Dimension(getContentPaneWidth(), 200));
this.validate(); this.validate();
} }
@ -213,19 +204,10 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected void layoutContentPane() { protected void layoutContentPane() {
super.layoutContentPane(); super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
} }
public void reloaPane(JPanel pane){ public void reloaPane(JPanel pane){
super.reloaPane(pane); super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
}
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.height = FIL_HEIGHT;
return dim;
} }
@Override @Override
@ -238,51 +220,37 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() { protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); 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(); preDataNum = new UITextField();
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true); 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); preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() { onlyPreData.addChangeListener(e -> checkBoxUse());
public void stateChanged(ChangeEvent e) {
checkBoxUse();
}
});
present = new PresentComboBox() { present = new PresentComboBox() {
protected void fireChange() { protected void fireChange() {
fire(); fire();
} }
}; };
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); presentPane = row(
panel2.add(presentPane, BorderLayout.SOUTH); cell(
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present"))
double[] column = {f}; ).weight(1.2), cell(present).weight(3)
double[] row = {p, p}; ).getComponent();
Component[][] coms = new Component[][]{
new Component[]{panel1}, return column(10,
new Component[]{panel2} cell(onlyPreData),
}; cell(preDataNumPane),
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column); 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() { protected void layoutContentPane() {
super.layoutContentPane(); super.layoutContentPane();
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
} }
public void reloaPane(JPanel pane){ public void reloaPane(JPanel pane){
super.reloaPane(pane); super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder());
} }
@Override @Override
@ -413,51 +379,37 @@ public class ChartDataFilterPane extends ThirdTabPane<ChartCollection> {
protected JPanel initOtherPane() { protected JPanel initOtherPane() {
onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); 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(); preDataNum = new UITextField();
UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num"));
combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther"));
combineOther.setSelected(true); 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); preDataNumPane.setVisible(false);
panel1.add(preDataNumPane, BorderLayout.CENTER);
notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series")); notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series"));
panel2.add(notShowNull, BorderLayout.NORTH);
onlyPreData.addChangeListener(new ChangeListener() { onlyPreData.addChangeListener(e -> checkBoxUse());
public void stateChanged(ChangeEvent e) {
checkBoxUse();
}
});
present = new PresentComboBox() { present = new PresentComboBox() {
protected void fireChange() { protected void fireChange() {
fire(); fire();
} }
}; };
presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); presentPane = row(
panel2.add(presentPane, BorderLayout.SOUTH); cell(
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present"))
double[] column = {f}; ).weight(1.2), cell(present).weight(3)
double[] row = {p, p}; ).getComponent();
Component[][] coms = new Component[][]{
new Component[]{panel1}, return column(10,
new Component[]{panel2} cell(onlyPreData),
}; cell(preDataNumPane),
return TableLayout4VanChartHelper.createGapTableLayoutPane(coms, row,column); 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; 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.base.TableData;
import com.fr.data.impl.NameTableData; 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.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataComboBox; import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.log.FineLoggerFactory; 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.BorderLayout;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
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{ public class DatabaseTableDataPane extends BasicPane{
private static final long serialVersionUID = 5316016202202932242L; private static final long serialVersionUID = 5316016202202932242L;
private TableDataComboBox tableNameCombox; private TableDataComboBox tableNameCombox;
@ -38,21 +36,16 @@ public class DatabaseTableDataPane extends BasicPane{
initTableCombox(); initTableCombox();
initReviewButton(); initReviewButton();
this.setLayout(new BorderLayout(0,0)); this.setLayout(new BorderLayout());
if (label != null) { this.add(
this.add(label, BorderLayout.WEST); row(
} cell(label).weight(1.2), cell(tableNameCombox).weight(2.4), flex(0.1), cell(reviewButton).weight(0.5)
).getComponent(), BorderLayout.CENTER
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);
setBorder(); setBorder();
} }
protected void setBorder () { protected void setBorder () {
this.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
} }
/** /**
* 返回选中的数据源. * 返回选中的数据源.
@ -101,15 +94,14 @@ public class DatabaseTableDataPane extends BasicPane{
} }
private void initReviewButton() { private void initReviewButton() {
reviewButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/search.png")); reviewButton = new UIButton(new LazyIcon("search"));
reviewButton.setBorder(new LineBorder(UIConstants.LINE_COLOR));
reviewButton.addMouseListener(new MouseAdapter() { reviewButton.addMouseListener(new MouseAdapter() {
@Override @Override
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
TableDataWrapper tableDataWrappe = tableNameCombox.getSelectedItem(); TableDataWrapper tableDataWrapper = tableNameCombox.getSelectedItem();
if ( tableDataWrappe != null) { if ( tableDataWrapper != null) {
try { try {
tableDataWrappe.previewData(); tableDataWrapper.previewData();
} catch (Exception e1) { } catch (Exception e1) {
FineLoggerFactory.getLogger().error(e1.getMessage(), 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; 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.chart.chartattr.ChartCollection;
import com.fr.design.beans.FurtherBasicBeanPane; 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.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.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 * @author kunsnat E-mail:kunsnat@gmail.com
@ -62,19 +63,14 @@ public class NormalChartDataPane extends DataContentsPane {
JPanel contentPane = new JPanel(new BorderLayout()); JPanel contentPane = new JPanel(new BorderLayout());
dataPane = new UIComboBoxPane<ChartCollection>() { dataPane = new UIComboBoxPane<ChartCollection>() {
protected void initLayout() { 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()) { if (ChartEditContext.supportReportData()) {
JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE, 0)); UILabel dataSourceLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source"));
northPane.add(jcb, BorderLayout.CENTER); this.add(row(
UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Source")); cell(dataSourceLabel).weight(LEFT_WEIGHT),
label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); cell(jcb).weight(RIGHT_WEIGHT)
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); ).getComponent(), BorderLayout.NORTH);
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);
} }
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
@ -95,7 +91,6 @@ public class NormalChartDataPane extends DataContentsPane {
} }
}; };
contentPane.add(dataPane, BorderLayout.CENTER); contentPane.add(dataPane, BorderLayout.CENTER);
dataPane.setBorder(BorderFactory.createEmptyBorder(10 ,0, 0, 0));
return contentPane; 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; package com.fr.design.mainframe.chart.gui.data;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.TableData; import com.fr.base.TableData;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; 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.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; 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.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private static final long serialVersionUID = 4740461028440155147L; 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 DatabaseTableDataPane tableDataPane;
private AbstractTableDataContentPane dataContentPane; private AbstractTableDataContentPane dataContentPane;
@ -37,14 +31,12 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
public TableDataPane(ChartDataPane parent) { public TableDataPane(ChartDataPane parent) {
this.parent = parent; this.parent = parent;
setLayout(new BorderLayout(0, FineUIScale.scale(10)));
initDataPane(); initDataPane();
} }
private void initDataPane() { private void initDataPane() {
UILabel label = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data")); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Table_Data"));
UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH);
UIComponentUtils.setPreferedWidth(label, ChartDataPane.LABEL_WIDTH);
tableDataPane = new DatabaseTableDataPane(label) { tableDataPane = new DatabaseTableDataPane(label) {
@Override @Override
protected void userEvent() { protected void userEvent() {
@ -52,9 +44,6 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
checkBoxUse(); 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); 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(); initSeriesPane();
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15));
panel.add(seriesPane); panel.add(seriesPane);
this.add(panel, "0,2,2,2"); 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); 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; 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.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; 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.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper; import com.fr.design.mainframe.chart.gui.data.ChartDataHelper;
import com.fr.stable.StringUtils; 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 javax.swing.JPanel;
import java.awt.BorderLayout; 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.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 多分类 单元格数据集 界面. * 多分类 单元格数据集 界面.
@ -56,38 +56,24 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
initEveryPane(); initEveryPane();
categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name")); categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
JPanel catePane = new JPanel(); addButton = new UIButton(new LazyIcon("add"));
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);
boxPane = new JPanel(); boxPane = new Column();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS));
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); 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() { private TinyFormulaPane addNewCatePane() {
final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY); final TinyFormulaPane formulaPane = initCategoryBox(StringUtils.EMPTY);
pane.setPreferredSize(new Dimension(100, 16));
pane.registerChangeListener(uiobListener);
formualList.add(pane);
final JPanel newButtonPane = new JPanel(); formulaPane.registerChangeListener(uiobListener);
newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); formualList.add(formulaPane);
newButtonPane.add(pane); UIButton delButton = new UIButton(new LazyIcon("close"));
JPanel newButtonPane = row(
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png")); cell(formulaPane).weight(3.7), flex(0.1), cell(delButton).weight(0.4)
newButtonPane.add(delButton); ).with(it -> it.setBorder(new ScaledEmptyBorder(10, 0, 0, 0))).getComponent();
boxPane.add(newButtonPane); boxPane.add(newButtonPane);
delButton.addActionListener(new ActionListener() { delButton.addActionListener(e -> {
@Override boxPane.remove(newButtonPane);
public void actionPerformed(ActionEvent e) { formualList.remove(formulaPane);
boxPane.remove(newButtonPane); checkComponent();
formualList.remove(pane); relayoutPane();
checkComponent();
relayoutPane();
}
}); });
delButton.registerChangeListener(uiobListener); delButton.registerChangeListener(uiobListener);
checkComponent(); checkComponent();
relayoutPane(); relayoutPane();
return pane; return formulaPane;
} }
private void checkAddButton() { 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.chartattr.ChartCollection;
import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.SeriesDefinition; 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.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.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.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane { public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane {
protected static final int PRE_WIDTH = 210;
protected TinyFormulaPane categoryName; protected TinyFormulaPane categoryName;
protected ChartDataFilterPane filterPane; protected ChartDataFilterPane filterPane;
@ -35,30 +37,24 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent
public CategoryPlotReportDataContentPane(ChartDataPane parent) { public CategoryPlotReportDataContentPane(ChartDataPane parent) {
initEveryPane(); initEveryPane();
categoryName = initCategoryBox(Toolkit.i18nText("Fine-Design_Chart_Category_Name")); categoryName = initCategoryBox(Toolkit.i18nText("Fine-Design_Chart_Category_Name"));
categoryName.setPreferredSize(new Dimension(236,30)); this.setLayout(new BorderLayout());
categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,20));
this.add(categoryName, "0,0,1,0");
filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent);
JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); this.add(column(
panel.setBorder(getSidesBorder()); cell(categoryName),
filterPane.setBorder(getFilterPaneBorder()); fix(10).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder())),
this.add(panel, "0,6,1,4"); } cell(new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane))
).getComponent());
}
protected TinyFormulaPane initCategoryBox(final String leftLabel) { protected TinyFormulaPane initCategoryBox(final String leftLabel) {
TinyFormulaPane categoryName = new DefaultTinyFormulaPane() { TinyFormulaPane categoryName = new DefaultTinyFormulaPane() {
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(4, 0)); UILabel label = new UILabel(leftLabel);
this.setLayout(new BorderLayout());
if(StringUtils.isNotEmpty(leftLabel)) { this.add(row(
UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Category_Name")); cell(label).weight(1.2), cell(formulaTextField).weight(2), flex(0.1), cell(formulaTextFieldButton).weight(0.4)
label1.setPreferredSize(new Dimension(75, 20)); ).getComponent());
this.add(label1, BorderLayout.WEST);
}
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
} }
public void okEvent() { 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; 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.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; 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.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataHelper; 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.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -30,6 +27,11 @@ import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 多分类轴 的数据集定义界面. * 多分类轴 的数据集定义界面.
* *
@ -38,9 +40,6 @@ import java.util.List;
*/ */
public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableDataContentPane implements UIObserver { public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableDataContentPane implements UIObserver {
private static final long serialVersionUID = -3305681053750642843L; 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; private JPanel boxPane;
@ -59,40 +58,37 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
public CategoryPlotMoreCateTableDataContentPane(ChartDataPane parent) { public CategoryPlotMoreCateTableDataContentPane(ChartDataPane parent) {
categoryCombox = new UIComboBox(); categoryCombox = new UIComboBox();
categoryCombox.setPreferredSize(new Dimension(COMBOX_WIDTH,COMBOX_HEIGHT)); UILabel categoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"));
addButton = new UIButton(new LazyIcon("add"));
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));
boxPane = new JPanel(); boxPane = new JPanel();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); 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.setLayout(new BorderLayout());
this.add(categoryPane, BorderLayout.NORTH);
this.add(getJSeparator());
seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot()); seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot());
this.add(seriesTypeComboxPane, BorderLayout.SOUTH); this.add(FineLayoutBuilder.createVerticalLayout(10, categoryPane, seriesTypeComboxPane));
addButton.addActionListener(new ActionListener() { addButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (boxList.size() < 2) { if (boxList.size() < 2) {
addNewCombox(); addNewComboBox();
relayoutPane(); relayoutPane();
} }
checkSeriseUse(categoryCombox.getSelectedItem() != null); checkSeriseUse(categoryCombox.getSelectedItem() != null);
checkComponent();
} }
}); });
@ -112,49 +108,39 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
addButton.setEnabled(hasUse); addButton.setEnabled(hasUse);
} }
private UIComboBox addNewCombox() { private UIComboBox addNewComboBox() {
final JPanel buttonPane = new JPanel(); final UIComboBox comboBox = new UIComboBox();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
final UIComboBox combox = new UIComboBox();
combox.setPreferredSize(new Dimension(COMBOX_WIDTH, COMBOX_HEIGHT));
int count = categoryCombox.getItemCount(); int count = categoryCombox.getItemCount();
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
combox.addItem(categoryCombox.getItemAt(i)); comboBox.addItem(categoryCombox.getItemAt(i));
} }
combox.registerChangeListener(uiobListener); comboBox.registerChangeListener(uiobListener);
combox.addItemListener(new ItemListener() { comboBox.addItemListener(e -> makeToolTipUse(comboBox));
@Override
public void itemStateChanged(ItemEvent e) { comboBox.setSelectedItem(categoryCombox.getItemAt(0));
makeToolTipUse(combox); makeToolTipUse(comboBox);
}
});
combox.setSelectedItem(categoryCombox.getItemAt(0)); UIButton delButton = new UIButton(new LazyIcon("close"));
makeToolTipUse(combox); 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); boxPane.add(buttonPane);
boxList.add(combox); boxList.add(comboBox);
checkComponent(); checkComponent();
delButton.addActionListener(new ActionListener() { delButton.addActionListener(e -> {
@Override boxPane.remove(buttonPane);
public void actionPerformed(ActionEvent e) { boxList.remove(comboBox);
boxPane.remove(buttonPane); checkComponent();
boxList.remove(combox); relayoutPane();
checkComponent();
relayoutPane();
}
}); });
delButton.registerChangeListener(uiobListener); delButton.registerChangeListener(uiobListener);
return combox; return comboBox;
} }
private void checkAddButton() { private void checkAddButton() {
@ -223,7 +209,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
NormalTableDataDefinition normal = (NormalTableDataDefinition) top; NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
int size = normal.getMoreCateSize(); int size = normal.getMoreCateSize();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
UIComboBox box = addNewCombox(); UIComboBox box = addNewComboBox();
box.setSelectedItem(normal.getMoreCateWithIndex(i)); 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.NormalTableDataDefinition;
import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartdata.TopDefinition;
import com.fr.design.gui.icombobox.UIComboBox; 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.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.List; import java.util.List;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 属性表, 矩形类的 数据集 数据界面. * 属性表, 矩形类的 数据集 数据界面.
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
@ -40,29 +39,24 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
public CategoryPlotTableDataContentPane(ChartDataPane parent) { public CategoryPlotTableDataContentPane(ChartDataPane parent) {
categoryCombox = new UIComboBox(); categoryCombox = new UIComboBox();
JPanel categoryPane = new JPanel(new BorderLayout(4,0)); UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ;
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));
categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); 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()); seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot());
this.add(seriesTypeComboxPane, BorderLayout.SOUTH);
categoryCombox.addItemListener(new ItemListener() { this.setLayout(new BorderLayout());
public void itemStateChanged(ItemEvent e) {
checkSeriseUse(categoryCombox.getSelectedItem() != null); this.add(column(10,
makeToolTipUse(categoryCombox); 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.AbstractDataFunction;
import com.fr.data.util.function.NoneFunction; import com.fr.data.util.function.NoneFunction;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.border.FineBorderFactory;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.extended.chart.UIComboBoxWithNone; import com.fr.extended.chart.UIComboBoxWithNone;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -25,6 +22,11 @@ import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; 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 = new CalculateComboBox();
calculateCombox.reset(); calculateCombox.reset();
isNeedSummary = true; isNeedSummary = true;
seriesName.setPreferredSize(new Dimension(100, 75));
seriesValue.setPreferredSize(new Dimension(100, 75));
calculateCombox.setPreferredSize(new Dimension(100, 75));
seriesName.addItemListener(new ItemListener() { seriesName.addItemListener(new ItemListener() {
@Override @Override
@ -76,39 +75,37 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
} }
private void initCenterPane() { 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")); 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")); 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")); UILabel Label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method"));
Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); centerPane = column(10,
Component[][] components = getUseComponent(Label1, Label2, Label3); row(
cell(Label1).weight(1), cell(seriesName).weight(2)
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6); ),
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); 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.setLayout(new BorderLayout());
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
private void initCenterPaneWithOutCaculateSummary() { 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")); 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")); UILabel label2 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value"));
label2.setPreferredSize(getLabelDimension()); centerPane = column(10,
UILabel label3 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")); row(
label3.setPreferredSize(getLabelDimension()); cell(label1).weight(1), cell(seriesName).weight(2)
Component[][] components = getUseComponentWithOutSummary(label1, label2, label3); ),
row(
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6); cell(label2).weight(1), cell(seriesValue).weight(2)
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); ),
fix(1).with(it -> it.setBorder(FineBorderFactory.createDefaultUnderlineBorder()))
).getComponent();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(centerPane, BorderLayout.CENTER); 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; 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.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.MoreNameCDDefinition; import com.fr.chart.chartdata.MoreNameCDDefinition;
import com.fr.chart.chartdata.OneValueCDDefinition; import com.fr.chart.chartdata.OneValueCDDefinition;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.ChartDataFilterPane;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
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() { protected void initLayout() {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); this.setLayout(new BorderLayout());
JPanel northPane = new JPanel(new BorderLayout(4, 0));
//使用系列名/系列值选项面板 //使用系列名/系列值选项面板
UILabel seriesLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); 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); 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() { this.add(column(
Dimension preferredSize = super.getPreferredSize(); row(
return new Dimension(246, (int) preferredSize.getHeight()); 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; 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.FRContext;
import com.fr.base.Utils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane; 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.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -193,8 +192,8 @@ public class ChartTextAttrPane extends BasicPane {
protected void initState() { protected void initState() {
fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report());
fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel()); fontSizeComboBox = new UIComboBox(getFontSizeComboBoxModel());
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); italic = new UIToggleButton(new LazyIcon("italic"));
initFontColorState(); initFontColorState();
} }
@ -217,11 +216,7 @@ public class ChartTextAttrPane extends BasicPane {
} }
protected JPanel getContentPane(JPanel buttonPane) { protected JPanel getContentPane(JPanel buttonPane) {
double f = TableLayout.FILL; return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3});
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
} }
protected double[] getRowSize() { 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; package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; 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.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -33,7 +33,7 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
} }
protected JPanel getContentPane(JPanel buttonPane) { 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"), preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"),
Toolkit.i18nText("Fine-Design_Chart_Custom")}); Toolkit.i18nText("Fine-Design_Chart_Custom")});
@ -46,7 +46,6 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane {
textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize);
panel.add(preButtonPane, BorderLayout.CENTER); panel.add(preButtonPane, BorderLayout.CENTER);
panel.add(textFontPane, BorderLayout.SOUTH); panel.add(textFontPane, BorderLayout.SOUTH);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
return panel; 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; package com.fr.design.mainframe.chart.gui.style;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.ColorWithThemeStyle; import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; 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.i18n.Toolkit;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -40,7 +38,7 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
private void initContent() { 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[][]{ Component[][] components = ChartEditContext.supportTheme() ? new Component[][]{
new Component[]{text, preButton}, new Component[]{text, preButton},
new Component[]{null, colorSelectBox}, new Component[]{null, colorSelectBox},
@ -48,23 +46,17 @@ public class ColorSelectBoxWithThemeStyle extends BasicPane {
new Component[]{text, colorSelectBox} 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.setLayout(new BorderLayout());
this.add(gapTableLayoutPane, BorderLayout.CENTER); this.add(gapTableLayoutPane, BorderLayout.CENTER);
} }
private void initListener() { private void initListener() {
preButton.addActionListener(new ActionListener() { preButton.addActionListener(e -> checkPreButton());
@Override
public void actionPerformed(ActionEvent e) {
checkPreButton();
}
});
} }
private void checkPreButton() { private void checkPreButton() {
colorSelectBox.setVisible(preButton.getSelectedIndex() == CUSTOM); colorSelectBox.setVisible(preButton.getSelectedIndex() == CUSTOM);
this.setPreferredSize(ChartEditContext.supportTheme() && preButton.getSelectedIndex() == CUSTOM ? new Dimension(0, 55) : new Dimension(0, 23));
} }
public String title4PopupWindow() { 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.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.border.Border;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; 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>{ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L; private static final long serialVersionUID = 2298609199400393886L;
private static final int MIN_TAB_HEIGHT = 25;
protected UIButtonGroup tabPane; protected UIButtonGroup tabPane;
protected String[] nameArray; protected String[] nameArray;
public JPanel centerPane; public JPanel centerPane;
@ -57,54 +46,18 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
if (!paneList.isEmpty()) { if (!paneList.isEmpty()) {
tabPane = new UIButtonGroup(nameArray); tabPane = new UIButtonGroup(nameArray);
tabPane.setSelectedIndex(0); tabPane.setSelectedIndex(0);
int prefHeight = tabPane.getPreferredSize().height; tabPane.addActionListener(e -> cardLayout.show(centerPane, nameArray[tabPane.getSelectedIndex()]));
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);
} }
} }
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
if (!paneList.isEmpty()) { if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0)); this.add(tabPane, BorderLayout.NORTH);
pane.add(tabPane);
this.add(pane, BorderLayout.NORTH);
} }
this.add(centerPane, BorderLayout.CENTER); 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 中间的内容面板的指定宽度 * @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.stable.Constants;
import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont; import com.fr.van.chart.designer.component.format.FormatPaneWithOutFont;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -134,7 +133,6 @@ public class ChartCategoryPane extends ChartAxisUsePane<Axis>{
@Override @Override
protected void layoutContentPane() { protected void layoutContentPane() {
leftcontentPane = createContentPane(); leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(5, 10, 5, 0, original));
this.add(leftcontentPane); 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 = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return panel; 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; 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.chart.chartattr.Chart;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.ibutton.UIToggleButton; 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.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Graphics;
/** /**
* Created by Mitisky on 16/3/9. * Created by Mitisky on 16/3/9.
@ -21,9 +24,9 @@ public abstract class ChartTabPane extends MultiTabPane<Chart> {
@Override @Override
protected void initLayout() { protected void initLayout() {
JPanel tabPanel = new JPanel(new BorderLayout()); JPanel tabPanel = new JPanel(new BorderLayout());
tabPanel.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, getBackground()));
tabPanel.add(tabPane, BorderLayout.CENTER); 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(tabPanel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); 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; package com.fr.van.chart.column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageBackground;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; 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.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup; 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.UISpinner;
import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx;
import com.fr.design.i18n.Toolkit; 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.backgroundpane.ImageBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; 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.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.stable.Constants; 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.VanChartBeautyPane;
import com.fr.van.chart.designer.component.VanChartBeautyPaneWithGradientBar; 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.VanChartBorderPane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component; 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() { protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED; contentPane = FineLayoutBuilder.createVerticalLayout(0,
double f = TableLayout.FILL; createSeriesStylePane(),
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; createBorderPane(),
double[] columnSize = {f}; createStackedAndAxisPane(),
double[] rowSize = {p,p,p,p,p,p,p,p,p,p}; createTrendLinePane()
Component[][] components = new Component[][]{ );
new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{f,e})}, contentPane = FineLayoutBuilder.asBorderLayoutWrapped(contentPane);
new Component[]{createBorderPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return contentPane; return contentPane;
} }
@ -74,55 +60,26 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
return new VanChartBorderWithRadiusPane(true); return new VanChartBorderWithRadiusPane(true);
} }
private JPanel createSeriesStylePane(double[] row, double[] col) { private JPanel createSeriesStylePane() {
isFixedWidth = new UIButtonGroup<Integer>(new String[]{Toolkit.i18nText("Fine-Design_Chart_YES"), Toolkit.i18nText("Fine-Design_Chart_NO")}); 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 = 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); seriesGap = new UINumberDragPaneWithPercent(-100, 100);
categoryGap = new UINumberDragPaneWithPercent(0, 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 = new ImageBackgroundQuickPane(false);
imagePane.setBorder(BorderFactory.createEmptyBorder(0,(int)TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH + TableLayout4VanChartHelper.COMPONENT_INTERVAL,0,0)); Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Fixed_Column_Width")), isFixedWidth},
JPanel panel1 = new JPanel(new BorderLayout()); new Component[]{null, columnWidth},
JPanel isFixedWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Fixed_Column_Width"),isFixedWidth); new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Series")), seriesGap},
isFixedWidthPane.setBorder(BorderFactory.createEmptyBorder(0,0,6,0)); new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gap_Category")), categoryGap},
panel1.add(isFixedWidthPane, BorderLayout.NORTH); new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")), isFillWithImage},
panel1.add(columnWidth, BorderLayout.CENTER); new Component[]{null, imagePane}
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},
}; };
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")); isFixedWidth.addActionListener(e -> checkColumnWidth());
Component[][] components3 = new Component[][]{ isFillWithImage.addActionListener(e -> checkImagePane());
new Component[]{fillImageLabel, UIComponentUtils.wrapWithBorderLayoutPane(isFillWithImage)}, return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"), borderPane);
};
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);
} }
private void checkAll() { 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() { protected void layoutContentPane() {
leftcontentPane = createContentPane(); leftcontentPane = createContentPane();
leftcontentPane.setBorder(BorderFactory.createMatteBorder(0, 5, 0, 10, original));
this.add(leftcontentPane); 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){ public void reloaPane(JPanel pane){
super.reloaPane(pane); super.reloaPane(pane);
leftcontentPane.setBorder(BorderFactory.createEmptyBorder()); 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; 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.beans.BasicBeanPane;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.jxbrowser.JxUIPane; 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.DesignerContext;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.general.ComparatorUtils; 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.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat; import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.stable.StringUtils; 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.CategoryNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ChangedPercentFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.ChangedValueFormatPaneWithCheckBox;
@ -52,6 +52,10 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 数据点提示内容界面含有通用设置富文本编辑器自定义JS界面 * 数据点提示内容界面含有通用设置富文本编辑器自定义JS界面
*/ */
@ -191,7 +195,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
initDetailPane(); initDetailPane();
initCenterPane(); initCenterPane();
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
content.add(createButtonPane(), BorderLayout.NORTH); content.add(createButtonPane(), BorderLayout.NORTH);
content.add(centerPanel, BorderLayout.CENTER); content.add(centerPanel, BorderLayout.CENTER);
@ -267,12 +271,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private JPanel createButtonPane() { private JPanel createButtonPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {f, p};
double[] row = {p, p};
if (supportRichEditor()) { if (supportRichEditor()) {
content = new UIButtonGroup<>(new String[]{ content = new UIButtonGroup<>(new String[]{
Toolkit.i18nText("Fine-Design_Chart_Common"), Toolkit.i18nText("Fine-Design_Chart_Common"),
@ -291,22 +289,18 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
new Component[]{content, null} new Component[]{content, null}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
} }
protected JPanel createCommonFormatPanel() { protected JPanel createCommonFormatPanel() {
double p = TableLayout.PREFERRED; JPanel formatContent = FineLayoutBuilder.compatibleTableLayout(10, getPaneComponents(), new double[]{1.2, 3});
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
JPanel formatContent = TableLayoutHelper.createTableLayoutPane(getPaneComponents(), getRowSize(p), new double[]{f, p});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(getLabelContentTitle()), formatContent} 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() { public JPanel createCommonStylePane() {
@ -316,13 +310,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
}); });
textAttrPane = createChartTextAttrPane(); textAttrPane = createChartTextAttrPane();
stylePanel = column(10,
JPanel buttonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), styleButton); row(
cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"))).weight(1.2), cell(styleButton).weight(3)
JPanel stylePanel = new JPanel(new BorderLayout()); ),
stylePanel.add(buttonPane, BorderLayout.CENTER); cell(textAttrPane)
stylePanel.add(textAttrPane, BorderLayout.SOUTH); ).getComponent();
initStyleButtonListener(); initStyleButtonListener();
return stylePanel; return stylePanel;
@ -360,19 +353,12 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private JPanel createRichEditorPanel() { 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[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Content_Style")), createRichEditorButton()} 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() { private JComponent createRichEditorButton() {
@ -485,12 +471,6 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
private JPanel createHtmlPane() { private JPanel createHtmlPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] column = {f, p};
double[] row = {p, p};
htmlLabelPane = createHtmlLabelPane(); htmlLabelPane = createHtmlLabelPane();
htmlLabelPane.setParent(parent); htmlLabelPane.setParent(parent);
@ -499,7 +479,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
new Component[]{htmlLabelPane, null} new Component[]{htmlLabelPane, null}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(htmlComponents, row, column); return FineLayoutBuilder.compatibleTableLayout(10, htmlComponents, new double[]{1.2, 3});
} }
protected VanChartHtmlLabelPane createHtmlLabelPane() { protected VanChartHtmlLabelPane createHtmlLabelPane() {
@ -514,7 +494,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} }
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); return new UIExpandablePane(title, panel, true);
} }
protected double[] getRowSize(double p) { 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; package com.fr.van.chart.designer.component;
import com.fine.theme.light.ui.FineButtonBorder;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
@ -50,6 +51,7 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
public VanChartUIListControlPane() { public VanChartUIListControlPane() {
super(); super();
this.setBorder(null); this.setBorder(null);
getToolBar().setBorder(new FineButtonBorder());
iniListener(); 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; package com.fr.van.chart.designer.component.border;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.GeneralInfo; import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.dialog.BasicPane; 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.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import 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 { public class VanChartBorderPane extends BasicPane {
private static final long serialVersionUID = -7770029552989609464L; private static final long serialVersionUID = -7770029552989609464L;
@ -53,36 +57,24 @@ public class VanChartBorderPane extends BasicPane {
} }
protected void initContent() { protected void initContent() {
double f = TableLayout.FILL; JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, getUseComponent(), new double[]{1.2, 3});
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
Component[][] components = getUseComponent();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSize(), columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
protected void initColorPanel() { 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")); UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Color"));
Component[][] components;
if (autoButton != null) { if (autoButton != null) {
rowSize = new double[]{p, p}; colorPanel = column(10,
components = new Component[][]{ row(cell(colorLabel).weight(1.2), cell(autoButton).weight(3)),
new Component[]{colorLabel, autoButton}, row(flex(1.2), cell(currentLineColorPane).weight(3))
new Component[]{null, currentLineColorPane} ).getComponent();
};
} else { } else {
rowSize = new double[]{p}; colorPanel = row(
components = new Component[][]{ cell(colorLabel).weight(1.2), cell(currentLineColorPane).weight(3)
new Component[]{colorLabel, currentLineColorPane} ).getComponent();
};
} }
colorPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
} }
protected double[] getRowSize() { protected double[] getRowSize() {
@ -111,7 +103,6 @@ public class VanChartBorderPane extends BasicPane {
private void checkPreButton() { private void checkPreButton() {
currentLineColorPane.setVisible(autoButton.getSelectedIndex() == 1); 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; 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.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; 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.JPanel;
import javax.swing.SwingConstants;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
@ -30,19 +27,14 @@ public class FormatPaneWithNormalType extends FormatPaneWithOutFont {
} }
protected void setTypeComboBoxPane(UIComboBox typeComboBox) { protected void setTypeComboBoxPane(UIComboBox typeComboBox) {
double f = TableLayout.FILL; JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, getTypeComboBoxComponent(typeComboBox), new double[]{1.2, 3});
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);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
} }
protected Component[][] getTypeComboBoxComponent (UIComboBox typeComboBox) { protected Component[][] getTypeComboBoxComponent (UIComboBox typeComboBox) {
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, 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; 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.ilable.UILabel;
import com.fr.design.gui.style.FormatPane; 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.JPanel;
import javax.swing.SwingConstants;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
/** /**
* Created by mengao on 2017/8/28. * Created by mengao on 2017/8/28.
* 只有文本格式设置没有字体设置 * 只有文本格式设置没有字体设置
*/ */
public class FormatPaneWithOutFont extends FormatPane { public class FormatPaneWithOutFont extends FormatPane {
private static final int HEIGHT = 30;
protected JPanel createContentPane(Component[][] components) { protected JPanel createContentPane(Component[][] components) {
double f = TableLayout.FILL; return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
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);
} }
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) { protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
typePane.setBorder(BorderFactory.createEmptyBorder());
return new Component[][]{ return new Component[][]{
new Component[]{null, null}, 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}, 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; 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.base.BaseUtils;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane; 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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; 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.attr.VanChartLegend;
import com.fr.plugin.chart.type.LayoutType; import com.fr.plugin.chart.type.LayoutType;
import com.fr.stable.Constants; 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.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartFloatPositionPane; 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.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -41,6 +41,10 @@ import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 属性表, 图表样式-图例 界面. * 属性表, 图表样式-图例 界面.
*/ */
@ -113,16 +117,12 @@ public class VanChartPlotLegendPane extends BasicPane {
isLegendVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Legend_Visible")); isLegendVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Legend_Visible"));
legendPane = createLegendPane(); legendPane = createLegendPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] col = {f};
double[] row = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isLegendVisible}, new Component[]{isLegendVisible},
new Component[]{legendPane}, new Component[]{legendPane},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
@ -141,20 +141,14 @@ public class VanChartPlotLegendPane extends BasicPane {
borderPane = new VanChartBorderWithRadiusPane(); borderPane = new VanChartBorderWithRadiusPane();
backgroundPane = creatBackgroundPane(); backgroundPane = creatBackgroundPane();
double p = TableLayout.PREFERRED; Column column = FineLayoutBuilder.createVerticalExpandPaneLayout(0,
double f = TableLayout.FILL; new Pair<>(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), createTitlePositionPane()),
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), createTitleStylePane()),
double[] columnSize = {f, e}; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane),
double[] rowSize = {p, p, p, p, p, p, p}; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), createDisplayStrategy())
Component[][] components = new Component[][]{ );
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null}, return FineLayoutBuilder.asBorderLayoutWrapped(column);
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);
} }
protected VanChartBackgroundPane creatBackgroundPane(){ protected VanChartBackgroundPane creatBackgroundPane(){
@ -166,27 +160,21 @@ public class VanChartPlotLegendPane extends BasicPane {
backgroundPane = creatBackgroundPane(); backgroundPane = creatBackgroundPane();
fixedCheckPane = createFixedCheckPane(); fixedCheckPane = createFixedCheckPane();
JPanel panel = new JPanel(); JPanel panel = new JPanel();
panel.setLayout(new BorderLayout()); panel.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
panel.add(createDisplayStrategy(), BorderLayout.CENTER); panel.add(createDisplayStrategy(), BorderLayout.CENTER);
panel.add(fixedCheckPane, BorderLayout.SOUTH); panel.add(fixedCheckPane, BorderLayout.SOUTH);
double p = TableLayout.PREFERRED; Column column = FineLayoutBuilder.createVerticalExpandPaneLayout(0,
double f = TableLayout.FILL; new Pair<>(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), createTitlePositionPane()),
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), createTitleStylePane()),
double[] columnSize = {f, e}; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane),
double[] rowSize = {p, p, p, p, p, p, p, p}; new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel)
Component[][] components = new Component[][]{ );
new Component[]{createTitlePositionPane(new double[]{p, p, p}, columnSize), null}, return FineLayoutBuilder.asBorderLayoutWrapped(column);
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);
} }
private JPanel createTitlePositionPane(double[] row, double[] col) { private JPanel createTitlePositionPane() {
String[] textArray = { String[] textArray = {
Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Top"),
Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"), Toolkit.i18nText("Fine-Design_Chart_Style_Alignment_Bottom"),
@ -213,7 +201,6 @@ public class VanChartPlotLegendPane extends BasicPane {
customFloatPositionButton.setEventBannded(true); customFloatPositionButton.setEventBannded(true);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), location}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layout_Position")), location},
new Component[]{null, customFloatPositionButton} new Component[]{null, customFloatPositionButton}
}; };
@ -223,13 +210,12 @@ public class VanChartPlotLegendPane extends BasicPane {
initPositionListener(); 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()); return column(10,
panel.add(positionPane, BorderLayout.NORTH); cell(positionPane), cell(layoutPane)
panel.add(layoutPane, BorderLayout.CENTER); ).getComponent();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel);
} }
private JPanel createLayoutPane() { 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 String[]{Toolkit.i18nText("Fine-Design_Chart_Layout_Flow"), Toolkit.i18nText("Fine-Design_Chart_Layout_Aligned")},
new LayoutType[]{LayoutType.FLOW, LayoutType.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[][]{ Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Arrange")), layoutButton} 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() { private void initPositionListener() {
@ -290,48 +271,34 @@ public class VanChartPlotLegendPane extends BasicPane {
private JPanel createTitleStylePane() { private JPanel createTitleStylePane() {
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane); return textAttrPane;
} }
private JPanel createDisplayStrategy() { private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。 //区域显示策略 恢复用注释。开始删除。
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1); maxProportion = new UINumberDragPaneWithPercent(0, 100, 1);
customSize = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); 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); customSize.addActionListener(e -> checkMaxProPortionUse());
maxProportionPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Max_Proportion"), maxProportion, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); Component[][] components = new Component[][]{
maxProportionPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Area_Size")), customSize},
JPanel panel = new JPanel(new BorderLayout()); new Component[]{maxProportionPane, null}
panel.add(limitSizePane, BorderLayout.NORTH); };
panel.add(maxProportionPane, BorderLayout.CENTER); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
customSize.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
return panel;
//区域显示策略 恢复用注释。结束删除。
//区域显示策略 恢复用注释。取消注释。
// limitPane = new LimitPane(false);
// return limitPane;
} }
private JPanel createFixedCheckPane() { private JPanel createFixedCheckPane() {
fixedCheck = new UICheckBox(Toolkit.i18nText("Fine-Engine_Chart_Open_Fixed_Display")); fixedCheck = new UICheckBox(Toolkit.i18nText("Fine-Engine_Chart_Open_Fixed_Display"));
fixedCheckLabel = new UILabel(Toolkit.i18nText("Fine-Engine_Chart_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[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{fixedCheckLabel, fixedCheck} new Component[]{fixedCheckLabel, fixedCheck}
}; };
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
} }
protected void checkAllUse() { 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; 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.BaseFormula;
import com.fr.base.BaseUtils;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.chartx.config.info.constant.ConfigType; 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.DefaultTinyFormulaPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UIBubbleFloatPane; 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.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; 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.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; 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.VanChartFloatPositionPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane;
import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Point; import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.swing.ui.layout.Layouts.row;
// 属性表-样式 标题界面 // 属性表-样式 标题界面
public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> { public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private static final long serialVersionUID = -2438898431228882682L; private static final long serialVersionUID = -2438898431228882682L;
@ -96,131 +96,108 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private void initComponents() { private void initComponents() {
isTitleVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Title_Visible")); isTitleVisible = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Title_Visible"));
tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Title_Tooltip") + "</html>"); tooltipLabel = new UILabel("<html>" + Toolkit.i18nText("Fine-Design_Chart_Title_Tooltip") + "</html>");
tooltipLabel.setForeground(Color.gray); FineUIStyle.setStyle(tooltipLabel, FineUIStyle.LABEL_TIP);
tooltipLabel.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 10));
tooltipLabel.setVisible(false); tooltipLabel.setVisible(false);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(isTitleVisible, BorderLayout.NORTH);
panel.add(tooltipLabel, BorderLayout.CENTER);
titlePane = createTitlePane(); 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.setLayout(new BorderLayout());
this.add(panel1, BorderLayout.CENTER); this.add(column(
cell(isTitleVisible),
cell(tooltipLabel),
cell(titlePane)
).getComponent(), BorderLayout.CENTER);
isTitleVisible.addActionListener(new ActionListener() { isTitleVisible.addActionListener(e -> checkTitlePaneUse());
public void actionPerformed(ActionEvent e) {
checkTitlePaneUse();
}
});
} }
} }
private JPanel createTitlePane() { private JPanel createTitlePane() {
backgroundPane = createBackgroundPane(); 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() { protected VanChartBackgroundWithOutShadowWithRadiusPane createBackgroundPane() {
return new VanChartBackgroundWithOutShadowWithRadiusPane(); return new VanChartBackgroundWithOutShadowWithRadiusPane();
} }
private JPanel createTitleContentPane(double[] row, double[] col) { private JPanel createTitleContentPane() {
titleContent = new DefaultTinyFormulaPane(); titleContent = new DefaultTinyFormulaPane();
useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(useHtml); UIComponentUtils.setLineWrap(useHtml);
Component[][] components = new Component[][]{ JPanel titleContentPane = column(10,
new Component[]{null, null}, row(
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT), titleContent}, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT)).weight(1.2),
new Component[]{null, useHtml}, cell(titleContent).weight(3)
}; )).getComponent();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); return new UIExpandablePane(
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), panel); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), titleContentPane);
} }
private JPanel createTitlePositionPane(double[] row, double[] col) { private JPanel createTitlePositionPane() {
Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()},
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), {new LazyIcon("h_center"), new LazyIcon("h_center").white()},
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")}; {new LazyIcon("h_right"), new LazyIcon("h_right").white()}};
Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT};
alignmentPane = new UIButtonGroup<>(hAlignmentIconArray, alignment);
alignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment);
customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position"));
UIComponentUtils.setLineWrap(customFloatPositionButton); UIComponentUtils.setLineWrap(customFloatPositionButton);
customFloatPositionButton.setEventBannded(true); 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(); customFloatPositionPane = new VanChartFloatPositionPane();
initPositionListener(); initPositionListener();
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); JPanel titlePositionPane = column(10,
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Form_Layout"), panel); 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() { private JPanel createTitleStylePane() {
textAttrPane = ChartEditContext.supportTheme() ? new ChartTextAttrPaneWithThemeStyle() : new ChartTextAttrPane(); 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() { private JPanel createDisplayStrategy() {
//区域显示策略 恢复用注释。开始删除。 //区域显示策略 恢复用注释。开始删除。
maxProportion = new UINumberDragPaneWithPercent(0, 100, 1); 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()); JPanel panel = new JPanel(new BorderLayout());
panel.add(limitSizePane, BorderLayout.NORTH); panel.add(column(10,
panel.add(maxProportionPane, BorderLayout.CENTER); 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() { ).getComponent());
@Override
public void actionPerformed(ActionEvent e) {
checkMaxProPortionUse();
}
});
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() { 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; 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.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.PaneTitleConstants;
import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.chart.mode.ChartEditContext;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; 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.VanChartBackgroundPane;
import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithThemeStyle; import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithThemeStyle;
import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane;
@ -52,16 +51,11 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
} else { } else {
chartBackgroundPane = ChartEditContext.supportTheme() ? new VanChartBackgroundPaneWithThemeStyle() : new VanChartBackgroundPane(); 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[][]{ Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)}, new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane, true)},
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_Background"), chartBackgroundPane)},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
contentPane.add(panel, BorderLayout.CENTER); contentPane.add(panel, BorderLayout.CENTER);
if (!isPlot) { if (!isPlot) {
@ -79,10 +73,6 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
chartBorderPane = new VanChartBorderWithRadiusPane(); chartBorderPane = new VanChartBorderWithRadiusPane();
chartBackgroundPane = new VanChartBackgroundPane(); chartBackgroundPane = new VanChartBackgroundPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components; Component[][] components;
if (plot.isSupportBorder()) {//有边框和背景 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); contentPane.add(panel, BorderLayout.CENTER);
parent.initAllListeners(); parent.initAllListeners();
@ -109,8 +99,8 @@ public class VanChartAreaBackgroundPane extends AbstractVanChartScrollPane<Chart
protected Component[][] initComponents() { protected Component[][] initComponents() {
return new Component[][]{ return new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane)}, new Component[]{new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), chartBorderPane, true)},
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_Background"), chartBackgroundPane, true)},
new Component[]{chartAxisAreaPane} 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; package com.fr.van.chart.designer.style.background;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.config.info.constant.ConfigType; import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; 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.plugin.chart.vanchart.VanChart;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout; 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() { protected void initLayout() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
if (!paneList.isEmpty()) { if (!paneList.isEmpty()) {
JPanel pane = new JPanel(new FlowLayout(FlowLayout.LEADING, 0, 0));
if (nameArray.length > 1) { if (nameArray.length > 1) {
pane.add(tabPane); this.add(cell(tabPane).getComponent(), BorderLayout.NORTH);
tabPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
this.add(pane, BorderLayout.NORTH);
} }
} }
centerPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }

43
designer-chart/src/main/java/com/fr/van/chart/designer/style/datasheet/VanChartDataSheetPane.java

@ -1,13 +1,14 @@
package com.fr.van.chart.designer.style.datasheet; package com.fr.van.chart.designer.style.datasheet;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.DataSheet; import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.config.info.constant.ConfigType; import com.fr.chartx.config.info.constant.ConfigType;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.style.FormatPane; import com.fr.design.gui.style.FormatPane;
import com.fr.design.layout.TableLayout; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithThemeStyle;
@ -18,8 +19,8 @@ import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.AxisType; import com.fr.plugin.chart.type.AxisType;
import com.fr.stable.collections.combination.Pair;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.border.VanChartBorderPane; import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.component.border.VanChartBorderPaneWithPreStyle; import com.fr.van.chart.designer.component.border.VanChartBorderPaneWithPreStyle;
import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType; import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType;
@ -27,8 +28,6 @@ import com.fr.van.chart.designer.component.format.FormatPaneWithNormalType;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/** /**
* 样式-数据表 * 样式-数据表
@ -54,32 +53,22 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
private void initComponents() { private void initComponents() {
isShowDataSheet = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Show_Data_Sheet")); isShowDataSheet = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Show_Data_Sheet"));
dataSheetPane = createDataSheetPane(); dataSheetPane = createDataSheetPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = creatComponent(dataSheetPane); Component[][] components = creatComponent(dataSheetPane);
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
isShowDataSheet.addActionListener(new ActionListener() { isShowDataSheet.addActionListener(e -> checkDataSheetPaneUse());
public void actionPerformed(ActionEvent e) {
checkDataSheetPaneUse();
}
});
} }
} }
protected Component[][] creatComponent(JPanel dataSheetPane) { protected Component[][] creatComponent(JPanel dataSheetPane) {
Component[][] components = new Component[][]{ return new Component[][]{
new Component[]{isShowDataSheet}, new Component[]{isShowDataSheet},
new Component[]{dataSheetPane} new Component[]{dataSheetPane}
}; };
return components;
} }
// 检查数据表界面是否可用. // 检查数据表界面是否可用.
@ -91,19 +80,12 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
textAttrPane = createChartTextAttrPane(); textAttrPane = createChartTextAttrPane();
formatPane = new FormatPaneWithNormalType(); formatPane = new FormatPaneWithNormalType();
borderPane = createBorderPanePane(); borderPane = createBorderPanePane();
Column column = FineLayoutBuilder.createVerticalExpandPaneLayout(0,
new Pair<>(Toolkit.i18nText("Fine-Design_Report_Base_Format"), formatPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane),
new Pair<>(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane));
double p = TableLayout.PREFERRED; return FineLayoutBuilder.asBorderLayoutWrapped(column);
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH;
double[] columnSize = {d, e};
double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format"), formatPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), textAttrPane), null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane), null},
};
return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
} }
protected VanChartBorderPane createBorderPanePane() { protected VanChartBorderPane createBorderPanePane() {
@ -150,7 +132,6 @@ public class VanChartDataSheetPane extends AbstractVanChartScrollPane<Chart> {
//数据表埋点 //数据表埋点
ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.DATA_TABLE, chart.getBuryingPointDataTableConfig()); ChartInfoCollector.getInstance().updateChartConfig(chart, ConfigType.DATA_TABLE, chart.getBuryingPointDataTableConfig());
// plot.setDataSheet2PlotList();
} }
@Override @Override

8
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPiePlotLabelPane.java

@ -1,11 +1,11 @@
package com.fr.van.chart.designer.style.label; package com.fr.van.chart.designer.style.label;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -25,14 +25,14 @@ public class VanChartPiePlotLabelPane extends VanChartPlotLabelPane {
} }
protected void createLabelPane() { protected void createLabelPane() {
setLabelPane(new JPanel(new BorderLayout(0, 4))); setLabelPane(new JPanel(new BorderLayout()));
setLabelDetailPane(new VanChartPieValueLabelDetailPane(getPlot(), getParentPane(), isInCondition())); setLabelDetailPane(new VanChartPieValueLabelDetailPane(getPlot(), getParentPane(), isInCondition()));
JPanel valuePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Label"), getLabelDetailPane()); JPanel valuePane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Label"), getLabelDetailPane(), true);
getLabelPane().add(valuePane, BorderLayout.NORTH); getLabelPane().add(valuePane, BorderLayout.NORTH);
if (!isInCondition()) { if (!isInCondition()) {
pieCategoryLabelPane = new VanChartPieCategoryLabelDetailPane(getPlot(), getParentPane(), isInCondition()); pieCategoryLabelPane = new VanChartPieCategoryLabelDetailPane(getPlot(), getParentPane(), isInCondition());
JPanel categoryPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Category_Label"), pieCategoryLabelPane); JPanel categoryPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Category_Label"), pieCategoryLabelPane);
getLabelPane().add(categoryPane, BorderLayout.CENTER); getLabelPane().add(categoryPane, BorderLayout.CENTER);
} }
} }

13
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -1,9 +1,12 @@
package com.fr.van.chart.designer.style.label; package com.fr.van.chart.designer.style.label;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.TwoTuple; import com.fr.chartx.TwoTuple;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -125,7 +128,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
double[] rowSize = getLabelPaneRowSize(plot, p); double[] rowSize = getLabelPaneRowSize(plot, p);
Component[][] components = getLabelPaneComponents(plot, p, columnSize); Component[][] components = getLabelPaneComponents(plot, p, columnSize);
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0});
} }
protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) { protected Component[][] getLabelPaneComponents(Plot plot, double p, double[] columnSize) {
@ -153,7 +156,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected JPanel createBorderAndBackgroundPane() { protected JPanel createBorderAndBackgroundPane() {
JPanel jPanel = new JPanel(); JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 5)); jPanel.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
jPanel.add(createLabelBorderPane(), BorderLayout.NORTH); jPanel.add(createLabelBorderPane(), BorderLayout.NORTH);
jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER); jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER);
return jPanel; return jPanel;
@ -161,7 +164,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
protected JPanel createLabelBorderPane() { protected JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane(); borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); borderPaneWithTitle = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane, true);
return borderPaneWithTitle; return borderPaneWithTitle;
} }
@ -179,7 +182,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
}; };
backgroundPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane); backgroundPaneWithTitle = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane);
return backgroundPaneWithTitle; return backgroundPaneWithTitle;
} }
@ -201,7 +204,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) {
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(title, panel); return new UIExpandablePane(title, panel);
} }
protected TwoTuple<String[], Integer[]> getPositionNamesAndValues() { protected TwoTuple<String[], Integer[]> getPositionNamesAndValues() {

21
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelPane.java

@ -1,11 +1,10 @@
package com.fr.van.chart.designer.style.label; package com.fr.van.chart.designer.style.label;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.AttrLabel; import com.fr.plugin.chart.base.AttrLabel;
import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.PlotFactory;
@ -14,8 +13,6 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartPlotLabelPane extends BasicPane { public class VanChartPlotLabelPane extends BasicPane {
private static final long serialVersionUID = -1701936672446232396L; private static final long serialVersionUID = -1701936672446232396L;
@ -39,7 +36,7 @@ public class VanChartPlotLabelPane extends BasicPane {
this.plot = plot; this.plot = plot;
this.inCondition = inCondition; this.inCondition = inCondition;
isLabelShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Label")); isLabelShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Label"));
labelPane = new JPanel(new BorderLayout(0, 4)); labelPane = new JPanel(new BorderLayout());
createLabelPane(); createLabelPane();
addComponents(); addComponents();
} }
@ -86,22 +83,12 @@ public class VanChartPlotLabelPane extends BasicPane {
if (inCondition) { if (inCondition) {
return labelPane; return labelPane;
} }
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isLabelShow}, new Component[]{isLabelShow},
new Component[]{labelPane} new Component[]{labelPane}
}; };
isLabelShow.addActionListener(new ActionListener() { isLabelShow.addActionListener(e -> checkBoxUse());
public void actionPerformed(ActionEvent e) { return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
checkBoxUse();
}
});
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return panel;
} }

36
designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.style.series; package com.fr.van.chart.designer.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.model.DataProcessor; import com.fr.base.chart.chartdata.model.DataProcessor;
import com.fr.base.chart.chartdata.model.LargeDataModel; import com.fr.base.chart.chartdata.model.LargeDataModel;
import com.fr.base.chart.chartdata.model.NormalDataModel; import com.fr.base.chart.chartdata.model.NormalDataModel;
@ -9,14 +11,12 @@ import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.GradientStyle; import com.fr.chart.base.GradientStyle;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; 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.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane; import com.fr.design.mainframe.chart.gui.style.series.AbstractPlotSeriesPane;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
@ -42,15 +42,16 @@ import com.fr.van.chart.designer.component.border.VanChartBorderPane;
import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.other.VanChartInteractivePane;
import com.fr.van.chart.pie.RadiusCardLayoutPane; import com.fr.van.chart.pie.RadiusCardLayoutPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
/** /**
* 图表样式-系列抽象界面 * 图表样式-系列抽象界面
*/ */
@ -104,13 +105,9 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
scrollPane.setViewportView(getContentInPlotType()); scrollPane.setViewportView(getContentInPlotType());
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
} }
JPanel panel = new JPanel(new BorderLayout()); return column(
JPanel colorPane = getColorPane(); cell(getColorPane()), cell(getContentInPlotType())
if (colorPane != null) { ).getComponent();
panel.add(colorPane, BorderLayout.NORTH);
}
panel.add(getContentInPlotType(), BorderLayout.CENTER);
return panel;
} }
/** /**
@ -135,8 +132,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
panel.add(vanChartFillStylePane, BorderLayout.CENTER); panel.add(vanChartFillStylePane, BorderLayout.CENTER);
} }
setColorPaneContent(panel); setColorPaneContent(panel);
JPanel colorPane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Color"), panel); JPanel colorPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Color"), panel, true);
panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 0));
return panel.getComponentCount() == 0 ? null : colorPane; return panel.getComponentCount() == 0 ? null : colorPane;
} }
@ -184,23 +180,19 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//边框(默认没有圆角) //边框(默认没有圆角)
protected JPanel createBorderPane() { protected JPanel createBorderPane() {
borderPane = createDiffBorderPane(); borderPane = createDiffBorderPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); borderPane.setBorder(new ScaledEmptyBorder(0, 0, 10, 0));
return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
} }
//半径界面 //半径界面
protected JPanel createRadiusPane(String title) { protected JPanel createRadiusPane(String title) {
radiusPane = initRadiusPane(); radiusPane = initRadiusPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH};
double[] rowSize = {p};
UILabel label = FRWidgetFactory.createLineWrapLabel(title); UILabel label = FRWidgetFactory.createLineWrapLabel(title);
label.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{label, radiusPane}, new Component[]{label, radiusPane},
}; };
radiusPaneWithTitle = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); radiusPaneWithTitle = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle; return ((VanChartPlot) plot).isInCustom() ? null : radiusPaneWithTitle;
} }
@ -284,7 +276,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//堆积和坐标轴设置(自定义柱形图等用到) //堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() { protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(); stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane();
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
return stackAndAxisEditExpandablePane; return stackAndAxisEditExpandablePane;
} }

37
designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java

@ -1,12 +1,13 @@
package com.fr.van.chart.designer.style.tooltip; package com.fr.van.chart.designer.style.tooltip;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.base.AttrTooltip;
@ -20,8 +21,6 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class VanChartPlotTooltipPane extends BasicPane { public class VanChartPlotTooltipPane extends BasicPane {
private static final long serialVersionUID = 6087381131907589370L; private static final long serialVersionUID = 6087381131907589370L;
@ -47,28 +46,19 @@ public class VanChartPlotTooltipPane extends BasicPane {
addComponents(plot); addComponents(plot);
} }
protected void addComponents(Plot plot) { protected void addComponents(Plot plot) {
isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip")); isTooltipShow = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Use_Tooltip"));
tooltipPane = createTooltipPane(plot); tooltipPane = createTooltipPane(plot);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{isTooltipShow}, new Component[]{isTooltipShow},
new Component[]{tooltipPane} new Component[]{tooltipPane}
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER); this.add(panel,BorderLayout.CENTER);
isTooltipShow.addActionListener(new ActionListener() { isTooltipShow.addActionListener(e -> checkBoxUse());
public void actionPerformed(ActionEvent e) {
checkBoxUse();
}
});
} }
protected JPanel createTooltipPane(Plot plot) { protected JPanel createTooltipPane(Plot plot) {
@ -77,25 +67,18 @@ public class VanChartPlotTooltipPane extends BasicPane {
initTooltipContentPane(plot); initTooltipContentPane(plot);
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,p};
Component[][] components = createComponents(plot); Component[][] components = createComponents(plot);
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
} }
protected Component[][] createComponents(Plot plot) { protected Component[][] createComponents(Plot plot) {
Component[][] components = new Component[][]{ return new Component[][]{
new Component[]{tooltipContentPane,null}, new Component[]{tooltipContentPane,null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane),null}, new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Border"),borderPane, true),null},
new Component[]{TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane),null}, new Component[]{new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Background"), backgroundPane, true),null},
new Component[]{createDisplayStrategy(plot),null}, new Component[]{createDisplayStrategy(plot),null},
}; };
return components;
} }
public VanChartStylePane getParentPane() { public VanChartStylePane getParentPane() {
@ -123,7 +106,7 @@ public class VanChartPlotTooltipPane extends BasicPane {
components[2] = new Component[]{showAllSeries,null}; components[2] = new Component[]{showAllSeries,null};
} }
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel);
} }
protected String getShowAllSeriesLabelText() { protected String getShowAllSeriesLabelText() {

3
designer-chart/src/main/java/com/fr/van/chart/pie/VanChartPieSeriesPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.pie;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
@ -69,7 +70,7 @@ public class VanChartPieSeriesPane extends VanChartAbstractPlotSeriesPane {
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Widget_Style"), panel, true);
} }
public void populateBean(Plot plot) { public void populateBean(Plot plot) {

1
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnPane.java

@ -108,7 +108,6 @@ public class DSColumnPane extends BasicPane {
contentPane.add(tabbedPane, BorderLayout.CENTER); contentPane.add(tabbedPane, BorderLayout.CENTER);
this.setPreferredSize(new Dimension(610, 400));
} }
@Override @Override

Loading…
Cancel
Save