diff --git a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java index 06fb8fcb86..e96edbdf07 100644 --- a/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java +++ b/designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java @@ -1,6 +1,7 @@ package com.fr.design.condition; +import com.fine.theme.icon.LazyIcon; import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.utils.FineUIUtils; import com.formdev.flatlaf.ui.FlatUIUtils; @@ -54,7 +55,7 @@ public abstract class ConditionAttributesPane extends BasicBeanPane { menuDef = new CellHighlightAddMenuDef(); menuDef.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Highlight_Click_to_Choose_Property_To_Modify")); - menuDef.setIconPath("com/fr/design/images/control/addPopup.png"); + menuDef.setIcon(new LazyIcon("add_popup")); toolbarDef.addShortCut(menuDef); diff --git a/designer-base/src/main/java/com/fr/design/condition/FlowLayoutExample.java b/designer-base/src/main/java/com/fr/design/condition/FlowLayoutExample.java deleted file mode 100644 index 3c0177f5d3..0000000000 --- a/designer-base/src/main/java/com/fr/design/condition/FlowLayoutExample.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.fr.design.condition; - -import javax.swing.*; -import java.awt.*; - -public class FlowLayoutExample { - public static void main(String[] args) { - JFrame frame = new JFrame("FlowLayout Example"); - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - frame.setSize(400, 300); - - // 创建一个主 JPanel 使用 BorderLayout - JPanel mainPanel = new JPanel(new BorderLayout()); - - // 创建一个居中面板 使用 FlowLayout 并设置为左对齐 - JPanel rowPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - - // 添加一些组件到 rowPanel - rowPanel.add(new JButton("Button 1")); - rowPanel.add(new JButton("Button 2")); - rowPanel.add(new JButton("Button 3")); - - // 创建一个带有 GridBagLayout 的面板,用于垂直居中 rowPanel - JPanel centerPanel = new JPanel(new GridBagLayout()); - - // 设置 GridBagConstraints 以在垂直方向居中 rowPanel - GridBagConstraints gbc = new GridBagConstraints(); - gbc.gridx = 0; - gbc.gridy = 0; - gbc.weightx = 1; - gbc.weighty = 1; - gbc.anchor = GridBagConstraints.NORTH; - gbc.fill = GridBagConstraints.HORIZONTAL; - - centerPanel.add(rowPanel, gbc); - - // 将居中面板添加到主面板的中间 - mainPanel.add(centerPanel, BorderLayout.CENTER); - centerPanel.setBorder(BorderFactory.createMatteBorder(1,1,1,1, Color.black)); - - // 将主面板添加到 JFrame - frame.add(mainPanel); - - frame.setVisible(true); - } -} diff --git a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java index 1dca4fdd16..f153999b1f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/itableeditorpane/UITableEditorPane.java @@ -175,7 +175,9 @@ public class UITableEditorPane extends BasicPane { editTable.getTableHeader().setResizingAllowed(resizingAllowed); } - + /** + * 设置 TableHeader 文字左对齐 + */ public static class TableHeaderRenderer extends DefaultTableCellRenderer { public TableHeaderRenderer() { setHorizontalAlignment(SwingConstants.LEFT); diff --git a/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java b/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java index d5efb5ac9e..8863236b90 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/style/background/impl/ImageBackgroundPane.java @@ -30,7 +30,9 @@ import java.awt.Image; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import static com.fine.swing.ui.layout.Layouts.*; +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; /** * Image background pane. diff --git a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java index fa15e8469d..45c2883aa9 100644 --- a/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/headerfooter/HeaderFooterEditPane.java @@ -151,8 +151,18 @@ public class HeaderFooterEditPane extends JPanel { //toolbar. JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); + printBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportGUI_Print_Background")); + headerUnitFieldPane = new AdjustHeightPane(); + footerUnitFieldPane = new AdjustHeightPane(); + headFootUnitFieldPane = new AdjustHeightPane(); + initIconToolPanel(); + toolbar.add(iconToolPanel); + return toolbar; + } + + private UIButton initCustomBackgroundButton() { UIButton customBackgroundButton = new UIButton(); - customBackgroundButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")); + customBackgroundButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Background")); customBackgroundButton.set4ToolbarButton(); customBackgroundButton.setIcon(new LazyIcon("background")); customBackgroundButton.addActionListener(new ActionListener() { @@ -160,34 +170,21 @@ public class HeaderFooterEditPane extends JPanel { final BackgroundPane backgroundPane = new BackgroundPane(); BasicDialog backgroundDialog = backgroundPane.showWindow( SwingUtilities.getWindowAncestor(HeaderFooterEditPane.this)); - backgroundPane.populate(background); + backgroundPane.populate(background); backgroundDialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { background = backgroundPane.update(); refreshPreivewPane(); - } + } }); backgroundDialog.setVisible(true); } }); - printBackgroundCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ReportGUI_Print_Background")); - - JPanel headerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - headerUnitFieldPane = new AdjustHeightPane(); - headerPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Header") + ":")); - headerPane.add(headerUnitFieldPane); - - JPanel footerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - footerUnitFieldPane = new AdjustHeightPane(); - footerPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_PageSetup_Footer") + ":")); - footerPane.add(footerUnitFieldPane); - - JPanel headerFooterPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - headFootUnitFieldPane = new AdjustHeightPane(); - headerFooterPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":")); - headerFooterPane.add(headFootUnitFieldPane); + return customBackgroundButton; + } + private void initIconToolPanel() { iconToolPanel = row( 6, cell(this.createHFInsertButton(new TextHFElement())), @@ -198,15 +195,13 @@ public class HeaderFooterEditPane extends JPanel { cell(this.createHFInsertButton(new TimeHFElement())), cell(this.createHFInsertButton(new ImageHFElement())), cell(this.createHFInsertButton(new NewLineHFElement())), - cell(customBackgroundButton), + cell(initCustomBackgroundButton()), cell(printBackgroundCheckBox), - row( - cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":")), - cell(headFootUnitFieldPane) - ).with(it -> it.setBorder(new ScaledEmptyBorder(2,0,2,0))) + row( + cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Height") + ":")), + cell(headFootUnitFieldPane) + ).with(it -> it.setBorder(new ScaledEmptyBorder(2,0,2,0))) ).getComponent(); - toolbar.add(iconToolPanel); - return toolbar; } /** diff --git a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java index efd9dc18e6..971813bff4 100644 --- a/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java @@ -25,7 +25,11 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import static com.fine.swing.ui.layout.Layouts.*; +import static com.fine.swing.ui.layout.Layouts.cell; +import static com.fine.swing.ui.layout.Layouts.column; +import static com.fine.swing.ui.layout.Layouts.fix; +import static com.fine.swing.ui.layout.Layouts.flex; +import static com.fine.swing.ui.layout.Layouts.row; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; /**