Browse Source

Merge remote-tracking branch 'origin/fbp/release' into fbp/release

fbp/release
Destiny.Lin 3 months ago
parent
commit
a1c8275bde
  1. 6
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java
  2. 28
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java
  3. 3
      designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java
  4. 6
      designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java
  5. 3
      designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java
  6. 8
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  7. 31
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  8. 4
      designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg
  9. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/fine_light.icon.json
  10. 1
      designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties
  11. 2
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

6
designer-base/src/main/java/com/fr/design/data/datapane/TableDataTree.java

@ -64,11 +64,11 @@ public class TableDataTree extends UserObjectRefreshJTree<TableDataSourceOP> {
} else if (nameObject.getObject() instanceof Integer) { } else if (nameObject.getObject() instanceof Integer) {
int num = (Integer) nameObject.getObject(); int num = (Integer) nameObject.getObject();
if (num == TableDataSourceOP.SERVER_TABLE_DATA) { if (num == TableDataSourceOP.SERVER_TABLE_DATA) {
this.setIcon(IconUtils.readIcon(IconPathConstants.STD_SHOW_ICON_PATH)); this.setIcon(new LazyIcon("server_database"));
} else if (num == TableDataSourceOP.STORE_PRECEDURE_DATA) { } else if (num == TableDataSourceOP.STORE_PRECEDURE_DATA) {
this.setIcon(IconUtils.readIcon(IconPathConstants.SP_SHOW_ICON_PATH)); this.setIcon(new LazyIcon("store_procedure"));
} else { } else {
this.setIcon(IconUtils.readIcon(IconPathConstants.DS_QUERY_ICON_PATH)); this.setIcon(new LazyIcon("database"));
} }
} else { } else {
this.setIcon(new LazyIcon("store_procedure")); this.setIcon(new LazyIcon("store_procedure"));

28
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/ServerTableDataWrapper.java

@ -6,6 +6,8 @@ import com.fr.base.svg.SVGLoader;
import com.fr.data.impl.ClassTableData; import com.fr.data.impl.ClassTableData;
import com.fr.data.impl.DBTableData; import com.fr.data.impl.DBTableData;
import com.fr.data.impl.EmbeddedTableData; import com.fr.data.impl.EmbeddedTableData;
import com.fr.data.impl.FileTableData;
import com.fr.data.impl.MultiTDTableData;
import com.fr.data.impl.RecursionTableData; import com.fr.data.impl.RecursionTableData;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.design.icon.WarningIcon; import com.fr.design.icon.WarningIcon;
@ -25,13 +27,10 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper {
@Override @Override
public Icon getIcon() { public Icon getIcon() {
if (tabledata instanceof DBTableData) { if (tabledata instanceof DBTableData) {
if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) { return getDBTableDataIcon();
return new LazyIcon("server_database_warning"); }
}
else { if (tabledata instanceof ClassTableData) {
return new LazyIcon("server_database");
}
} else if (tabledata instanceof ClassTableData) {
return new LazyIcon("class_table_data"); return new LazyIcon("class_table_data");
} else if (tabledata instanceof EmbeddedTableData) { } else if (tabledata instanceof EmbeddedTableData) {
return new LazyIcon("data_table"); return new LazyIcon("data_table");
@ -39,10 +38,23 @@ public final class ServerTableDataWrapper extends AbstractTableDataWrapper {
return new LazyIcon("tree"); return new LazyIcon("tree");
} else if (tabledata instanceof StoreProcedure) { } else if (tabledata instanceof StoreProcedure) {
return new LazyIcon("store_procedure"); return new LazyIcon("store_procedure");
} } else if (tabledata instanceof FileTableData) {
return new LazyIcon("file");
} else if (tabledata instanceof MultiTDTableData) {
return new LazyIcon("multi");
}
return new LazyIcon("server_database"); return new LazyIcon("server_database");
} }
private Icon getDBTableDataIcon() {
if (StringUtils.isBlank(((DBTableData) tabledata).getQuery())) {
return new LazyIcon("server_database_warning");
}
else {
return new LazyIcon("server_database");
}
}
/** /**
* 是否异常 * 是否异常
* @return * @return

3
designer-base/src/main/java/com/fr/design/gui/controlpane/JListControlPane.java

@ -30,6 +30,7 @@ import javax.swing.JPopupMenu;
import javax.swing.ListCellRenderer; import javax.swing.ListCellRenderer;
import javax.swing.ListSelectionModel; import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -381,7 +382,7 @@ public abstract class JListControlPane extends JControlPane implements ListContr
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(24))); setPreferredSize(new Dimension(list.getWidth(), FineUIScale.scale(UIManager.getInt("List.cellRender.height"))));
if (value instanceof ListModelElement) { if (value instanceof ListModelElement) {
ListModelElement element = ((ListModelElement) value); ListModelElement element = ((ListModelElement) value);
Nameable nameable = element.wrapper; Nameable nameable = element.wrapper;

6
designer-base/src/main/java/com/fr/design/gui/ilist/JNameEdList.java

@ -22,10 +22,10 @@ import java.util.Vector;
public class JNameEdList extends UIList implements CellEditorListener { public class JNameEdList extends UIList implements CellEditorListener {
/** /**
* 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为16x16 * 原值为20,设计器图标由png替换为svg之后JNameEdList的icon大小为24x24
* 重命名是会出现左侧一部分带有背景色的渲染 * 重命名是会出现左侧一部分带有背景色的渲染
*/ */
private static final int ICON_WIDTH = 16; private static final int ICON_WIDTH = 24;
private boolean editable = true; private boolean editable = true;
// kunsnat: 是否强制ListName是数字 (int型) // kunsnat: 是否强制ListName是数字 (int型)
@ -240,7 +240,7 @@ public class JNameEdList extends UIList implements CellEditorListener {
return false; return false;
} }
Rectangle rect = this.getCellBounds(index, index); Rectangle rect = this.getCellBounds(index, index);
// alex:所有的JNameEdList都有Icon,空出前面20 * 20的位置就是放的Icon // alex:所有的JNameEdList都有Icon,空出前面24 * 24的位置就是放的Icon
rect.setRect(createRect(rect, getIconWidth())); rect.setRect(createRect(rect, getIconWidth()));
editorComp.setBounds(rect); editorComp.setBounds(rect);

3
designer-base/src/main/java/com/fr/design/i18n/DesignSizeI18nManager.java

@ -1,5 +1,6 @@
package com.fr.design.i18n; package com.fr.design.i18n;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.locale.LocaleManager; import com.fr.locale.LocaleManager;
@ -52,6 +53,6 @@ public class DesignSizeI18nManager {
if (arr.length < SPLIT_LENGTH) { if (arr.length < SPLIT_LENGTH) {
return BasicDialog.DEFAULT; return BasicDialog.DEFAULT;
} }
return new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX])); return FineUIScale.scale(new Dimension(Integer.parseInt(arr[WIDTH_INDEX]), Integer.parseInt(arr[HEIGHT_INDEX])));
} }
} }

8
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -107,6 +107,8 @@ import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import static com.fine.theme.utils.FineUIScale.scale;
public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener { public class DesignerFrame extends JFrame implements JTemplateActionListener, TargetModifiedListener {
private static final String DESIGNER_FRAME_NAME = "designer_frame"; private static final String DESIGNER_FRAME_NAME = "designer_frame";
@ -115,7 +117,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final long serialVersionUID = -8732559571067484460L; private static final long serialVersionUID = -8732559571067484460L;
private static final int MENU_HEIGHT = 26; private static final int MENU_HEIGHT = scale(26);
private static final Integer SECOND_LAYER = 100; private static final Integer SECOND_LAYER = 100;
@ -578,8 +580,8 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
closeButton.setBorder(null); closeButton.setBorder(null);
int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2; int x = contentWidth - EastRegionContainerPane.getInstance().getContainerWidth() - closeMode.getIconWidth() / 2;
int y = MENU_HEIGHT - closeMode.getIconHeight() / 2; int y = MENU_HEIGHT - closeMode.getIconHeight() / 2;
closeButton.setBounds(x, y, UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH, closeButton.setBounds(x, y, scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH),
UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH); scale(UIConstants.CLOSE_AUTHORITY_HEIGHT_AND_WIDTH));
} }
/** /**

31
designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java

@ -1,6 +1,7 @@
package com.fr.design.mainframe.check; package com.fr.design.mainframe.check;
import com.fine.theme.icon.LazyIcon; import com.fine.theme.icon.LazyIcon;
import com.formdev.flatlaf.util.ScaledEmptyBorder;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.dialog.FineJOptionPane; import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -24,7 +25,7 @@ import javax.swing.JDialog;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import java.awt.FlowLayout; import java.awt.BorderLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
@ -32,6 +33,10 @@ import java.awt.event.WindowEvent;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
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.flex;
import static com.fine.swing.ui.layout.Layouts.row;
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog;
import static javax.swing.JOptionPane.OK_CANCEL_OPTION; import static javax.swing.JOptionPane.OK_CANCEL_OPTION;
import static javax.swing.JOptionPane.OK_OPTION; import static javax.swing.JOptionPane.OK_OPTION;
@ -73,7 +78,7 @@ public class CheckButton extends UIButton {
} }
if (set.isEmpty()) { if (set.isEmpty()) {
okButton.setEnabled(true); okButton.setEnabled(true);
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); imageLabel.setIcon(new LazyIcon("success", 20));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>"); message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>");
} else { } else {
if (dialog != null) { if (dialog != null) {
@ -172,7 +177,7 @@ public class CheckButton extends UIButton {
@Override @Override
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) {
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); imageLabel.setIcon(new LazyIcon("error", 20));
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>"); message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>");
okButton.setEnabled(true); okButton.setEnabled(true);
return null; return null;
@ -198,16 +203,16 @@ public class CheckButton extends UIButton {
dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName())); dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName()));
JPanel jp = new JPanel(); JPanel jp = new JPanel();
JPanel upPane = new JPanel(); JPanel upPane = new JPanel();
JPanel downPane = new JPanel(); JPanel downPane = new JPanel(new BorderLayout());
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png")); imageLabel = new UILabel(new LazyIcon("waiting", 20));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.add(row(10,
upPane.add(imageLabel); column(cell(imageLabel),flex()), cell(message)
upPane.add(message); ).getComponent());
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); downPane.add(okButton, BorderLayout.EAST);
downPane.add(okButton); jp.setLayout(new BorderLayout());
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); jp.add(column(flex(), cell(upPane), flex()).getComponent());
jp.add(upPane); jp.add(downPane, BorderLayout.SOUTH);
jp.add(downPane); jp.setBorder(new ScaledEmptyBorder(10, 10, 10,10));
dialog.add(jp); dialog.add(jp);
dialog.setResizable(false); dialog.setResizable(false);
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this));

4
designer-base/src/main/resources/com/fine/theme/icon/tip/waiting.svg

@ -0,0 +1,4 @@
<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="M30 16C30 23.7313 23.7313 30 16 30C8.26871 30 2 23.7313 2 16C2 8.26871 8.26871 2 16 2C23.7313 2 30 8.26871 30 16Z" fill="#2576EF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.96855 8.00001L9.97222 8H22.0278L22.0314 8.00001H22.2222L22.2201 8.01902C22.6649 8.10828 23 8.50112 23 8.97222C23 9.50917 22.5647 9.94444 22.0278 9.94444H22.0062L21.8879 11.0091C21.7678 12.0894 21.2815 13.1137 20.4912 13.9505L18.4461 16.1159L20.3508 17.9646C21.2301 18.8181 21.7783 19.8932 21.9168 21.0359L22.0337 22C22.5679 22.0032 23 22.4373 23 22.9722C23 23.5092 22.5647 23.9445 22.0278 23.9445H9.97222C9.43528 23.9445 9 23.5092 9 22.9722C9 22.4373 9.4321 22.0032 9.96633 22L10.0832 21.0359C10.2217 19.8932 10.7699 18.8181 11.6492 17.9646L13.5539 16.1159L11.5088 13.9505C10.7185 13.1137 10.2322 12.0894 10.1121 11.0091L9.99383 9.94444H9.97222C9.43528 9.94444 9 9.50917 9 8.97222C9 8.50112 9.33507 8.10828 9.77989 8.01902L9.77778 8.00001H9.96855ZM11.6014 9.94444L11.7046 10.8736C11.7938 11.6762 12.1551 12.4371 12.7421 13.0586L15.4038 15.8768C15.5498 16.0315 15.5445 16.2748 15.3919 16.4229L12.8376 18.902C12.1844 19.5361 11.7772 20.3347 11.6743 21.1836L11.5753 22H20.4247L20.3257 21.1836C20.2228 20.3347 19.8156 19.5361 19.1624 18.902L16.6081 16.4229C16.4555 16.2748 16.4502 16.0315 16.5962 15.8768L19.2579 13.0586C19.8449 12.4371 20.2062 11.6762 20.2954 10.8736L20.3986 9.94444H11.6014ZM16.7778 18.1111C16.7778 18.5407 16.4296 18.8889 16 18.8889C15.5704 18.8889 15.2222 18.5407 15.2222 18.1111C15.2222 17.6816 15.5704 17.3333 16 17.3333C16.4296 17.3333 16.7778 17.6816 16.7778 18.1111ZM18.3333 12.5528C18.3333 12.4009 18.2102 12.2778 18.0583 12.2778H13.9417C13.7898 12.2778 13.6667 12.4009 13.6667 12.5528C13.6667 12.6257 13.6956 12.6956 13.7472 12.7472L15.725 14.725C15.8769 14.8769 16.1231 14.8769 16.275 14.725L18.2528 12.7472C18.3044 12.6956 18.3333 12.6257 18.3333 12.5528Z" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

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

@ -439,6 +439,7 @@
"top": "border/top.svg", "top": "border/top.svg",
"all":"border/all.svg", "all":"border/all.svg",
"error":"tip/error.svg", "error":"tip/error.svg",
"waiting":"tip/waiting.svg",
"information":"tip/information.svg", "information":"tip/information.svg",
"new_information":"tip/new_information.svg", "new_information":"tip/new_information.svg",
"success":"tip/success.svg", "success":"tip/success.svg",

1
designer-base/src/main/resources/com/fine/theme/light/ui/laf/FineLightLaf.properties

@ -450,6 +450,7 @@ List.showCellFocusIndicator = false
List.cellRender.background = #FFF List.cellRender.background = #FFF
List.cellRender.button.width = 28 List.cellRender.button.width = 28
List.cellRender.button.height = 24 List.cellRender.button.height = 24
List.cellRender.height = 24
List.wrapper.text.fontColor = #0a1c3877 List.wrapper.text.fontColor = #0a1c3877
#---- Menu ---- #---- Menu ----

2
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties

@ -1,5 +1,5 @@
# \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height # \u9ED8\u8BA4\u4E3A\u7C7B\u7684\u5168\u9650\u5B9A\u540D\uFF08\u53EF\u81EA\u5B9A\u4E49key\uFF09= width * height
com.fr.design.mainframe.check.CheckButton=250*118 com.fr.design.mainframe.check.CheckButton=360*160
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=360*185 com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=360*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31 com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=325*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=360*280 com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=360*280

Loading…
Cancel
Save