Browse Source

Pull request #13942: REPORT-111997 NewUI 修改按钮布局

Merge in DESIGN/design from ~LEO.QIN/design:newui to newui

* commit '5985e677da559d734668a22daa8c12793faf2ee4':
  REPORT-111997 NewUI 修改按钮样式
newui
Leo.Qin-覃宇攀 7 months ago
parent
commit
84200c3081
  1. 4
      designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java
  2. 17
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java
  3. 30
      designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java

4
designer-realize/src/main/java/com/fr/design/mainframe/ReportFloatPane.java

@ -54,8 +54,8 @@ public class ReportFloatPane extends Column {
initInsertToolBar(); initInsertToolBar();
this.add( this.add(
row(10, row(10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_FloatElement"))), cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_FloatElement"))).weight(1.2),
cell(createButtonUI()).weight(1.0) cell(createButtonUI()).weight(3.0)
) )
); );

17
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -4,16 +4,14 @@ import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.SubReportCellAction; import com.fr.design.actions.insert.cell.SubReportCellAction;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
/** /**
* 单元格元素子报表编辑器 * 单元格元素子报表编辑器
@ -33,11 +31,10 @@ public class CellSubReportEditor extends CellQuickEditor {
public JComponent createCenterBody() { public JComponent createCenterBody() {
JPanel content = new JPanel(new BorderLayout()); JPanel content = new JPanel(new BorderLayout());
subReportButton = new UIButton(); subReportButton = new UIButton();
subReportButton.setOpaque(false); content.add(row(
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ cell(EMPTY_LABEL).weight(1.2),
new Component[]{EMPTY_LABEL, subReportButton}}, cell(subReportButton).weight(3)
new double[]{TableLayout.PREFERRED}, ).getComponent());
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;
} }

30
designer-realize/src/main/java/com/fr/quickeditor/floatquick/FloatImageQuickEditor.java

@ -1,26 +1,25 @@
package com.fr.quickeditor.floatquick; package com.fr.quickeditor.floatquick;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.report.SelectImagePane; import com.fr.design.report.SelectImagePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.quickeditor.FloatQuickEditor; import com.fr.quickeditor.FloatQuickEditor;
import com.fr.report.cell.cellattr.CellImage; import com.fr.report.cell.cellattr.CellImage;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import static com.fine.swing.ui.layout.Layouts.cell;
import static com.fine.swing.ui.layout.Layouts.row;
public class FloatImageQuickEditor extends FloatQuickEditor { public class FloatImageQuickEditor extends FloatQuickEditor {
public FloatImageQuickEditor() { public FloatImageQuickEditor() {
@ -33,21 +32,14 @@ public class FloatImageQuickEditor extends FloatQuickEditor {
showEditingDialog(); showEditingDialog();
} }
}); });
editbutton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
editbutton.setMargin(null);
editbutton.setOpaque(false);
Component[][] components = new Component[][]{
new Component[]{editbutton}
};
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p};
JPanel pane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.setBorder(BorderFactory.createEmptyBorder(10, 75, 10, 15)); this.add(row(
this.add(pane, BorderLayout.CENTER); 10,
cell(new UILabel()).weight(1.2),
cell(editbutton).weight(3)
).getComponent(), BorderLayout.NORTH);
} }

Loading…
Cancel
Save