Browse Source

模板引擎熟悉ui翻新/代码问题整改

newui
renekton 5 months ago
parent
commit
ee22ad6e65
  1. 3
      designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java
  2. 1
      designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java
  3. 3
      designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java
  4. 10
      designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java
  5. 5
      designer-base/src/main/java/com/fr/design/menu/NameSeparator.java
  6. 66
      designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

3
designer-base/src/main/java/com/fr/design/gui/frpane/ObjectProperiesPane.java

@ -3,6 +3,7 @@ package com.fr.design.gui.frpane;
import com.fine.theme.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.editor.ValueEditorPane;
@ -32,7 +33,7 @@ public class ObjectProperiesPane extends BasicBeanPane<ListMap> {
public ObjectProperiesPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
this.setBorder(new ScaledEmptyBorder(10, 0, 0, 0));
JPanel buttonPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.addButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Add") + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Property"),
new LazyIcon("add"));

1
designer-base/src/main/java/com/fr/design/gui/imenu/UIMenu.java

@ -7,7 +7,6 @@ import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.MenuElement;
import java.awt.Component;
import java.awt.Dimension;
/**
* @author null

3
designer-base/src/main/java/com/fr/design/gui/style/FollowingThemePane.java

@ -1,6 +1,7 @@
package com.fr.design.gui.style;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.TemplateTheme;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver;
@ -46,7 +47,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver {
public FollowingThemePane(String name) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));
this.setBorder(new ScaledEmptyBorder(0, 0, 0, 10));
followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS);
followingThemeButtonGroup.setAutoFireStateChanged(false);

10
designer-base/src/main/java/com/fr/design/hyperlink/popup/CustomFontPane.java

@ -1,12 +1,10 @@
package com.fr.design.hyperlink.popup;
import com.fr.base.BaseUtils;
import com.fr.design.constants.LayoutConstants;
import com.fine.theme.icon.LazyIcon;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.stable.Constants;
@ -46,9 +44,9 @@ public class CustomFontPane extends JPanel {
fontSizeComboBox.setEditable(true);
colorSelectPane = new UIColorButton();
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_italic.png"));
underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_underline.png"));
bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(new LazyIcon("italic"));
underline = new UIToggleButton(new LazyIcon("underline"));
colorSelectPane.setOpaque(true);
bold.setOpaque(true);

5
designer-base/src/main/java/com/fr/design/menu/NameSeparator.java

@ -1,5 +1,6 @@
package com.fr.design.menu;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper;
import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.ilable.UILabel;
@ -52,11 +53,11 @@ public class NameSeparator extends UpdateAction {
}
public Dimension getSize() {
return new Dimension(super.getSize().width, 30);
return new Dimension(super.getSize().width, FineUIScale.scale(30));
}
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 30);
return new Dimension(super.getPreferredSize().width, FineUIScale.scale(30));
}
}

66
designer-realize/src/main/java/com/fr/design/report/ReportEnginePane.java

@ -1,6 +1,7 @@
package com.fr.design.report;
import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.editor.editor.IntegerEditor;
@ -48,6 +49,7 @@ 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;
import static com.fine.swing.ui.layout.Layouts.box;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
import static com.fine.theme.utils.FineUIScale.scale;
@ -92,7 +94,7 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
outAdvicePane.setPreferredSize(new Dimension(FineUIScale.scale(600), FineUIScale.scale(160)));
outAdvicePane.add(createAdvicePane());
this.add(column(10,
this.add(column(20,
cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))),
cell(wrapComponentWithTitle(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))).weight(1.0),
cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice"))))
@ -135,7 +137,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
* 目前先屏蔽后面新引擎显示页码再加上相关代码
*/
private void createEngineXSettingPane() {
outEngineXSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"));
outEngineXSettingPane = new JPanel(new BorderLayout());
UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_New_Engine"));
JPanel engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
engineXPageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
@ -151,17 +154,26 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
rowCountBox.setSelected(false);
rowCountPanel.add(rowCountBox);
JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip"));
engineXSettingPane.add(column(10,
cell(pageQueryBoxPanel),
cell(engineXPageQueryPane),
cell(rowCountPanel),
cell(tip))
engineXSettingPane.add(row(20,
column(10,
column(fix(6), cell(title)),
cell(new UILabel()),
cell(new UILabel()),
cell(new UILabel())
),
column(10,
cell(pageQueryBoxPanel),
cell(engineXPageQueryPane),
cell(rowCountPanel),
cell(tip)))
.getComponent());
outEngineXSettingPane.add(engineXSettingPane);
}
private void createLineEngineSettingPane() {
outLineEngineSettingPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"));
outLineEngineSettingPane = new JPanel(new BorderLayout());
UILabel title = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Line_Engine"));
JPanel lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
lineEnginePageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
@ -174,10 +186,15 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
lineEngineSettingPane.add(lineEnginePageQueryPane);
lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane));
JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip"));
lineEngineSettingPane.add(column(10,
cell(pageQueryBoxPanel),
cell(lineEnginePageQueryPane),
cell(tipPane))
lineEngineSettingPane.add(row(20,
column(10,
column(fix(6), cell(title)),
cell(new UILabel()),
cell(new UILabel())),
column(10,
cell(pageQueryBoxPanel),
cell(lineEnginePageQueryPane),
cell(tipPane)))
.getComponent());
outLineEngineSettingPane.add(lineEngineSettingPane);
}
@ -191,12 +208,12 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
}
private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) {
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p};
double columnSize[] = {p, p};
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage")), countPerPageEditor}};
JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0));
JPanel pageQueryPane = new JPanel(new BorderLayout());
pageQueryPane.setBorder(new ScaledEmptyBorder(0, 8, 0, 0));
pageQueryPane.add(row(4,
cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage"))),
cell(countPerPageEditor)
).getComponent());
return pageQueryPane;
}
@ -242,16 +259,9 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
buttonGroup.add(lineEngine);
radioButtons.add(newEngine);
radioButtons.add(lineEngine);
double p = TableLayout.FILL;
double[] rowSize = {p};
double[] columnSize = {p, p, p, p, p};
Component[][] components = new Component[][]{
new Component[]{
newEngine,
lineEngine
}
};
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JPanel pagingEngineRadioPanel = new JPanel(new BorderLayout());
pagingEngineRadioPanel.add(row(20, cell(newEngine), cell(lineEngine)).getComponent());
newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane));
lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane));
return pagingEngineRadioPanel;

Loading…
Cancel
Save