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.icon.LazyIcon;
import com.fine.theme.light.ui.FineRoundBorder; import com.fine.theme.light.ui.FineRoundBorder;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
@ -32,7 +33,7 @@ public class ObjectProperiesPane extends BasicBeanPane<ListMap> {
public ObjectProperiesPane() { public ObjectProperiesPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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(); 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"), 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")); 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.JPopupMenu;
import javax.swing.MenuElement; import javax.swing.MenuElement;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension;
/** /**
* @author null * @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; package com.fr.design.gui.style;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
@ -46,7 +47,7 @@ public class FollowingThemePane extends BasicPane implements UIObserver {
public FollowingThemePane(String name) { public FollowingThemePane(String name) {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); 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 = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS);
followingThemeButtonGroup.setAutoFireStateChanged(false); 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; package com.fr.design.hyperlink.popup;
import com.fr.base.BaseUtils; import com.fine.theme.icon.LazyIcon;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -46,9 +44,9 @@ public class CustomFontPane extends JPanel {
fontSizeComboBox.setEditable(true); fontSizeComboBox.setEditable(true);
colorSelectPane = new UIColorButton(); colorSelectPane = new UIColorButton();
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_bold.png")); bold = new UIToggleButton(new LazyIcon("bold"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_italic.png")); italic = new UIToggleButton(new LazyIcon("italic"));
underline = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/new_underline.png")); underline = new UIToggleButton(new LazyIcon("underline"));
colorSelectPane.setOpaque(true); colorSelectPane.setOpaque(true);
bold.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; package com.fr.design.menu;
import com.fine.theme.utils.FineUIScale;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -52,11 +53,11 @@ public class NameSeparator extends UpdateAction {
} }
public Dimension getSize() { public Dimension getSize() {
return new Dimension(super.getSize().width, 30); return new Dimension(super.getSize().width, FineUIScale.scale(30));
} }
public Dimension getPreferredSize() { 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; package com.fr.design.report;
import com.fine.theme.utils.FineUIScale; import com.fine.theme.utils.FineUIScale;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.editor.editor.IntegerEditor; 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.column;
import static com.fine.swing.ui.layout.Layouts.row; 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.box;
import static com.fine.swing.ui.layout.Layouts.fix;
import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle; import static com.fine.theme.utils.FineUIUtils.wrapComponentWithTitle;
import static com.fine.theme.utils.FineUIScale.scale; 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.setPreferredSize(new Dimension(FineUIScale.scale(600), FineUIScale.scale(160)));
outAdvicePane.add(createAdvicePane()); outAdvicePane.add(createAdvicePane());
this.add(column(10, this.add(column(20,
cell(wrapComponentWithTitle(outReportEnginePane, Toolkit.i18nText("Fine-Design_Report_Report_Engine_Attribute"))), 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(outPagingEngineSelectPane, Toolkit.i18nText("Fine-Design_Report_Paging_Engine_Select"))).weight(1.0),
cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice")))) cell(wrapComponentWithTitle(outAdvicePane, Toolkit.i18nText("Fine-Design_Report_Advice"))))
@ -135,7 +137,8 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
* 目前先屏蔽后面新引擎显示页码再加上相关代码 * 目前先屏蔽后面新引擎显示页码再加上相关代码
*/ */
private void createEngineXSettingPane() { 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 engineXSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
engineXPageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); engineXPageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
@ -151,17 +154,26 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
rowCountBox.setSelected(false); rowCountBox.setSelected(false);
rowCountPanel.add(rowCountBox); rowCountPanel.add(rowCountBox);
JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip")); JPanel tip = createTipPane(Toolkit.i18nText("Fine-Design_Report_Engine_X_tip"));
engineXSettingPane.add(column(10, engineXSettingPane.add(row(20,
cell(pageQueryBoxPanel), column(10,
cell(engineXPageQueryPane), column(fix(6), cell(title)),
cell(rowCountPanel), cell(new UILabel()),
cell(tip)) cell(new UILabel()),
cell(new UILabel())
),
column(10,
cell(pageQueryBoxPanel),
cell(engineXPageQueryPane),
cell(rowCountPanel),
cell(tip)))
.getComponent()); .getComponent());
outEngineXSettingPane.add(engineXSettingPane); outEngineXSettingPane.add(engineXSettingPane);
} }
private void createLineEngineSettingPane() { 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 lineEngineSettingPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_M_Pane();
JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageQueryBoxPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
lineEnginePageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging")); lineEnginePageQueryBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fixed_Line_Paging"));
@ -174,10 +186,15 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
lineEngineSettingPane.add(lineEnginePageQueryPane); lineEngineSettingPane.add(lineEnginePageQueryPane);
lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane)); lineEnginePageQueryBox.addActionListener(new SelectActionListener(lineEnginePageQueryBox, lineEnginePageQueryPane));
JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip")); JPanel tipPane = createTipPane(Toolkit.i18nText("Fine-Design_Report_Line_Engine_tip"));
lineEngineSettingPane.add(column(10, lineEngineSettingPane.add(row(20,
cell(pageQueryBoxPanel), column(10,
cell(lineEnginePageQueryPane), column(fix(6), cell(title)),
cell(tipPane)) cell(new UILabel()),
cell(new UILabel())),
column(10,
cell(pageQueryBoxPanel),
cell(lineEnginePageQueryPane),
cell(tipPane)))
.getComponent()); .getComponent());
outLineEngineSettingPane.add(lineEngineSettingPane); outLineEngineSettingPane.add(lineEngineSettingPane);
} }
@ -191,12 +208,12 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
} }
private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) { private JPanel createPageQueryPane(IntegerEditor countPerPageEditor) {
double p = TableLayout.PREFERRED; JPanel pageQueryPane = new JPanel(new BorderLayout());
double rowSize[] = {p, p}; pageQueryPane.setBorder(new ScaledEmptyBorder(0, 8, 0, 0));
double columnSize[] = {p, p}; pageQueryPane.add(row(4,
Component[][] components = {{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage")), countPerPageEditor}}; cell(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_LayerPageReport_Count_PerPage"))),
JPanel pageQueryPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); cell(countPerPageEditor)
pageQueryPane.setBorder(BorderFactory.createEmptyBorder(5, 15, 0, 0)); ).getComponent());
return pageQueryPane; return pageQueryPane;
} }
@ -242,16 +259,9 @@ public class ReportEnginePane extends BasicBeanPane<LayerReportAttr> {
buttonGroup.add(lineEngine); buttonGroup.add(lineEngine);
radioButtons.add(newEngine); radioButtons.add(newEngine);
radioButtons.add(lineEngine); radioButtons.add(lineEngine);
double p = TableLayout.FILL;
double[] rowSize = {p}; JPanel pagingEngineRadioPanel = new JPanel(new BorderLayout());
double[] columnSize = {p, p, p, p, p}; pagingEngineRadioPanel.add(row(20, cell(newEngine), cell(lineEngine)).getComponent());
Component[][] components = new Component[][]{
new Component[]{
newEngine,
lineEngine
}
};
JPanel pagingEngineRadioPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane)); newEngine.addActionListener(new EngineSelectActionListener(newEngine, engineSettingPane, outEngineXSettingPane, outLineEngineSettingPane));
lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane)); lineEngine.addActionListener(new EngineSelectActionListener(lineEngine, engineSettingPane, outLineEngineSettingPane, outEngineXSettingPane));
return pagingEngineRadioPanel; return pagingEngineRadioPanel;

Loading…
Cancel
Save