Browse Source

REPORT-111997 NewUI 修改按钮样式

newui
Leo.Qin 7 months ago
parent
commit
de85a0815d
  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();
this.add(
row(10,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_FloatElement"))),
cell(createButtonUI()).weight(1.0)
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Add_FloatElement"))).weight(1.2),
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.constants.UIConstants;
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 javax.swing.Icon;
import javax.swing.JComponent;
import javax.swing.JPanel;
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() {
JPanel content = new JPanel(new BorderLayout());
subReportButton = new UIButton();
subReportButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{EMPTY_LABEL, subReportButton}},
new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
content.add(row(
cell(EMPTY_LABEL).weight(1.2),
cell(subReportButton).weight(3)
).getComponent());
return content;
}

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

@ -1,26 +1,25 @@
package com.fr.quickeditor.floatquick;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.Style;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.report.SelectImagePane;
import com.fr.general.ComparatorUtils;
import com.fr.quickeditor.FloatQuickEditor;
import com.fr.report.cell.cellattr.CellImage;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
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.row;
public class FloatImageQuickEditor extends FloatQuickEditor {
public FloatImageQuickEditor() {
@ -33,21 +32,14 @@ public class FloatImageQuickEditor extends FloatQuickEditor {
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.setBorder(new ScaledEmptyBorder(0, 10, 0, 10));
this.setBorder(BorderFactory.createEmptyBorder(10, 75, 10, 15));
this.add(pane, BorderLayout.CENTER);
this.add(row(
10,
cell(new UILabel()).weight(1.2),
cell(editbutton).weight(3)
).getComponent(), BorderLayout.NORTH);
}

Loading…
Cancel
Save