diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java index 4cf5637d94..47359028b5 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineUIStyle.java @@ -32,6 +32,7 @@ public interface FineUIStyle { String PLAIN_BUTTON = "plainButton"; String TOGGLE_GROUP = "inToggleGroup"; String COMPACT_BUTTON = "compactButton"; + String ROUND_BORDER_PANEL = "roundBorder"; String MENU_TOOL_BAR = "menuToolBar"; String MENU_ITEM_TOOL_BAR = "menuItemToolBar"; diff --git a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java index 5260ce1752..edd531cae9 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/ColumnSelectedEditor.java +++ b/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.wrapper.TableDataWrapper; import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.data.TableDataColumn; import com.fr.stable.StringUtils; @@ -17,6 +16,9 @@ import java.awt.event.ItemListener; import java.util.List; 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 implements Prep public ColumnSelectedEditor() { 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()); columnNames = new String[0]; tableDataComboBox.addItemListener(new ItemListener() { @@ -52,10 +54,7 @@ public class ColumnSelectedEditor extends Editor implements Prep } }); columnNameComboBox = new UIComboBox(); - tableDataComboBox.setPreferredSize(new Dimension(82, 20)); - this.add(tableDataComboBox); - columnNameComboBox.setPreferredSize(new Dimension(82, 20)); - this.add(columnNameComboBox); + this.add(row(10, cell(tableDataComboBox), cell(columnNameComboBox)).getComponent()); } @Override diff --git a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java index 6cfb221ca1..24c87a8c5d 100644 --- a/designer-base/src/main/java/com/fr/design/formula/FormulaPane.java +++ b/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.utils.FineUIScale; 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.fr.base.BaseFormula; import com.fr.base.BaseUtils; @@ -320,7 +322,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { // text initFormulaTextArea(); UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); - formulaTextAreaScrollPane.setBorder(new FineRoundBorder()); + formulaTextAreaScrollPane.setBorder(new FlatRoundBorder()); // buttonPane JPanel buttonPane = row(8).getComponent(); @@ -1192,7 +1194,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { private JPanel initFunctionNameList() { functionNameList = new JList(new DefaultListModel()); UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); - functionNameScrollPane.setBorder(new FineRoundBorder()); + functionNameScrollPane.setBorder(new FlatButtonBorder()); functionNameList.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); initFunctionNameListCellRenderer(); initFunctionNameListSelectionListener(); @@ -1273,7 +1275,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula { // variable variablesTree = new JTree(); UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); - variablesTreePane.setBorder(new FineRoundBorder()); + variablesTreePane.setBorder(new FlatRoundBorder()); variablesTree.setBackground(FlatUIUtils.getUIColor("background.normal", Color.WHITE)); variablesTree.setRootVisible(false); variablesTree.setShowsRootHandles(true); diff --git a/designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java b/designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java index e4e81f7eb7..087a24fc48 100644 --- a/designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java +++ b/designer-base/src/main/java/com/fr/design/formula/TinyFormulaPane.java @@ -1,7 +1,6 @@ package com.fr.design.formula; import com.fine.theme.icon.LazyIcon; -import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.BaseFormula; import com.fr.design.beans.BasicBeanPane; 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.mainframe.DesignerContext; -import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; + /** * * @author zhou @@ -70,15 +72,10 @@ public class TinyFormulaPane extends BasicBeanPane implements UIObserver } 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.add(pane,BorderLayout.NORTH) ; + this.add(row( + cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5) + ).getComponent()) ; } /** diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java index 594a21ac5c..591b80a4db 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/JControlPane.java @@ -1,6 +1,7 @@ package com.fr.design.gui.controlpane; import com.formdev.flatlaf.ui.FlatUIUtils; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.border.FineBorderFactory; import com.fr.design.dialog.BasicPane; 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.Nameable; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSplitPane; import java.awt.BorderLayout; @@ -148,7 +150,10 @@ abstract class JControlPane extends BasicPane implements UnrepeatedNameHelper, S toolbarDef.addShortCut(sj.getShortCut()); } 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); toolbarDef.updateToolBar(toolBar); } diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index a9c03a6eeb..8f39d041dd 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -1,6 +1,6 @@ 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.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilist.JNameEdList; @@ -76,7 +76,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon nameableList.setName(LIST_NAME); UIScrollPane scrollPane = new UIScrollPane(nameableList); leftPane.add(scrollPane, BorderLayout.CENTER); - leftPane.setBorder(new FineRoundBorder()); + leftPane.setBorder(new FlatRoundBorder()); nameableList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); nameableList.addMouseListener(getHelper().getListMouseListener(nameableList, this)); diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java index 9fd7620c7f..08cd1f5eb2 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/FineTabbedPane.java @@ -167,4 +167,24 @@ public class FineTabbedPane extends Column { public Component getSelectedComponent() { 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(); + } + } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java index 8274b65355..a60bb7f18e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.check; +import com.fine.theme.utils.FineUIStyle; import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.gui.ibutton.UIButton; 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")); + FineUIStyle.setStyle(okButton, FineUIStyle.STYLE_PRIMARY); okButton.addActionListener(this); bottomPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); bottomPanel.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java index cdbd6d10f2..f2101b944a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridControlPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.theme; +import com.fine.theme.icon.LazyIcon; import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormThemeConfig; 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.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; -import com.fr.design.icon.IconPathConstants; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.theme.dialog.TemplateThemeProfileDialog; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ToolBarDef; -import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.third.javax.annotation.Nullable; import com.fr.transaction.CallBackAdaptor; -import javax.swing.BorderFactory; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JSeparator; @@ -35,8 +33,6 @@ import java.awt.BasicStroke; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.RenderingHints; @@ -99,8 +95,6 @@ public class TemplateThemeGridControlPane extends Basic private void initializePane() { setLayout(FRGUIPaneFactory.createBorderLayout()); - setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 10)); - setPreferredSize(new Dimension(CONTENT_WIDTH, CONTENT_HEIGHT)); add(createActionsContainer(), BorderLayout.NORTH); @@ -177,10 +171,8 @@ public class TemplateThemeGridControlPane extends Basic private JPanel createActionsContainer() { JPanel content = FRGUIPaneFactory.createBorderLayout_S_Pane(); - content.setPreferredSize(new Dimension(content.getPreferredSize().width, 20)); UIToolbar toolBar = ToolBarDef.createJToolBar(); - toolBar.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); content.add(toolBar, BorderLayout.CENTER); MenuDef addMenuDef = createAddMenuDef(); @@ -210,17 +202,14 @@ public class TemplateThemeGridControlPane extends Basic content.add(setTheme4NewTemplateButton, BorderLayout.EAST); JPanel container = FRGUIPaneFactory.createBorderLayout_S_Pane(); - container.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0)); container.add(content, BorderLayout.CENTER); - container.setPreferredSize(new Dimension(container.getPreferredSize().width, 30)); - return container; } private MenuDef createAddMenuDef() { 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.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())); @@ -239,7 +228,7 @@ public class TemplateThemeGridControlPane extends Basic setEnabled(initialEnabled); setName(Toolkit.i18nText("Fine-Design_Basic_Remove")); setMnemonic('R'); - setSmallIcon(IOUtils.readIcon(IconPathConstants.TD_REMOVE_ICON_PATH)); + setSmallIcon(new LazyIcon("remove")); } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java index 36e962c6af..704f9c1a35 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeGridPagesPane.java +++ b/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.ChangeListener; 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.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; @@ -276,27 +276,27 @@ public class TemplateThemeGridPagesPane extends JPanel { } public static class TemplateThemeManagingPane extends TemplateThemeGridPagePane { - private final UITabbedPane tabbedPane; + private final FineTabbedPane tabbedPane; public TemplateThemeManagingPane(@Nullable Window window) { setLayout(FRGUIPaneFactory.createBorderLayout()); - tabbedPane = new UITabbedPane(); - tabbedPane.setTabBorderColor(new Color(0xE0E0E1)); - add(tabbedPane, BorderLayout.CENTER); - TemplateThemeGridControlPane formThemesManagerPane = TemplateThemeGridControlPane.createFormThemesManagerPane(window); TemplateThemeGridControlPane reportThemesManagerPane = TemplateThemeGridControlPane.createReportThemesManagerPane(window); - tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Form_Tab"), formThemesManagerPane); - tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Manager_Dialog_Report_Tab"), reportThemesManagerPane); - + tabbedPane = FineTabbedPane.builder() + .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); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); TemplateThemeConfig config = template.getUsingTemplateThemeConfig(); if (config == reportThemesManagerPane.getConfig()) { tabbedPane.setSelectedIndex(1); } + + add(tabbedPane, BorderLayout.CENTER); + } @Override diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java index 91ab9a57b1..9865321987 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/cell/CellStyleEditPane.java +++ b/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 java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.GridLayout; import java.util.ArrayList; import java.util.List; @@ -42,7 +41,6 @@ public class CellStyleEditPane extends MultiTabPane { public CellStyleEditPane() { super(); - tabPane.setLayout(new GridLayout(1, 3, 0, 0)); } diff --git a/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index.svg b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index.svg new file mode 100644 index 0000000000..2df8e391ac --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index_disable.svg new file mode 100644 index 0000000000..dd0e39f792 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_index_disable.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name.svg b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name.svg new file mode 100644 index 0000000000..22a4ad36ab --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name_disable.svg b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name_disable.svg new file mode 100644 index 0000000000..0abdef6e3c --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/editor/ds_column_name_disable.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json index 4e3213695b..d8ac2732b5 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json @@ -275,6 +275,8 @@ "tab": "widget/tab.svg", "text_area": "widget/text_area.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" } } diff --git a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties index d20add6df5..814b64db95 100644 --- a/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties +++ b/designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties @@ -1257,6 +1257,9 @@ CellOtherSetPane.height=$Component.defaultHeight [style]Panel.lightGrey=\ background: $Center.OuterShadowColor +[style]Panel.roundBorder=\ + arc: 5 + [style]Panel.menuBar=\ background: $MenuBar.background diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java index 183f14b768..6af8a112e5 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartDialog.java @@ -1,5 +1,6 @@ package com.fr.design.chart; +import com.fine.theme.utils.FineUIStyle; import com.fr.base.chart.BaseChartCollection; import com.fr.chart.chartattr.ChartCollection; 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")); cancel = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); + FineUIStyle.setStyle(ok, FineUIStyle.STYLE_PRIMARY); + this.applyClosingAction(); this.applyEscapeAction(); this.setBasicDialogSize(BasicDialog.DEFAULT); diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java index c34fcce653..b6879dc102 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartTypePane.java +++ b/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 */ +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.chart.chartattr.ChartCollection; 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.base.mode.DesignModeContext; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.info.ChartInfoCollector; import com.fr.design.utils.gui.GUICoreUtils; @@ -17,7 +22,6 @@ import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.van.chart.config.DefaultStyleHelper4Van; -import javax.swing.BorderFactory; import javax.swing.DefaultListCellRenderer; import javax.swing.DefaultListModel; import javax.swing.JList; @@ -73,9 +77,11 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven mainTypeList.setSelectedIndex(0); JSplitPane spane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, typeScrollPane, subListPane); - spane.setDividerLocation(120); - spane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_M_Popup_Chart_Type"))); - this.add(spane); + spane.setDividerLocation(150); + + 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); } @@ -92,11 +98,9 @@ public class ChartTypePane extends ChartCommonWizardPane implements CallbackEven ChartIcon chartIcon = (ChartIcon) value; if (isSelected) { // 深蓝色. - this.setBackground(new Color(57, 107, 181)); - this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon), Color.WHITE)); - } else { - this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon))); + this.setBackground(FlatUIUtils.getUIColor("Tree.selectionBackground", new Color(57, 107, 181))); } + this.setBorder(GUICoreUtils.createTitledBorder(getChartName(chartIcon))); } return this; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java index 9edb02d9f7..9224674924 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/MeterPlotTableDataContentPane.java +++ b/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; +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.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.MeterPlot; import com.fr.chart.chartdata.MeterTableDefinition; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; 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.mainframe.chart.gui.ChartDataPane; 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.UIComboBoxWithNone; import com.fr.general.GeneralUtils; import com.fr.stable.StringUtils; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; -import javax.swing.BoxLayout; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; 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 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 valueBox; private UIComboBox targetBox; private TinyFormulaPane custom; private ChartDataFilterPane filterPane; - private JPanel boxPane; + private Column boxPane; public MeterPlotTableDataContentPane(ChartDataPane parent) { - this.setLayout(new BorderLayout()); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); nameBox = new UIComboBoxWithNone(); nameBox.setSelectedIndex(nameBox.getItemCount() -1); @@ -63,8 +57,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane custom = new DefaultTinyFormulaPane(); filterPane = new ChartDataFilterPane(new MeterPlot(), parent); - boxPane = new JPanel(); - boxPane.setLayout(new BoxLayout(boxPane, BoxLayout.Y_AXIS)); + boxPane = new Column(); + boxPane.setSpacing(10); JPanel namePane = createPaneWithLabel(Toolkit.i18nText(METER_NAME), getNameComponent()); 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); - - filterPane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15)); - boxPane.setBorder(BorderFactory.createEmptyBorder(7, 24, 7, 15)); - jPanel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 5)); + JPanel jPanel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), filterPane, true); this.add(getJSeparator(), BorderLayout.NORTH); this.add(boxPane, BorderLayout.CENTER); @@ -108,12 +98,8 @@ public class MeterPlotTableDataContentPane extends AbstractTableDataContentPane } private JPanel createPaneWithLabel(String labelName, Component component) { - component.setPreferredSize(new Dimension(COMBOBOX_WIDTH, COMBOBOX_HEIGHT)); UILabel label = new BoldFontTextLabel(labelName); - label.setPreferredSize(new Dimension(LABEL_WIDTH, COMBOBOX_HEIGHT)); - JPanel paneWithLabel = GUICoreUtils.createBorderLayoutPane(new Component[]{component, null, null, label, null}); - paneWithLabel.setBorder(BorderFactory.createEmptyBorder(3, 0, 3, 0)); - return paneWithLabel; + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, component); } protected void refreshBoxListWithSelectTableData(List list) { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java index cf8f55bb79..0ebc75d75e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; 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.style.ChartFillStylePane; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JSeparator; +import java.awt.BorderLayout; +import java.awt.Component; + /** * 属性表, 图表样式 - 系列 界面, 通过重载继承每个不同的方法, 得到内容的组合. * @author kunsnat E-mail:kunsnat@gmail.com @@ -37,10 +40,6 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane{ } 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]; JPanel panel; @@ -51,7 +50,7 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane{ components[1] = new Component[]{new JSeparator()}; } - panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); JScrollPane scrollPane = new JScrollPane(); scrollPane.setViewportView(panel); @@ -68,7 +67,7 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane{ components[2] = new Component[]{contentPane}; } - panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + panel = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); } return panel; diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java index e8ef8714da..e150466ecc 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/type/ChartImagePane.java +++ b/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.image.BufferedImage; +import static com.fine.theme.utils.FineUIScale.scale; + public class ChartImagePane extends ChartSelectDemoPane { 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 Color ENTER_COLOR = new Color(216, 242, 253); 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.setBackground(UIConstants.TOOLBARUI_BACKGROUND); - this.setPreferredSize(new Dimension(IMAGE_WIDTH, IMAGE_HIGTH)); + this.setPreferredSize(getScaledDimension()); } public ChartImagePane(String fullIconPath, String tipName, boolean isDrawRightLine){ @@ -45,7 +47,7 @@ public class ChartImagePane extends ChartSelectDemoPane { super.paint(g); 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.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)); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java index a006ce54f3..751175b09f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/area/VanChartAreaSeriesPane.java @@ -1,13 +1,12 @@ package com.fr.van.chart.area; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.foldablepane.UIExpandablePane; 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.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.VanChartLineTypePane; import com.fr.van.chart.designer.component.VanChartLineTypePaneWithoutDashed; @@ -27,11 +26,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { 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[][]{ new Component[]{createLineTypePane()}, new Component[]{createMarkerPane()}, @@ -42,7 +36,7 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { new Component[]{createTrendLinePane()}, }; - contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); + contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); return contentPane; } @@ -61,6 +55,6 @@ public class VanChartAreaSeriesPane extends VanChartLineSeriesPane { protected JPanel createMarkerPane() { markerPane = new VanChartMarkerPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane, true); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/MeterCustomPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/MeterCustomPlotTableDataContentPane.java index 6b00e9eb20..c23598e952 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/MeterCustomPlotTableDataContentPane.java +++ b/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 java.awt.Component; -import java.awt.Dimension; /** * Created by Fangjie on 2016/5/18. */ public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataContentPane { - private static final int TEXT_HT = 20; - private static final int TEXT_WD = 80; private UITextField nameField; public MeterCustomPlotTableDataContentPane(ChartDataPane parent) { super(parent); @@ -24,7 +21,6 @@ public class MeterCustomPlotTableDataContentPane extends MeterPlotTableDataConte @Override protected Component getNameComponent() { nameField = new UITextField(); - nameField.setPreferredSize(new Dimension(TEXT_WD, TEXT_HT)); return nameField; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java index 5b17494da9..77b581bdd7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.custom.component; +import com.fine.theme.utils.FineUIScale; import com.fr.base.BaseFormula; import com.fr.chart.chartattr.Plot; import com.fr.chart.web.ChartHyperPoplink; @@ -43,6 +44,7 @@ import com.fr.stable.Nameable; import com.fr.stable.bridge.StableFactory; import com.fr.van.chart.designer.component.VanChartUIListControlPane; +import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.lang.reflect.Constructor; @@ -59,6 +61,7 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane { public VanChartHyperLinkPane() { super(); + setPreferredSize(FineUIScale.scale(new Dimension(224, 420))); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java index b6119aa642..20aada59a8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java @@ -1,27 +1,28 @@ 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.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.utils.gui.UIComponentUtils; -import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; -import java.util.Arrays; import java.awt.BorderLayout; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.row; + /** * line相关设置 */ @@ -51,22 +52,14 @@ public class VanChartLineTypePane extends BasicPane { Toolkit.i18nText("Fine-Design_Chart_Open"), 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}, nullValueBreakComponent = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")), nullValueBreak}; Component[][] components = createContentComponent(lineStyleComponent, nullValueBreakComponent); - double[] row = new double[components.length]; - Arrays.fill(row, p); - double[] col = {f, e}; - - lineStylePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + lineStylePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.add(typeAndWidthPane, BorderLayout.NORTH); this.add(lineStylePane, BorderLayout.CENTER); } @@ -84,29 +77,16 @@ public class VanChartLineTypePane extends BasicPane { checkLineStyle(); } }); - - Component[][] lineTypeComps = new Component[][]{ - new Component[]{null, null}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineTypeComboBox} - }; - Component[][] lineWidthComps = new Component[][]{ - new Component[]{ - FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), - UIComponentUtils.wrapWithBorderLayoutPane(lineWidthSpinner)} - }; - - 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; + lineWidthPane = row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width"))).weight(1.2), cell(lineWidthSpinner).weight(3) + ).getComponent(); + + return column(10, + row( + cell(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style"))).weight(1.2), + cell(lineTypeComboBox).weight(3) + ), + cell(lineWidthPane)).getComponent(); } protected LineTypeComboBox createLineType() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java index 1f8b55cfbf..d087c7f026 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java @@ -1,6 +1,9 @@ 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.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -30,7 +33,7 @@ public class VanChartMarkerPane extends BasicPane { private BasicBeanPane imageMarkerPane; 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")}; commonORCustom = new UIButtonGroup(array, array); @@ -88,7 +91,9 @@ public class VanChartMarkerPane extends BasicPane { } 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); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java index dbcdb0e21c..5574d26474 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.base.AttrColor; import com.fr.chart.base.AttrLineStyle; import com.fr.chart.base.LineStyleInfo; @@ -96,8 +97,8 @@ public class VanChartTrendLinePane extends BasicPane{ new Component[]{label, periodPane} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, new double[]{p,p,p}, col); - trendLineHidePane = TableLayout4VanChartHelper.createGapTableLayoutPane(componentsMayHide, new double[]{p,p,p,p}, col); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2 ,3}); + trendLineHidePane = FineLayoutBuilder.compatibleTableLayout(10, componentsMayHide, new double[]{1.2 ,3}); trendLineStyle.addActionListener(new ActionListener() { @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java index a3902abdc2..3e271fc48c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartUIListControlPane.java @@ -1,13 +1,10 @@ package com.fr.van.chart.designer.component; -import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.controlpane.UIListControlPane; 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.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; @@ -21,7 +18,6 @@ import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.Component; import java.awt.FlowLayout; import java.awt.Point; import java.awt.Window; @@ -98,13 +94,6 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem 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 public void saveSettings() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java index 0afa4492a9..59760e86dd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java +++ b/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.xcombox.MarkerComboBox; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -81,8 +80,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane }; radius = new UISpinnerWithPx(0, 100, 0.5, 0); - double p = TableLayout.PREFERRED; - markerTypePane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerTypeComponent(), new double[]{1.2, 3}); markerConfigPane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerConfigComponent(), new double[]{1.2, 3}); @@ -92,13 +89,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane checkMarkType(); } }); - - JPanel contentPane = new JPanel(new BorderLayout(0, 6)); - - contentPane.add(markerTypePane, BorderLayout.CENTER); - contentPane.add(markerConfigPane, BorderLayout.SOUTH); - - this.add(contentPane); + this.setLayout(new BorderLayout()); + this.add(FineLayoutBuilder.createVerticalLayout(10, markerTypePane, markerConfigPane)); } protected Component[][] getMarkerTypeComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java index 3d6c85f4ec..45cb7187b2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartImageMarkerPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.background.ImageFileBackground; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.chart.UISpinnerWithPx; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; 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.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; 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. */ @@ -30,25 +33,18 @@ public class VanChartImageMarkerPane extends BasicBeanPane { public VanChartImageMarkerPane() { imageBackgroundPane = new ImageBackgroundQuickPane(false); - imageBackgroundPane.setPreferredSize(getImageBackgroundPreferredSize(imageBackgroundPane.getPreferredSize())); width = 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[][]{ 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}, }; - JPanel sizePanel = TableLayoutHelper.createTableLayoutPane(components, row, col); + JPanel sizePanel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); JPanel panel = createContentPane(imageBackgroundPane, sizePanel); - panel.setBorder(BorderFactory.createEmptyBorder(0, 72, 0, 0)); - + this.setLayout(new BorderLayout()); this.add(panel); } @@ -57,10 +53,11 @@ public class VanChartImageMarkerPane extends BasicBeanPane { } protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) { - JPanel panel = new JPanel(new BorderLayout(0, 4)); - panel.add(imageBackgroundPane, BorderLayout.CENTER); - panel.add(sizePanel, BorderLayout.SOUTH); - return panel; + return row( + flex(1.2), column(10, + cell(imageBackgroundPane), cell(sizePanel) + ).weight(3) + ).getComponent(); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java index 61c3f18173..f9c8e08023 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisScrollPaneWithTypeSelect.java +++ b/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; -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.chartattr.Axis; import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.PaneTitleConstants; 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.van.chart.config.DefaultStyleHelper4Van; import com.fr.van.chart.designer.AbstractVanChartScrollPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -58,10 +59,12 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll } protected void initLayout() { - this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); - JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Type"), jcb); + this.setLayout(new BorderLayout()); + 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(cardPane, BorderLayout.CENTER); + setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java index dde467226c..1dac1dbf9f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisStyleSettingPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.base.BaseFormula; import com.fr.chart.base.TextAttr; 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.itextfield.UITextField; 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.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.attr.axis.VanChartAxisLabelStyle; 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 javax.swing.JPanel; @@ -41,14 +41,10 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane(new String[]{Toolkit.i18nText("Fine-Design_Chart_Automatic"), Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapValue = new UITextField(); - labelGapPane = createLabelGapPane(row, column); + labelGapPane = createLabelGapPane(); 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(labelTextAttrPane, BorderLayout.CENTER); contentPane.add(labelGapPane, BorderLayout.SOUTH); @@ -146,7 +142,7 @@ public class VanChartAxisStyleSettingPane extends BasicBeanPane { 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[][]{ new Component[]{createTitlePane(isXAxis), null}, new Component[]{createLabelPane(), null}, @@ -152,7 +149,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{createValueStylePane(), null}, }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); } protected JPanel createTitlePane(boolean isXAxis) { @@ -191,9 +188,9 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - JPanel jPanel = new JPanel(new BorderLayout()); - jPanel.add(showTitlePane, BorderLayout.NORTH); - jPanel.add(titlePane, BorderLayout.CENTER); + JPanel jPanel = column(10, + cell(showTitlePane), cell(titlePane) + ).getComponent(); return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel, true); } @@ -218,7 +215,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel); 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(labelContentPane, BorderLayout.CENTER); @@ -402,9 +399,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); 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[]{null, centerPane}, + new Component[]{centerPane, null}, }; JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); @@ -416,7 +412,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - 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() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java index 61371ee2f4..e4cdda9c9b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartValueAxisPane.java +++ b/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}, }; - return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3}); } protected boolean showLabelDisplay() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java index adaabb5dfd..c22cf2318a 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartAxisButtonPane.java +++ b/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; +import com.fine.swing.ui.layout.Column; import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; 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.van.chart.designer.style.axis.VanChartAxisPane; -import javax.swing.BoxLayout; import javax.swing.Icon; import javax.swing.JPanel; -import java.util.ArrayList; -import java.util.List; import java.awt.BorderLayout; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.Graphics; +import java.util.ArrayList; +import java.util.List; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -49,7 +49,7 @@ public class VanChartAxisButtonPane extends BasicBeanPane { private List indexList_X = new ArrayList(); private List indexList_Y = new ArrayList(); - private JPanel buttonPane; + private Column buttonPane; private VanChartAxisPane parent; @@ -63,7 +63,8 @@ public class VanChartAxisButtonPane extends BasicBeanPane { addButton.setVisible(false); this.add(eastPane, BorderLayout.EAST); - buttonPane = new JPanel(); + buttonPane = new Column(); + buttonPane.setSpacing(10); this.add(buttonPane, BorderLayout.CENTER); itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); @@ -88,28 +89,8 @@ public class VanChartAxisButtonPane extends BasicBeanPane { return; } buttonPane.removeAll(); - buttonPane.setLayout(new BoxLayout(buttonPane, BoxLayout.Y_AXIS)); - - 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)); - } - } + buttonPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList_X)); + buttonPane.add(FineLayoutBuilder.createCommonTableLayout(COL_COUNT, 10, 10, indexList_Y)); if (popupMenu != null) { popupMenu.setVisible(false); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java index 7817b75f58..8e4af07c60 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.base.TextAttr; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.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.type.FontAutoType; 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.axis.VanChartValueAxisPane; import com.fr.van.chart.designer.style.axis.component.VanChartMinMaxValuePane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -49,20 +48,16 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { if (gaugeStyle == null) { gaugeStyle = GaugeStyle.POINTER; } - double p = TableLayout.PREFERRED; - 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); + return FineLayoutBuilder.compatibleTableLayout(0, getPanelComponents(), new double[]{1}); } - private Component[][] getPanelComponents(double p, double f, double[] columnSize) { + private Component[][] getPanelComponents() { switch (gaugeStyle) { case THERMOMETER: return new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p}, columnSize), null}, + new Component[]{createLabelPane(), 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()}, }; case RING: @@ -75,21 +70,21 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { }; default: return new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p, p}, columnSize), null}, + new Component[]{createLabelPane(), null}, new Component[]{createValueDefinition(), null}, 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")}); labelTextAttrPane = getChartTextAttrPane(); labelContentPane = new JPanel(new BorderLayout()); labelContentPane.add(labelTextAttrPane); - labelContentPane.setBorder(BorderFactory.createEmptyBorder(0, 15, 0, 0)); - JPanel panel = new JPanel(new BorderLayout(0, 6)); - panel.add(TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel), BorderLayout.NORTH); + JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); + panel.add(FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Label")), showLabel), BorderLayout.NORTH); panel.add(labelContentPane, BorderLayout.CENTER); showLabel.addActionListener(new ActionListener() { @Override @@ -97,9 +92,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { checkLabelPane(); } }); - JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); - return jPanel; + return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, panel, true); } protected ChartTextAttrPane getChartTextAttrPane() { @@ -149,20 +142,18 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane { minMaxValuePane = new VanChartMinMaxValuePane(); 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); secTickColor = new ColorSelectBox(100); 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_Second_Graduation_Line")), secTickColor}, }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - JPanel jPanel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 15)); - return jPanel; + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_TickColor"), panel, true); } private boolean isMulti(GaugeStyle style) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java index d8c3217380..c6edc2eb5d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeCateOrPercentLabelDetailPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; +import com.fr.design.foldablepane.UIExpandablePane; 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.LabelContentPaneWithPercent; import com.fr.van.chart.designer.style.VanChartStylePane; @@ -64,6 +65,7 @@ public class VanChartGaugeCateOrPercentLabelDetailPane extends VanChartGaugeLabe } protected JPanel createTableLayoutPaneWithTitle(String title, Component component) { - return TableLayout4VanChartHelper.createTableLayoutPaneWithSmallTitle(title, component); + JPanel panel = FineLayoutBuilder.asBorderLayoutWrapped(component); + return new UIExpandablePane(title, panel, true); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java index 0f9e84729d..a5fd8ca284 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.Plot; 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.i18n.Toolkit; 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.ChartTextAttrPaneWithAuto; import com.fr.plugin.chart.base.AttrLabelDetail; @@ -63,7 +63,7 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane { initStyleListener(); - return TableLayoutHelper.createTableLayoutPane(getLabelStyleComponents(plot), row, col); + return FineLayoutBuilder.compatibleTableLayout(10, getLabelStyleComponents(plot),new double[]{1.2, 3}); } protected void initStyleListener() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java index ead3978acd..dfc234f61d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java +++ b/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.style.VanChartStylePane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; @@ -53,7 +52,6 @@ public class VanChartPlotLabelDetailPane extends BasicPane { private VanChartBorderWithShapePane borderPane; private VanChartBackgroundWithOutImagePane backgroundPane; - private JPanel tractionLinePane; private JPanel positionPane; private Integer[] oldPositionValues; @@ -245,12 +243,11 @@ public class VanChartPlotLabelDetailPane extends BasicPane { if (plot.isSupportLeadLine()) { tractionLine = new UIToggleButton(Toolkit.i18nText("Fine-Design_Chart_Show_Guideline")); - tractionLinePane = TableLayout4VanChartHelper.createGapTableLayoutPane("", tractionLine); - tractionLinePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); - panel.add(tractionLinePane, BorderLayout.SOUTH); + panel.add(tractionLine, BorderLayout.SOUTH); initPositionListener(); } 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")); @@ -369,7 +366,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } private void checkPositionEnabled() { - tractionLinePane.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE); + tractionLine.setVisible(position.getSelectedItem() != null && position.getSelectedItem() == Constants.OUTSIDE); } protected void checkPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 9a2da2285a..7098b685e9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/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.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } - return column(10, + return column(0, cell(getColorPane()), cell(getContentInPlotType()) ).getComponent(); } @@ -159,7 +159,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //线 protected JPanel createLineTypePane() { 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() { @@ -175,7 +175,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //填充颜色 protected JPanel createAreaFillColorPane() { 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() { 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() { stackAndAxisEditPane = new VanChartStackedAndAxisListControlPane(); - stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane); + stackAndAxisEditExpandablePane = new UIExpandablePane(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane, true); return stackAndAxisEditExpandablePane; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartImageMarkerWithoutWidthAndHeightPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartImageMarkerWithoutWidthAndHeightPane.java index 30b1d4e9b5..af045f93b0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartImageMarkerWithoutWidthAndHeightPane.java +++ b/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 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. @@ -13,8 +17,10 @@ public class VanChartImageMarkerWithoutWidthAndHeightPane extends VanChartImageM @Override protected JPanel createContentPane(ImageBackgroundQuickPane imageBackgroundPane, JPanel sizePanel) { - JPanel panel = new JPanel(new BorderLayout()); - panel.add(imageBackgroundPane, BorderLayout.CENTER); - return panel; + return row( + flex(1.2), column(10, + cell(imageBackgroundPane) + ).weight(3) + ).getComponent(); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java index 5b0999ca3f..4e5cd9c954 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java @@ -1,13 +1,12 @@ package com.fr.van.chart.line; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.Marker; +import com.fr.design.foldablepane.UIExpandablePane; 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.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.VanChartMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; @@ -27,10 +26,6 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { } 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[][]{ new Component[]{createLineTypePane()}, @@ -41,7 +36,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane { new Component[]{createTrendLinePane()}, }; - contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); + contentPane = FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); 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); } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java index d60c169dfc..1c80a87ee4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; 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.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; @@ -27,12 +26,8 @@ public class AreaPane extends AbstractReportDataContentPane { protected JPanel createContentPane() { areaName = new DefaultTinyFormulaPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p}; Component[][] components = getComponent(); - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3}); } protected Component[][] getComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java index 8a69f0af31..f1e1dd54c1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; 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 javax.swing.JPanel; @@ -30,12 +29,8 @@ public class LongLatAreaPane extends AreaPane { areaName = new DefaultTinyFormulaPane(); longitude = 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(); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected Component[][] getComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java index d7934dc294..9355ecfb49 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.icombobox.UIComboBox; 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.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; @@ -42,12 +41,8 @@ public class AreaPane extends AbstractTableDataContentPane { protected JPanel createAreaNamePane() { initAreaNameCom(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p}; Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3}); } protected Component[][] getComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java index 200ae1e513..a7d7399bd6 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java +++ b/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; +import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; 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. */ public class LineMapAreaPane extends PointMapAreaPane { - private static final int V_GAP = 10; protected AreaPane endAreaPane; public LineMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { @@ -26,7 +26,7 @@ public class LineMapAreaPane extends PointMapAreaPane { initAreaPane(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(endAreaPane, BorderLayout.CENTER); return content; diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java index b3e3dbd114..8f55a16054 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.gui.icombobox.UIComboBox; 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.contentpane.table.VanPointMapPlotTableDataContentPane; @@ -30,13 +29,9 @@ public class LongLatAreaPane extends AreaPane { initLongitudeCom(); initLatitudeCom(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p, p, p}; Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 12, 6); + return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); } protected Component[][] getComponent() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java index 17eb27907d..a16122779b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java +++ b/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.plugin.chart.map.data.VanMapReportDefinition; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Dimension; import java.util.List; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; + /** * Created by Mitisky on 16/5/16. */ @@ -26,7 +28,6 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte initEveryPane(); initAreaName(); JPanel panel = getContent(); - panel.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); this.add(panel, "0,0,2,0"); } @@ -34,15 +35,12 @@ public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataConte areaName = new DefaultTinyFormulaPane() { @Override 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")); - label.setPreferredSize(new Dimension(75, 20)); - this.add(label, BorderLayout.WEST); - - formulaTextField.setPreferredSize(new Dimension(100, 20)); - this.add(formulaTextField, BorderLayout.CENTER); - this.add(formulaTextFieldButton, BorderLayout.EAST); + this.add(row(cell(label).weight(1.2), + cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5) + ).getComponent()); } }; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java index 00e4d67182..05141e98f9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; 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.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.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.report.PointMapLongLatAreaPane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.CardLayout; -import java.awt.Component; import java.awt.Dimension; /** @@ -33,8 +31,7 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa @Override protected JPanel getContent() { longLatReportFormulaPane = new LongLatReportFormulaPane(); - JPanel content = new JPanel(new BorderLayout(0, 4)); - content.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0)); + JPanel content = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); content.add(longLatReportFormulaPane, BorderLayout.CENTER); return content; } @@ -55,9 +52,6 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa public class LongLatReportFormulaPane extends BasicBeanPane { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - private UIButtonGroup locationType; private JPanel centerPane; @@ -65,7 +59,7 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa private AbstractLongLatAreaPane longLatAreaPane; public LongLatReportFormulaPane() { - this.setLayout(new BorderLayout(0, 5)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); centerPane = new JPanel(new CardLayout()) { @Override public Dimension getPreferredSize() { @@ -94,15 +88,9 @@ public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDa locationType.setSelectedIndex(0); - double[] columnSize = {p, f}; - double[] rowSize = {p}; - - 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); - + JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")), locationType + ); this.add(panel, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java index 284320cebc..2b9d7a9797 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.data.MapMatchResult; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSeparator; import java.util.List; import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; @@ -32,14 +29,12 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { - this.setLayout(new BorderLayout(0, 4)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); initAreaNameCom(); JPanel areaNamePane = createAreaNamePane(); 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(jSeparator, BorderLayout.CENTER); @@ -63,19 +58,8 @@ public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPa protected JPanel createAreaNamePane() { 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; - 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); + return FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, label, createAreaPanel(areaNameCom)); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java index 0006f5e22c..1259273588 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java +++ b/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; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; import com.fr.base.Utils; import com.fr.chartx.TwoTuple; import com.fr.design.chartx.component.MapAreaMatchPane; @@ -17,13 +17,15 @@ import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.tree.DefaultMutableTreeNode; import java.util.Set; -import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.WindowEvent; 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 * @version 10.0 @@ -55,13 +57,11 @@ public abstract class VanMapTableDataContentPane extends AbstractTableDataConten } public JPanel createAreaPanel(UIComboBox areaBox) { - JPanel areaPanel = new JPanel(new BorderLayout(4, 0)); - 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 uiButton = new UIButton(new LazyIcon("tool_config")); uiButton.addActionListener(createActionListener(areaBox)); - areaPanel.add(uiButton, BorderLayout.EAST); - return areaPanel; + return row( + cell(areaBox).weight(2.4), flex(0.1), cell(uiButton).weight(0.5) + ).getComponent(); } private ActionListener createActionListener(final UIComboBox areaBox){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java index 39110caf12..2871566eba 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ b/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; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.widget.FRWidgetFactory; 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.PointMapLongLatAreaPane; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -29,8 +28,6 @@ import java.awt.Dimension; * Created by Mitisky on 16/5/17. */ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableDataContentPane { - private static final int LEFT_GAP = 19; - private static final int V_GAP = 15; //改控件相当于面积图的区域名控件 private LongLatAreaTableComboPane longLatTableComboPane; @@ -43,10 +40,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData } protected JPanel createAreaNamePane() { - JPanel panel = new JPanel(new BorderLayout()); - panel.setBorder(BorderFactory.createEmptyBorder(0, LEFT_GAP, V_GAP, 0)); - panel.add(longLatTableComboPane, BorderLayout.CENTER); - return panel; + return FineLayoutBuilder.asBorderLayoutWrapped(longLatTableComboPane); } @Override @@ -91,11 +85,7 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData public LongLatAreaTableComboPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double labelWidth = 65; - - this.setLayout(new BorderLayout(0, 5)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); centerPane = new JPanel(new CardLayout()) { @Override public Dimension getPreferredSize() { @@ -124,15 +114,10 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData centerPane.add(longLatAreaPane, "longLat"); locationType.setSelectedIndex(0); - - double[] columnSize = {labelWidth, f}; - double[] rowSize = {p}; 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(centerPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java index ba8d24929d..e1b1fda584 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotTableDataContentPane.java @@ -1,5 +1,7 @@ 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.chartattr.ChartCollection; 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.itextfield.UITextField; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; 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.AssistUtils; import com.fr.stable.StringUtils; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSeparator; import java.awt.BorderLayout; @@ -38,9 +37,6 @@ import java.util.List; * Created by Fangjie on 2016/6/15. */ 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 UITextField nameField; @@ -74,7 +70,6 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa levelNameList = new ArrayList(); for (int i = 0; i < levelNum; i++){ levelNameList.add(new UIComboBox()); - levelNameList.get(i).setPreferredSize(new Dimension(WD, HT)); levelNameList.get(i).addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); } } @@ -86,47 +81,32 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa contentPane = new JPanel(); - contentPane.setLayout(new BorderLayout(0, 4)); + contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10))); contentPane.add(north, BorderLayout.NORTH); contentPane.add(center, BorderLayout.CENTER); } 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(); - for (int i = 0; i < levelNum + 3; i++){ - rowSize_center[i] = p; - } Component[][] components_center = new Component[levelNum + 3][]; - 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)}; } value = new UIComboBox(); - value.setPreferredSize(new Dimension(WD, HT)); calculateCombox = new CalculateComboBox(); calculateCombox.reset(); - calculateCombox.setPreferredSize(new Dimension(WD, HT)); 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+2] = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox}; - initCenterItemListener(); registerListener4Center(); - - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components_center,rowSize_center,columnSize_center); - panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); - return panel; + return FineLayoutBuilder.compatibleTableLayout(10, components_center, new double[]{1.2, 3}); } @@ -158,9 +138,6 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa } 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){ @Override @@ -189,9 +166,7 @@ public class MultiPiePlotTableDataContentPane extends AbstractTableDataContentPa new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit}, }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, rowSize_north, columnSize_north); - panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0)); - return panel; + return FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3}); } private void refreshCenterPane(){ diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index 9d2b1883ca..675e4eebf3 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -140,7 +140,7 @@ public class RichTextToolBar extends BasicPane { private void addToToolBar() { this.setLayout(new BorderLayout()); 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()); }