Browse Source

Merging in latest from upstream (DESIGN/design:refs/heads/newui)

* commit '30831127a4a586c5d78bafbafff05bebf4b6adf8':
  REPORT-127436【NewUI】设计器样式翻新-icon图标调整
newui
Zongyu.Wang-王宗雨 5 months ago
parent
commit
cd15857380
  1. 15
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java
  2. 17
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  3. 5
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java
  4. 4
      designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java
  5. 19
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  6. 6
      designer-base/src/main/resources/com/fine/theme/icon/dataset/database_warning.svg
  7. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter.svg
  8. 3
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_disable.svg
  9. 4
      designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_popup.svg
  10. 3
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  11. 9
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  12. 11
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  13. 3
      designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java
  14. 2
      designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java

15
designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.svg.SVGLoader;
import com.fr.data.impl.DBTableData;
import com.fr.design.actions.tabledata.TableDataAction;
@ -140,8 +141,20 @@ public class TableDataNameObjectCreator extends NameObjectCreator {
return iconPath;
}
/**
* 菜单图标后续WarningIcon优化
* @return Icon
*/
private Icon createMenuIcon() {
return b ? new WarningIcon(this.menuImage) : this.menuIcon;
if(b) {
if (this.menuIcon instanceof LazyIcon) {
LazyIcon lazyIcon = (LazyIcon) this.menuIcon;
return new LazyIcon(lazyIcon.getId() + "_warning");
} else {
return new WarningIcon(this.menuImage);
}
}
return this.menuIcon;
}
/**

17
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -166,6 +166,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
rightPanel.setBorder(new ScaledEmptyBorder(0,0,0,10));
rightPanel.add(getTextSetPanel());
fileTypeComboBox.addActionListener(getFileTypeListener(rightPanel));
rightPanel.setPreferredSize(FineUIScale.scale(new Dimension(-1, 400)));
//文件数据集整体布局,服务器数据集/模板数据集下的文件数据集,创建文件数据集,三处面板通用布局
this.add(column(LayoutConstants.VERTICAL_GAP,
@ -274,12 +275,14 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
encodingComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
encodingComboBox.setSelectedIndex(4);
return column(
JPanel xmlSetPanel = new JPanel(new BorderLayout());
xmlSetPanel.add(column(
LayoutConstants.VGAP_MEDIUM,
row(LayoutConstants.HORIZONTAL_GAP, cell(encodeLabel).weight(0.2), cell(encodingComboBox).weight(0.8)),
cell(new XMLNodeTreePane()),
cell(new XMLNodeTreePane()).weight(1),
cell(getPreviewPanel())
).getComponent();
).getComponent());
return xmlSetPanel;
}
/**
@ -288,7 +291,9 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
*/
private JPanel getExcelSetPanel() {
needColumnNameCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_FirstRow_IS_Column_Name"), false);
return column(cell(needColumnNameCheckBox), cell(getPreviewPanel())).getComponent();
JPanel excelSetPanel = new JPanel(new BorderLayout());
excelSetPanel.add(column(cell(needColumnNameCheckBox), flex(1), cell(getPreviewPanel())).getComponent());
return excelSetPanel;
}
private String getFilePathFromUrlOrLocal() {
@ -335,7 +340,9 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
//编码类型
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type"));
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
return column(cell(getTxtCenterPane()), cell(getPreviewPanel())).getComponent();
JPanel textSetPanel = new JPanel(new BorderLayout());
textSetPanel.add(column(cell(getTxtCenterPane()), flex(1), cell(getPreviewPanel())).getComponent());
return textSetPanel;
}
/**

5
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/TemplateTableDataWrapper.java

@ -1,9 +1,8 @@
package com.fr.design.data.tabledata.wrapper;
import com.fine.theme.icon.LazyIcon;
import com.fr.base.TableData;
import com.fr.base.svg.SVGLoader;
import com.fr.data.impl.DBTableData;
import com.fr.design.icon.WarningIcon;
import com.fr.stable.StringUtils;
import javax.swing.Icon;
@ -20,7 +19,7 @@ public final class TemplateTableDataWrapper extends AbstractTableDataWrapper {
@Override
public Icon getIcon() {
if (tabledata instanceof DBTableData && StringUtils.isBlank(((DBTableData) tabledata).getQuery())) {
return new WarningIcon(SVGLoader.load("/com/fr/design/standard/database.svg"));
return new LazyIcon("database_warning");
}
return TableDataFactory.getIcon(tabledata);
}

4
designer-base/src/main/java/com/fr/design/fun/PreviewProvider.java

@ -42,7 +42,9 @@ public interface PreviewProvider extends Mutable, Filter<JTemplate> {
* 下拉弹出菜单的图标Id
* @return 图标Id
*/
String iconIdForPopupItem();
default String iconIdForPopupItem() {
return StringUtils.EMPTY;
}
/**
* 点击下拉菜单时触发的事件

19
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -9,6 +9,7 @@ import com.fr.base.io.BaseBook;
import com.fr.base.iofile.attr.DesignBanCopyAttrMark;
import com.fr.base.iofile.attr.TemplateIdAttrMark;
import com.fr.base.iofile.attr.TemplateThemeAttrMark;
import com.fr.base.svg.IconUtils;
import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.TemplateThemeCompatible;
import com.fr.base.theme.TemplateThemeConfig;
@ -1458,7 +1459,23 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
*/
public Icon getPreviewLargeIcon() {
PreviewProvider provider = getPreviewType();
return new LazyIcon(provider.iconIdForPopupItem(), 32);
if(StringUtils.isEmpty(provider.iconIdForPopupItem())) {
return IconUtils.readIcon(provider.iconPathForLarge());
} else {
return new LazyIcon(provider.iconIdForPopupItem(), 32);
}
}
/**
* 获取预览图标兼容老图标获取方式存在插件中未实现新图标
* @return Icon
*/
public Icon getPreviewIcon(PreviewProvider provider) {
if(StringUtils.isEmpty(provider.iconIdForPopupItem())) {
return IconUtils.readIcon(provider.iconPathForPopupItem());
} else {
return new LazyIcon(provider.iconIdForPopupItem());
}
}
/**

6
designer-base/src/main/resources/com/fine/theme/icon/dataset/database_warning.svg

@ -0,0 +1,6 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M15 22.9032C21.6274 22.9032 27 20.8755 27 18.3742V13.671C27 16.1723 21.6274 18.2 15 18.2C8.37258 18.2 3 16.1723 3 13.671V18.3742C3 20.8755 8.37258 22.9032 15 22.9032ZM27 12.4516C27 14.9529 21.6274 16.9806 15 16.9806C8.37258 16.9806 3 14.9529 3 12.4516V7.92258C3 10.4239 8.37258 12.4516 15 12.4516C21.6274 12.4516 27 10.4239 27 7.92258V12.4516ZM15 11.0581C21.6274 11.0581 27 9.03035 27 6.52903C27 4.02772 21.6274 2 15 2C8.37258 2 3 4.02772 3 6.52903C3 9.03035 8.37258 11.0581 15 11.0581ZM15 29C21.6274 29 27 26.9723 27 24.471V19.7677C27 22.2691 21.6274 24.2968 15 24.2968C8.37258 24.2968 3 22.2691 3 19.7677V24.471C3 26.9723 8.37258 29 15 29Z" fill="#5493F2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M29.875 22C29.875 26.3489 26.3489 29.875 22 29.875C17.6511 29.875 14.125 26.3489 14.125 22C14.125 17.6511 17.6511 14.125 22 14.125C26.3489 14.125 29.875 17.6511 29.875 22Z" fill="#F9AE31"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.3626 24.5785C21.1876 24.7535 21.1001 24.966 21.1001 25.216C21.1001 25.466 21.1876 25.6785 21.3626 25.8535C21.5376 26.0285 21.7501 26.116 22.0001 26.116C22.2501 26.116 22.4626 26.0285 22.6376 25.8535C22.8126 25.6785 22.9001 25.466 22.9001 25.216C22.9001 24.966 22.8126 24.7535 22.6376 24.5785C22.4626 24.4035 22.2501 24.316 22.0001 24.316C21.7501 24.316 21.5376 24.4035 21.3626 24.5785Z" fill="white"/>
<rect x="21.2124" y="17.749" width="1.575" height="5.625" rx="0.7" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5221 13.2368L16 13.8094V14.5843V27.9209L12 25.4593V14.6415V13.8666L11.4779 13.294L3.00394 4L24.9438 4L16.5221 13.2368ZM18 27.9209V14.5843L26.4217 5.34751C27.5925 4.06344 26.6815 2 24.9438 2H3.00394C1.26627 2 0.355264 4.06344 1.52603 5.34751L10 14.6415V25.4593C10 26.1539 10.3603 26.7986 10.9518 27.1626L14.9518 29.6242C16.2843 30.4442 18 29.4855 18 27.9209ZM23 16C22.4477 16 22 16.4477 22 17C22 17.5523 22.4477 18 23 18H29C29.5523 18 30 17.5523 30 17C30 16.4477 29.5523 16 29 16H23ZM22 22C22 21.4477 22.4477 21 23 21H29C29.5523 21 30 21.4477 30 22C30 22.5523 29.5523 23 29 23H23C22.4477 23 22 22.5523 22 22ZM23 26C22.4477 26 22 26.4477 22 27C22 27.5523 22.4477 28 23 28H29C29.5523 28 30 27.5523 30 27C30 26.4477 29.5523 26 29 26H23Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 926 B

3
designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_disable.svg

@ -0,0 +1,3 @@
<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M16.5221 13.2368L16 13.8094V14.5843V27.9209L12 25.4593V14.6415V13.8666L11.4779 13.294L3.00394 4L24.9438 4L16.5221 13.2368ZM18 27.9209V14.5843L26.4217 5.34751C27.5925 4.06344 26.6815 2 24.9438 2H3.00394C1.26627 2 0.355264 4.06344 1.52603 5.34751L10 14.6415V25.4593C10 26.1539 10.3603 26.7986 10.9518 27.1626L14.9518 29.6242C16.2843 30.4442 18 29.4855 18 27.9209ZM23 16C22.4477 16 22 16.4477 22 17C22 17.5523 22.4477 18 23 18H29C29.5523 18 30 17.5523 30 17C30 16.4477 29.5523 16 29 16H23ZM22 22C22 21.4477 22.4477 21 23 21H29C29.5523 21 30 21.4477 30 22C30 22.5523 29.5523 23 29 23H23C22.4477 23 22 22.5523 22 22ZM23 26C22.4477 26 22 26.4477 22 27C22 27.5523 22.4477 28 23 28H29C29.5523 28 30 27.5523 30 27C30 26.4477 29.5523 26 29 26H23Z" fill="#0A1C38" fill-opacity="0.29"/>
</svg>

After

Width:  |  Height:  |  Size: 927 B

4
designer-base/src/main/resources/com/fine/theme/icon/toolbar/filter_popup.svg

@ -0,0 +1,4 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.261 10.6184L12 10.9047V11.2921V17.9604L10 16.7297V11.3208V10.9333L9.73896 10.647L5.50197 6L16.4719 6L12.261 10.6184ZM13 17.9604V11.2921L17.2109 6.67375C17.7963 6.03172 17.3408 5 16.4719 5H5.50197C4.63313 5 4.17763 6.03172 4.76301 6.67375L9 11.3208V16.7297C9 17.0769 9.18016 17.3993 9.4759 17.5813L11.4759 18.8121C12.1422 19.2221 13 18.7428 13 17.9604ZM15.5 12C15.2239 12 15 12.2239 15 12.5C15 12.7761 15.2239 13 15.5 13H18.5C18.7761 13 19 12.7761 19 12.5C19 12.2239 18.7761 12 18.5 12H15.5ZM15 15C15 14.7239 15.2239 14.5 15.5 14.5H18.5C18.7761 14.5 19 14.7239 19 15C19 15.2761 18.7761 15.5 18.5 15.5H15.5C15.2239 15.5 15 15.2761 15 15ZM15.5 17C15.2239 17 15 17.2239 15 17.5C15 17.7761 15.2239 18 15.5 18H18.5C18.7761 18 19 17.7761 19 17.5C19 17.2239 18.7761 17 18.5 17H15.5Z" fill="#0A1C38" fill-opacity="0.9"/>
<path d="M18.1425 21C18.0158 21 17.9523 20.8468 18.042 20.7571L20.7571 18.042C20.8468 17.9523 21 18.0158 21 18.1425V20.6C21 20.8209 20.8209 21 20.6 21H18.1425Z" fill="#0A1C38" fill-opacity="0.9"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

3
designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json

@ -36,6 +36,7 @@
"views": "views.svg",
"preview_sql": "previewSql.svg",
"database": "dataset/database.svg",
"database_warning": "dataset/database_warning.svg",
"preview": "dataset/preview.svg",
"connection": "dataset/connection.svg",
"class_table_data": "dataset/class_table_data.svg",
@ -172,6 +173,8 @@
"add_popup": "toolbar/add_popup.svg",
"bracket": "toolbar/bracket.svg",
"unBracket": "toolbar/unBracket.svg",
"filter": "toolbar/filter.svg",
"filter_popup": "toolbar/filter_popup.svg",
"param_edit": "param/edit.svg",
"param_edit_pressed": "param/edit_pressed.svg",
"param_hide": "param/hide.svg",

9
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -816,13 +816,6 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
return formDesign.getEastDownPane();
}
@Override
/**
*
*/
public Icon getPreviewLargeIcon() {
return super.getPreviewLargeIcon();
}
@Override
public Parameter[] getJTemplateParameters() {
@ -839,7 +832,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
List<UIMenuItem> menuItems = new ArrayList<UIMenuItem>();
PreviewProvider[] previewProviders = supportPreview();
for (final PreviewProvider provider : previewProviders) {
UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), new LazyIcon(provider.iconIdForPopupItem()));
UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), getPreviewIcon(provider));
item.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {

11
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -982,7 +982,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
List<UIMenuItem> menuItems = new ArrayList<UIMenuItem>();
PreviewProvider[] previewProviders = supportPreview();
for (final PreviewProvider provider : previewProviders) {
UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), new LazyIcon(provider.iconIdForPopupItem()));
UIMenuItem item = new UIMenuItem(provider.nameForPopupItem(), getPreviewIcon(provider));
item.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@ -1082,15 +1082,6 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
centerPane.needToShowCoverAndHidPane();
}
@Override
/**
*
*/
public Icon getPreviewLargeIcon() {
PreviewProvider provider = getPreviewType();
return new LazyIcon(provider.iconIdForPopupItem(), 32);
}
/**
* 获取当前workBook的参数及默认值
* 同名参数的话模板参数覆盖全局参数

3
designer-realize/src/main/java/com/fr/design/report/PageSetupPane.java

@ -3,6 +3,7 @@
*/
package com.fr.design.report;
import com.fine.theme.utils.FineUIStyle;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@ -255,7 +256,7 @@ public class PageSetupPane extends BasicPane {
temp.append("&nbsp");
}
zeroMarginWarn = new UILabel("<html><body>" + temp + "<br><br></html></body>");
zeroMarginWarn.setForeground(Color.RED);
FineUIStyle.setStyle(zeroMarginWarn, FineUIStyle.LABEL_WARNING_TIP);
// left
marginTopUnitFieldPane = new UnitFieldPane(Constants.UNIT_MM);

2
designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java

@ -66,7 +66,7 @@ public class ReportWebWidgetConstants {
// flash打印按钮
public static final WidgetOption FLASHPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Utils_Print[Client]"),
BaseUtils.readIcon("/com/fr/web/images/flashPrint.png"), FlashPrint.class);
new LazyIcon("flashFile"), FlashPrint.class);
// appletprint
public static final WidgetOption APPLETPRINT = WidgetOptionFactory.createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Applet_Print"),

Loading…
Cancel
Save