Browse Source

Merge pull request #7918 in DESIGN/design from final/10.0 to persist/10.0

* commit '941089d0ee000a1c819fb9986dbead1c2b44d356':
  REPORT-66167 解决图表栏有时候无法显示某些图表的问题
  REPORT-66342 组件复用-设计器里在线组件页面一直显示加载中,日志没有报错;帆软市场web页面效果正常
  REPORT-66174 组件复用-tab块组件创建的复用组件,原始尺寸没超过500*300,但是复用组件的尺寸和原始尺寸不一致了
  REPORT-63660 修正不合理的国际化命名
  REPORT-65920
  REPORT-65724 安全性-水印-水印公式不解析 1.从全局读取水印
  REPORT-65724 安全性-水印-水印公式不解析 1.所有面板读取水印都从global读取
  REPORT-65920 【11.0】mac电脑设计器全屏,tab-移动端-样式模板,下拉框偶发性的会出现在下面一个层级
  REPORT-66011 设计器显示的文字错了
  REPORT-65950 fix 改成toFront
  REPORT-63660 frm新旧自适应切换-国际化问题
  REPORT-65950 10.0设计器打开11.0模板时,全局样式丢失和大版本不匹配的弹窗顺序不对
  REPORT-58799 模版缺失插件提示无法关闭
persist/10.0 10.0.19.2022.02.14
superman 3 years ago
parent
commit
d96182d015
  1. 11
      designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java
  2. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java
  3. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  4. 42
      designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java
  5. 0
      designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png
  6. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java
  7. 6
      designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java
  8. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java
  9. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  10. 13
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  11. 8
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java
  12. 4
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

11
designer-base/src/main/java/com/fr/design/dialog/InformationWarnPane.java

@ -37,6 +37,17 @@ public class InformationWarnPane extends JPanel{
public void show() {
showWindow(SwingUtilities.getWindowAncestor(this)).setVisible(true);
}
public void showOnFront() {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
AlertDialog dialog = showWindow(SwingUtilities.getWindowAncestor(InformationWarnPane.this));
dialog.setVisible(true);
dialog.toFront();
}
});
}
public InformationWarnPane(String infor, String moreInfo, String title) {
this.title = title;

4
designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java

@ -10,9 +10,11 @@ import com.fr.design.data.BasicTableDataTreePane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener;
import com.fr.design.utils.LoadingUtils;
import javax.swing.JComponent;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
@ -31,7 +33,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener
private static final long serialVersionUID = 1L;
private JTemplate<?, ?> component;
private TransparentPane transparentPane = new TransparentPane();
private OpenLoadingPane loadingPane = new OpenLoadingPane();
private JPanel loadingPane = LoadingUtils.createLoadingPane();
private OpenFailedPane failedPane = new OpenFailedPane();
private JLayeredPane layeredPane = new JLayeredPane() {
@Override

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

@ -1096,7 +1096,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
String info = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Open-New_Form_Tip");
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
if (showTipPane) {
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
new InformationWarnPane(info, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).showOnFront();
}
return true;
}
@ -1119,7 +1119,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
String infor = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Template_Version_Not_Match", DesignUtils.parseVersion(xmlDesignerVersion));
String moreInfo = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Version_Tip_More_Info");
if (showTipPane) {
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).show();
new InformationWarnPane(infor, moreInfo, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips")).showOnFront();
}
return true;
}

42
designer-base/src/main/java/com/fr/design/mainframe/OpenLoadingPane.java → designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java

@ -1,35 +1,29 @@
package com.fr.design.mainframe;
package com.fr.design.utils;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.general.IOUtils;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.LayoutManager;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/4/9
*/
public class OpenLoadingPane extends JPanel {
private static final ImageIcon LOADING_ICON = new ImageIcon(IOUtils.readImage("/com/fr/design/images/mainframe/openloading.png"));
public class LoadingUtils {
private static final ImageIcon LOADING_ICON = new ImageIcon(IOUtils.readImage("/com/fr/design/images/mainframe/loading.png"));
private static final Color TIP_COLOR = new Color(108, 174, 235);
private static final int Y_GAP = 50;
private static final int X_GAP = 10;
private UILabel loadingLabel;
private UILabel tipLabel;
public OpenLoadingPane() {
setLayout(new LayoutManager() {
public static JPanel createLoadingPane() {
JPanel jPanel = new JPanel();
UILabel loadingLabel = new UILabel(LOADING_ICON);
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Loading"));
tipLabel.setForeground(TIP_COLOR);
jPanel.setLayout(new LayoutManager() {
@Override
public void removeLayoutComponent(Component comp) {
}
@ -64,12 +58,10 @@ public class OpenLoadingPane extends JPanel {
public void addLayoutComponent(String name, Component comp) {
}
});
setBackground(Color.WHITE);
loadingLabel = new UILabel(LOADING_ICON);
tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Open_Template_Loading"));
tipLabel.setForeground(TIP_COLOR);
add(loadingLabel);
add(tipLabel);
jPanel.setBackground(Color.WHITE);
jPanel.add(loadingLabel);
jPanel.add(tipLabel);
return jPanel;
}
}
}

0
designer-base/src/main/resources/com/fr/design/images/mainframe/openloading.png → designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

4
designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java

@ -196,7 +196,9 @@ public class FormParaWidgetPane extends JPanel {
JPanel componentsPara = new JPanel(new FlowLayout(FlowLayout.LEFT));
WidgetOption[] chartOptions = loadChartOptions();
for (WidgetOption chartOption : chartOptions) {
componentsPara.add(new ToolBarButton(chartOption));
ToolBarButton button = new ToolBarButton(chartOption);
button.setPreferredSize(new Dimension(widgetButtonWidth, widgetButtonHeight));
componentsPara.add(button);
}
int x = COMMON_CHAR_NUM * (widgetButtonWidth + smallGAP);
int y = (int) Math.ceil(chartOptions.length / ((double) COMMON_CHAR_NUM)) * (widgetButtonHeight + smallGAP);

6
designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java

@ -27,7 +27,11 @@ public enum OnlineWidgetSortType implements SortType<OnlineShareWidget> {
public int compare(OnlineShareWidget o1, OnlineShareWidget o2) {
double t1 = getSortValue(o1, parameterMap);
double t2 = getSortValue(o2, parameterMap);
return ComparatorUtils.compareCommonType(t2, t1);
// Comparator中比较double/float相等时,不允许误差. 否则会违背 "若x = y , y = z, 则x = z"的约定。
// 因为允许误差的情况下,x和y间的误差在允许范围内,被判定相等,y和间的误差在允许范围内,被判定相等,
// 但x和z间的误差可能超出允许范围,从而不相等,因此会违背上述约定。
// 产生IllegalArgumentException: Comparison method violates its general contract!
return Double.compare(t2, t1);
}
});
}

7
designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java

@ -8,14 +8,11 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWTitleLayout;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.FormSelection;
import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate;
import com.fr.form.share.SharableWidgetProvider;
import com.fr.form.share.bean.ShareLayoutWidget;
import com.fr.form.share.constants.ComponentPath;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
@ -38,9 +35,7 @@ public class ShareComponentUtils {
public static XCreator createXCreator(Widget creatorSource, String shareId, SharableWidgetProvider provider) {
XCreator xCreator;
if (creatorSource instanceof WCardMainBorderLayout) {
xCreator = XCreatorUtils.createXCreator(creatorSource, new Dimension(500, 300));
} else if (creatorSource instanceof ShareLayoutWidget) {
if (creatorSource instanceof ShareLayoutWidget) {
xCreator = XCreatorUtils.createXCreator(((ShareLayoutWidget) creatorSource).getWidget(), new Dimension(provider.getWidth(), provider.getHeight()));
} else {
xCreator = XCreatorUtils.createXCreator(creatorSource, new Dimension(provider.getWidth(), provider.getHeight()));

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -13,11 +13,9 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.xpane.LayoutStylePane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.LayoutBorderStyle;
@ -25,7 +23,6 @@ import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.act.BorderPacker;
import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory;
@ -134,7 +131,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
layoutCombox.setSelectedIndex(1);
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle());
boundPane.populate();
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
//从全局读取水印
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplateAndGlobal(getCurrentIOFile()));
}
public WAbsoluteBodyLayout updateSubPane() {

13
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -18,7 +18,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xpane.LayoutStylePane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
@ -38,9 +37,12 @@ import com.fr.general.act.BorderPacker;
import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
/**
* Created by ibm on 2017/8/2.
@ -160,7 +162,8 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
adaptComboBox.setSelectedIndex(ob.getCompState());
componentIntervel.setValue(ob.getCompInterval());
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle());
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile()));
//从全局读取水印
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplateAndGlobal(getCurrentIOFile()));
}
private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) {

8
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppUtils.java

@ -8,7 +8,6 @@ import com.fr.design.extra.exe.callback.ModifyStatusCallback;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.app.PluginRemote.PluginStatus;
import com.fr.design.ui.util.UIUtil;
import com.fr.locale.InterProviderFactory;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.context.PluginMarkerAdapter;
@ -27,6 +26,7 @@ import com.fr.third.guava.cache.CacheBuilder;
import com.fr.third.guava.collect.Multimap;
import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities;
import java.time.Duration;
import java.util.Collection;
import java.util.Map;
@ -167,8 +167,8 @@ public class DesignerAppUtils {
disable.clear();
// 从所有未安装中过滤远程未启用的,添加到未启用列表
disable.addAll(notInstall.stream().filter(plugin ->
pluginRemoteStatus.containsKey(plugin.getPluginID())
&& !pluginRemoteStatus.get(plugin.getPluginID()).isRunning())
pluginRemoteStatus.containsKey(plugin.getPluginID())
&& !pluginRemoteStatus.get(plugin.getPluginID()).isRunning())
.collect(Collectors.toList()));
// 清理未安装中所有远程安装过的插件(包含启用和未启用)
notInstall.removeIf(adapter -> pluginRemoteStatus.containsKey(adapter.getPluginID()));
@ -183,7 +183,7 @@ public class DesignerAppUtils {
// 试图获取多行读取错误提示并缓存待处理列表
String detail = dealWithErrorDetailMultiLineAndCache(path);
if (detail.length() > 0) {
UIUtil.invokeLaterIfNeeded(() -> {
SwingUtilities.invokeLater(() -> {
if (WorkContext.getCurrent().isLocal()) {
UIExpandDialog.Builder()
.owner(DesignerContext.getDesignerFrame())

4
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -834,7 +834,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
tipCardPane.setPreferredSize(new Dimension(224, 50));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
} else {
//未定义
@ -958,7 +958,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
//显示set和tip
setCardPane.setPreferredSize(new Dimension(156, 20));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 2, VGAP);
tipCardPane.setPreferredSize(new Dimension(224, 40));
tipCardPane.setPreferredSize(new Dimension(224, 50));
TableLayoutHelper.modifyTableLayoutIndexVGap(contentPane, 4, VGAP_INNER);
break;
case EVEN:

Loading…
Cancel
Save