Browse Source

REPORT-113994 【NewUI】设计器样式翻新-图表

newui
Levy.Xie-解安森 4 months ago
parent
commit
97777571ec
  1. 1
      designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java
  2. 11
      designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java
  3. 8
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  4. 17
      designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java
  5. 7
      designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java
  6. 4
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java
  7. 20
      designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java
  8. 2
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  9. 17
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java
  10. 18
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java
  11. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java
  12. 3
      designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index.svg
  13. 3
      designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index_disable.svg
  14. 3
      designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name.svg
  15. 3
      designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name_disable.svg
  16. 4
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  17. 3
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  18. 3
      designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java
  19. 20
      designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java
  20. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java
  21. 19
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  22. 14
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java
  23. 14
      designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java
  24. 4
      designer-chart/src/main/java/com/fr/van/chart/custom/component/MeterCustomPlotTableDataContentPane.java
  25. 3
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java
  26. 56
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  27. 9
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java
  28. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java
  29. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java
  30. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java
  31. 29
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java
  32. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java
  33. 22
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java
  34. 26
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  35. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java
  36. 37
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java
  37. 43
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  38. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java
  39. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  40. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  41. 11
      designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java
  42. 14
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartImageMarkerWithoutWidthAndHeightPane.java
  43. 13
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  44. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java
  45. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java
  46. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java
  47. 4
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java
  48. 9
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java
  49. 18
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java
  50. 26
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java
  51. 24
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  52. 18
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java
  53. 27
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java
  54. 35
      designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java
  55. 2
      designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

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

@ -32,6 +32,7 @@ public interface FineUIStyle {
String PLAIN_BUTTON = "plainButton"; String PLAIN_BUTTON = "plainButton";
String TOGGLE_GROUP = "inToggleGroup"; String TOGGLE_GROUP = "inToggleGroup";
String COMPACT_BUTTON = "compactButton"; String COMPACT_BUTTON = "compactButton";
String ROUND_BORDER_PANEL = "roundBorder";
String MENU_TOOL_BAR = "menuToolBar"; String MENU_TOOL_BAR = "menuToolBar";
String MENU_ITEM_TOOL_BAR = "menuItemToolBar"; String MENU_ITEM_TOOL_BAR = "menuItemToolBar";

11
designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -6,7 +6,6 @@ import com.fr.design.data.datapane.TableDataComboBox;
import com.fr.design.data.tabledata.Prepare4DataSourceChange; import com.fr.design.data.tabledata.Prepare4DataSourceChange;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -17,6 +16,9 @@ import java.awt.event.ItemListener;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 选择数据列编辑器 * 选择数据列编辑器
* *
@ -30,7 +32,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> implements Prep
public ColumnSelectedEditor() { public ColumnSelectedEditor() {
this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Column")); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_DS_Column"));
this.setLayout(FRGUIPaneFactory.createLeftZeroLayout()); this.setLayout(new BorderLayout());
tableDataComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableDataComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
columnNames = new String[0]; columnNames = new String[0];
tableDataComboBox.addItemListener(new ItemListener() { tableDataComboBox.addItemListener(new ItemListener() {
@ -52,10 +54,7 @@ public class ColumnSelectedEditor extends Editor<SimpleDSColumn> implements Prep
} }
}); });
columnNameComboBox = new UIComboBox(); columnNameComboBox = new UIComboBox();
tableDataComboBox.setPreferredSize(new Dimension(82, 20)); this.add(row(10, cell(tableDataComboBox), cell(columnNameComboBox)).getComponent());
this.add(tableDataComboBox);
columnNameComboBox.setPreferredSize(new Dimension(82, 20));
this.add(columnNameComboBox);
} }
@Override @Override

8
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -5,6 +5,8 @@ import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.fine.theme.utils.FineUIStyle; import com.fine.theme.utils.FineUIStyle;
import com.formdev.flatlaf.ui.FlatButtonBorder;
import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
@ -320,7 +322,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// text // text
initFormulaTextArea(); initFormulaTextArea();
UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea);
formulaTextAreaScrollPane.setBorder(new FineRoundBorder()); formulaTextAreaScrollPane.setBorder(new FlatRoundBorder());
// buttonPane // buttonPane
JPanel buttonPane = row(8).getComponent(); JPanel buttonPane = row(8).getComponent();
@ -1192,7 +1194,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private JPanel initFunctionNameList() { private JPanel initFunctionNameList() {
functionNameList = new JList(new DefaultListModel()); functionNameList = new JList(new DefaultListModel());
UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList);
functionNameScrollPane.setBorder(new FineRoundBorder()); functionNameScrollPane.setBorder(new FlatButtonBorder());
functionNameList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); functionNameList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
initFunctionNameListCellRenderer(); initFunctionNameListCellRenderer();
initFunctionNameListSelectionListener(); initFunctionNameListSelectionListener();
@ -1273,7 +1275,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
// variable // variable
variablesTree = new JTree(); variablesTree = new JTree();
UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); UIScrollPane variablesTreePane = new UIScrollPane(variablesTree);
variablesTreePane.setBorder(new FineRoundBorder()); variablesTreePane.setBorder(new FlatRoundBorder());
variablesTree.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); variablesTree.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE));
variablesTree.setRootVisible(false); variablesTree.setRootVisible(false);
variablesTree.setShowsRootHandles(true); variablesTree.setShowsRootHandles(true);

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

@ -1,7 +1,6 @@
package com.fr.design.formula; package com.fr.design.formula;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -11,12 +10,15 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Cursor; import java.awt.Cursor;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* *
* @author zhou * @author zhou
@ -70,15 +72,10 @@ public class TinyFormulaPane extends BasicBeanPane<String> implements UIObserver
} }
protected void initLayout() { protected void initLayout() {
JPanel pane = new JPanel(new BorderLayout());
JPanel pane1 = new JPanel(new BorderLayout());
pane1.add(formulaTextField, BorderLayout.NORTH);
pane1.setBorder(new ScaledEmptyBorder(0,0,0,5));
pane.add(pane1,BorderLayout.CENTER);
pane.add(formulaTextFieldButton,BorderLayout.EAST);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(pane,BorderLayout.NORTH) ; this.add(row(
cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5)
).getComponent()) ;
} }
/** /**

7
designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.formdev.flatlaf.ui.FlatUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.border.FineBorderFactory; import com.fr.design.border.FineBorderFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.controlpane.shortcutfactory.AbstractShortCutFactory; import com.fr.design.gui.controlpane.shortcutfactory.AbstractShortCutFactory;
@ -13,6 +14,7 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.Filter; import com.fr.stable.Filter;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSplitPane; import javax.swing.JSplitPane;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -148,7 +150,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S
toolbarDef.addShortCut(sj.getShortCut()); toolbarDef.addShortCut(sj.getShortCut());
} }
toolBar = ToolBarDef.createJToolBar(); toolBar = ToolBarDef.createJToolBar();
toolBar.setBorder(FineBorderFactory.createUnderlineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY))); toolBar.setBorder(BorderFactory.createCompoundBorder(
FineBorderFactory.createUnderlineBorder(FlatUIUtils.getUIColor("defaultBorderColor", Color.GRAY)),
new ScaledEmptyBorder(3, 0, 3, 0)
));
toolBar.setBorderPainted(true); toolBar.setBorderPainted(true);
toolbarDef.updateToolBar(toolBar); toolbarDef.updateToolBar(toolBar);
} }

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

@ -1,6 +1,6 @@
package com.fr.design.gui.controlpane; package com.fr.design.gui.controlpane;
import com.fine.theme.light.ui.FineRoundBorder; import com.formdev.flatlaf.ui.FlatRoundBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.JNameEdList;
@ -76,7 +76,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon
nameableList.setName(LIST_NAME); nameableList.setName(LIST_NAME);
UIScrollPane scrollPane = new UIScrollPane(nameableList); UIScrollPane scrollPane = new UIScrollPane(nameableList);
leftPane.add(scrollPane, BorderLayout.CENTER); leftPane.add(scrollPane, BorderLayout.CENTER);
leftPane.setBorder(new FineRoundBorder()); leftPane.setBorder(new FlatRoundBorder());
nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this)); nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this));

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

@ -167,4 +167,24 @@ public class FineTabbedPane extends Column {
public Component getSelectedComponent() { public Component getSelectedComponent() {
return tabComponents.get(String.valueOf(tabGroup.getSelectedItem())); return tabComponents.get(String.valueOf(tabGroup.getSelectedItem()));
} }
/**
* 设置选中的Tab组件
*
* @param i 组件序号
*/
public void setSelectedIndex(int i) {
tabGroup.setSelectedIndex(i);
cards.show(centerPane, String.valueOf(tabGroup.getSelectedItem()));
}
/**
* 获取选中的组件序号
*
* @return 组件序号
*/
public int getSelectedIndex() {
return tabGroup.getSelectedIndex();
}
} }

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

@ -1,5 +1,6 @@
package com.fr.design.mainframe.check; package com.fr.design.mainframe.check;
import com.fine.theme.utils.FineUIStyle;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -111,6 +112,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
//底部的按钮面板 //底部的按钮面板
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY);
okButton.addActionListener(this); okButton.addActionListener(this);
bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));

17
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.theme; package com.fr.design.mainframe.theme;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
import com.fr.base.theme.FormThemeConfig; import com.fr.base.theme.FormThemeConfig;
import com.fr.base.theme.ReportTheme; import com.fr.base.theme.ReportTheme;
@ -14,18 +15,15 @@ import com.fr.design.event.ChangeListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.icon.IconPathConstants;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nullable; import com.fr.third.javax.annotation.Nullable;
import com.fr.transaction.CallBackAdaptor; import com.fr.transaction.CallBackAdaptor;
import javax.swing.BorderFactory;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
@ -35,8 +33,6 @@ import java.awt.BasicStroke;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
import java.awt.RenderingHints; import java.awt.RenderingHints;
@ -99,8 +95,6 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
private void initializePane() { private void initializePane() {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10));
setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT));
add(createActionsContainer(), BorderLayout.NORTH); add(createActionsContainer(), BorderLayout.NORTH);
@ -177,10 +171,8 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
private JPanel createActionsContainer() { private JPanel createActionsContainer() {
JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane();
content.setPreferredSize(new Dimension(content.getPreferredSize().width, 20));
UIToolbar toolBar = ToolBarDef.createJToolBar(); UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
content.add(toolBar, BorderLayout.CENTER); content.add(toolBar, BorderLayout.CENTER);
MenuDef addMenuDef = createAddMenuDef(); MenuDef addMenuDef = createAddMenuDef();
@ -210,17 +202,14 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
content.add(setTheme4NewTemplateButton, BorderLayout.EAST); content.add(setTheme4NewTemplateButton, BorderLayout.EAST);
JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane();
container.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
container.add(content, BorderLayout.CENTER); container.add(content, BorderLayout.CENTER);
container.setPreferredSize(new Dimension(container.getPreferredSize().width, 30));
return container; return container;
} }
private MenuDef createAddMenuDef() { private MenuDef createAddMenuDef() {
MenuDef menuDef = new MenuDef(Toolkit.i18nText("Fine-Design_Basic_Action_Add")); MenuDef menuDef = new MenuDef(Toolkit.i18nText("Fine-Design_Basic_Action_Add"));
menuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); menuDef.setIcon(new LazyIcon("add_popup"));
menuDef.setRePaint(true); menuDef.setRePaint(true);
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Light_Theme"), config.getDefaultLightThemeName())); menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Light_Theme"), config.getDefaultLightThemeName()));
menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Dark_Theme"), config.getDefaultDarkThemeName())); menuDef.addShortCut(new AddThemeAction(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Pane_Create_Dark_Theme"), config.getDefaultDarkThemeName()));
@ -239,7 +228,7 @@ public class TemplateThemeGridControlPane<T extends TemplateTheme> extends Basic
setEnabled(initialEnabled); setEnabled(initialEnabled);
setName(Toolkit.i18nText("Fine-Design_Basic_Remove")); setName(Toolkit.i18nText("Fine-Design_Basic_Remove"));
setMnemonic('R'); setMnemonic('R');
setSmallIcon(IOUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH)); setSmallIcon(new LazyIcon("remove"));
} }
@Override @Override

18
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java

@ -12,7 +12,7 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.event.ChangeEvent; import com.fr.design.event.ChangeEvent;
import com.fr.design.event.ChangeListener; import com.fr.design.event.ChangeListener;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
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.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
@ -276,27 +276,27 @@ public class TemplateThemeGridPagesPane extends JPanel {
} }
public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane { public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane {
private final UITabbedPane tabbedPane; private final FineTabbedPane tabbedPane;
public TemplateThemeManagingPane(@Nullable Window window) { public TemplateThemeManagingPane(@Nullable Window window) {
setLayout(FRGUIPaneFactory.createBorderLayout()); setLayout(FRGUIPaneFactory.createBorderLayout());
tabbedPane = new UITabbedPane();
tabbedPane.setTabBorderColor(new Color(0xE0E0E1));
add(tabbedPane, BorderLayout.CENTER);
TemplateThemeGridControlPane<FormTheme> formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(window); TemplateThemeGridControlPane<FormTheme> formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(window);
TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(window); TemplateThemeGridControlPane<ReportTheme> reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(window);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane); tabbedPane = FineTabbedPane.builder()
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane); .addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane)
.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane)
.build();
tabbedPane.setSelectedIndex(0); tabbedPane.setSelectedIndex(0);
JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?,?> template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig(); TemplateThemeConfig<? extends TemplateTheme> config = template.getUsingTemplateThemeConfig();
if (config == reportThemesManagerPane.getConfig()) { if (config == reportThemesManagerPane.getConfig()) {
tabbedPane.setSelectedIndex(1); tabbedPane.setSelectedIndex(1);
} }
add(tabbedPane, BorderLayout.CENTER);
} }
@Override @Override

2
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java

@ -21,7 +21,6 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.GridLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -42,7 +41,6 @@ public class CellStyleEditPane extends MultiTabPane<ThemedCellStyle> {
public CellStyleEditPane() { public CellStyleEditPane() {
super(); super();
tabPane.setLayout(new GridLayout(1, 3, 0, 0));
} }

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

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H28V28H4V4ZM2 4C2 2.89543 2.89543 2 4 2H28C29.1046 2 30 2.89543 30 4V28C30 29.1046 29.1046 30 28 30H4C2.89543 30 2 29.1046 2 28V4ZM17.2124 9.21626L10.3109 18H17.2124L17.2124 9.21626ZM19.2124 20H23C23.5523 20 24 19.5523 24 19C24 18.4477 23.5523 18 23 18H19.2124V6.5C19.2124 5.94772 18.7647 5.5 18.2124 5.5C18.1903 5.5 18.1683 5.50072 18.1465 5.50213C17.8352 5.48438 17.5185 5.61256 17.3084 5.87998L7.54397 18.3075C7.23346 18.7026 7.26724 19.2675 7.62262 19.6229C7.72566 19.726 7.84506 19.8013 7.97204 19.8494C8.12527 19.9449 8.3062 20 8.5 20H17.2124V25C17.2124 25.5523 17.6601 26 18.2124 26C18.7647 26 19.2124 25.5523 19.2124 25V20Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 825 B

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

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M4 4H28V28H4V4ZM2 4C2 2.89543 2.89543 2 4 2H28C29.1046 2 30 2.89543 30 4V28C30 29.1046 29.1046 30 28 30H4C2.89543 30 2 29.1046 2 28V4ZM17.2124 9.21626L10.3109 18H17.2124L17.2124 9.21626ZM19.2124 20H23C23.5523 20 24 19.5523 24 19C24 18.4477 23.5523 18 23 18H19.2124V6.5C19.2124 5.94772 18.7647 5.5 18.2124 5.5C18.1903 5.5 18.1683 5.50072 18.1465 5.50213C17.8352 5.48438 17.5185 5.61256 17.3084 5.87998L7.54397 18.3075C7.23346 18.7026 7.26724 19.2675 7.62262 19.6229C7.72566 19.726 7.84506 19.8013 7.97204 19.8494C8.12527 19.9449 8.3062 20 8.5 20H17.2124V25C17.2124 25.5523 17.6601 26 18.2124 26C18.7647 26 19.2124 25.5523 19.2124 25V20Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 826 B

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

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V13H19C20.1046 13 21 13.8954 21 15V23C21 24.1046 20.1046 25 19 25H13C11.8954 25 11 24.1046 11 23V15V6ZM19 23H13V15H19V23ZM8 19H2L2 23H8V19ZM8 17H2C0.895431 17 0 17.8954 0 19V23C0 24.1046 0.89543 25 2 25H8C9.10457 25 10 24.1046 10 23L10 22L10 19L10 18.998V15C10 13.8954 9.10457 13 8 13H2H1C0.447715 13 0 13.4477 0 14C0 14.5523 0.447715 15 1 15H2H8L8 17ZM24 13H31C31.5523 13 32 13.4477 32 14C32 14.5523 31.5523 15 31 15H24V23H31C31.5523 23 32 23.4477 32 24C32 24.5523 31.5523 25 31 25H24C22.8954 25 22 24.1046 22 23V15C22 13.8954 22.8954 13 24 13Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 792 B

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

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M11 6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V13H19C20.1046 13 21 13.8954 21 15V23C21 24.1046 20.1046 25 19 25H13C11.8954 25 11 24.1046 11 23V15V6ZM19 23H13V15H19V23ZM8 19H2L2 23H8V19ZM8 17H2C0.895431 17 0 17.8954 0 19V23C0 24.1046 0.89543 25 2 25H8C9.10457 25 10 24.1046 10 23L10 22L10 19L10 18.998V15C10 13.8954 9.10457 13 8 13H2H1C0.447715 13 0 13.4477 0 14C0 14.5523 0.447715 15 1 15H2H8L8 17ZM24 13H31C31.5523 13 32 13.4477 32 14C32 14.5523 31.5523 15 31 15H24V23H31C31.5523 23 32 23.4477 32 24C32 24.5523 31.5523 25 31 25H24C22.8954 25 22 24.1046 22 23V15C22 13.8954 22.8954 13 24 13Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 793 B

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

@ -275,6 +275,8 @@
"tab": "widget/tab.svg", "tab": "widget/tab.svg",
"text_area": "widget/text_area.svg", "text_area": "widget/text_area.svg",
"text_field": "widget/text_field.svg", "text_field": "widget/text_field.svg",
"widget_tree": "widget/tree.svg" "widget_tree": "widget/tree.svg",
"ds_column_name": "editor/ds_column_name.svg",
"ds_column_index": "editor/ds_column_index.svg"
} }
} }

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

@ -1257,6 +1257,9 @@ CellOtherSetPane.height=$Component.defaultHeight
[style]Panel.lightGrey=\ [style]Panel.lightGrey=\
background: $Center.OuterShadowColor background: $Center.OuterShadowColor
[style]Panel.roundBorder=\
arc: 5
[style]Panel.menuBar=\ [style]Panel.menuBar=\
background: $MenuBar.background background: $MenuBar.background

3
designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java

@ -1,5 +1,6 @@
package com.fr.design.chart; package com.fr.design.chart;
import com.fine.theme.utils.FineUIStyle;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -54,6 +55,8 @@ public class ChartDialog extends MiddleChartDialog {
ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); ok = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel"));
FineUIStyle.setStyle(ok, FineUIStyle.STYLE_PRIMARY);
this.applyClosingAction(); this.applyClosingAction();
this.applyEscapeAction(); this.applyEscapeAction();
this.setBasicDialogSize(BasicDialog.DEFAULT); this.setBasicDialogSize(BasicDialog.DEFAULT);

20
designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java

@ -3,6 +3,10 @@ package com.fr.design.chart;
* the Pane of the Chart * the Pane of the Chart
*/ */
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineUIUtils;
import com.formdev.flatlaf.ui.FlatUIUtils;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager; import com.fr.chart.charttypes.ChartTypeManager;
@ -10,6 +14,7 @@ import com.fr.chartx.attr.ChartProvider;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.mainframe.chart.info.ChartInfoCollector;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -17,7 +22,6 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import javax.swing.BorderFactory;
import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListCellRenderer;
import javax.swing.DefaultListModel; import javax.swing.DefaultListModel;
import javax.swing.JList; import javax.swing.JList;
@ -73,9 +77,11 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
mainTypeList.setSelectedIndex(0); mainTypeList.setSelectedIndex(0);
JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane); JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane);
spane.setDividerLocation(120); spane.setDividerLocation(150);
spane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type")));
this.add(spane); Column center = (Column) FineUIUtils.wrapComponentWithTitle(spane, Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"));
center.setBorder(new ScaledEmptyBorder(10, 10, 10, 10));
this.add(center);
iconViewList.setSelectedIndex(0); iconViewList.setSelectedIndex(0);
} }
@ -92,11 +98,9 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven
ChartIcon chartIcon = (ChartIcon) value; ChartIcon chartIcon = (ChartIcon) value;
if (isSelected) { if (isSelected) {
// 深蓝色. // 深蓝色.
this.setBackground(new Color(57, 107, 181)); this.setBackground(FlatUIUtils.getUIColor("Tree.selectionBackground", new Color(57, 107, 181)));
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon), Color.WHITE));
} else {
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon)));
} }
this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon)));
} }
return this; return this;

34
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java

@ -1,9 +1,13 @@
package com.fr.design.mainframe.chart.gui.data.table; package com.fr.design.mainframe.chart.gui.data.table;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.MeterPlot; import com.fr.chart.chartattr.MeterPlot;
import com.fr.chart.chartdata.MeterTableDefinition; import com.fr.chart.chartdata.MeterTableDefinition;
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.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -12,19 +16,14 @@ 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 com.fr.extended.chart.StringFormula; import com.fr.extended.chart.StringFormula;
import com.fr.extended.chart.UIComboBoxWithNone; import com.fr.extended.chart.UIComboBoxWithNone;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
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.Component; import java.awt.Component;
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 java.util.List; import java.util.List;
@ -40,21 +39,16 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
private static final String METER_VALUE = Toolkit.i18nText("Fine-Design_Chart_Value_Pointer"); private static final String METER_VALUE = Toolkit.i18nText("Fine-Design_Chart_Value_Pointer");
private static final String TARGET_VALUE = Toolkit.i18nText("Fine-Design_Chart_Target_Value"); private static final String TARGET_VALUE = Toolkit.i18nText("Fine-Design_Chart_Target_Value");
private static final int COMBOBOX_WIDTH = 115;
private static final int COMBOBOX_HEIGHT = 20;
private static final int LABEL_WIDTH = 85;
private UIComboBox nameBox; private UIComboBox nameBox;
private UIComboBox valueBox; private UIComboBox valueBox;
private UIComboBox targetBox; private UIComboBox targetBox;
private TinyFormulaPane custom; private TinyFormulaPane custom;
private ChartDataFilterPane filterPane; private ChartDataFilterPane filterPane;
private JPanel boxPane; private Column boxPane;
public MeterPlotTableDataContentPane(ChartDataPane parent) { public MeterPlotTableDataContentPane(ChartDataPane parent) {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
nameBox = new UIComboBoxWithNone(); nameBox = new UIComboBoxWithNone();
nameBox.setSelectedIndex(nameBox.getItemCount() -1); nameBox.setSelectedIndex(nameBox.getItemCount() -1);
@ -63,8 +57,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
custom = new DefaultTinyFormulaPane(); custom = new DefaultTinyFormulaPane();
filterPane = new ChartDataFilterPane(new MeterPlot(), parent); filterPane = new ChartDataFilterPane(new MeterPlot(), parent);
boxPane = new JPanel(); boxPane = new Column();
boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); boxPane.setSpacing(10);
JPanel namePane = createPaneWithLabel(Toolkit.i18nText(METER_NAME), getNameComponent()); JPanel namePane = createPaneWithLabel(Toolkit.i18nText(METER_NAME), getNameComponent());
boxPane.add(namePane); boxPane.add(namePane);
@ -92,11 +86,7 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
} }
}); });
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane); JPanel jPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane, true);
filterPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
boxPane.setBorder(BorderFactory.createEmptyBorder(7, 24, 7, 15));
jPanel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 5));
this.add(getJSeparator(), BorderLayout.NORTH); this.add(getJSeparator(), BorderLayout.NORTH);
this.add(boxPane, BorderLayout.CENTER); this.add(boxPane, BorderLayout.CENTER);
@ -108,12 +98,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane
} }
private JPanel createPaneWithLabel(String labelName, Component component) { private JPanel createPaneWithLabel(String labelName, Component component) {
component.setPreferredSize(new Dimension(COMBOBOX_WIDTH, COMBOBOX_HEIGHT));
UILabel label = new BoldFontTextLabel(labelName); UILabel label = new BoldFontTextLabel(labelName);
label.setPreferredSize(new Dimension(LABEL_WIDTH, COMBOBOX_HEIGHT)); return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, component);
JPanel paneWithLabel = GUICoreUtils.createBorderLayoutPane(new Component[]{component, null, null, label, null});
paneWithLabel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0));
return paneWithLabel;
} }
protected void refreshBoxListWithSelectTableData(List list) { protected void refreshBoxListWithSelectTableData(List list) {

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

@ -1,17 +1,20 @@
package com.fr.design.mainframe.chart.gui.style.series; package com.fr.design.mainframe.chart.gui.style.series;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
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.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
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.ChartFillStylePane; import com.fr.design.mainframe.chart.gui.style.ChartFillStylePane;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import javax.swing.JScrollPane;
import javax.swing.JSeparator;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
* 属性表, 图表样式 - 系列 界面, 通过重载继承每个不同的方法, 得到内容的组合. * 属性表, 图表样式 - 系列 界面, 通过重载继承每个不同的方法, 得到内容的组合.
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
@ -37,10 +40,6 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
} }
protected JPanel getContentPane(boolean custom) { protected JPanel getContentPane(boolean custom) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p, p, p};
Component[][] components = new Component[3][1]; Component[][] components = new Component[3][1];
JPanel panel; JPanel panel;
@ -51,7 +50,7 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
components[1] = new Component[]{new JSeparator()}; components[1] = new Component[]{new JSeparator()};
} }
panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
JScrollPane scrollPane = new JScrollPane(); JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(panel); scrollPane.setViewportView(panel);
@ -68,7 +67,7 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
components[2] = new Component[]{contentPane}; components[2] = new Component[]{contentPane};
} }
panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
} }
return panel; return panel;

14
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java

@ -13,9 +13,11 @@ import java.awt.Graphics;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import static com.fine.theme.utils.FineUIScale.scale;
public class ChartImagePane extends ChartSelectDemoPane { public class ChartImagePane extends ChartSelectDemoPane {
private static final long serialVersionUID = -2785128245790568603L; private static final long serialVersionUID = -2785128245790568603L;
private static final int IMAGE_WIDTH = 58; private static final int IMAGE_WIDTH = 56;
private static final int IMAGE_HIGTH = 50; private static final int IMAGE_HIGTH = 50;
private static final Color ENTER_COLOR = new Color(216, 242, 253); private static final Color ENTER_COLOR = new Color(216, 242, 253);
private boolean isDrawRightLine = false; private boolean isDrawRightLine = false;
@ -30,7 +32,7 @@ public class ChartImagePane extends ChartSelectDemoPane {
this.setBorder(BorderFactory.createMatteBorder(0, 0, 0, isDrawRightLine ? 1 : 0, UIConstants.SELECT_TAB)); this.setBorder(BorderFactory.createMatteBorder(0, 0, 0, isDrawRightLine ? 1 : 0, UIConstants.SELECT_TAB));
this.setBackground(UIConstants.TOOLBARUI_BACKGROUND); this.setBackground(UIConstants.TOOLBARUI_BACKGROUND);
this.setPreferredSize(new Dimension(IMAGE_WIDTH, IMAGE_HIGTH)); this.setPreferredSize(getScaledDimension());
} }
public ChartImagePane(String fullIconPath, String tipName, boolean isDrawRightLine){ public ChartImagePane(String fullIconPath, String tipName, boolean isDrawRightLine){
@ -45,7 +47,7 @@ public class ChartImagePane extends ChartSelectDemoPane {
super.paint(g); super.paint(g);
BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath); BufferedImage image1 = IOUtils.readImageWithCache(fullIconPath);
g.drawImage(image1, 0, 0, IMAGE_WIDTH, IMAGE_HIGTH, null); g.drawImage(image1, 0, 0, scale(IMAGE_WIDTH), scale(IMAGE_HIGTH), null);
} }
}; };
@ -58,8 +60,12 @@ public class ChartImagePane extends ChartSelectDemoPane {
this.setBorder(BorderFactory.createMatteBorder(0, 0, 0, isDrawRightLine ? 1 : 0, UIConstants.SELECT_TAB)); this.setBorder(BorderFactory.createMatteBorder(0, 0, 0, isDrawRightLine ? 1 : 0, UIConstants.SELECT_TAB));
this.setBackground(UIConstants.TOOLBARUI_BACKGROUND); this.setBackground(UIConstants.TOOLBARUI_BACKGROUND);
this.setPreferredSize(new Dimension(IMAGE_WIDTH, IMAGE_HIGTH)); this.setPreferredSize(getScaledDimension());
}
private Dimension getScaledDimension() {
return scale(new Dimension(IMAGE_WIDTH, IMAGE_HIGTH));
} }
/** /**

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

@ -1,13 +1,12 @@
package com.fr.van.chart.area; package com.fr.van.chart.area;
import com.fine.theme.utils.FineLayoutBuilder;
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.foldablepane.UIExpandablePane;
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.van.chart.column.VanChartCustomStackAndAxisConditionPane; import com.fr.van.chart.column.VanChartCustomStackAndAxisConditionPane;
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.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePane;
import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed;
@ -27,11 +26,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
protected JPanel getContentInPlotType() { protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createLineTypePane()}, new Component[]{createLineTypePane()},
new Component[]{createMarkerPane()}, new Component[]{createMarkerPane()},
@ -42,7 +36,7 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return contentPane; return contentPane;
} }
@ -61,6 +55,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane {
protected JPanel createMarkerPane() { protected JPanel createMarkerPane() {
markerPane = new VanChartMarkerPane(); markerPane = new VanChartMarkerPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true);
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/custom/component/MeterCustomPlotTableDataContentPane.java

@ -8,14 +8,11 @@ import com.fr.design.mainframe.chart.gui.data.table.MeterPlotTableDataContentPan
import com.fr.plugin.chart.data.VanChartMeterCustomTableDefinition; import com.fr.plugin.chart.data.VanChartMeterCustomTableDefinition;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
/** /**
* Created by Fangjie on 2016/5/18. * Created by Fangjie on 2016/5/18.
*/ */
public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataContentPane { public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataContentPane {
private static final int TEXT_HT = 20;
private static final int TEXT_WD = 80;
private UITextField nameField; private UITextField nameField;
public MeterCustomPlotTableDataContentPane(ChartDataPane parent) { public MeterCustomPlotTableDataContentPane(ChartDataPane parent) {
super(parent); super(parent);
@ -24,7 +21,6 @@ public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataConte
@Override @Override
protected Component getNameComponent() { protected Component getNameComponent() {
nameField = new UITextField(); nameField = new UITextField();
nameField.setPreferredSize(new Dimension(TEXT_WD, TEXT_HT));
return nameField; return nameField;
} }

3
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.custom.component; package com.fr.van.chart.custom.component;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
@ -43,6 +44,7 @@ import com.fr.stable.Nameable;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.van.chart.designer.component.VanChartUIListControlPane; import com.fr.van.chart.designer.component.VanChartUIListControlPane;
import java.awt.Dimension;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
@ -59,6 +61,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
public VanChartHyperLinkPane() { public VanChartHyperLinkPane() {
super(); super();
setPreferredSize(FineUIScale.scale(new Dimension(224, 420)));
} }
@Override @Override

56
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java

@ -1,27 +1,28 @@
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.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
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.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.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineStyle;
import com.fr.plugin.chart.type.LineType; import com.fr.plugin.chart.type.LineType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.Arrays;
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.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.row;
/** /**
* line相关设置 * line相关设置
*/ */
@ -51,22 +52,14 @@ public class VanChartLineTypePane extends BasicPane {
Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Open"),
Toolkit.i18nText("Fine-Design_Chart_Close")}); Toolkit.i18nText("Fine-Design_Chart_Close")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
Component[] lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle}, Component[] lineStyleComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style_Present")), lineStyle},
nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak}; nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak};
Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent); Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent);
double[] row = new double[components.length]; lineStylePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
Arrays.fill(row, p);
double[] col = {f, e};
lineStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout(0, 6)); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
this.add(typeAndWidthPane, BorderLayout.NORTH); this.add(typeAndWidthPane, BorderLayout.NORTH);
this.add(lineStylePane, BorderLayout.CENTER); this.add(lineStylePane, BorderLayout.CENTER);
} }
@ -84,29 +77,16 @@ public class VanChartLineTypePane extends BasicPane {
checkLineStyle(); checkLineStyle();
} }
}); });
lineWidthPane = row(
Component[][] lineTypeComps = new Component[][]{ cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width"))).weight(1.2), cell(lineWidthSpinner).weight(3)
new Component[]{null, null}, ).getComponent();
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox}
}; return column(10,
Component[][] lineWidthComps = new Component[][]{ row(
new Component[]{ cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style"))).weight(1.2),
FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), cell(lineTypeComboBox).weight(3)
UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)} ),
}; cell(lineWidthPane)).getComponent();
double p = TableLayout.PREFERRED, f = TableLayout.FILL, e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] col = {f, e};
JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineTypeComps, new double[]{p, p}, col);
lineWidthPane = TableLayout4VanChartHelper.createGapTableLayoutPane(lineWidthComps, new double[]{p}, col);
JPanel contentPane = new JPanel(new BorderLayout(0, 6));
contentPane.add(lineTypePane, BorderLayout.CENTER);
contentPane.add(lineWidthPane, BorderLayout.SOUTH);
return contentPane;
} }
protected LineTypeComboBox createLineType() { protected LineTypeComboBox createLineType() {

9
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java

@ -1,6 +1,9 @@
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.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
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;
@ -30,7 +33,7 @@ public class VanChartMarkerPane extends BasicPane {
private BasicBeanPane imageMarkerPane; private BasicBeanPane imageMarkerPane;
public VanChartMarkerPane() { public VanChartMarkerPane() {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
String[] array = new String[]{Toolkit.i18nText("Fine-Design_Chart_Rule"), Toolkit.i18nText("Fine-Design_Chart_Custom")}; String[] array = new String[]{Toolkit.i18nText("Fine-Design_Chart_Rule"), Toolkit.i18nText("Fine-Design_Chart_Custom")};
commonORCustom = new UIButtonGroup<String>(array, array); commonORCustom = new UIButtonGroup<String>(array, array);
@ -88,7 +91,9 @@ public class VanChartMarkerPane extends BasicPane {
} }
protected void layoutComponents() { protected void layoutComponents() {
this.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Point_Style"), commonORCustom), BorderLayout.NORTH); this.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Point_Style")), commonORCustom
), BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }

5
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.base.AttrColor; import com.fr.chart.base.AttrColor;
import com.fr.chart.base.AttrLineStyle; import com.fr.chart.base.AttrLineStyle;
import com.fr.chart.base.LineStyleInfo; import com.fr.chart.base.LineStyleInfo;
@ -96,8 +97,8 @@ public class VanChartTrendLinePane extends BasicPane{
new Component[]{label, periodPane} new Component[]{label, periodPane}
}; };
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p,p,p}, col); JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2 ,3});
trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, new double[]{p,p,p,p}, col); trendLineHidePane = FineLayoutBuilder.compatibleTableLayout(10, componentsMayHide, new double[]{1.2 ,3});
trendLineStyle.addActionListener(new ActionListener() { trendLineStyle.addActionListener(new ActionListener() {
@Override @Override

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

@ -1,13 +1,10 @@
package com.fr.van.chart.designer.component; package com.fr.van.chart.designer.component;
import com.fine.theme.utils.FineLayoutBuilder;
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;
import com.fr.design.gui.controlpane.UIListControlPane; import com.fr.design.gui.controlpane.UIListControlPane;
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.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
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.design.utils.gui.GUICoreUtils;
@ -21,7 +18,6 @@ import javax.swing.SwingUtilities;
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.FlowLayout; import java.awt.FlowLayout;
import java.awt.Point; import java.awt.Point;
import java.awt.Window; import java.awt.Window;
@ -98,13 +94,6 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem
this.listenerList.add(ChangeListener.class, l); this.listenerList.add(ChangeListener.class, l);
} }
@Override
protected JPanel getLeftTopPane(UIToolbar topToolBar) {
Component[][] components = new Component[][]{
new Component[]{new UILabel(getAddItemText()), topToolBar},
};
return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
}
@Override @Override
public void saveSettings() { public void saveSettings() {

12
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -8,7 +8,6 @@ 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.gui.xcombox.MarkerComboBox; import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -81,8 +80,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
}; };
radius = new UISpinnerWithPx(0, 100, 0.5, 0); radius = new UISpinnerWithPx(0, 100, 0.5, 0);
double p = TableLayout.PREFERRED;
markerTypePane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerTypeComponent(), new double[]{1.2, 3}); markerTypePane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerTypeComponent(), new double[]{1.2, 3});
markerConfigPane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerConfigComponent(), new double[]{1.2, 3}); markerConfigPane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerConfigComponent(), new double[]{1.2, 3});
@ -92,13 +89,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
checkMarkType(); checkMarkType();
} }
}); });
this.setLayout(new BorderLayout());
JPanel contentPane = new JPanel(new BorderLayout(0, 6)); this.add(FineLayoutBuilder.createVerticalLayout(10, markerTypePane, markerConfigPane));
contentPane.add(markerTypePane, BorderLayout.CENTER);
contentPane.add(markerConfigPane, BorderLayout.SOUTH);
this.add(contentPane);
} }
protected Component[][] getMarkerTypeComponent() { protected Component[][] getMarkerTypeComponent() {

29
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java

@ -1,12 +1,11 @@
package com.fr.van.chart.designer.component.marker; package com.fr.van.chart.designer.component.marker;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.background.ImageFileBackground; import com.fr.base.background.ImageFileBackground;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ilable.UILabel; 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.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.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
@ -14,12 +13,16 @@ import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.stable.Constants; import com.fr.stable.Constants;
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 java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* Created by Mitisky on 16/5/19. * Created by Mitisky on 16/5/19.
*/ */
@ -30,25 +33,18 @@ public class VanChartImageMarkerPane extends BasicBeanPane<VanChartAttrMarker> {
public VanChartImageMarkerPane() { public VanChartImageMarkerPane() {
imageBackgroundPane = new ImageBackgroundQuickPane(false); imageBackgroundPane = new ImageBackgroundQuickPane(false);
imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize()));
width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); width = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30); height = new UISpinnerWithPx(0, Integer.MAX_VALUE, 0.5, 30);
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p};
double[] col = {p, f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Width")), width}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Width")), width},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height")), height}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Height")), height},
}; };
JPanel sizePanel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel sizePanel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel panel = createContentPane(imageBackgroundPane, sizePanel); JPanel panel = createContentPane(imageBackgroundPane, sizePanel);
panel.setBorder(BorderFactory.createEmptyBorder(0, 72, 0, 0)); this.setLayout(new BorderLayout());
this.add(panel); this.add(panel);
} }
@ -57,10 +53,11 @@ public class VanChartImageMarkerPane extends BasicBeanPane<VanChartAttrMarker> {
} }
protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) { protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) {
JPanel panel = new JPanel(new BorderLayout(0, 4)); return row(
panel.add(imageBackgroundPane, BorderLayout.CENTER); flex(1.2), column(10,
panel.add(sizePanel, BorderLayout.SOUTH); cell(imageBackgroundPane), cell(sizePanel)
return panel; ).weight(3)
).getComponent();
} }
/** /**

11
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java

@ -1,10 +1,12 @@
package com.fr.van.chart.designer.style.axis; package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineLayoutBuilder;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.chart.base.ColorWithThemeStyle; import com.fr.chart.base.ColorWithThemeStyle;
import com.fr.chart.chartattr.Axis; import com.fr.chart.chartattr.Axis;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
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.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -14,7 +16,6 @@ import com.fr.plugin.chart.attr.axis.VanChartValueAxis;
import com.fr.plugin.chart.type.AxisType; import com.fr.plugin.chart.type.AxisType;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
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.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -58,10 +59,12 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll
} }
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.setLayout(new BorderLayout());
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Type"), jcb); JPanel northPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Type")), jcb);
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);
setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
} }

22
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.designer.style.axis; package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
@ -8,13 +10,11 @@ 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.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.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
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.attr.axis.VanChartAxisLabelStyle; import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle;
import com.fr.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.config.DefaultStyleHelper4Van;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox; import com.fr.van.chart.designer.style.axis.component.AxisLabelDisplayComboBox;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -41,14 +41,10 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
public VanChartAxisStyleSettingPane(boolean showLabelDisplayPane, ChartTextAttrPane textAttrPane) { public VanChartAxisStyleSettingPane(boolean showLabelDisplayPane, ChartTextAttrPane textAttrPane) {
this.showLabelDisplayPane = showLabelDisplayPane; this.showLabelDisplayPane = showLabelDisplayPane;
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] column = {f, s};
double[] row = {p, p, p};
labelDisplayComboBox = new AxisLabelDisplayComboBox(); labelDisplayComboBox = new AxisLabelDisplayComboBox();
labelDisplayPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show"), labelDisplayComboBox, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); labelDisplayPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3} ,
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Show")), labelDisplayComboBox);
labelDisplayPane.setVisible(showLabelDisplayPane); labelDisplayPane.setVisible(showLabelDisplayPane);
labelTextAttrPane = textAttrPane; labelTextAttrPane = textAttrPane;
@ -56,10 +52,10 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapStyle = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapValue = new UITextField(); labelGapValue = new UITextField();
labelGapPane = createLabelGapPane(row, column); labelGapPane = createLabelGapPane();
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
contentPane = new JPanel(new BorderLayout()); contentPane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
contentPane.add(labelDisplayPane, BorderLayout.NORTH); contentPane.add(labelDisplayPane, BorderLayout.NORTH);
contentPane.add(labelTextAttrPane, BorderLayout.CENTER); contentPane.add(labelTextAttrPane, BorderLayout.CENTER);
contentPane.add(labelGapPane, BorderLayout.SOUTH); contentPane.add(labelGapPane, BorderLayout.SOUTH);
@ -146,7 +142,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
return null; return null;
} }
private JPanel createLabelGapPane(double[] row, double[] col) { private JPanel createLabelGapPane() {
Component[][] gapComponents = new Component[][]{ Component[][] gapComponents = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{ new Component[]{
@ -156,8 +152,8 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane<VanChartAxisLabe
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle} new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle}
}; };
JPanel gapDetailPane = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); JPanel gapDetailPane = FineLayoutBuilder.compatibleTableLayout(10, gapComponents, new double[]{1.2, 3});
labelGapValuePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText(""), labelGapValue, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); labelGapValuePane = FineLayoutBuilder.asBorderLayoutWrapped(labelGapValue);
JPanel panel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(new BorderLayout());
panel.add(gapDetailPane, BorderLayout.CENTER); panel.add(gapDetailPane, BorderLayout.CENTER);

26
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -2,6 +2,7 @@ package com.fr.van.chart.designer.style.axis;
import com.fine.theme.utils.FineComponentsFactory; import com.fine.theme.utils.FineComponentsFactory;
import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.BaseFormula; import com.fr.base.BaseFormula;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.base.chart.chartdata.TopDefinitionProvider;
@ -55,6 +56,9 @@ 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;
/** /**
* 坐标轴的基础配置项分类时间值等公共的部分 * 坐标轴的基础配置项分类时间值等公共的部分
*/ */
@ -136,13 +140,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
protected JPanel createContentPane(boolean isXAxis) { protected JPanel createContentPane(boolean isXAxis) {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double[] column = {f, s};
double[] rowSize = {p, p, p, p, p, p, p, p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitlePane(isXAxis), null}, new Component[]{createTitlePane(isXAxis), null},
new Component[]{createLabelPane(), null}, new Component[]{createLabelPane(), null},
@ -152,7 +149,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
new Component[]{createValueStylePane(), null}, new Component[]{createValueStylePane(), null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
} }
protected JPanel createTitlePane(boolean isXAxis) { protected JPanel createTitlePane(boolean isXAxis) {
@ -191,9 +188,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
}); });
JPanel jPanel = new JPanel(new BorderLayout()); JPanel jPanel = column(10,
jPanel.add(showTitlePane, BorderLayout.NORTH); cell(showTitlePane), cell(titlePane)
jPanel.add(titlePane, BorderLayout.CENTER); ).getComponent();
return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel, true); return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel, true);
} }
@ -218,7 +215,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel); new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel);
JPanel labelContentPane = createLabelContentPane(); JPanel labelContentPane = createLabelContentPane();
JPanel labelPane = new JPanel(new BorderLayout()); JPanel labelPane = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
labelPane.add(showLabelPane, BorderLayout.NORTH); labelPane.add(showLabelPane, BorderLayout.NORTH);
labelPane.add(labelContentPane, BorderLayout.CENTER); labelPane.add(labelContentPane, BorderLayout.CENTER);
@ -402,9 +399,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom"));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Format"), SwingConstants.LEFT), valueFormatStyle},
new Component[]{null, centerPane}, new Component[]{centerPane, null},
}; };
JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
@ -416,7 +412,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
}); });
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Use_Format"), contentPane);
} }
protected FormatPane createFormatPane() { protected FormatPane createFormatPane() {

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java

@ -52,7 +52,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane {
new Component[]{createValueStylePane(), null}, new Component[]{createValueStylePane(), null},
}; };
return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
} }
protected boolean showLabelDisplay() { protected boolean showLabelDisplay() {

37
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java

@ -1,6 +1,8 @@
package com.fr.van.chart.designer.style.axis.component; package com.fr.van.chart.designer.style.axis.component;
import com.fine.swing.ui.layout.Column;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -14,15 +16,13 @@ import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.van.chart.designer.style.axis.VanChartAxisPane; import com.fr.van.chart.designer.style.axis.VanChartAxisPane;
import javax.swing.BoxLayout;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics; import java.awt.Graphics;
import java.util.ArrayList;
import java.util.List;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -49,7 +49,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
private List<ChartAxisButton> indexList_X = new ArrayList<ChartAxisButton>(); private List<ChartAxisButton> indexList_X = new ArrayList<ChartAxisButton>();
private List<ChartAxisButton> indexList_Y = new ArrayList<ChartAxisButton>(); private List<ChartAxisButton> indexList_Y = new ArrayList<ChartAxisButton>();
private JPanel buttonPane; private Column buttonPane;
private VanChartAxisPane parent; private VanChartAxisPane parent;
@ -63,7 +63,8 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
addButton.setVisible(false); addButton.setVisible(false);
this.add(eastPane, BorderLayout.EAST); this.add(eastPane, BorderLayout.EAST);
buttonPane = new JPanel(); buttonPane = new Column();
buttonPane.setSpacing(10);
this.add(buttonPane, BorderLayout.CENTER); this.add(buttonPane, BorderLayout.CENTER);
itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX);
@ -88,28 +89,8 @@ public class VanChartAxisButtonPane extends BasicBeanPane<VanChartAxisPlot> {
return; return;
} }
buttonPane.removeAll(); buttonPane.removeAll();
buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.Y_AXIS)); buttonPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList_X));
buttonPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList_Y));
JPanel pane = null;
int size_X = indexList_X.size();
int size_Y = indexList_Y.size();
for (int i = 0; i < size_X; i++) {
if (i % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
buttonPane.add(pane);
}
pane.add(indexList_X.get(i));
}
for (int i = 0; i < size_Y; i++) {
if ((i + size_X) % COL_COUNT == 0) {
pane = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
buttonPane.add(pane);
}
if (pane != null) {
pane.add(indexList_Y.get(i));
}
}
if (popupMenu != null) { if (popupMenu != null) {
popupMenu.setVisible(false); popupMenu.setVisible(false);

43
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -1,11 +1,12 @@
package com.fr.van.chart.designer.style.axis.gauge; package com.fr.van.chart.designer.style.axis.gauge;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
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.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.ChartTextAttrPaneWithAuto; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
@ -17,12 +18,10 @@ import com.fr.plugin.chart.attr.axis.VanChartGaugeAxis;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.FontAutoType; import com.fr.plugin.chart.type.FontAutoType;
import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane; import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane;
import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane; import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane;
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.Component;
@ -49,20 +48,16 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
if (gaugeStyle == null) { if (gaugeStyle == null) {
gaugeStyle = GaugeStyle.POINTER; gaugeStyle = GaugeStyle.POINTER;
} }
double p = TableLayout.PREFERRED; return FineLayoutBuilder.compatibleTableLayout(0, getPanelComponents(), new double[]{1});
double f = TableLayout.FILL;
double[] columnSize = {f, p};
double[] rowSize = {p, p, p, p, p, p, p, p};
return TableLayoutHelper.createTableLayoutPane(getPanelComponents(p, f, columnSize), rowSize, columnSize);
} }
private Component[][] getPanelComponents(double p, double f, double[] columnSize) { private Component[][] getPanelComponents() {
switch (gaugeStyle) { switch (gaugeStyle) {
case THERMOMETER: case THERMOMETER:
return new Component[][]{ return new Component[][]{
new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, new Component[]{createLabelPane(), null},
new Component[]{createValueDefinition(), null}, new Component[]{createValueDefinition(), null},
new Component[]{createTickColorPane(new double[]{p, p, p}, new double[]{p, f}), null}, new Component[]{createTickColorPane(), null},
new Component[]{createValueStylePane()}, new Component[]{createValueStylePane()},
}; };
case RING: case RING:
@ -75,21 +70,21 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
}; };
default: default:
return new Component[][]{ return new Component[][]{
new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, new Component[]{createLabelPane(), null},
new Component[]{createValueDefinition(), null}, new Component[]{createValueDefinition(), null},
new Component[]{createValueStylePane()}, new Component[]{createValueStylePane()},
}; };
} }
} }
protected JPanel createLabelPane(double[] row, double[] col) { protected JPanel createLabelPane() {
showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); showLabel = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")});
labelTextAttrPane = getChartTextAttrPane(); labelTextAttrPane = getChartTextAttrPane();
labelContentPane = new JPanel(new BorderLayout()); labelContentPane = new JPanel(new BorderLayout());
labelContentPane.add(labelTextAttrPane); labelContentPane.add(labelTextAttrPane);
labelContentPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
JPanel panel = new JPanel(new BorderLayout(0, 6)); panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel), BorderLayout.NORTH);
panel.add(labelContentPane, BorderLayout.CENTER); panel.add(labelContentPane, BorderLayout.CENTER);
showLabel.addActionListener(new ActionListener() { showLabel.addActionListener(new ActionListener() {
@Override @Override
@ -97,9 +92,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
checkLabelPane(); checkLabelPane();
} }
}); });
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel, true);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return jPanel;
} }
protected ChartTextAttrPane getChartTextAttrPane() { protected ChartTextAttrPane getChartTextAttrPane() {
@ -149,20 +142,18 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
minMaxValuePane = new VanChartMinMaxValuePane(); minMaxValuePane = new VanChartMinMaxValuePane();
break; break;
} }
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), minMaxValuePane, true);
} }
private JPanel createTickColorPane(double[] row, double[] col) { private JPanel createTickColorPane() {
mainTickColor = new ColorSelectBox(100); mainTickColor = new ColorSelectBox(100);
secTickColor = new ColorSelectBox(100); secTickColor = new ColorSelectBox(100);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTickColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Main_Graduation_Line")), mainTickColor},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secTickColor}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Second_Graduation_Line")), secTickColor},
}; };
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel, true);
panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15));
return jPanel;
} }
private boolean isMulti(GaugeStyle style) { private boolean isMulti(GaugeStyle style) {

6
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java

@ -1,8 +1,9 @@
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.foldablepane.UIExpandablePane;
import com.fr.plugin.chart.type.GaugeStyle; import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate; import com.fr.van.chart.designer.component.label.LabelContentPaneWithCate;
import com.fr.van.chart.designer.component.label.LabelContentPaneWithPercent; import com.fr.van.chart.designer.component.label.LabelContentPaneWithPercent;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -64,6 +65,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe
} }
protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { protected JPanel createTableLayoutPaneWithTitle(String title, Component component) {
return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); JPanel panel = FineLayoutBuilder.asBorderLayoutWrapped(component);
return new UIExpandablePane(title, panel, true);
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -1,5 +1,6 @@
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.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.TwoTuple; import com.fr.chartx.TwoTuple;
@ -7,7 +8,6 @@ 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.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
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.ChartTextAttrPaneWithAuto; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPaneWithAuto;
import com.fr.plugin.chart.base.AttrLabelDetail; import com.fr.plugin.chart.base.AttrLabelDetail;
@ -63,7 +63,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
initStyleListener(); initStyleListener();
return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); return FineLayoutBuilder.compatibleTableLayout(10, getLabelStyleComponents(plot),new double[]{1.2, 3});
} }
protected void initStyleListener() { protected void initStyleListener() {

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

@ -26,7 +26,6 @@ import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutI
import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane; import com.fr.van.chart.designer.component.border.VanChartBorderWithShapePane;
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 javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -53,7 +52,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
private VanChartBorderWithShapePane borderPane; private VanChartBorderWithShapePane borderPane;
private VanChartBackgroundWithOutImagePane backgroundPane; private VanChartBackgroundWithOutImagePane backgroundPane;
private JPanel tractionLinePane;
private JPanel positionPane; private JPanel positionPane;
private Integer[] oldPositionValues; private Integer[] oldPositionValues;
@ -245,12 +243,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
if (plot.isSupportLeadLine()) { if (plot.isSupportLeadLine()) {
tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline"));
tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine); panel.add(tractionLine, BorderLayout.SOUTH);
tractionLinePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
panel.add(tractionLinePane, BorderLayout.SOUTH);
initPositionListener(); initPositionListener();
} else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) { } else if (PlotFactory.plotAutoAdjustLabelPosition(plot)) {
panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust"), autoAdjust), BorderLayout.SOUTH); panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Chart_Auto_Adjust")), autoAdjust), BorderLayout.SOUTH);
} }
return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout")); return getLabelLayoutPane(panel, Toolkit.i18nText("Fine-Design_Form_Attr_Layout"));
@ -369,7 +366,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
} }
private void checkPositionEnabled() { private void checkPositionEnabled() {
tractionLinePane.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE); tractionLine.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE);
} }
protected void checkPane() { protected void checkPane() {

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

@ -106,7 +106,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
scrollPane.setViewportView(getContentInPlotType()); scrollPane.setViewportView(getContentInPlotType());
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
} }
return column(10, return column(0,
cell(getColorPane()), cell(getContentInPlotType()) cell(getColorPane()), cell(getContentInPlotType())
).getComponent(); ).getComponent();
} }
@ -159,7 +159,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//线 //线
protected JPanel createLineTypePane() { protected JPanel createLineTypePane() {
lineTypePane = getLineTypePane(); lineTypePane = getLineTypePane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Line"), lineTypePane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Line"), lineTypePane, true);
} }
protected VanChartLineTypePane getLineTypePane() { protected VanChartLineTypePane getLineTypePane() {
@ -175,7 +175,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//填充颜色 //填充颜色
protected JPanel createAreaFillColorPane() { protected JPanel createAreaFillColorPane() {
areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane(); areaSeriesFillColorPane = new VanChartAreaSeriesFillColorPane();
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Area"), areaSeriesFillColorPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Area"), areaSeriesFillColorPane, true);
} }
//边框(默认没有圆角) //边框(默认没有圆角)
@ -271,13 +271,14 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP
//不透明度 //不透明度
protected JPanel createAlphaPane() { protected JPanel createAlphaPane() {
transparent = new UINumberDragPaneWithPercent(0, 100); transparent = new UINumberDragPaneWithPercent(0, 100);
return TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Report_Alpha"), transparent); return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent);
} }
//堆积和坐标轴设置(自定义柱形图等用到) //堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() { protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(); stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane();
stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane, true);
return stackAndAxisEditExpandablePane; return stackAndAxisEditExpandablePane;
} }

14
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartImageMarkerWithoutWidthAndHeightPane.java

@ -4,7 +4,11 @@ import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.van.chart.designer.component.marker.VanChartImageMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartImageMarkerPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.column;
import static com.fine.swing.ui.layout.Layouts.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* Created by hufan on 2017/1/13. * Created by hufan on 2017/1/13.
@ -13,8 +17,10 @@ public class VanChartImageMarkerWithoutWidthAndHeightPane extends VanChartImageM
@Override @Override
protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) { protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) {
JPanel panel = new JPanel(new BorderLayout()); return row(
panel.add(imageBackgroundPane, BorderLayout.CENTER); flex(1.2), column(10,
return panel; cell(imageBackgroundPane)
).weight(3)
).getComponent();
} }
} }

13
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -1,13 +1,12 @@
package com.fr.van.chart.line; package com.fr.van.chart.line;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.Marker;
import com.fr.design.foldablepane.UIExpandablePane;
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.plugin.chart.marker.type.MarkerType; import com.fr.plugin.chart.marker.type.MarkerType;
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.VanChartMarkerPane; import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
@ -27,10 +26,6 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
} }
protected JPanel getContentInPlotType() { protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createLineTypePane()}, new Component[]{createLineTypePane()},
@ -41,7 +36,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
new Component[]{createTrendLinePane()}, new Component[]{createTrendLinePane()},
}; };
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1});
return contentPane; return contentPane;
} }
@ -62,6 +57,6 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
} }
}; };
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true);
} }
} }

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java

@ -1,11 +1,10 @@
package com.fr.van.chart.map.designer.data.component.report; package com.fr.van.chart.map.designer.data.component.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
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.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
@ -27,12 +26,8 @@ public class AreaPane extends AbstractReportDataContentPane {
protected JPanel createContentPane() { protected JPanel createContentPane() {
areaName = new DefaultTinyFormulaPane(); areaName = new DefaultTinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p};
Component[][] components = getComponent(); Component[][] components = getComponent();
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
} }
protected Component[][] getComponent() { protected Component[][] getComponent() {

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java

@ -1,11 +1,10 @@
package com.fr.van.chart.map.designer.data.component.report; package com.fr.van.chart.map.designer.data.component.report;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
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.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -30,12 +29,8 @@ public class LongLatAreaPane extends AreaPane {
areaName = new DefaultTinyFormulaPane(); areaName = new DefaultTinyFormulaPane();
longitude = new DefaultTinyFormulaPane(); longitude = new DefaultTinyFormulaPane();
latitude = new DefaultTinyFormulaPane(); latitude = new DefaultTinyFormulaPane();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p, p, p};
Component[][] components = getComponent(); Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3});
} }
protected Component[][] getComponent() { protected Component[][] getComponent() {

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java

@ -1,10 +1,9 @@
package com.fr.van.chart.map.designer.data.component.table; package com.fr.van.chart.map.designer.data.component.table;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
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.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
@ -42,12 +41,8 @@ public class AreaPane extends AbstractTableDataContentPane {
protected JPanel createAreaNamePane() { protected JPanel createAreaNamePane() {
initAreaNameCom(); initAreaNameCom();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p};
Component[][] components = getComponent(); Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3});
} }
protected Component[][] getComponent() { protected Component[][] getComponent() {

4
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java

@ -1,5 +1,6 @@
package com.fr.van.chart.map.designer.data.component.table; package com.fr.van.chart.map.designer.data.component.table;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
@ -15,7 +16,6 @@ import java.util.List;
* Created by hufan on 2016/12/21. * Created by hufan on 2016/12/21.
*/ */
public class LineMapAreaPane extends PointMapAreaPane { public class LineMapAreaPane extends PointMapAreaPane {
private static final int V_GAP = 10;
protected AreaPane endAreaPane; protected AreaPane endAreaPane;
public LineMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { public LineMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
@ -26,7 +26,7 @@ public class LineMapAreaPane extends PointMapAreaPane {
initAreaPane(parentPane); initAreaPane(parentPane);
initEndAreaPane(parentPane); initEndAreaPane(parentPane);
JPanel content = new JPanel(new BorderLayout(0, V_GAP)); JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
content.add(areaPane, BorderLayout.NORTH); content.add(areaPane, BorderLayout.NORTH);
content.add(endAreaPane, BorderLayout.CENTER); content.add(endAreaPane, BorderLayout.CENTER);
return content; return content;

9
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java

@ -1,9 +1,8 @@
package com.fr.van.chart.map.designer.data.component.table; package com.fr.van.chart.map.designer.data.component.table;
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.BoldFontTextLabel; import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane;
@ -30,13 +29,9 @@ public class LongLatAreaPane extends AreaPane {
initLongitudeCom(); initLongitudeCom();
initLatitudeCom(); initLatitudeCom();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f, COMPONENT_WIDTH};
double[] rowSize = {p, p, p};
Component[][] components = getComponent(); Component[][] components = getComponent();
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3});
} }
protected Component[][] getComponent() { protected Component[][] getComponent() {

18
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java

@ -10,12 +10,14 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.plugin.chart.map.data.VanMapReportDefinition; import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* Created by Mitisky on 16/5/16. * Created by Mitisky on 16/5/16.
*/ */
@ -26,7 +28,6 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte
initEveryPane(); initEveryPane();
initAreaName(); initAreaName();
JPanel panel = getContent(); JPanel panel = getContent();
panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
this.add(panel, "0,0,2,0"); this.add(panel, "0,0,2,0");
} }
@ -34,15 +35,12 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte
areaName = new DefaultTinyFormulaPane() { areaName = new DefaultTinyFormulaPane() {
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(4, 0)); this.setLayout(new BorderLayout());
UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")); UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name"));
label.setPreferredSize(new Dimension(75, 20)); this.add(row(cell(label).weight(1.2),
this.add(label, BorderLayout.WEST); cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5)
).getComponent());
formulaTextField.setPreferredSize(new Dimension(100, 20));
this.add(formulaTextField, BorderLayout.CENTER);
this.add(formulaTextFieldButton, BorderLayout.EAST);
} }
}; };
} }

26
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java

@ -1,23 +1,21 @@
package com.fr.van.chart.map.designer.data.contentpane.report; package com.fr.van.chart.map.designer.data.contentpane.report;
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.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.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.data.VanMapReportDefinition; import com.fr.plugin.chart.map.data.VanMapReportDefinition;
import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.report.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.report.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.report.PointMapLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.report.PointMapLongLatAreaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
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.CardLayout; import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
/** /**
@ -33,8 +31,7 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa
@Override @Override
protected JPanel getContent() { protected JPanel getContent() {
longLatReportFormulaPane = new LongLatReportFormulaPane(); longLatReportFormulaPane = new LongLatReportFormulaPane();
JPanel content = new JPanel(new BorderLayout(0, 4)); JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10)));
content.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0));
content.add(longLatReportFormulaPane, BorderLayout.CENTER); content.add(longLatReportFormulaPane, BorderLayout.CENTER);
return content; return content;
} }
@ -55,9 +52,6 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa
public class LongLatReportFormulaPane extends BasicBeanPane<VanMapReportDefinition> { public class LongLatReportFormulaPane extends BasicBeanPane<VanMapReportDefinition> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
private UIButtonGroup<Integer> locationType; private UIButtonGroup<Integer> locationType;
private JPanel centerPane; private JPanel centerPane;
@ -65,7 +59,7 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa
private AbstractLongLatAreaPane longLatAreaPane; private AbstractLongLatAreaPane longLatAreaPane;
public LongLatReportFormulaPane() { public LongLatReportFormulaPane() {
this.setLayout(new BorderLayout(0, 5)); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
centerPane = new JPanel(new CardLayout()) { centerPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
@ -94,15 +88,9 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa
locationType.setSelectedIndex(0); locationType.setSelectedIndex(0);
double[] columnSize = {p, f}; JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
double[] rowSize = {p}; new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")), locationType
);
Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")), locationType},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);

24
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java

@ -1,25 +1,22 @@
package com.fr.van.chart.map.designer.data.contentpane.table; package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
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.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel; 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.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.data.MapMatchResult;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
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.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -32,14 +29,12 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa
protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane;
public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
initAreaNameCom(); initAreaNameCom();
JPanel areaNamePane = createAreaNamePane(); JPanel areaNamePane = createAreaNamePane();
JSeparator jSeparator = new JSeparator(); JSeparator jSeparator = new JSeparator();
areaNamePane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15));
jSeparator.setPreferredSize(new Dimension(246, 2));
this.add(areaNamePane, BorderLayout.NORTH); this.add(areaNamePane, BorderLayout.NORTH);
this.add(jSeparator, BorderLayout.CENTER); this.add(jSeparator, BorderLayout.CENTER);
@ -63,19 +58,8 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa
protected JPanel createAreaNamePane() { protected JPanel createAreaNamePane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")); UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name"));
label.setPreferredSize(new Dimension(80, 20));
areaNameCom.setPreferredSize(new Dimension(100, 20));
double p = TableLayout.PREFERRED; return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, createAreaPanel(areaNameCom));
double f = TableLayout.FILL;
double[] columnSize = {p, f};
double[] rowSize = {p};
Component[][] components = new Component[][]{
new Component[]{label, createAreaPanel(areaNameCom)},
};
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
} }

18
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java

@ -1,6 +1,6 @@
package com.fr.van.chart.map.designer.data.contentpane.table; package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chartx.TwoTuple; import com.fr.chartx.TwoTuple;
import com.fr.design.chartx.component.MapAreaMatchPane; import com.fr.design.chartx.component.MapAreaMatchPane;
@ -17,13 +17,15 @@ import javax.swing.JFrame;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.util.Set; import java.util.Set;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.awt.event.WindowListener; import java.awt.event.WindowListener;
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;
/** /**
* @author Bjorn * @author Bjorn
* @version 10.0 * @version 10.0
@ -55,13 +57,11 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten
} }
public JPanel createAreaPanel(UIComboBox areaBox) { public JPanel createAreaPanel(UIComboBox areaBox) {
JPanel areaPanel = new JPanel(new BorderLayout(4, 0)); UIButton uiButton = new UIButton(new LazyIcon("tool_config"));
areaBox.setPreferredSize(new Dimension(70, 20));
areaPanel.add(areaBox, BorderLayout.CENTER);
UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
uiButton.addActionListener(createActionListener(areaBox)); uiButton.addActionListener(createActionListener(areaBox));
areaPanel.add(uiButton, BorderLayout.EAST); return row(
return areaPanel; cell(areaBox).weight(2.4), flex(0.1), cell(uiButton).weight(0.5)
).getComponent();
} }
private ActionListener createActionListener(final UIComboBox areaBox){ private ActionListener createActionListener(final UIComboBox areaBox){

27
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java

@ -1,12 +1,12 @@
package com.fr.van.chart.map.designer.data.contentpane.table; package com.fr.van.chart.map.designer.data.contentpane.table;
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.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.BoldFontTextLabel; 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.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
@ -15,7 +15,6 @@ import com.fr.van.chart.map.designer.data.component.table.AreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane;
import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
@ -29,8 +28,6 @@ import java.awt.Dimension;
* Created by Mitisky on 16/5/17. * Created by Mitisky on 16/5/17.
*/ */
public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableDataContentPane { public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableDataContentPane {
private static final int LEFT_GAP = 19;
private static final int V_GAP = 15;
//改控件相当于面积图的区域名控件 //改控件相当于面积图的区域名控件
private LongLatAreaTableComboPane longLatTableComboPane; private LongLatAreaTableComboPane longLatTableComboPane;
@ -43,10 +40,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData
} }
protected JPanel createAreaNamePane() { protected JPanel createAreaNamePane() {
JPanel panel = new JPanel(new BorderLayout()); return FineLayoutBuilder.asBorderLayoutWrapped(longLatTableComboPane);
panel.setBorder(BorderFactory.createEmptyBorder(0, LEFT_GAP, V_GAP, 0));
panel.add(longLatTableComboPane, BorderLayout.CENTER);
return panel;
} }
@Override @Override
@ -91,11 +85,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData
public LongLatAreaTableComboPane() { public LongLatAreaTableComboPane() {
double p = TableLayout.PREFERRED; this.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
double f = TableLayout.FILL;
double labelWidth = 65;
this.setLayout(new BorderLayout(0, 5));
centerPane = new JPanel(new CardLayout()) { centerPane = new JPanel(new CardLayout()) {
@Override @Override
public Dimension getPreferredSize() { public Dimension getPreferredSize() {
@ -124,15 +114,10 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData
centerPane.add(longLatAreaPane, "longLat"); centerPane.add(longLatAreaPane, "longLat");
locationType.setSelectedIndex(0); locationType.setSelectedIndex(0);
double[] columnSize = {labelWidth, f};
double[] rowSize = {p};
UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Geographic")); UILabel label = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Geographic"));
Component[][] components = new Component[][]{
new Component[]{label, locationType},
};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 5, 6); JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3},
label, locationType);
this.add(panel, BorderLayout.NORTH); this.add(panel, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);

35
designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java

@ -1,5 +1,7 @@
package com.fr.van.chart.multilayer.data; package com.fr.van.chart.multilayer.data;
import com.fine.theme.utils.FineLayoutBuilder;
import com.fine.theme.utils.FineUIScale;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.TopDefinition; import com.fr.chart.chartdata.TopDefinition;
@ -11,7 +13,6 @@ 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.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.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
@ -21,9 +22,7 @@ import com.fr.plugin.chart.multilayer.data.MultiPieValueDefinition;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.AssistUtils; import com.fr.stable.AssistUtils;
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.JSeparator; import javax.swing.JSeparator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -38,9 +37,6 @@ import java.util.List;
* Created by Fangjie on 2016/6/15. * Created by Fangjie on 2016/6/15.
*/ */
public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver { public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPane implements UIObserver {
private static final int HT = 20;
private static final int WD = 100;
private static final int LABEL_WIDTH = 72;
private UISpinner levelNumEdit; private UISpinner levelNumEdit;
private UITextField nameField; private UITextField nameField;
@ -74,7 +70,6 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
levelNameList = new ArrayList<UIComboBox>(); levelNameList = new ArrayList<UIComboBox>();
for (int i = 0; i < levelNum; i++){ for (int i = 0; i < levelNum; i++){
levelNameList.add(new UIComboBox()); levelNameList.add(new UIComboBox());
levelNameList.get(i).setPreferredSize(new Dimension(WD, HT));
levelNameList.get(i).addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); levelNameList.get(i).addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None"));
} }
} }
@ -86,47 +81,32 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
contentPane = new JPanel(); contentPane = new JPanel();
contentPane.setLayout(new BorderLayout(0, 4)); contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10)));
contentPane.add(north, BorderLayout.NORTH); contentPane.add(north, BorderLayout.NORTH);
contentPane.add(center, BorderLayout.CENTER); contentPane.add(center, BorderLayout.CENTER);
} }
private JPanel createCenterPane() { private JPanel createCenterPane() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize_center = {LABEL_WIDTH, COMPONENT_WIDTH};
double[] rowSize_center = new double[levelNum + 3];
initLevelNameList(); initLevelNameList();
for (int i = 0; i < levelNum + 3; i++){
rowSize_center[i] = p;
}
Component[][] components_center = new Component[levelNum + 3][]; Component[][] components_center = new Component[levelNum + 3][];
for (int i = 0; i < levelNum; i++){ for (int i = 0; i < levelNum; i++){
components_center[i] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level") + String.valueOf(i+1)), levelNameList.get(i)}; components_center[i] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level") + String.valueOf(i+1)), levelNameList.get(i)};
} }
value = new UIComboBox(); value = new UIComboBox();
value.setPreferredSize(new Dimension(WD, HT));
calculateCombox = new CalculateComboBox(); calculateCombox = new CalculateComboBox();
calculateCombox.reset(); calculateCombox.reset();
calculateCombox.setPreferredSize(new Dimension(WD, HT));
components_center[levelNum] = new Component[]{getJSeparator(), null}; components_center[levelNum] = new Component[]{getJSeparator(), null};
components_center[levelNum+1] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), value}; components_center[levelNum+1] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), value};
components_center[levelNum+2] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox}; components_center[levelNum+2] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox};
initCenterItemListener(); initCenterItemListener();
registerListener4Center(); registerListener4Center();
return FineLayoutBuilder.compatibleTableLayout(10, components_center, new double[]{1.2, 3});
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center);
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
return panel;
} }
@ -158,9 +138,6 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
} }
private JPanel createNorthPane() { private JPanel createNorthPane() {
double p = TableLayout.PREFERRED;
double[] columnSize_north = {LABEL_WIDTH, COMPONENT_WIDTH};
double[] rowSize_north = {p, p, p};
levelNumEdit = new UISpinner(1, 15, 1, levelNum){ levelNumEdit = new UISpinner(1, 15, 1, levelNum){
@Override @Override
@ -189,9 +166,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit},
}; };
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north); return FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3});
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
return panel;
} }
private void refreshCenterPane(){ private void refreshCenterPane(){

2
designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java

@ -140,7 +140,7 @@ public class RichTextToolBar extends BasicPane {
private void addToToolBar() { private void addToToolBar() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(row(10, this.add(row(10,
cell(fontNameComboBox).weight(0.3),cell(fontSizeComboBox).weight(0.1), cell(toolbar).weight(0.6) cell(fontNameComboBox).weight(0.3),cell(fontSizeComboBox).weight(0.15), cell(toolbar).weight(0.6)
).getComponent()); ).getComponent());
} }

Loading…
Cancel
Save