diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java new file mode 100644 index 0000000000..57fd6a63a0 --- /dev/null +++ b/designer-base/src/main/java/com/fine/theme/utils/FineComponentsFactory.java @@ -0,0 +1,44 @@ +package com.fine.theme.utils; + +import com.fine.theme.icon.LazyIcon; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.stable.Constants; + +import javax.swing.Icon; + +/** + * 设计器典型组件组合工厂 + * + * @author Levy.Xie + * @since 11.0 + * Created on 2024/07/26 + */ +public class FineComponentsFactory { + + /** + * 创建水平对齐按钮组 + * + * @return 组件 + */ + public static UIButtonGroup createHorizontalAlignmentButtonGroup() { + Icon[][] alignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()}, + {new LazyIcon("h_center"), new LazyIcon("h_center").white()}, + {new LazyIcon("h_right"), new LazyIcon("h_right").white()}}; + Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; + return new UIButtonGroup<>(alignmentIconArray, alignment); + } + + /** + * 创建垂直对齐按钮组 + * + * @return 组件 + */ + public static UIButtonGroup createVerticalAlignmentButtonGroup() { + Icon[][] alignmentIconArray = {{new LazyIcon("v_top"), new LazyIcon("v_top").white()}, + {new LazyIcon("v_center"), new LazyIcon("v_center").white()}, + {new LazyIcon("v_bottom"), new LazyIcon("v_bottom").white()}}; + Integer[] alignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM}; + return new UIButtonGroup<>(alignmentIconArray, alignment); + } + +} diff --git a/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java b/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java index 11d7137ec4..8bf7b3f0e7 100644 --- a/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java +++ b/designer-base/src/main/java/com/fine/theme/utils/FineLayoutBuilder.java @@ -5,6 +5,7 @@ import com.fine.swing.ui.layout.Layouts; import com.fine.swing.ui.layout.Row; import com.fine.swing.ui.layout.Spacer; import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.ilable.UILabel; import com.fr.log.FineLoggerFactory; import com.fr.stable.collections.combination.Pair; @@ -131,15 +132,32 @@ public class FineLayoutBuilder { * @param elements 面板元素 * @return 面板 */ - public static Column createVerticalLayout(int spacing, JPanel... elements) { + public static Column createVerticalLayout(int spacing, Component... elements) { Column column = new Column(); column.setSpacing(spacing); - for (JPanel element : elements) { + for (Component element : elements) { column.add(element); } return column; } + /** + * 创建水平布局面板 + * + * @param spacing 间距 + * @param elements 面板元素 + * @return 面板 + */ + public static Row createHorizontalLayout(int spacing, double[] weight, Component... elements) { + Row row = new Row(); + row.setSpacing(spacing); + for (int i = 0; i < elements.length; i++) { + Layouts.populate(row, cell(elements[i]).weight(weight[i])); + } + return row; + } + + /** * 组件包装于BorderLayout中 * 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 155ffa7731..d7cee71f4b 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 @@ -33,6 +33,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/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 76f32d6f0c..9bf4d325de 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fine.theme.icon.LazyIcon; import com.fr.base.svg.IconUtils; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; @@ -61,7 +62,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { protected UIButton initEditButton(UIButton editButton, Dimension buttonSize) { editButton = new UILockButton( EditLockUtils.CONNECTION_LOCKED_ICON, - IconUtils.readIcon("/com/fr/design/images/m_web/connection"), + new LazyIcon("connection"), EditLockUtils.CONNECTION_LOCKED_TOOLTIPS, null ); 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/editor/editor/CursorEditor.java b/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java index 3b658d0cef..d8997a5556 100644 --- a/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java +++ b/designer-base/src/main/java/com/fr/design/editor/editor/CursorEditor.java @@ -14,7 +14,6 @@ public class CursorEditor extends Editor { this.setLayout(FRGUIPaneFactory.createCenterFlowLayout()); label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor")); this.add(label); - this.setPreferredSize(new Dimension(10,20)); this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cursor")); this.setEnabled(false); } 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 9b44e75a91..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 @@ -169,11 +169,22 @@ public class FineTabbedPane extends Column { } /** - * 获取当前选中的Tab组件下标 + * 设置选中的Tab组件 * - * @return indx + * @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/gui/imenu/UIMenu.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java index ec78046709..eb2de5b79e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java @@ -7,6 +7,7 @@ import javax.swing.JMenuItem; import javax.swing.JPopupMenu; import javax.swing.MenuElement; import java.awt.Component; +import java.awt.Dimension; /** * @author null diff --git a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java index 8a7431fd2a..9c9a68f466 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/FRFontPane.java @@ -13,11 +13,11 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.UIConstants; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; -import com.fr.design.gui.core.ReactiveCardPane; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.utils.DesignUtils; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; @@ -28,16 +28,11 @@ import com.fr.stable.Constants; import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; import java.awt.BorderLayout; -import java.awt.Component; import java.util.Vector; -import static com.fine.swing.ui.layout.Layouts.Cell; import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.row; -import static com.fine.swing.ui.layout.Layouts.column; /** * Pane to edit Font. @@ -66,7 +61,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse private UIToggleButton isShadowCheckBox; private UIToggleButton superPane; private UIToggleButton subPane; - private ReactiveCardPane styleContainer; + private UIToolbar styleToolbar; public FRFontPane() { this.initComponents(); @@ -111,7 +106,6 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse int line = frFont.getUnderline(); if (line == Constants.LINE_NONE) { underline.setSelected(false); - styleContainer.removeAll(); } else { underline.setSelected(true); this.underlineCombo.setSelectedLineStyle(line); @@ -129,7 +123,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse this.superPane.setSelected(false); this.subPane.setSelected(false); } - styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate(); + underlineCombo.setVisible(underline.isSelected()); } /** @@ -239,41 +233,35 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse isShadowCheckBox = new UIToggleButton(new LazyIcon("shadow")); superPane = new UIToggleButton(new LazyIcon("super")); subPane = new UIToggleButton(new LazyIcon("sub")); - styleContainer = ReactiveCardPane.create() - .addSupplier("showLine", this::createContentWithLine) - .addSupplier("hideLine", this:: createContentNoLine); + styleToolbar = createToolbar(); initAllNames(); setToolTips(); initListeners(); - styleContainer.select("hideLine").populate(); + underlineCombo.setVisible(false); this.setLayout(new BorderLayout()); this.add(Layouts.column(LayoutConstants.VERTICAL_GAP, cell(fontNameComboBox), row(5, cell(fontSizeStyleComboBox).weight(1), cell(fontSizeComboBox).weight(1)), - cell(styleContainer) + cell(styleToolbar), + cell(underlineCombo) ).getComponent(), BorderLayout.CENTER); DefaultValues defaultValues = FRContext.getDefaultValues(); populateBean(defaultValues.getFRFont()); } - private Component createContentNoLine() { - return createFontButtonRow().getComponent(); - } - - private Component createContentWithLine() { - return column(LayoutConstants.VERTICAL_GAP, - createFontButtonRow(), - cell(underlineCombo) - ).getComponent(); - } - - private Cell createFontButtonRow() { - return row(3, cell(colorSelectPane), cell(underline), cell(isStrikethroughCheckBox), cell(isShadowCheckBox), - cell(superPane), cell(subPane)); + private UIToolbar createToolbar() { + UIToolbar toolbar = new UIToolbar(); + toolbar.add(colorSelectPane); + toolbar.add(underline); + toolbar.add(isStrikethroughCheckBox); + toolbar.add(isShadowCheckBox); + toolbar.add(superPane); + toolbar.add(subPane); + return toolbar; } private void initAllNames() { @@ -303,12 +291,7 @@ public class FRFontPane extends AbstractBasicStylePane implements GlobalNameObse } private void initListeners() { - underline.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - styleContainer.select(underline.isSelected() ? "showLine" : "hideLine").populate(); - } - }); + underline.addChangeListener(e -> underlineCombo.setVisible(underline.isSelected())); } /** diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupUIUtils.java b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupUIUtils.java index 54deee8380..2256cb9bac 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupUIUtils.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/popup/MobilePopupUIUtils.java @@ -35,7 +35,7 @@ public class MobilePopupUIUtils { titleLabel.setForeground(color); jp.add(row(10, cell(titleLabel), - cell(contentPanel) + cell(contentPanel).weight(1.0) ).getComponent()); return jp; } 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/predefined/ui/detail/ColorFillStylePane.java b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java index 823dd6ff3a..d835e2f372 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/predefined/ui/detail/ColorFillStylePane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.predefined.ui.detail; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; import com.fr.base.Utils; @@ -7,14 +8,11 @@ import com.fr.chart.base.ChartConstants; import com.fr.config.predefined.ColorFillStyle; import com.fr.config.predefined.PredefinedColorStyle; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.constants.LayoutConstants; import com.fr.design.event.UIObserverListener; import com.fr.design.gui.icombobox.ColorSchemeComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.background.gradient.FixedGradientBarNoTheme; import com.fr.design.style.color.ColorAdjustPane; import com.fr.stable.StringUtils; @@ -158,14 +156,7 @@ public class ColorFillStylePane extends BasicBeanPane { } protected JPanel getContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = 155; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(contentPaneComponents(), rowSize, columnSize, 12, LayoutConstants.VGAP_LARGE); - return panel; + return FineLayoutBuilder.compatibleTableLayout(10, contentPaneComponents(), new double[]{1.2, 3}); } protected Component[][] contentPaneComponents() { 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/java/com/fr/design/menu/NameSeparator.java b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java index f5a0a1a756..b64f133267 100644 --- a/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java +++ b/designer-base/src/main/java/com/fr/design/menu/NameSeparator.java @@ -52,11 +52,11 @@ public class NameSeparator extends UpdateAction { } public Dimension getSize() { - return new Dimension(super.getSize().width, 20); + return new Dimension(super.getSize().width, 30); } public Dimension getPreferredSize() { - return new Dimension(super.getPreferredSize().width, 20); + return new Dimension(super.getPreferredSize().width, 30); } } diff --git a/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java b/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java index a02efff2dc..57df8937fa 100644 --- a/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java +++ b/designer-base/src/main/java/com/fr/design/widget/component/DateValuePane.java @@ -61,12 +61,17 @@ public class DateValuePane extends Column { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None"))); cardLayout.show(customPane, tabTitles[index]); }); - this.add( - row( - cell(titleLabel).weight(1.2), cell(widgetValueHead).weight(1.6), flex(1.4) - ), - cell(customRow) - ); + if (StringUtils.isNotEmpty(title)) { + this.add( + row( + cell(titleLabel).weight(1.2), cell(widgetValueHead).weight(3) + ), + cell(customRow) + ); + } else { + this.add(cell(widgetValueHead),cell(customPane)); + } + } 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/icon/insert/float_normal.svg b/designer-base/src/main/resources/com/fine/theme/icon/insert/float_normal.svg new file mode 100644 index 0000000000..b2204b711e --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/insert/float_normal.svg @@ -0,0 +1,7 @@ + + + icon_属性_悬浮元素_下拉列表用_normal + + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/newline.svg b/designer-base/src/main/resources/com/fine/theme/icon/newline.svg new file mode 100644 index 0000000000..6236b57ed3 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/newline.svg @@ -0,0 +1,3 @@ + + + diff --git a/designer-base/src/main/resources/com/fine/theme/icon/page.svg b/designer-base/src/main/resources/com/fine/theme/icon/page.svg new file mode 100644 index 0000000000..6ba88c97d1 --- /dev/null +++ b/designer-base/src/main/resources/com/fine/theme/icon/page.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 6a1eef0853..6313715ca7 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 @@ -26,6 +26,7 @@ "time": "time.svg", "logo": "logo.svg", "pages": "pages.svg", + "page": "page.svg", "digitalPlatform": "digitalPlatform.svg", "tables": "tables.svg", "views": "views.svg", @@ -142,6 +143,7 @@ "image": "insert/image.svg", "bias": "insert/bias.svg", "sub_report": "insert/sub_report.svg", + "float_normal": "insert/float_normal.svg", "popup": { "normal": "popup/popup.svg" }, @@ -298,8 +300,11 @@ "text_area": "widget/text_area.svg", "text_field": "widget/text_field.svg", "widget_tree": "widget/tree.svg", + "ds_column_name": "editor/ds_column_name.svg", + "ds_column_index": "editor/ds_column_index.svg", "user_widget": "widget/user_widget.svg", "advanced_editor": "param/advanced_editor.svg", - "function_manage": "function_manage.svg" + "function_manage": "function_manage.svg", + "newline": "newline.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 1274335f8b..70e0f58a1d 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 @@ -1258,6 +1258,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/TableDataPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java index 0c84c65e63..52e2f32cbd 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.data; +import com.fine.swing.ui.layout.Column; import com.fine.theme.utils.FineUIScale; import com.fr.base.TableData; import com.fr.chart.chartattr.Chart; @@ -22,6 +23,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ private static final long serialVersionUID = 4740461028440155147L; private DatabaseTableDataPane tableDataPane; private AbstractTableDataContentPane dataContentPane; + protected Column centerPane; private ChartDataPane parent; @@ -44,7 +46,10 @@ public class TableDataPane extends FurtherBasicBeanPane{ checkBoxUse(); } }; - this.add(tableDataPane, BorderLayout.NORTH); + centerPane = new Column(); + centerPane.setSpacing(10); + centerPane.add(tableDataPane); + this.add(centerPane, BorderLayout.CENTER); } /** @@ -116,7 +121,7 @@ public class TableDataPane extends FurtherBasicBeanPane{ } dataContentPane = contentPane; if(dataContentPane != null) { - add(dataContentPane, BorderLayout.CENTER); + centerPane.add(dataContentPane); } } 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/ChartTextAttrPaneWithThemeStyle.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java index 76862a7577..85362b1329 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithThemeStyle.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; +import com.fine.theme.utils.FineLayoutBuilder; import com.fine.theme.utils.FineUIScale; import com.fr.chart.base.TextAttr; import com.fr.design.gui.ibutton.UIButtonGroup; @@ -37,13 +38,9 @@ public class ChartTextAttrPaneWithThemeStyle extends ChartTextAttrPane { preButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Theme"), Toolkit.i18nText("Fine-Design_Chart_Custom")}); - double f = TableLayout.FILL; - double e = getEdithAreaWidth(); - double p = TableLayout.PREFERRED; - double[] columnSize = {f, e}; UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Character"), SwingConstants.LEFT); - JPanel preButtonPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][]{new Component[]{text, preButton}}, new double[]{p}, columnSize); - textFontPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), getRowSize(), columnSize); + JPanel preButtonPane = FineLayoutBuilder.compatibleTableLayout(10, new Component[][]{new Component[]{text, preButton}}, new double[]{1.2, 3}); + textFontPane = FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3}); panel.add(preButtonPane, BorderLayout.CENTER); panel.add(textFontPane, BorderLayout.SOUTH); return panel; 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/design/module/ChartHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java index e81c4de238..88a691423b 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java @@ -42,10 +42,10 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); NameableCreator[] related4ChartHyper = { - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), formHyperlink.getClass(), FormHyperlinkPane.class)}; + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float"), ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), formHyperlink.getClass(), FormHyperlinkPane.class)}; return ArrayUtils.addAll(super.getHyperlinkCreators(), related4ChartHyper); } diff --git a/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java index 12025a4115..cd383ca358 100644 --- a/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java @@ -32,9 +32,9 @@ public class FormHyperlinkGroup extends BaseHyperlinkGroup { public NameableCreator[] getHyperlinkCreators() { FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); NameableCreator[] related4ChartHyper = { - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), IconUtils.readIcon("com/fr/design/images/data/hyperlink.svg"), formHyperlink.getClass(), FormHyperlinkPane.class)}; + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), formHyperlink.getClass(), FormHyperlinkPane.class)}; return ArrayUtils.addAll(super.getHyperlinkCreators(), related4ChartHyper); } 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/VanChartBeautyPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java index 0fefa406e0..d82b6409c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java @@ -1,14 +1,13 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.base.GradientStyle; import com.fr.design.beans.BasicBeanPane; 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.plugin.chart.type.GradientType; import com.fr.stable.StringUtils; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -37,17 +36,11 @@ public class VanChartBeautyPane extends BasicBeanPane { gradientTypeBox = new UIButtonGroup(names); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p}; - Component[][] components = new Component[][]{ new Component[]{new UILabel(labelName()), gradientTypeBox}, }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected String[] getNameArray() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java index 3f7374c34d..c1b3424d15 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartFillStylePane.java @@ -10,8 +10,6 @@ import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.mainframe.predefined.ui.detail.ColorFillStylePane; import com.fr.design.utils.gui.GUICoreUtils; -import javax.swing.BorderFactory; -import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -36,12 +34,6 @@ public class VanChartFillStylePane extends ColorFillStylePane implements Designe this.add(getContentPane(), BorderLayout.CENTER); } - protected JPanel getContentPane() { - JPanel contentPane = super.getContentPane(); - contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); - return contentPane; - } - protected Component[][] contentPaneComponents() { return new Component[][]{ new Component[]{null, null}, diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java index 0af3a24b13..716435b2e7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartGanttTimeLinePane.java @@ -1,17 +1,15 @@ package com.fr.van.chart.designer.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; 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.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.plugin.chart.gantt.VanChartGanttPlot; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; -import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -27,13 +25,12 @@ public class VanChartGanttTimeLinePane extends JPanel { public VanChartGanttTimeLinePane() { this.setLayout(new BorderLayout()); - this.add(createSwitchButtonPane(), BorderLayout.NORTH); - this.add(createCenterPane(), BorderLayout.CENTER); + this.add(FineLayoutBuilder.createVerticalLayout(10, + createSwitchButtonPane(), createCenterPane() + )); } private JPanel createSwitchButtonPane() { - double[] columnSize = {TableLayout.PREFERRED, TableLayout.FILL}; - double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED}; String[] array = new String[]{Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Not_Show"), Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Show")}; switchButton = new UIButtonGroup<>(array); switchButton.addChangeListener(new ChangeListener() { @@ -42,25 +39,20 @@ public class VanChartGanttTimeLinePane extends JPanel { setCenterPaneVisibility(); } }); - UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Current_Line"), SwingConstants.LEFT); - return TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][] { - new Component[]{null, null}, + UILabel text = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Current_Line")); + return FineLayoutBuilder.compatibleTableLayout(10, new Component[][] { new Component[] {text, switchButton} - }, rowSize, columnSize); + }, new double[]{1.2, 3}); } private JPanel createCenterPane() { - double[] columnSize = {TableLayout.FILL, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; - double[] rowSize = {TableLayout.PREFERRED, TableLayout.PREFERRED, TableLayout.PREFERRED}; - colorSelect = new ColorSelectBoxWithOutTransparent(100); opacity = new UINumberDragPaneWithPercent(0, 100); - centerPane = TableLayout4VanChartHelper.createGapTableLayoutPane(new Component[][] { - new Component[]{null, null}, + centerPane = FineLayoutBuilder.compatibleTableLayout(10, new Component[][] { new Component[] {new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect}, new Component[] {new UILabel(Toolkit.i18nText("Fine-Design_Report_Alpha")), opacity} - }, rowSize, columnSize); + }, new double[]{1.2, 3}); centerPane.setVisible(false); 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 1cf695ec2c..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,20 +1,14 @@ package com.fr.van.chart.designer.component; -import com.fine.theme.light.ui.FineButtonBorder; import com.fr.chart.chartattr.Plot; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; 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.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.Nameable; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.JComponent; @@ -24,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; @@ -51,7 +44,6 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem public VanChartUIListControlPane() { super(); this.setBorder(null); - getToolBar().setBorder(new FineButtonBorder()); iniListener(); } @@ -102,18 +94,6 @@ public abstract class VanChartUIListControlPane extends UIListControlPane implem this.listenerList.add(ChangeListener.class, l); } - @Override - protected JPanel getLeftTopPane(UIToolbar topToolBar) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(getAddItemText()), topToolBar}, - }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } @Override public void saveSettings() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java index f3de5d17fb..f6d89b66a1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component.background; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.background.ImageBackground; import com.fr.chart.chartglyph.GeneralInfo; import com.fr.design.dialog.BasicPane; @@ -9,7 +10,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; @@ -17,7 +17,6 @@ import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.VanChartGradientPane; import com.fr.general.Background; import com.fr.stable.Constants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -72,13 +71,7 @@ public class VanChartBackgroundPane extends BasicPane { } protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - - double[] rowSize = {p, p, p, p, p}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, getPaneComponents(), new double[]{1.2, 3}); } protected void initComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java index d854f9917f..1c739b6b4b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPaneWithOutImageAndShadow.java @@ -1,16 +1,10 @@ package com.fr.van.chart.designer.component.background; -import com.fr.design.constants.LayoutConstants; 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.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; -import javax.swing.JPanel; import java.awt.Component; /** @@ -27,21 +21,6 @@ public class VanChartBackgroundPaneWithOutImageAndShadow extends VanChartBackgro super(hasAuto); } - - @Override - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double[] columnSize = {f, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH}; - double[] rowSize = {p, p, p}; - - JPanel tableLayoutPane = TableLayoutHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize, - TableLayout4VanChartHelper.COMPONENT_INTERVAL, LayoutConstants.VGAP_MEDIUM); - tableLayoutPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 4, 0)); - return tableLayoutPane; - } - @Override protected void initList() { paneList.add(new NullBackgroundQuickPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java index 9f2bdf6bc0..a3136fb3ed 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartMarkerBackgroundPane.java @@ -2,15 +2,10 @@ package com.fr.van.chart.designer.component.background; import com.fr.base.background.ColorBackground; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.backgroundpane.BackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; - -import javax.swing.JPanel; import java.awt.Component; /** @@ -19,17 +14,6 @@ import java.awt.Component; public class VanChartMarkerBackgroundPane extends VanChartBackgroundPane { private static final long serialVersionUID = -1032221277140976934L; - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); - } - protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{null, null}, 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 e2cdf0cb02..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 @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.component.marker; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartglyph.Marker; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.ilable.UILabel; @@ -7,8 +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.design.layout.TableLayoutHelper; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -71,17 +70,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane public VanChartCommonMarkerPane() { markerTypeComboBox = new MarkerComboBox(getMarkers()); markerFillColor = new VanChartMarkerBackgroundPane() { - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - double e = getColumnSize()[1]; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - - return TableLayoutHelper.createTableLayoutPane(getPaneComponents(), rowSize, columnSize); - } - protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{null, null}, @@ -92,10 +80,8 @@ public class VanChartCommonMarkerPane extends BasicBeanPane }; radius = new UISpinnerWithPx(0, 100, 0.5, 0); - double p = TableLayout.PREFERRED; - - markerTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerTypeComponent(), new double[]{p}, getColumnSize()); - markerConfigPane = TableLayout4VanChartHelper.createGapTableLayoutPane(getMarkerConfigComponent(), new double[]{p, p}, getColumnSize()); + markerTypePane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerTypeComponent(), new double[]{1.2, 3}); + markerConfigPane = FineLayoutBuilder.compatibleTableLayout(10, getMarkerConfigComponent(), new double[]{1.2, 3}); markerTypeComboBox.addActionListener(new ActionListener() { @Override @@ -103,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/other/AutoRefreshPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java index 1e656a8bf0..f5b1004d58 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/AutoRefreshPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.other; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.UIDialog; @@ -9,23 +10,19 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.RefreshMoreLabel; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.PlotFactory; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; -import javax.swing.BorderFactory; import javax.swing.JPanel; 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.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -57,7 +54,6 @@ public class AutoRefreshPane extends BasicBeanPane { protected JPanel createContentPane() { - JPanel content = new JPanel(new BorderLayout(0, 6)); moreLabel = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); moreLabel.addChangeListener(new ChangeListener() { @Override @@ -82,34 +78,27 @@ public class AutoRefreshPane extends BasicBeanPane { jPanel.add(autoTooltip, BorderLayout.CENTER); jPanel.add(tooltipSet, BorderLayout.EAST); - JPanel moreLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label"), moreLabel); + JPanel moreLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_More_Label")), moreLabel); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f, 20}; - double[] column = {f, 20}; - double[] rowSize = {p}; Component[][] components = initComponent(jPanel); - JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel panel1 = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 1.2, 1.2, 0.6}); contentPane = new JPanel(new BorderLayout()); contentPane.add(panel1, BorderLayout.CENTER); Component[][] AutoTooltipComponent = initAutoTooltipComponent(); - JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(AutoTooltipComponent, rowSize, column); - panel2.setBorder(BorderFactory.createEmptyBorder(10, 0,0,0)); + JPanel panel2 = FineLayoutBuilder.compatibleTableLayout(10, AutoTooltipComponent, new double[]{1.2, 2, 1}); contentPane.add(panel2, BorderLayout.SOUTH); - contentPane.setBorder(BorderFactory.createEmptyBorder(0, 72,0,0)); - content.add(moreLabelPane, BorderLayout.NORTH); - content.add(contentPane, BorderLayout.CENTER); - return content; + return FineLayoutBuilder.createVerticalLayout(10, moreLabelPane, contentPane); } protected Component[][] initComponent(JPanel autoTooltipPane){ return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")), autoRefreshTime, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))}, - new Component[]{autoTooltip,null, tooltipSet}, + new Component[]{null, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Interval")), + autoRefreshTime, new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Seconds"))}, + new Component[]{null, autoTooltip, null, tooltipSet}, }; } @@ -117,13 +106,12 @@ public class AutoRefreshPane extends BasicBeanPane { protected Component[][] initAutoTooltipComponent () { return new Component[][]{ - new Component[]{autoTooltip, tooltipSet}, + new Component[]{null, autoTooltip, tooltipSet}, }; } private void initTooltipSet() { - tooltipSet = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png")); - tooltipSet.setPreferredSize(new Dimension(20, 20)); + tooltipSet = new UIButton(new LazyIcon("tool_config")); tooltipSet.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java index edf45b4ccc..334104128c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/VanChartInteractivePane.java @@ -1,5 +1,7 @@ package com.fr.van.chart.designer.other; +import com.fine.swing.ui.layout.Column; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.BaseFormula; import com.fr.base.Utils; import com.fr.chart.chartattr.Chart; @@ -7,6 +9,7 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chartx.attr.LargeDataModeType; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.frpane.UINumberDragPane; @@ -20,7 +23,6 @@ import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UnsignedIntUISpinner; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.design.widget.FRWidgetFactory; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -48,11 +50,9 @@ import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.other.zoom.ZoomPane; -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; @@ -127,30 +127,23 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected JPanel getInteractivePane(VanChartPlot plot) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p, p, p, p}; - - Component[][] components = ChartEditContext.normalMode() ? new Component[][]{ - new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, + new Component[]{createToolBarPane(), null}, //大数据模式 恢复用注释。取消注释。 //new Component[]{createLargeDataModePane(), null}, new Component[]{createAnimationPane(), null}, - new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, + new Component[]{createAxisRotationPane(plot), null}, new Component[]{createZoomPane(plot), null}, new Component[]{createAutoRefreshPane(plot), null}, new Component[]{createHyperlinkPane(), null} } : new Component[][]{ - new Component[]{createToolBarPane(getToolBarRowSize(), columnSize), null}, + new Component[]{createToolBarPane(), null}, new Component[]{createAnimationPane(), null}, - new Component[]{createAxisRotationPane(new double[]{p, p}, columnSize, plot), null}, - new Component[]{createZoomPane(plot), null} + new Component[]{createAxisRotationPane(plot), null}, + new Component[]{createZoomPane(plot, false), null} }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1, 0}); } //大数据模式 恢复用注释。取消注释。 @@ -192,27 +185,25 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected JPanel createZoomPane(VanChartPlot plot) { - //图表缩放新设计 恢复用注释。取消注释。 -// zoomPane = createZoomPane(); -// if (zoomPane == null) { -// return null; -// } -// return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), zoomPane); + return this.createZoomPane(plot, true); + } - //图表缩放新设计 恢复用注释。删除下面方法体所有代码。 + protected JPanel createZoomPane(VanChartPlot plot, boolean withUnderline) { if (!plot.isSupportZoomDirection()) { return null; } zoomWidget = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Open_Zoom_Control")); zoomGesture = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}); - JPanel zoomWidgetPane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget"), zoomWidget); - JPanel zoomGesturePane = TableLayout4VanChartHelper.createGapTableLayoutPaneWithoutTop(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture"), zoomGesture); + JPanel zoomWidgetPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Widget")), zoomWidget); + JPanel zoomGesturePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_ZoomGesture")), zoomGesture); zoomType = new UIButtonGroup(getNameArray(), getValueArray()); zoomTypePane = getZoomTypePane(zoomType); JPanel panel = createZoomPaneContent(zoomWidgetPane, zoomGesturePane, plot); zoomWidget.addActionListener((event) -> checkZoomPane()); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Use_Zoom"), panel, withUnderline); } private void createChangeEnablePane(VanChartRectanglePlot plot) { @@ -235,17 +226,11 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { centerPane.add(scaleAxisPane, scaleAxis); centerPane.add(scrollPane, scroll); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] row = {p, p}; Component[][] components = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Control_Type")), controlType}, new Component[]{centerPane, null} }; - changeEnablePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); - changeEnablePane.setBorder(BorderFactory.createEmptyBorder(5, 12, 0, 0)); + changeEnablePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); controlType.addActionListener((event) -> checkCardPane()); } @@ -259,14 +244,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_From")), from}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_To")), to}, }; - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] row = {p, p, p}; - JPanel resizePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); - return resizePane; + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } @@ -274,11 +252,6 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { VanChartAxis vanChartAxis = plot.getCategoryAxisList().get(0); AxisType axisType = vanChartAxis.getAxisType(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] row = {p}; Component[][] components; if (axisType == AxisType.AXIS_CATEGORY) { categoryNum = new UnsignedIntUISpinner(1, Double.MAX_VALUE, 1); @@ -291,7 +264,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Scaling")), scaling}, }; } - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected void checkCardPane() { @@ -312,13 +285,14 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { } protected JPanel createZoomPaneContent(JPanel zoomWidgetPane, JPanel zoomGesturePane, VanChartPlot plot) { - JPanel panel = new JPanel(new BorderLayout(0, 4)); + Column panel = new Column(); + panel.setSpacing(10); if (plot.isSupportZoomCategoryAxis()) {//支持缩放控件 createChangeEnablePane((VanChartRectanglePlot) plot); - panel.add(zoomWidgetPane, BorderLayout.NORTH); - panel.add(changeEnablePane, BorderLayout.CENTER); + panel.add(zoomWidgetPane); + panel.add(changeEnablePane); } - panel.add(zoomTypePane, BorderLayout.SOUTH); + panel.add(zoomTypePane); return panel; } @@ -430,7 +404,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { return null; } - private JPanel createAxisRotationPane(double[] row, double[] col, VanChartPlot plot) { + private JPanel createAxisRotationPane(VanChartPlot plot) { if (!(plot.getAxisPlotType() == AxisPlotType.RECTANGLE)) { return null; } @@ -449,12 +423,12 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { new Component[]{null, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Reversal")), axisRotation} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis"), panel, true); } - protected JPanel createToolBarPane(double[] row, double[] col) { + protected JPanel createToolBarPane() { isSort = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Sort")); exportImages = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Export_Image")); fullScreenDisplay = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_FullScreen_Display")); @@ -462,8 +436,8 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { Component[][] components = createToolBarComponents(); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_ToolBar"), panel, true); } protected double[] getToolBarRowSize() { @@ -492,24 +466,19 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { protected JPanel createAnimationPane() { isChartAnimation = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); chartAnimationLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Animation_Effects")); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p}; Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{chartAnimationLabel, isChartAnimation} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Animation"), panel, true); } protected JPanel createAutoRefreshPane(VanChartPlot plot) { autoRefreshPane = getMoreLabelPane(plot); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Moniter_refresh"), autoRefreshPane, true); } protected AutoRefreshPane getMoreLabelPane(VanChartPlot plot) { @@ -519,7 +488,7 @@ public class VanChartInteractivePane extends AbstractVanChartScrollPane { protected JPanel createHyperlinkPane() { superLink = new VanChartHyperLinkPane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), superLink); } private void checkLargeDataMode() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 925d2c38b6..cc5199d3c2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -1,6 +1,6 @@ package com.fr.van.chart.designer.style; -import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineComponentsFactory; import com.fine.theme.utils.FineUIStyle; import com.fr.base.BaseFormula; import com.fr.base.Utils; @@ -33,7 +33,6 @@ import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.component.VanChartFloatPositionPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutShadowWithRadiusPane; -import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.SwingConstants; import javax.swing.event.ChangeEvent; @@ -144,11 +143,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { } private JPanel createTitlePositionPane() { - Icon[][] hAlignmentIconArray = {{new LazyIcon("h_left"), new LazyIcon("h_left").white()}, - {new LazyIcon("h_center"), new LazyIcon("h_center").white()}, - {new LazyIcon("h_right"), new LazyIcon("h_right").white()}}; - Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; - alignmentPane = new UIButtonGroup<>(hAlignmentIconArray, alignment); + alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup(); customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); UIComponentUtils.setLineWrap(customFloatPositionButton); customFloatPositionButton.setEventBannded(true); 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 46b210c7ec..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,9 +1,12 @@ package com.fr.van.chart.designer.style.axis; +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; @@ -13,10 +16,8 @@ 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.BorderFactory; import javax.swing.JPanel; import java.util.ArrayList; import java.util.List; @@ -58,11 +59,12 @@ public class VanChartAxisScrollPaneWithTypeSelect extends AbstractVanChartScroll } protected void initLayout() { - this.setLayout(new BorderLayout(0,6)); - JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Type"), jcb); - northPane.setBorder(BorderFactory.createEmptyBorder(0,5,0,0)); + 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(new double[]{p, p, p, p, p, p}, column, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p, p}, column), null}, - new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, - new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, + new Component[]{createTitlePane(isXAxis), null}, + new Component[]{createLabelPane(), null}, + new Component[]{createLineStylePane(), null}, + new Component[]{createAxisPositionPane(isXAxis), null}, new Component[]{createDisplayStrategy(), null}, new Component[]{createValueStylePane(), null}, }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); } - protected JPanel createTitlePane(double[] row, double[] col, boolean isXAxis) { + protected JPanel createTitlePane(boolean isXAxis) { showTitle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Use_Show"), Toolkit.i18nText("Fine-Design_Chart_Hidden")}); titleAlignPane = isXAxis ? getXAxisTitleAlignPane() : getYAxisTitleAlignPane(); titleAlignPane.setSelectedItem(Constants.CENTER); @@ -179,10 +177,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation) }, }; - titlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - titlePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); + titlePane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); - JPanel showTitlePane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Title"), showTitle); + JPanel showTitlePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Axis_Title")), showTitle); showTitle.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -190,48 +188,38 @@ 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 TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel); + return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_TITLE_TITLE, jPanel, true); } private UIButtonGroup getXAxisTitleAlignPane() { - Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")}; - Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; - - return new UIButtonGroup(alignmentIconArray, alignment); + return FineComponentsFactory.createHorizontalAlignmentButtonGroup(); } private UIButtonGroup getYAxisTitleAlignPane() { - Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_top_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_center_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/v_down_normal.png")}; - Integer[] alignment = new Integer[]{Constants.TOP, Constants.CENTER, Constants.BOTTOM}; - - return new UIButtonGroup(alignmentIconArray, alignment); + return FineComponentsFactory.createVerticalAlignmentButtonGroup(); } - protected JPanel createLabelPane(double[] row, double[] col) { + protected JPanel createLabelPane() { initLabelComponents(); labelPane = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane()); wholeDisplayLabelPanel = new VanChartAxisStyleSettingPane(showLabelDisplay(), getChartTextAttrPane()); - wholeDisplayLabelPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); addComponentsListener(); - JPanel showLabelPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Axis_Label"), showLabel); + JPanel showLabelPane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + 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); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane); + return new UIExpandablePane(PaneTitleConstants.CHART_STYLE_LABEL_TITLE, labelPane, true); } private void initLabelComponents() { @@ -298,7 +286,6 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { */ private JPanel createCategoryStylePane() { categoryStylePane = new JPanel(new BorderLayout()); - categoryStylePane.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); return categoryStylePane; } @@ -316,7 +303,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { return VanChartAxisPaneHelper.createAxisTextAttrPane(); } - protected JPanel createLineStylePane(double[] row, double[] col) { + protected JPanel createLineStylePane() { axisLineStyle = createLineComboBox(); axisLineColor = new ColorSelectBoxWithThemeStyle(100); String[] strings = new String[]{Toolkit.i18nText("Fine-Design_Chart_Open"), Toolkit.i18nText("Fine-Design_Chart_Close")}; @@ -324,8 +311,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { mainTick = new UIButtonGroup(strings, values); secondTick = new UIButtonGroup(strings, values); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getLineStylePaneComponents(), row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, getLineStylePaneComponents(), new double[]{1.2, 3}); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Axis_Line_Style"), panel, true); } protected LineComboBox createLineComboBox() { @@ -342,7 +329,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { }; } - protected JPanel createAxisPositionPane(double[] row, double[] col, boolean isXAxis) { + protected JPanel createAxisPositionPane(boolean isXAxis) { position = new UIButtonGroup(getAxisPositionNameArray(isXAxis), getAxisPositionValueArray(isXAxis)); reversed = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_On"), Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); Component[][] components = new Component[][]{ @@ -354,8 +341,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_AxisReversed")), reversed}, }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), panel, true); } private String[] getAxisPositionNameArray(boolean isXAxis) { @@ -393,11 +380,8 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { } }); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel, true); - //区域显示策略 恢复用注释。取消注释。 -// limitPane = new LimitPane(); -// return limitPane; } protected JPanel createValueStylePane() { @@ -413,16 +397,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane { centerPane.add(valueFormat, Toolkit.i18nText("Fine-Design_Chart_Common")); centerPane.add(htmlLabelPane, Toolkit.i18nText("Fine-Design_Chart_Custom")); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p}; 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 = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); valueFormatStyle.addActionListener(new ActionListener() { @@ -432,7 +411,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/VanChartTimeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java index 500667963b..598465380b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartTimeAxisPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.designer.style.axis; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.BaseFormula; import com.fr.base.Utils; import com.fr.design.chart.ChartSwingUtils; @@ -7,6 +8,7 @@ import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.editor.DateEditor; import com.fr.design.editor.editor.Editor; import com.fr.design.editor.editor.FormulaEditor; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.date.UIDatePicker; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icombobox.UIComboBox; @@ -15,7 +17,6 @@ import com.fr.design.gui.style.FormatPane; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.general.DateUtils; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.attr.axis.VanChartAxis; @@ -61,24 +62,17 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { @Override 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,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createTitlePane(new double[]{p, p, p, p, p,p}, column, isXAxis),null}, - new Component[]{createLabelPane(new double[]{p, p, p}, column),null}, + new Component[]{createTitlePane(isXAxis),null}, + new Component[]{createLabelPane(),null}, new Component[]{createValueDefinition(),null}, - new Component[]{createLineStylePane(new double[]{p, p,p,p,p}, columnSize),null}, - new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis),null}, + new Component[]{createLineStylePane(),null}, + new Component[]{createAxisPositionPane(isXAxis),null}, new Component[]{createDisplayStrategy(),null}, new Component[]{createValueStylePane(),null}, }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); } protected boolean showLabelDisplay() { @@ -87,7 +81,7 @@ public class VanChartTimeAxisPane extends VanChartBaseAxisPane { private JPanel createValueDefinition(){ timeMinMaxValuePane = new TimeMinMaxValuePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), timeMinMaxValuePane, true); } @Override 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 032642c93a..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 @@ -1,13 +1,13 @@ package com.fr.van.chart.designer.style.axis; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.BaseFormula; import com.fr.chart.base.ChartBaseUtils; import com.fr.design.chart.ChartSwingUtils; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.stable.StringUtils; @@ -42,35 +42,28 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { @Override 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,p,p,p,p,p,p}; Component[][] components = new Component[][]{ - new Component[]{createTitlePane(new double[]{p, p, p, p, p, p}, column, isXAxis), null}, - new Component[]{createLabelPane(new double[]{p, p, p}, column), null}, - new Component[]{createMinMaxValuePane(new double[]{p, p}, columnSize), null}, - new Component[]{createLineStylePane(new double[]{p, p, p, p, p}, columnSize), null}, - new Component[]{createAxisPositionPane(new double[]{p, p, p}, columnSize, isXAxis), null}, + new Component[]{createTitlePane(isXAxis), null}, + new Component[]{createLabelPane(), null}, + new Component[]{createMinMaxValuePane(), null}, + new Component[]{createLineStylePane(), null}, + new Component[]{createAxisPositionPane(isXAxis), null}, new Component[]{createDisplayStrategy(), null}, new Component[]{createValueStylePane(), null}, }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3}); } protected boolean showLabelDisplay() { return false; } - protected JPanel createMinMaxValuePane(double[] row, double[] col){ - JPanel panel = createCommenValuePane(row,col); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel); + protected JPanel createMinMaxValuePane(){ + JPanel panel = createCommenValuePane(); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), panel, true); } - protected JPanel createCommenValuePane(double[] row, double[] col){ + protected JPanel createCommenValuePane(){ initMinMaxValuePane(); logBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Custom_LogBase_Value")); @@ -82,10 +75,6 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { }); ChartSwingUtils.addListener(logBox, logBaseField); -// JPanel logPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); -// logPane.add(logBox); -// logPane.add(logBaseField); - logPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Log_Base_Value"), logBaseField, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); @@ -108,7 +97,7 @@ public class VanChartValueAxisPane extends VanChartBaseAxisPane { } }); - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected void initMinMaxValuePane() { 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 3020093278..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,5 +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; @@ -13,16 +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.BorderFactory; -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; @@ -57,15 +57,14 @@ public class VanChartAxisButtonPane extends BasicBeanPane { this.parent = vanChartAxisPane; this.setLayout(new BorderLayout()); - addButton = new AddButton(BaseUtils.readIcon("/com/fr/design/images/control/addPopup.png")); + addButton = new AddButton(new LazyIcon("add_popup")); JPanel eastPane = new JPanel(new BorderLayout()); - eastPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 20)); eastPane.add(addButton, BorderLayout.NORTH); addButton.setVisible(false); this.add(eastPane, BorderLayout.EAST); - buttonPane = new JPanel(); - buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 0)); + buttonPane = new Column(); + buttonPane.setSpacing(10); this.add(buttonPane, BorderLayout.CENTER); itemX = new UIMenuItem(VanChartAttrHelper.X_AXIS_PREFIX); @@ -90,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/axis/radar/VanChartRadarXAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java index 3558443c4f..6e82234ea3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarXAxisPane.java @@ -1,13 +1,11 @@ package com.fr.van.chart.designer.style.axis.radar; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.gui.icombobox.LineComboBox; 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.stable.CoreConstants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.axis.VanChartBaseAxisPane; import javax.swing.JPanel; @@ -22,20 +20,13 @@ public class VanChartRadarXAxisPane extends VanChartBaseAxisPane { 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}; Component[][] components = new Component[][]{ - new Component[]{createLabelPane(new double[]{p, p, p}, column),null}, - new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize),null}, + new Component[]{createLabelPane(),null}, + new Component[]{createLineStylePane(),null}, new Component[]{createValueStylePane(),null}, }; - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1}); } protected boolean showLabelDisplay() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java index 0015676882..635d04fa40 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/radar/VanChartRadarYAxisPane.java @@ -1,19 +1,17 @@ package com.fr.van.chart.designer.style.axis.radar; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.LineComboBox; 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.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartValueAxis; import com.fr.stable.CoreConstants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.style.axis.VanChartValueAxisPane; import com.fr.van.chart.designer.style.axis.component.MinMaxValuePaneWithOutSecTick; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -33,21 +31,14 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { 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[]{createLabelPane(new double[]{p, p, p}, column), null}, - new Component[]{createMinMaxValuePane(new double[]{p, p, p}, columnSize), null}, - new Component[]{createLineStylePane(new double[]{p, p, p, p}, columnSize), null}, + new Component[]{createLabelPane(), null}, + new Component[]{createMinMaxValuePane(), null}, + new Component[]{createLineStylePane(), null}, new Component[]{createValueStylePane(), null}, }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } protected LineComboBox createLineComboBox() { @@ -55,16 +46,11 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { } @Override - protected JPanel createMinMaxValuePane(double[] row, double[] col) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - + protected JPanel createMinMaxValuePane() { valueStyle = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Axis_Unified_Count"), Toolkit.i18nText("Fine-Design_Chart_Respectively_Specified")}); - JPanel commenPane = createCommenValuePane(new double[]{p, p, p}, columnSize); + JPanel commenPane = createCommenValuePane(); tableDataPane = new RadarTableDataPane(); centerPane = new JPanel(new CardLayout()); @@ -81,9 +67,7 @@ public class VanChartRadarYAxisPane extends VanChartValueAxisPane { } }); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane); - contentPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - return panel; + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Value_Definition"), contentPane, true); } protected Component[][] getLineStylePaneComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java index ff50691601..7352ec7bc2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAreaPane.java @@ -1,6 +1,5 @@ package com.fr.van.chart.designer.style.background; -import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.Plot; import com.fr.chartx.config.info.constant.ConfigType; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; @@ -16,7 +15,6 @@ import java.util.ArrayList; import java.util.List; import java.awt.BorderLayout; -import static com.fine.swing.ui.layout.Layouts.cell; /** * 属性表, 图表样式-背景界面. @@ -35,10 +33,10 @@ public class VanChartAreaPane extends ThirdTabPane implements AutoSele protected void initLayout() { - this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); + this.setLayout(new BorderLayout()); if (!paneList.isEmpty()) { if (nameArray.length > 1) { - this.add(cell(tabPane).getComponent(), BorderLayout.NORTH); + this.add(tabPane, BorderLayout.NORTH); } } this.add(centerPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java index acd26d422d..6702db56bb 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAxisAreaPane.java @@ -1,12 +1,13 @@ package com.fr.van.chart.designer.style.background; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +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.gui.style.ColorSelectBoxWithThemeStyle; import com.fr.design.style.color.ColorSelectBox; import com.fr.general.ComparatorUtils; @@ -17,7 +18,6 @@ import com.fr.plugin.chart.type.LineType; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.LineTypeComboBox; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.CardLayout; @@ -59,19 +59,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane { horizonLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); verticalLineType = new LineTypeComboBox(new LineType[]{LineType.NONE, LineType.SOLID, LineType.DASHED}); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] columnSize = {f}; - double[] rowSize = {p, p, p}; - - Component[][] components = new Component[][]{ - new Component[]{createGridLinePane()}, - new Component[]{createAlertLinePane()}, - new Component[]{createIntervalPane(new double[]{p, p, p, p}, new double[]{f, s})}, - }; - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + JPanel panel = FineLayoutBuilder.createVerticalLayout(0, + createGridLinePane(), createAlertLinePane(), createIntervalPane() + ); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); } @@ -79,12 +69,12 @@ public class VanChartAxisAreaPane extends BasicBeanPane { protected JPanel createGridLinePane() { initGridLineComponents(); - JPanel panel = new JPanel(new BorderLayout(0, 4)); + JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Horizontal"), true), BorderLayout.NORTH); panel.add(createSingleGridLinePane(Toolkit.i18nText("Fine-Design_Chart_Direction_Vertical"), false), BorderLayout.CENTER); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Grid_Line"), panel, true); } protected void initGridLineComponents() { @@ -127,9 +117,9 @@ public class VanChartAxisAreaPane extends BasicBeanPane { LineTypeComboBox lineTypeComboBox = isHorizontal ? horizonLineType : verticalLineType; JPanel colorSelectPane = isHorizontal ? horizontalColorPane : verticalColorPane; - JPanel lineTypePane = TableLayout4VanChartHelper.createGapTableLayoutPane(title, lineTypeComboBox); + JPanel lineTypePane = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, new UILabel(title), lineTypeComboBox); - JPanel singleGridLinePane = new JPanel(new BorderLayout()); + JPanel singleGridLinePane = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); singleGridLinePane.add(lineTypePane, BorderLayout.NORTH); singleGridLinePane.add(colorSelectPane, BorderLayout.CENTER); @@ -139,22 +129,19 @@ public class VanChartAxisAreaPane extends BasicBeanPane { protected JPanel createAlertLinePane() { alertLine = getAlertLinePane(); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), alertLine); - alertLine.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - return panel; + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Alert_Line"), alertLine, true); } protected AlertLineListControlPane getAlertLinePane() { return new AlertLineListControlPane(); } - protected JPanel createIntervalPane(double[] row, double[] col) { + protected JPanel createIntervalPane() { isDefaultIntervalBackground = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Default_Interval"), Toolkit.i18nText("Fine-Design_Chart_Custom_Interval_Background")}); horizontalColorBackground = new ColorSelectBox(100); verticalColorBackground = new ColorSelectBox(100); Component[][] components = getIntervalPaneComponents(); - JPanel defaultPane = TableLayoutHelper.createTableLayoutPane(components, row, col); - defaultPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); + JPanel defaultPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); customIntervalBackground = getBackgroundListControlPane(); cardLayout = new CardLayout(); @@ -168,12 +155,11 @@ public class VanChartAxisAreaPane extends BasicBeanPane { } }); JPanel intervalPane = new JPanel(new BorderLayout(0, 6)); - JPanel panel1 = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), isDefaultIntervalBackground); + JPanel panel1 = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Interval_Background")), isDefaultIntervalBackground); intervalPane.add(panel1, BorderLayout.NORTH); intervalPane.add(centerPane, BorderLayout.CENTER); - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), intervalPane); - intervalPane.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - return panel; + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Interval_Background"), intervalPane); } protected BackgroundListControlPane getBackgroundListControlPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java index fbea849909..8df598dd05 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartGantPlotAreaBackgroundPane.java @@ -1,15 +1,14 @@ package com.fr.van.chart.designer.style.background; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.plugin.chart.gantt.VanChartGanttPlot; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -26,16 +25,8 @@ public class VanChartGantPlotAreaBackgroundPane extends VanChartAreaBackgroundPa @Override protected JPanel createContentPane() { JPanel contentPane = new JPanel(new BorderLayout()); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f}; - double[] rowSize = {p, p}; - Component[][] components = new Component[][]{ - new Component[]{createAxisBorderPane()}, - new Component[]{createContentBorderPane()} - }; - - contentPane.add(TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize), BorderLayout.CENTER); + contentPane.add(FineLayoutBuilder.createVerticalLayout( + 0, createAxisBorderPane(), createContentBorderPane()), BorderLayout.CENTER); return contentPane; } @@ -69,34 +60,28 @@ public class VanChartGantPlotAreaBackgroundPane extends VanChartAreaBackgroundPa private JPanel createAxisBorderPane() { axisColorPane = new ColorSelectBoxWithOutTransparent(100); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle( + return new UIExpandablePane( Toolkit.i18nText("Fine-Design_Chart_Gant_Axis_Border"), - createBorderPane(axisColorPane) + createBorderPane(axisColorPane), true ); } private JPanel createContentBorderPane() { contentColorPane = new ColorSelectBoxWithOutTransparent(100); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle( + return new UIExpandablePane( Toolkit.i18nText("Fine-Design_Chart_Gant_Content_Border"), createBorderPane(contentColorPane) ); } private JPanel createBorderPane(ColorSelectBoxWithOutTransparent colorPane) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, TableLayout4VanChartHelper.EDIT_AREA_WIDTH}; - double[] rowSize = {p, p}; - Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{ new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), colorPane } }; - return TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } } 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/VanChartPieValueLabelDetailPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java index 43f6da1e94..bd705b0e06 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPieValueLabelDetailPane.java @@ -68,16 +68,6 @@ public class VanChartPieValueLabelDetailPane extends VanChartPlotLabelDetailPane protected JPanel createLabelBackgroundPane() { VanChartBackgroundWithOutImagePane backgroundPane = new VanChartBackgroundWithOutImagePane() { - @Override - protected JPanel initContentPanel() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p}; - return TableLayout4VanChartHelper.createGapTableLayoutPane(getPaneComponents(), rowSize, columnSize); - } - @Override protected Component[][] getPaneComponents() { return new Component[][]{ 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 2cf72679f3..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; @@ -204,7 +202,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane { } protected JPanel createTableLayoutPaneWithTitle(String title, JPanel panel) { - return new UIExpandablePane(title, panel); + return new UIExpandablePane(title, panel, true); } protected TwoTuple getPositionNamesAndValues() { @@ -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 470e9ead02..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 @@ -1,6 +1,7 @@ package com.fr.van.chart.designer.style.series; import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.chart.chartdata.model.DataProcessor; import com.fr.base.chart.chartdata.model.LargeDataModel; @@ -105,7 +106,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP scrollPane.setViewportView(getContentInPlotType()); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); } - return column( + return column(0, cell(getColorPane()), cell(getContentInPlotType()) ).getComponent(); } @@ -125,7 +126,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //获取颜色面板 protected JPanel getColorPane() { - JPanel panel = new JPanel(new BorderLayout()); + JPanel panel = new JPanel(new BorderLayout(0, FineUIScale.scale(10))); stylePane = createStylePane(); vanChartFillStylePane = getVanChartFillStylePane(); if (vanChartFillStylePane != null) { @@ -158,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() { @@ -174,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); } //边框(默认没有圆角) @@ -205,7 +206,8 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP checkLarge(); } }); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Large_Model"), largeDataModelGroup); + JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Large_Model")), largeDataModelGroup); return createLargeDataModelPane(panel); } @@ -227,8 +229,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } protected JPanel createLargeDataModelPane(JPanel jPanel) { - JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel); - return panel; + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Large_Data"), jPanel, true); } protected UIButtonGroup createLargeDataModelGroup() { @@ -270,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/designer/style/tooltip/VanChartPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java index 5c7e7dd2ed..e93c9690c7 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java @@ -7,12 +7,10 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; 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.plugin.chart.base.AttrTooltip; import com.fr.van.chart.designer.PlotFactory; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.background.VanChartBackgroundWithOutImagePane; import com.fr.van.chart.designer.component.border.VanChartBorderWithRadiusPane; @@ -93,11 +91,6 @@ public class VanChartPlotTooltipPane extends BasicPane { showAllSeries = new UICheckBox(getShowAllSeriesLabelText()); followMouse = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow_Mouse"), Toolkit.i18nText("Fine-Design_Chart_Not_Follow_Mouse")}); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = { p,p,p}; Component[][] components = new Component[3][2]; components[0] = new Component[]{null,null}; components[1] = new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")), UIComponentUtils.wrapWithBorderLayoutPane(followMouse)}; @@ -105,7 +98,7 @@ public class VanChartPlotTooltipPane extends BasicPane { if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){ components[2] = new Component[]{showAllSeries,null}; } - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy"), panel); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java index 7ada5f9c58..16659efcd8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/other/VanChartDrillMapInteractivePane.java @@ -1,11 +1,12 @@ package com.fr.van.chart.drillmap.designer.other; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.base.DrillMapTools; import com.fr.chart.chartattr.Chart; +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.backgroundpane.ColorBackgroundQuickPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.mode.ChartEditContext; @@ -16,11 +17,9 @@ import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.background.VanChartBackgroundPaneWithOutImageAndShadow; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom; -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.Component; /** @@ -36,26 +35,21 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith @Override protected JPanel getInteractivePane(VanChartPlot plot) { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p, p, p, p, p, p, p, p}; Component[][] components = ChartEditContext.normalMode() ? new Component[][]{ - new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null}, + new Component[]{createToolBarPane(), null}, new Component[]{createAnimationPane(), null}, new Component[]{createZoomPane(plot), null}, new Component[]{createDrillToolsPane(), null}, new Component[]{createAutoRefreshPane(plot), null}, new Component[]{createHyperlinkPane(), null} } : new Component[][]{ - new Component[]{createToolBarPane(new double[]{p, p, p}, columnSize), null}, + new Component[]{createToolBarPane(), null}, new Component[]{createAnimationPane(), null}, new Component[]{createZoomPane(plot), null}, new Component[]{createDrillToolsPane(), null} }; - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } private JPanel createDrillToolsPane() { @@ -65,12 +59,7 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith @Override protected JPanel getContentPane(JPanel buttonPane) { - double p = TableLayout.PREFERRED; - double e = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] columnSize = {e}; - double[] rowSize = {p, p}; - - return TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize); + return FineLayoutBuilder.compatibleTableLayout(10, getComponents(buttonPane), new double[]{1.2, 3}); } @Override @@ -96,10 +85,6 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith }; catalogSuperLink = new VanChartCatalogHyperLinkPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f}; - double[] rowSize = {p, p, p, p, p, p}; Component[][] components = ChartEditContext.duchampMode() ? new Component[][]{ new Component[]{null}, new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Character"), textAttrPane)}, @@ -112,11 +97,9 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith new Component[]{selectBackgroundPane}, new Component[]{catalogSuperLink} }; - drillPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + drillPane = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); - JPanel panel = new JPanel(new BorderLayout()); - panel.add(openOrClosePane, BorderLayout.NORTH); - panel.add(drillPane, BorderLayout.CENTER); + JPanel panel = FineLayoutBuilder.createVerticalLayout(10, openOrClosePane, drillPane); openOrClose.addChangeListener(new ChangeListener() { @Override @@ -124,16 +107,14 @@ public class VanChartDrillMapInteractivePane extends VanChartInteractivePaneWith checkEnable(); } }); - - JPanel panel1 = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Drill"), panel); - panel.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - return panel1; + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Drill"), panel); } private JPanel createTitlePane(String title, Component component) { - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(title, component, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH); - panel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - return panel; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(title), component} + }; + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1.2, 3}); } private void checkEnable() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java index 150f9c913d..d22c3a3af3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/VanChartGanttDataAndLinkPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.gantt.designer.data; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; @@ -55,6 +56,7 @@ public class VanChartGanttDataAndLinkPane extends MultiTabPane paneList = initPaneList(); initComponents(); + setBorder(new ScaledEmptyBorder(10, 0, 0, 0)); } private void initComponents(){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java index e5b2435b1e..1d53034ddf 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotReportDataContentPane.java @@ -1,11 +1,11 @@ package com.fr.van.chart.gantt.designer.data.data; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.van.chart.gantt.designer.data.data.component.GanttReportDataContentPane; import com.fr.van.chart.gantt.designer.data.data.component.GanttReportDataProjectPane; -import javax.swing.BorderFactory; import java.awt.BorderLayout; /** @@ -14,12 +14,10 @@ import java.awt.BorderLayout; public class GanttPlotReportDataContentPane extends AbstractReportDataContentPane { private GanttReportDataProjectPane projectPane; private GanttReportDataContentPane contentPane; - private static final int V_GAP = 7; public GanttPlotReportDataContentPane() { initComponent(); - this.setLayout(new BorderLayout(0, V_GAP)); - projectPane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.add(projectPane, BorderLayout.NORTH); this.add(contentPane, BorderLayout.CENTER); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java index feab3545db..347776827f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/GanttPlotTableDataContentPane.java @@ -1,11 +1,11 @@ package com.fr.van.chart.gantt.designer.data.data; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.van.chart.gantt.designer.data.data.component.GanttTableDataContentPane; import com.fr.van.chart.gantt.designer.data.data.component.GanttTableDataProjectPane; -import javax.swing.BorderFactory; import javax.swing.JSeparator; import java.awt.BorderLayout; import java.util.List; @@ -16,12 +16,10 @@ import java.util.List; public class GanttPlotTableDataContentPane extends AbstractTableDataContentPane { private GanttTableDataProjectPane projectPane; private GanttTableDataContentPane contentPane; - private static final int V_GAP = 7; public GanttPlotTableDataContentPane() { initComponent(); - this.setLayout(new BorderLayout(0, V_GAP)); - projectPane.setBorder(BorderFactory.createEmptyBorder(0,17,0,15)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.add(projectPane, BorderLayout.NORTH); this.add(new JSeparator(), BorderLayout.CENTER); this.add(contentPane, BorderLayout.SOUTH); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java index c00109db92..9c5e671c2d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java @@ -6,13 +6,15 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; -import javax.swing.BorderFactory; import javax.swing.Icon; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.awt.Dimension; 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; + /** * Created by hufan on 2017/1/10. */ @@ -20,8 +22,6 @@ public abstract class ComboBoxWithButtonPane extends JPanel { private UIComboBox comboBoxName; private UIButton button; private int index = 0; - private static final int H_GAP = 5; - private static final int LEFT_GAP = 7; private UIObserverListener listener; public ComboBoxWithButtonPane() { @@ -31,20 +31,16 @@ public abstract class ComboBoxWithButtonPane extends JPanel { public ComboBoxWithButtonPane(int index) { this.index = index; comboBoxName = new UIComboBox(); - comboBoxName.setPreferredSize(new Dimension(80,20)); button = new UIButton(getButtonIcon()); - button.setPreferredSize(new Dimension(20, 20)); button.addActionListener(getButtonListener()); UILabel title = new UILabel(getTitleText()); - title.setPreferredSize(new Dimension(80, 20)); - this.setLayout(new BorderLayout(H_GAP, 0)); - this.add(comboBoxName, BorderLayout.CENTER); - this.add(button, BorderLayout.EAST); - this.add(title, BorderLayout.WEST); - this.setBorder(BorderFactory.createEmptyBorder(0, LEFT_GAP, 0, 0)); + this.setLayout(new BorderLayout()); + this.add(row( + cell(title).weight(1.2), cell(comboBoxName).weight(2.4), flex(0.1), cell(button).weight(0.5) + ).getComponent()); } protected abstract String getTitleText(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java index 57f2463865..398e59fbed 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataContentPane.java @@ -1,21 +1,23 @@ package com.fr.van.chart.gantt.designer.data.data.component; +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.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; 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.data.report.AbstractReportDataContentPane; import com.fr.plugin.chart.gantt.data.VanGanttReportDefinition; import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper; -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.flex; +import static com.fine.swing.ui.layout.Layouts.row; /** * Created by hufan on 2017/1/11. @@ -29,13 +31,11 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ private TinyFormulaPane linkID; public GanttReportDataContentPane() { - this.setLayout(new BorderLayout()); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); initAllComponent(); JPanel panel = getContentPane(); - panel.setBorder(BorderFactory.createEmptyBorder(10,24,0,15)); this.add(getJSeparator(), BorderLayout.NORTH); this.add(panel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); } @@ -57,25 +57,16 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ return new DefaultTinyFormulaPane() { @Override protected void initLayout() { - this.setLayout(new BorderLayout(4, 0)); - + this.setLayout(new BorderLayout()); UILabel label = new UILabel(title); - 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()); } }; } private JPanel getContentPane(){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p,p}; - double[] col = {f}; - Component[][] components = new Component[][]{ new Component[]{seriesName}, new Component[]{startTime}, @@ -85,7 +76,7 @@ public class GanttReportDataContentPane extends AbstractReportDataContentPane{ new Component[]{linkID} }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java index 14691049a1..6da45224d8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttReportDataProjectPane.java @@ -1,5 +1,7 @@ package com.fr.van.chart.gantt.designer.data.data.component; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.event.UIObserver; @@ -25,7 +27,7 @@ public class GanttReportDataProjectPane extends AbstractReportDataContentPane im private List processPaneList = new ArrayList(); public GanttReportDataProjectPane() { - firstProcessPane = new TinyFormulaWithButtonPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Project_Name"), "/com/fr/design/images/buttonicon/add.png") { + firstProcessPane = new TinyFormulaWithButtonPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Project_Name"), new LazyIcon("add")) { @Override protected void buttonEvent(TinyFormulaWithButtonPane pane) { addProcessPane(); @@ -38,7 +40,7 @@ public class GanttReportDataProjectPane extends AbstractReportDataContentPane im }; firstProcessPane.registerChangeListener(listener); - this.setLayout(new BorderLayout(0, 7)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.add(firstProcessPane, BorderLayout.NORTH); if (center != null) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java index 82bb26e438..aaf2db78d9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataContentPane.java @@ -1,11 +1,10 @@ package com.fr.van.chart.gantt.designer.data.data.component; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.gui.icombobox.UIComboBox; 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.data.table.AbstractTableDataContentPane; import com.fr.general.ComparatorUtils; @@ -13,11 +12,9 @@ import com.fr.plugin.chart.gantt.data.VanGanttTableDefinition; import com.fr.stable.StringUtils; import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.util.List; /** @@ -36,10 +33,7 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ public GanttTableDataContentPane() { this.setLayout(new BorderLayout()); initAllComponent(); - JPanel panel = getContentPane(); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); - this.add(panel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); + this.add(getContentPane(), BorderLayout.CENTER); } @@ -62,10 +56,6 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ } private JPanel getContentPane(){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p,p}; - double[] col = {p,f}; Component[][] components = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesComboBox}, @@ -76,7 +66,7 @@ public class GanttTableDataContentPane extends AbstractTableDataContentPane{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Task_ID")), taskIDComboBox} }; - return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java index a7b9955406..abe44f4461 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/GanttTableDataProjectPane.java @@ -1,6 +1,7 @@ package com.fr.van.chart.gantt.designer.data.data.component; -import com.fr.base.BaseUtils; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineUIScale; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.event.UIObserver; @@ -44,7 +45,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl @Override protected Icon getButtonIcon(){ - return BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png"); + return new LazyIcon("add"); } @Override protected ActionListener getButtonListener(){ @@ -58,7 +59,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl } }; - this.setLayout(new BorderLayout(0, V_GAP)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); if (center != null) { this.add(center, BorderLayout.CENTER); @@ -93,7 +94,7 @@ public class GanttTableDataProjectPane extends AbstractTableDataContentPane impl @Override protected Icon getButtonIcon() { - return BaseUtils.readIcon("/com/fr/design/images/buttonicon/delete.png"); + return new LazyIcon("delete"); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java index 1dee2835ce..9a7911fb17 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/TinyFormulaWithButtonPane.java @@ -1,20 +1,25 @@ package com.fr.van.chart.gantt.designer.data.data.component; +import com.fine.theme.icon.LazyIcon; +import com.fr.base.svg.IconUtils; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.chart.gui.UIEditLabel; -import com.fr.general.IOUtils; +import javax.swing.Icon; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; -import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; + /** * Created by hufan on 2017/1/11. */ @@ -26,10 +31,10 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse protected UIObserverListener listener; public TinyFormulaWithButtonPane(String text) { - this(text, "/com/fr/design/images/buttonicon/delete.png"); + this(text, new LazyIcon("delete")); } - public TinyFormulaWithButtonPane(String text, String iconUrl) { + public TinyFormulaWithButtonPane(String text, Icon icon) { editLabel = new UIEditLabel(text,SwingConstants.LEFT){ protected void doAfterMousePress(){ clearAllBackground(); @@ -40,19 +45,19 @@ public abstract class TinyFormulaWithButtonPane extends JPanel implements UIObse return false; } }; - editLabel.setPreferredSize(new Dimension(80,20)); tinyFormulaPane = new DefaultTinyFormulaPane(); - UIButton button = new UIButton(IOUtils.readIcon(iconUrl)); - button.setPreferredSize(new Dimension(20, 20)); + UIButton button = new UIButton(icon); button.addActionListener(initButtonListener(this)); + this.setLayout(new BorderLayout()); + this.add(row( + cell(editLabel).weight(1.2), cell(tinyFormulaPane).weight(2.4), flex(0.1), cell(button).weight(0.5) + ).getComponent()); + } - this.setLayout(new BorderLayout(4, 0)); - - this.add(editLabel, BorderLayout.WEST); - this.add(tinyFormulaPane, BorderLayout.CENTER); - this.add(button, BorderLayout.EAST); + public TinyFormulaWithButtonPane(String text, String iconUrl) { + this(text, IconUtils.readIcon(iconUrl)); } private ActionListener initButtonListener(final TinyFormulaWithButtonPane pane){ diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java index 1d1c602218..d254e15997 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkReportDataContentPane.java @@ -1,21 +1,22 @@ package com.fr.van.chart.gantt.designer.data.link; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; 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.data.report.AbstractReportDataContentPane; import com.fr.plugin.chart.gantt.data.VanGanttLinkReportDefinition; import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper; -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.flex; +import static com.fine.swing.ui.layout.Layouts.row; /** * Created by hufan on 2017/1/12. @@ -29,7 +30,6 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan this.setLayout(new BorderLayout()); initAllComponent(); JPanel panel = getContentPane(); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.add(panel, BorderLayout.CENTER); } private void initAllComponent() { @@ -44,32 +44,23 @@ public class GanttLinkReportDataContentPane extends AbstractReportDataContentPan return new DefaultTinyFormulaPane() { @Override protected void initLayout() { - this.setLayout(new BorderLayout(4, 0)); - - UILabel label = new UILabel(title ); - 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.setLayout(new BorderLayout()); + UILabel label = new UILabel(title); + this.add(row( + cell(label).weight(1.2), cell(formulaTextField).weight(2.4), flex(0.1), cell(formulaTextFieldButton).weight(0.5) + ).getComponent()); } }; } private JPanel getContentPane(){ - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p}; - double[] col = {f}; - Component[][] components = new Component[][]{ new Component[]{startTaskID}, new Component[]{endTaskID}, new Component[]{linkType} }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java index 427c5906d2..7ba594907b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/link/GanttLinkTableDataContentPane.java @@ -1,22 +1,19 @@ package com.fr.van.chart.gantt.designer.data.link; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.gui.icombobox.UIComboBox; 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.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.gantt.data.VanGanttLinkTableDefinition; import com.fr.stable.StringUtils; import com.fr.van.chart.gantt.designer.data.data.GanttDataPaneHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.util.List; /** @@ -31,9 +28,7 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane this.setLayout(new BorderLayout()); initAllComponent(); JPanel panel = getContentPane(); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.add(panel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); } @@ -47,18 +42,13 @@ public class GanttLinkTableDataContentPane extends AbstractTableDataContentPane } private JPanel getContentPane(){ - 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_Start_Task_ID")), startTaskIDComboBox}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Task_ID")), endTaskIDComboBox}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Link_Type")), linkTypeComboBox} }; - return TableLayoutHelper.createGapTableLayoutPane(components, row, col,24,6); + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java index fe0d2d6771..ca01053e85 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePane.java @@ -1,16 +1,14 @@ package com.fr.van.chart.gantt.designer.style.axis; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPaneWithPercent; 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.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttr; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -39,15 +37,9 @@ public class GanttAxisStylePane extends BasicBeanPane { public GanttAxisStylePane() { initComponents(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p, p, p}; - double[] col = {f, e}; - Component[][] components = getUsedComponents(); - JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col); + JPanel content = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); this.setLayout(new BorderLayout()); this.add(content, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java index 102b0c2321..7b920d7652 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttAxisStylePaneWithPosition.java @@ -1,14 +1,12 @@ package com.fr.van.chart.gantt.designer.style.axis; -import com.fr.base.BaseUtils; +import com.fine.theme.utils.FineComponentsFactory; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttr; import com.fr.plugin.chart.gantt.attr.GanttAxisStyleAttrWithPosition; -import com.fr.stable.Constants; -import javax.swing.Icon; import java.awt.Component; /** @@ -22,11 +20,7 @@ public class GanttAxisStylePaneWithPosition extends GanttAxisStylePane { protected void initComponents() { super.initComponents(); - Icon[] alignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), - BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_right_normal.png")}; - Integer[] alignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT}; - alignmentPane = new UIButtonGroup<>(alignmentIconArray, alignment); + alignmentPane = FineComponentsFactory.createHorizontalAlignmentButtonGroup(); } protected Component[][] getUsedComponents() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java index c2461899b5..cc37b54440 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttProcessAxisPane.java @@ -1,17 +1,16 @@ package com.fr.van.chart.gantt.designer.style.axis; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.chart.chartattr.Plot; +import com.fr.design.foldablepane.UIExpandablePane; 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.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.plugin.chart.gantt.attr.GanttProcessAxis; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.AbstractVanChartScrollPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -32,20 +31,12 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane { @Override protected JPanel createContentPane() { - - 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[]{createHorizontalProportionPane()}, - new Component[]{createHorizontalHeaderPane()}, - new Component[]{createVerticalHeaderPane()}, - new Component[]{createBodyPane()} - }; - - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.createVerticalLayout(0, + createHorizontalProportionPane(), + createHorizontalHeaderPane(), + createVerticalHeaderPane(), + createBodyPane() + ); } protected void layoutContentPane() { @@ -56,19 +47,19 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane { private Component createBodyPane() { bodyPane = new GanttAxisStylePaneWithPosition(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), bodyPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Content"), bodyPane); } private Component createHorizontalHeaderPane() { horizontalHeaderPane = new GanttAxisStylePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Table"), horizontalHeaderPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Table"), horizontalHeaderPane, true); } private Component createVerticalHeaderPane() { verticalHeaderPane = new GanttAxisStylePaneWithPosition(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Vertical_Table"), verticalHeaderPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Vertical_Table"), verticalHeaderPane, true); } private Component createHorizontalProportionPane() { @@ -91,9 +82,10 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane { } }); - JPanel jPanel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion"), panel); + JPanel jPanel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Horizontal_Proportion")), panel); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Function_Percent"), jPanel, true); } private void checkoutPaneVisible() { @@ -119,7 +111,7 @@ public class GanttProcessAxisPane extends AbstractVanChartScrollPane { @Override public void updateBean(VanChart vanChart){ - VanChartGanttPlot ganttPlot = (VanChartGanttPlot) vanChart.getPlot(); + VanChartGanttPlot ganttPlot = vanChart.getPlot(); GanttProcessAxis processAxis = new GanttProcessAxis(); processAxis.setCustomProportion(typeButton.getSelectedIndex() == 1); diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java index 2f65faeccc..bb40c4902d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/axis/GanttTimeAxisPane.java @@ -1,17 +1,16 @@ package com.fr.van.chart.gantt.designer.style.axis; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.plugin.chart.gantt.attr.GanttTimeAxis; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.vanchart.VanChart; import com.fr.van.chart.designer.AbstractVanChartScrollPane; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.Component; @@ -35,10 +34,6 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane { @Override protected JPanel createContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p}; - double[] col = {f}; Component[][] components = new Component[][]{ new Component[]{createConditionConfigPane()}, @@ -46,7 +41,7 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane { new Component[]{createDownHeadPane()}, }; - return TableLayoutHelper.createTableLayoutPane(components, row, col); + return FineLayoutBuilder.compatibleTableLayout(0, components, new double[]{1}); } protected void layoutContentPane() { @@ -57,13 +52,13 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane { private Component createDownHeadPane() { downHeadPane = new GanttAxisStylePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Down_Head_Table"),downHeadPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Down_Head_Table"),downHeadPane); } private Component createUpHeadPane() { upHeadPane = new GanttAxisStylePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Up_Head_Table"),upHeadPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Up_Head_Table"),upHeadPane, true); } private Component createConditionConfigPane() { @@ -71,12 +66,6 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane { initialLevel = new UIComboBox(ZOOM_LEVELS); weekendTooltip = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p, p, p}; - double[] col = {f, e}; - Component[][] components = new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Time_Zoom")), timeZoom}, @@ -84,9 +73,9 @@ public class GanttTimeAxisPane extends AbstractVanChartScrollPane { new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Weekend_Tooltip")), weekendTooltip} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Condition_Config"),panel); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Condition_Config"),panel, true); } @Override diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java index a62f054e7f..380047194b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java @@ -1,19 +1,18 @@ package com.fr.van.chart.gantt.designer.style.series; +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.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.LineComboBox; 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.ChartStylePane; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.stable.CoreConstants; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.VanChartBeautyPane; import com.fr.van.chart.designer.component.VanChartGanttTimeLinePane; import com.fr.van.chart.designer.component.VanChartMarkerPane; @@ -40,49 +39,33 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { @Override protected JPanel getContentInPlotType() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] row = {p,p,p,p,p}; - double[] col = {f}; - - Component[][] components = new Component[][]{ - new Component[]{createGanntStylePane()}, - new Component[]{createLinkLinePane()}, - new Component[]{createMarkerPane()}, - new Component[]{createLargeDataModelPane()}, - new Component[]{createGuideLinePane()} - }; - - contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col); + contentPane = FineLayoutBuilder.createVerticalLayout(0, + createGanntStylePane(), + createLinkLinePane(), + createLargeDataModelPane(), + createGuideLinePane() + ); return contentPane; } private JPanel createGanntStylePane(){ seriesNewLine = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Open"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Close")}); - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_New_Line"),seriesNewLine); - JPanel ganntStylePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Pattern"), panel); - return ganntStylePane; + JPanel panel = FineLayoutBuilder.createHorizontalLayout(0, new double[]{1.2, 3}, + new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_New_Line")), seriesNewLine); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Pattern"), panel, true); } private JPanel createLinkLinePane(){ lineWidth = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); colorSelect = new ColorSelectBoxWithOutTransparent(100); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] col = {f, e}; - double[] row = {p,p,p}; - Component[][] components = new Component[][]{ - new Component[]{null, null}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), lineWidth}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), colorSelect} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); - JPanel linkLinePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Link_Line"), panel); - return linkLinePane; + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Link_Line"), panel, true); } //标记点类型 @@ -98,12 +81,12 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane { return new VanChartImageMarkerWithoutWidthAndHeightPane(); } }; - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gannt_Marker"), markerPane); + return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gannt_Marker"), markerPane, true); } protected JPanel createGuideLinePane() { timeLinePane = new VanChartGanttTimeLinePane(); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Identify"), timeLinePane); + return new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Guide_Line_Identify"), timeLinePane); } @Override 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/map/designer/type/GeoUrlPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java index c69297fa86..23c8580495 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GeoUrlPane.java @@ -1,8 +1,9 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.icon.LazyIcon; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Parameter; import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; -import com.fr.design.constants.LayoutConstants; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.file.HistoryTemplateListCache; @@ -11,18 +12,14 @@ import com.fr.design.gui.icombobox.FRTreeComboBox; 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.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; -import com.fr.general.IOUtils; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.designer.type.GEOJSONTreeHelper; import com.fr.plugin.chart.map.server.ChartGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.type.MapType; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; import com.fr.workspace.WorkContext; @@ -123,7 +120,7 @@ public class GeoUrlPane extends JPanel implements UIObserver { boolean hasRefreshButton = !WorkContext.getCurrent().isLocal(); - UIButton button = new UIButton(IOUtils.readIcon("/com/fr/design/images/control/refresh.png")); + UIButton button = new UIButton(new LazyIcon("refresh")); button.setToolTipText(Toolkit.i18nText("Fine-Design_Chart_Update_Remote_Map_JSON")); button.addActionListener(new ActionListener() { @Override @@ -133,23 +130,17 @@ public class GeoUrlPane extends JPanel implements UIObserver { } }); - double p = TableLayout.PREFERRED; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double f = TableLayout.FILL; - double[] rowSize = {p, p}; - double[] columnSize = hasRefreshButton ? new double[]{d + 10, e - 20, 20} : new double[]{f, e}; - Component[] comps = hasRefreshButton ? new Component[]{sourceTitleLabel, sourceComboBox, button} : new Component[]{sourceTitleLabel, sourceComboBox}; - double hGap = hasRefreshButton ? 0 : TableLayout4VanChartHelper.COMPONENT_INTERVAL; + double[] weight = hasRefreshButton ? new double[]{1.2, 2.5, 0.5} : new double[]{1.2, 3}; + Component[][] components = new Component[][]{ new Component[]{null, null}, comps, }; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, hGap, LayoutConstants.VGAP_LARGE); + return FineLayoutBuilder.compatibleTableLayout(0, components, weight); } protected UILabel createSourceTitleLabel() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java index 37f178e196..17634d1406 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.Utils; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; @@ -8,8 +9,6 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; @@ -20,9 +19,7 @@ import com.fr.plugin.chart.map.server.MapLayerConfigManager; import com.fr.plugin.chart.type.GISLayerType; import com.fr.plugin.chart.type.GaoDeGisType; import com.fr.plugin.chart.type.ZoomLevel; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; import javax.swing.event.PopupMenuEvent; @@ -123,22 +120,12 @@ public class GisLayerPane extends JPanel implements UIObserver { layerPaneCheckPane.add(standardLayers, "standard"); layerPaneCheckPane.add(customLayers, "custom"); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double[] row = {p, p, p}; - double[] col = {f, e}; - Component[][] components = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Gis_Layer")), gisButton}, new Component[]{null, layerPaneCheckPane}, new Component[]{layerCardPane, null}, }; - - JPanel panel = TableLayoutHelper.createTableLayoutPane(components, row, col); - panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); - return panel; + return FineLayoutBuilder.compatibleTableLayout(10, components, new double[]{1.2, 3}); } private void initLayerCardPane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java index 668a9b7745..9bcb197e3d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/MapStatusPane.java @@ -1,18 +1,17 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineLayoutBuilder; +import com.fine.theme.utils.FineUIScale; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.TableLayout; import com.fr.plugin.chart.base.ViewCenter; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.stable.ArrayUtils; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -76,30 +75,22 @@ public class MapStatusPane extends JPanel { longitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0); latitude = new UISpinner(-Double.MAX_VALUE, Double.MAX_VALUE, 1, 0.0); - double p = TableLayout.PREFERRED; - double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; - double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; - double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; - double[] rowSize = {p, p, p}; - double[] columnSize = {d, e}; - double[] column = {d, s}; Component[][] comps = new Component[][]{ new Component[]{null, null}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), zoomLevel}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_View_Center")), viewCenterCom}, }; - levelAndCenterPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, columnSize); + levelAndCenterPane = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3}); Component[][] longAndLatComps = new Component[][]{ new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude} }; - longAndLatPane = TableLayout4VanChartHelper.createGapTableLayoutPane(longAndLatComps, rowSize, column); - longAndLatPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); + longAndLatPane = FineLayoutBuilder.compatibleTableLayout(10, longAndLatComps, new double[]{1.2, 3}); longAndLatPane.setVisible(false); - this.setLayout(new BorderLayout(0, 6)); + this.setLayout(new BorderLayout(0, FineUIScale.scale(10))); this.add(levelAndCenterPane, BorderLayout.NORTH); this.add(longAndLatPane, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java index 4101fbd9d5..25e4316df0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/TileLayerPane.java @@ -1,10 +1,9 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextarea.UITextArea; -import com.fr.design.layout.TableLayout; import com.fr.plugin.chart.base.GisLayer; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.awt.BorderLayout; @@ -22,18 +21,13 @@ public class TileLayerPane extends JPanel { public TileLayerPane() { - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p}; - double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH - 3}; - customTileLayer = new UITextArea(); attribution = new UITextArea(); Component[][] comps = new Component[][]{ new Component[]{new UILabel("url"), customTileLayer}, new Component[]{new UILabel("Attribution"), attribution} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); - panel.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, comps, new double[]{1.2, 3}); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java index 5be437619c..43ef07ca67 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapSourceChoosePane.java @@ -1,15 +1,14 @@ package com.fr.van.chart.map.designer.type; +import com.fine.theme.utils.FineLayoutBuilder; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; +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.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; -import com.fr.van.chart.designer.TableLayout4VanChartHelper; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -33,26 +32,18 @@ public class VanChartMapSourceChoosePane extends JPanel implements UIObserver { initGisLayerPane(); this.setLayout(new BorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 5, 0, 0)); - double p = TableLayout.PREFERRED; - double[] columnSize = {230}; - double[] rowSize = {p, p, p, p, p, p, p, p}; + JPanel panel = FineLayoutBuilder.createVerticalLayout(10, geoUrlPane, gisLayerPane); - JPanel panel = new JPanel(new BorderLayout()); + JPanel basePane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Report_Basic"), panel, true); - panel.add(geoUrlPane, BorderLayout.NORTH); - panel.add(gisLayerPane, BorderLayout.CENTER); - - JPanel basePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Report_Basic"), panel); - - JPanel mapStatusPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), mapStatusPane); + JPanel mapStatusPaneWithTitle = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Map_Init_Status"), mapStatusPane); Component[][] comps = new Component[][]{ new Component[]{basePane}, new Component[]{mapStatusPaneWithTitle} }; - JPanel contentPane = TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize); - + JPanel contentPane = FineLayoutBuilder.compatibleTableLayout(0, comps, new double[]{1}); + this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10)); this.add(contentPane, BorderLayout.CENTER); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java index cace219db2..0e5b100530 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/multilayer/data/MultiPiePlotReportDataContentPane.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.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.event.UIObserver; @@ -9,19 +11,15 @@ import com.fr.design.formula.TinyFormulaPane; 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.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.plugin.chart.multilayer.data.MultiPieReportDataDefinition; import com.fr.stable.AssistUtils; -import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.JSeparator; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.util.ArrayList; import java.util.List; @@ -57,19 +55,13 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent contentPane = new JPanel(); - contentPane.setLayout(new BorderLayout(0, 5)); + contentPane.setLayout(new BorderLayout(0, FineUIScale.scale(10))); contentPane.add(north, BorderLayout.NORTH); contentPane.add(center, BorderLayout.CENTER); - contentPane.setBorder(BorderFactory.createEmptyBorder(0,20,4,10)); } private JPanel createNorthPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize_north = {f, COMPONENT_WIDTH}; - double[] rowSize_north = {p, p, p}; - levelNumEdit = new UISpinner(1, 15, 1, levelNum){ @Override protected void fireStateChanged() { @@ -90,7 +82,6 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent }; nameField = new UITextField(); - nameField.setPreferredSize(new Dimension(WD, HT)); Component[][] components_north = new Component[][]{ new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_MultiPie_Series_Name")), nameField}, @@ -98,7 +89,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Level_Number")), levelNumEdit}, }; - return TableLayoutHelper.createTableLayoutPane(components_north, rowSize_north, columnSize_north); + return FineLayoutBuilder.compatibleTableLayout(10, components_north, new double[]{1.2, 3}); } private void refreshCenterPane(){ @@ -119,16 +110,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent } private JPanel createCenterPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize_center = {f, COMPONENT_WIDTH}; - double[] rowSize_center = new double[levelNum + 2]; - initLevelNameList(); - - for (int i = 0; i < levelNum + 2; i++){ - rowSize_center[i] = p; - } Component[][] components_center = new Component[levelNum + 2][]; for (int i = 0; i < levelNum; i++){ @@ -142,7 +124,7 @@ public class MultiPiePlotReportDataContentPane extends AbstractReportDataContent registerListener4Center(); - return TableLayoutHelper.createTableLayoutPane(components_center,rowSize_center,columnSize_center); + return FineLayoutBuilder.compatibleTableLayout(10, components_center,new double[]{1.2, 3}); } /** 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-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java index 11f94ef87b..d01241c60b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotReportDataContentPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.structure.desinger.data; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.formula.DefaultTinyFormulaPane; @@ -7,12 +8,9 @@ import com.fr.design.formula.TinyFormulaPane; 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.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.plugin.chart.structure.data.StructureReportDefinition; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -29,10 +27,6 @@ public class StructurePlotReportDataContentPane extends AbstractReportDataConten private TinyFormulaPane nodeValue; public StructurePlotReportDataContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p}; nodeName = new DefaultTinyFormulaPane(); nodeID = new DefaultTinyFormulaPane(); @@ -48,8 +42,7 @@ public class StructurePlotReportDataContentPane extends AbstractReportDataConten new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Value")), nodeValue}, }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2,3}); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java index f91f6641eb..6ca5cdce50 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/structure/desinger/data/StructurePlotTableDataContentPane.java @@ -1,5 +1,6 @@ package com.fr.van.chart.structure.desinger.data; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.data.util.function.AbstractDataFunction; @@ -7,18 +8,14 @@ import com.fr.design.gui.icombobox.UIComboBox; 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.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.structure.data.StructureTableDefinition; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.util.List; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; /** * Created by shine on 2017/2/15. @@ -32,11 +29,6 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP private CalculateComboBox calculateCombox; public StructurePlotTableDataContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p, p, p, p, p, p}; - nodeName = new UIComboBox(); nodeId = new UIComboBox(); parenrId = new UIComboBox(); @@ -53,11 +45,9 @@ public class StructurePlotTableDataContentPane extends AbstractTableDataContentP new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox} }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java index d924004881..749d0e3db1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotReportDataContentPane.java @@ -1,17 +1,15 @@ package com.fr.van.chart.wordcloud.designer.data; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.design.formula.DefaultTinyFormulaPane; import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; -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.plugin.chart.wordcloud.data.WordCloudReportDefinition; -import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -26,10 +24,6 @@ public class WordCloudPlotReportDataContentPane extends AbstractReportDataConten private TinyFormulaPane wordValue; public WordCloudPlotReportDataContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = { p, p, p}; name = new UITextField(); wordName = new DefaultTinyFormulaPane(); @@ -41,9 +35,7 @@ public class WordCloudPlotReportDataContentPane extends AbstractReportDataConten new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Word_Value")), wordValue} }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,24,6); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); - + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); this.setLayout(new BorderLayout()); this.add(panel, BorderLayout.CENTER); diff --git a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java index e7f5f2af08..6cd4f59b84 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/data/WordCloudPlotTableDataContentPane.java @@ -1,23 +1,20 @@ package com.fr.van.chart.wordcloud.designer.data; +import com.fine.theme.utils.FineLayoutBuilder; import com.fr.base.chart.chartdata.TopDefinitionProvider; import com.fr.chart.chartattr.ChartCollection; import com.fr.data.util.function.AbstractDataFunction; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.wordcloud.data.WordCloudTableDefinition; -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 java.util.List; /** @@ -31,10 +28,6 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP private CalculateComboBox calculateCombox; public WordCloudPlotTableDataContentPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = { p, p, p, p}; name = new UITextField(); wordName = new UIComboBox(); @@ -49,12 +42,10 @@ public class WordCloudPlotTableDataContentPane extends AbstractTableDataContentP new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")), calculateCombox} }; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize); + JPanel panel = FineLayoutBuilder.compatibleTableLayout(10, components,new double[]{1.2, 3}); this.setLayout(new BorderLayout()); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); this.add(panel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(246,(int)this.getPreferredSize().getHeight())); } diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java index 97efbda442..2e622b6b08 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/DSColumnCellEditor.java @@ -13,7 +13,6 @@ import com.fr.report.core.SheetUtils; import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.poly.PolyECBlock; import com.fr.report.worksheet.WorkSheet; -import com.fr.stable.ProductConstants; import javax.swing.JOptionPane; import javax.swing.SwingUtilities; @@ -66,7 +65,6 @@ public class DSColumnCellEditor extends AbstractCellEditor implements DialogActi dsColumnPane.putElementcase(grid.getElementCasePane()); dsColumnPane.putCellElement(cellElement); BasicDialog dsColumnDialog = this.dsColumnPane.showWindowWithCustomSize(SwingUtilities.getWindowAncestor(grid), null, DSColumnPane.DEFAULT_DIMENSION); - dsColumnDialog.addDialogActionListener(this); try { 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 0a5a93602d..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 @@ -3,25 +3,23 @@ */ package com.fr.design.cell.editor; +import com.fine.theme.icon.LazyIcon; import com.fr.base.BaseFormula; -import com.fr.base.BaseUtils; import com.fr.base.FRContext; -import com.fr.base.Utils; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.form.util.FontTransformUtil; import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.UIFormula; import com.fr.design.fun.DefaultValueAdjustProvider; -import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.style.FRFontPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.report.RichTextEditingPane; import com.fr.design.style.color.UIToolbarColorButton; import com.fr.design.utils.DesignUtils; -import com.fr.design.utils.DesignUtils; import com.fr.general.FRFont; import com.fr.log.FineLoggerFactory; import com.fr.report.cell.cellattr.core.RichTextConverter; @@ -43,9 +41,8 @@ import javax.swing.text.MutableAttributeSet; import javax.swing.text.SimpleAttributeSet; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; +import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -54,6 +51,9 @@ import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.row; + /** * * @@ -61,8 +61,6 @@ import java.awt.event.MouseListener; */ public class RichTextToolBar extends BasicPane { - private static final Dimension BUTTON_SIZE = new Dimension(24, 20); - /** * 富文本字体下拉框默认首选字体 非设计器UI界面字体 */ @@ -78,6 +76,7 @@ public class RichTextToolBar extends BasicPane { private UIToggleButton superPane; private UIToggleButton subPane; private UIToggleButton formulaPane; + private UIToolbar toolbar; //外部传进来的 private RichTextEditingPane textPane; @@ -105,58 +104,44 @@ public class RichTextToolBar extends BasicPane { } private void initAllButton() { + toolbar = new UIToolbar(); fontNameComboBox = new UIComboBox(DesignUtils.getAvailableFontFamilyNames4Report()); - fontNameComboBox.setPreferredSize(new Dimension(144, 20)); fontSizeComboBox = new UIComboBox(FRFontPane.getFontSizes()); - colorSelectPane = new UIToolbarColorButton(BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png")); + colorSelectPane = new UIToolbarColorButton(new LazyIcon("foreground")); colorSelectPane.set4Toolbar(); - bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png")); - italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png")); - underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/underline.png")); - superPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sup.png")); - subPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/sub.png")); - formulaPane = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); + bold = new UIToggleButton(new LazyIcon("bold")); + italic = new UIToggleButton(new LazyIcon("italic")); + underline = new UIToggleButton(new LazyIcon("underline")); + superPane = new UIToggleButton(new LazyIcon("super")); + subPane = new UIToggleButton(new LazyIcon("sub")); + formulaPane = new UIToggleButton(new LazyIcon("formula")); //名字 initAllNames(); //悬浮提示 setToolTips(); - //样式 - setAllButtonStyle(); + //设置ToolBar + addIntoToolBar(); //绑定监听器 bindListener(); } - private void setAllButtonStyle() { - setButtonStyle(bold); - setButtonStyle(italic); - setButtonStyle(underline); - setButtonStyle(subPane); - setButtonStyle(superPane); - setButtonStyle(formulaPane); + private void addIntoToolBar() { + toolbar.add(bold); + toolbar.add(italic); + toolbar.add(underline); + toolbar.add(subPane); + toolbar.add(superPane); + toolbar.add(formulaPane); } - private void setButtonStyle(UIButton button) { - button.setNormalPainted(false); - button.setBackground(null); - button.setOpaque(false); - button.setPreferredSize(BUTTON_SIZE); - button.setBorderPaintedOnlyWhenPressed(true); - } private void addToToolBar() { - this.setLayout(new FlowLayout(FlowLayout.LEFT)); - - this.add(fontNameComboBox); - this.add(fontSizeComboBox); - this.add(bold); - this.add(italic); - this.add(underline); - this.add(colorSelectPane); - this.add(superPane); - this.add(subPane); - this.add(formulaPane); + this.setLayout(new BorderLayout()); + this.add(row(10, + cell(fontNameComboBox).weight(0.3),cell(fontSizeComboBox).weight(0.15), cell(toolbar).weight(0.6) + ).getComponent()); } private void bindListener() { diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java index 5c2155dc77..4de5de08bb 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HFComponent.java @@ -287,7 +287,7 @@ public class HFComponent extends UILabel implements MoveActionListener { } else if (hfElement.getClass().equals(FormulaHFElement.class)) { return new LazyIcon("formula"); } else if (hfElement.getClass().equals(PageNumberHFElement.class)) { - return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/page.png"); + return new LazyIcon("page"); } else if (hfElement.getClass().equals(NumberOfPageHFElement.class)) { return new LazyIcon("pages"); } else if (hfElement.getClass().equals(DateHFElement.class)) { @@ -297,7 +297,7 @@ public class HFComponent extends UILabel implements MoveActionListener { } else if (hfElement.getClass().equals(ImageHFElement.class)) { return new LazyIcon("image"); } else if (hfElement.getClass().equals(NewLineHFElement.class)) { - return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/newLine.png"); + return new LazyIcon("newline"); } return BaseUtils.readIcon("/com/fr/base/images/dialog/headerfooter/undefined.png"); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 66f97093e2..b1f0caadbf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe; +import com.fine.theme.icon.LazyIcon; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; import com.fr.design.actions.UpdateAction; @@ -185,7 +186,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { private void addInsertFloatMenuDef(MenuDef menuDef) { // 悬浮元素菜单 MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuName()); - subMenuDef.setIconPath("/com/fr/design/images/m_insert/float_normal.svg"); + subMenuDef.setIcon(new LazyIcon("float_normal")); menuDef.addShortCut(subMenuDef); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java b/designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java index 6291c5ddfc..3f546b628c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/cell/QuickEditorRegion.java @@ -33,7 +33,6 @@ public class QuickEditorRegion extends JPanel { if (EMPTY == null) { EMPTY = new JPanel(new BorderLayout()); UILabel content = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_None_Message_Property_Table") + "!"); - content.setBorder(BorderFactory.createEmptyBorder(0, 70, 0, 0)); EMPTY.add(content, BorderLayout.CENTER); } return EMPTY; diff --git a/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java b/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java index 2784511bae..8ffdfd8385 100644 --- a/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/PDFExportPane.java @@ -42,7 +42,7 @@ public class PDFExportPane extends BasicPane { cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Export_Content_Protect"))), row(cell(isNeedPassword), fix(5), cell(passwordWritePane)) ).getComponent(); - this.add(wrapComponentWithTitle(contextProtectPane, "PDF" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export"))); + this.add(wrapComponentWithTitle(contextProtectPane, "PDF" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportD_Excel_Export")), BorderLayout.NORTH); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index ed5e7dea20..0569236674 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -1,5 +1,6 @@ package com.fr.design.report; +import com.fine.theme.utils.FineUIScale; import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.GraphHelper; import com.fr.design.border.UIRoundedBorder; @@ -98,7 +99,7 @@ public class ReportColumnsPane extends BasicPane{ super.paintBorder(g); } }; - north.setPreferredSize(new Dimension(549, 59)); + north.setPreferredSize(FineUIScale.scale(new Dimension(549, 59))); north.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(11, 23, 6, 23), new UIRoundedBorder(new Color(204, 204, 204), 1, 10))); String[] textArray = new String[] { com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_TurnOn"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_TurnOff") @@ -212,7 +213,6 @@ public class ReportColumnsPane extends BasicPane{ JPanel divideRowPane = column( 20, cell(wrapComponentWithTitle(north, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Style"))), - cell(north), cell(center) ).getComponent(); @@ -343,15 +343,15 @@ public class ReportColumnsPane extends BasicPane{ 10, cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")).weight(0.12), cell(repeatColDataTextField).weight(0.33), - cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 " + "")).weight(0.15), - flex(0.4) + cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 " + "")).weight(0.2), + flex(0.35) ), row( 10, cell(copyLabel).weight(0.12), cell(copyTitleTextField).weight(0.33), - cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18" + "")).weight(0.15), - flex(0.4) + cell(new UILabel("" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18" + "")).weight(0.2), + flex(0.35) ) ).getComponent(); diff --git a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java index 26acc77513..94bb7322f0 100644 --- a/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/RichTextPane.java @@ -1,11 +1,11 @@ package com.fr.design.report; +import com.fine.theme.utils.FineUIUtils; +import com.formdev.flatlaf.ui.FlatRoundBorder; import com.fr.base.BaseFormula; import com.fr.base.Style; import com.fr.design.cell.editor.RichTextToolBar; import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.icontainer.UIScrollPane; -import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.DesignUtils; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; @@ -20,7 +20,6 @@ import com.fr.stable.Constants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; -import javax.swing.JPanel; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultStyledDocument; @@ -33,6 +32,9 @@ import java.awt.Font; import java.math.BigDecimal; import java.util.Iterator; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; + public class RichTextPane extends BasicPane { //12号字体有个奇怪的bug, 字体下部分渲染会截断一部分, 换其他字体没问题, 字体改大小也没问题. @@ -48,17 +50,13 @@ public class RichTextPane extends BasicPane { } protected void initComponents() { - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + this.setLayout(new BorderLayout()); textPane = new RichTextEditingPane(); + textPane.setBorder(new FlatRoundBorder()); + textPane.setBackground(FineUIUtils.getUIColor("background.normal", "background")); textPane.setFont(DEFAUL_FONT); toolBar = new RichTextToolBar(textPane); - northPane.add(toolBar); - - JPanel southPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - southPane.add(new UIScrollPane(textPane)); - this.add(southPane, BorderLayout.CENTER); - this.add(northPane, BorderLayout.NORTH); + this.add(column(10, cell(toolBar), cell(textPane).weight(1)).getComponent()); } @Override diff --git a/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java b/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java index 7c183cd83d..48a57dd913 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/CommonPane.java @@ -41,7 +41,7 @@ public class CommonPane extends JPanel { ), //报表缓存有效时间 row(cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Cache_Validate_Time"))).weight(0.2), - row(cell(this.cacheValidateTimeEditor).weight(0.7), fix(5), cell(new UILabel("milliseconds")).weight(0.3)).weight(0.4), + row(cell(this.cacheValidateTimeEditor).weight(0.6), fix(5), cell(new UILabel("milliseconds")).weight(0.4)).weight(0.4), flex(0.4) ) ).with(it -> it.setBorder(new ScaledEmptyBorder(10,10,10,10))).getComponent()); diff --git a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java index d18e521106..7ff9797069 100644 --- a/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java +++ b/designer-realize/src/main/java/com/fr/poly/creator/ECBlockPane.java @@ -3,6 +3,7 @@ */ package com.fr.poly.creator; +import com.fine.theme.icon.LazyIcon; import com.fr.base.TRL; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; @@ -143,7 +144,7 @@ public class ECBlockPane extends PolyElementCasePane { private void addInsertFloatMenuDef(MenuDef menuDef) { // 悬浮元素菜单 MenuDef subMenuDef = new MenuDef(KeySetUtils.INSERT_FLOAT.getMenuName()); - subMenuDef.setIconPath("/com/fr/design/images/m_insert/float.png"); + subMenuDef.setIcon(new LazyIcon("float_normal")); menuDef.addShortCut(subMenuDef); UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, this); for (int i = 0; i < actions.length; i++) { diff --git a/designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java index 723a3aba23..9d5ce49885 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java @@ -1,5 +1,6 @@ package com.fr.quickeditor.chartquick; +import com.formdev.flatlaf.util.ScaledEmptyBorder; import com.fr.base.chart.BaseChartCollection; import com.fr.design.gui.chart.BaseChartPropertyPane; import com.fr.design.mainframe.ElementCasePane; @@ -9,13 +10,13 @@ import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.Elem; -import java.awt.*; +import java.awt.BorderLayout; public class FloatChartQuickEditor extends QuickEditor { public FloatChartQuickEditor() { setLayout(new BorderLayout()); - setBorder(null); + setBorder(new ScaledEmptyBorder(0, 10, 0, 10)); } @Override diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash.png b/designer-realize/src/main/resources/com/fr/design/images/splash.png index 9e3cac4197..d6b5123e90 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash.png and b/designer-realize/src/main/resources/com/fr/design/images/splash.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png index 8e90c76e33..e928859f22 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png index 8e90c76e33..e928859f22 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_en.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png index a284a5585e..5ecc655fce 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png index 2a67ffa3ce..c2cbf2f03b 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png and b/designer-realize/src/main/resources/com/fr/design/images/splash@2x_zh_TW.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_en.png b/designer-realize/src/main/resources/com/fr/design/images/splash_en.png index 9e3cac4197..d6b5123e90 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_en.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_en.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png b/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png index 0535306e30..5944d95736 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_zh.png differ diff --git a/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png b/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png index 9d435160ce..66865ab590 100644 Binary files a/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png and b/designer-realize/src/main/resources/com/fr/design/images/splash_zh_TW.png differ