Browse Source

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

* commit 'e550094e84048dc6d215bcd29cc9e3a366094cba':
  REPORT-53019 字体检查国际化显示不全
  REPORT-53019 字体检查国际化显示不全
  REPORT-53019 字体检查国际化显示不全
  REPORT-52987  修复kerberos认证下暴露的throwable和驱动加载优先级问题
  REPORT-52987   修复dataoperator的兼容问题;顺带修复发现的引用bug
  REPORT-52933 [阻止]修改log导出配置目录后,log一直为空
  REPORT-52264 修改弹窗的父窗口为DesignerContext.getDesignerFrame()
  REPORT-52264 模版权限编辑警告弹窗不在页面中间
  REPORT-52087 单元格元素数据列中首次修改字符不会生效
  REPORT-49014 update 修改下国际化key
  REPORT-49014 连接同一个远程环境,同时双击打开同一个模板 一人正常打开 一人打开空白
  REPORT-52087 单元格元素数据列中首次修改字符不会生效
  REPORT-52087 单元格元素数据列中首次修改字符不会生效
  代码修改
  REPORT-51188 决策报表的tab块,在绝对布局下拖拽存在缩小问题
  REPORT-51830 tab里报表块设置图片背景,复制粘贴得到的tab里的报表块预览时没有背景了,设计器里看是有图片背景的。0228也有此现象。
  REPORT-51188 决策报表的tab块,在绝对布局下拖拽存在缩小问题
persist/10.0 10.0.16.2021.06.10
superman 4 years ago
parent
commit
34c4367a0b
  1. 27
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  2. 30
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  4. 8
      designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java
  5. 18
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckButton.java
  6. 12
      designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java
  7. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties
  8. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties
  9. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties
  10. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh.properties
  11. 4
      designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties
  12. 2
      designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
  13. 2
      designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java
  14. 20
      designer-form/src/main/java/com/fr/design/mainframe/FormArea.java
  15. 27
      designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java
  16. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  17. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java
  18. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java
  19. 2
      designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java

27
designer-base/src/main/java/com/fr/design/DesignerEnvManager.java

@ -15,20 +15,18 @@ import com.fr.design.env.DesignerWorkspaceType;
import com.fr.design.env.LocalDesignerWorkspaceInfo; import com.fr.design.env.LocalDesignerWorkspaceInfo;
import com.fr.design.env.RemoteDesignerWorkspaceInfo; import com.fr.design.env.RemoteDesignerWorkspaceInfo;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.DesignerPortProvider;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.locale.impl.ProductImproveMark; import com.fr.design.locale.impl.ProductImproveMark;
import com.fr.design.mainframe.vcs.VcsConfigManager; import com.fr.design.mainframe.vcs.VcsConfigManager;
import com.fr.design.notification.SnapChatConfig; import com.fr.design.notification.SnapChatConfig;
import com.fr.design.port.DesignerPortContext; import com.fr.design.port.DesignerPortContext;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.style.color.ColorSelectConfigManager; import com.fr.design.style.color.ColorSelectConfigManager;
import com.fr.design.update.push.DesignerPushUpdateConfigManager;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.DesignerPort; import com.fr.design.utils.DesignerPort;
import com.fr.exit.DesignerExiter; import com.fr.exit.DesignerExiter;
import com.fr.file.FILEFactory; import com.fr.file.FILEFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogFormatter;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.SupportLocale; import com.fr.general.SupportLocale;
@ -36,15 +34,14 @@ import com.fr.general.locale.LocaleCenter;
import com.fr.general.locale.LocaleMark; import com.fr.general.locale.LocaleMark;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.ListMap; import com.fr.stable.ListMap;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.core.UUID; import com.fr.stable.core.UUID;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
@ -52,6 +49,7 @@ import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLWriter; import com.fr.stable.xml.XMLWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import com.fr.third.apache.log4j.FileAppender;
import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.WorkContextCallback; import com.fr.workspace.WorkContextCallback;
@ -78,8 +76,6 @@ import java.util.ListIterator;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
/** /**
* The manager of Designer GUI. * The manager of Designer GUI.
@ -306,14 +302,23 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
calender.setTimeInMillis(System.currentTimeMillis()); calender.setTimeInMillis(System.currentTimeMillis());
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); final String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new File(fileName).exists()) { if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new File(fileName)); StableUtils.makesureFileExist(new File(fileName));
} }
Handler handler = new FileHandler(fileName, true); LogHandler handler = new LogHandler<FileAppender>() {
final FileAppender appender = new FileAppender(
new com.fr.third.apache.log4j.PatternLayout("%d{HH:mm:ss} %t %p [%c] %m%n"),
fileName
);
@Override
public FileAppender getHandler() {
return appender;
}
};
handler.setFormatter(new FRLogFormatter()); FineLoggerFactory.getLogger().addLogAppender(handler);
FineLoggerFactory.getLogger().addLogHandler(handler);
} catch (SecurityException e) { } catch (SecurityException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} catch (IOException e) { } catch (IOException e) {

30
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -6,7 +6,7 @@ package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperatorProvider;
import com.fr.data.solution.ExceptionSolutionSelector; import com.fr.data.solution.ExceptionSolutionSelector;
import com.fr.data.solution.entity.DriverPage; import com.fr.data.solution.entity.DriverPage;
import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor; import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor;
@ -22,9 +22,12 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
@ -93,7 +96,26 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
Connection database = DatabaseConnectionPane.this.updateBean(); Connection database = DatabaseConnectionPane.this.updateBean();
// 返回连接结果 // 返回连接结果
DriverPage.updateCache(); DriverPage.updateCache();
DataOperator.getInstance().testConnectionWithException(database); final Exception[] exception = new Exception[1];
WorkContext.getCurrent().get(DataOperatorProvider.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 正常调用发生的异常也会被捕获,因此需要对异常类型进行判断,如果是NoSuchMethodException 就要去调用 testConnection
// 如果不是 NoSuchMethodException 保存下异常上下文
// 两种情况下异常都需要抛出
if (exceptionInfo.getException() instanceof NoSuchMethodException) {
if (!WorkContext.getCurrent().get(DataOperatorProvider.class).testConnection(database)) {
exception[0] = new Exception(Toolkit.i18nText("Fine-Design_Description_Of_Test_Connection"));
}
} else {
exception[0] = exceptionInfo.getException();
}
return null;
}
}).testConnectionWithException(database);
if (exception[0] != null) {
throw exception[0];
}
return null; return null;
} }
@ -114,8 +136,8 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
okButton.setEnabled(true); okButton.setEnabled(true);
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed")); message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed"));
Connection database = DatabaseConnectionPane.this.updateBean();
SolutionProcessor select = ExceptionSolutionSelector.get().select(e); SolutionProcessor select = ExceptionSolutionSelector.get().select(e, database);
if (select instanceof ClassNotFoundExceptionSolutionProcessor) { if (select instanceof ClassNotFoundExceptionSolutionProcessor) {
JPanel gridJpanel = new JPanel(); JPanel gridJpanel = new JPanel();
gridJpanel.setLayout(new GridLayout(5, 1, 0, 5)); gridJpanel.setLayout(new GridLayout(5, 1, 0, 5));

2
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -967,7 +967,7 @@ public class MutilTempalteTabPane extends JComponent {
//如果在权限编辑情况下,不允许切换到表单类型的工作簿 //如果在权限编辑情况下,不允许切换到表单类型的工作簿
if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) { if (DesignerMode.isAuthorityEditing() && !openedTemplate.get(selectedIndex).isJWorkBook()) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex)); DesignerContext.getDesignerFrame().addAndActivateJTemplate(openedTemplate.get(tempSelectedIndex));
FineJOptionPane.showMessageDialog(MutilTempalteTabPane.this, Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported") FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Form_Authority_Edited_Cannot_Be_Supported")
+ "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); + "!", Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE);
MutilTempalteTabPane.this.repaint(); MutilTempalteTabPane.this.repaint();
return; return;

8
designer-base/src/main/java/com/fr/design/gui/icombobox/LazyComboBox.java

@ -62,6 +62,12 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject})); this.setModel(new DefaultComboBoxModel<>(new Object[]{anObject}));
super.setSelectedItem(anObject); super.setSelectedItem(anObject);
} }
}
private void setSelectedItemWithDocumentChange(Object anObject) {
initialSelected = anObject;
super.setSelectedItem(anObject);
} }
@Override @Override
@ -183,7 +189,7 @@ public abstract class LazyComboBox extends UIComboBox implements PopupMenuListen
} }
filtering = true; filtering = true;
String xx = textField.getText(); String xx = textField.getText();
LazyComboBox.this.setSelectedItem(xx); LazyComboBox.this.setSelectedItemWithDocumentChange(xx);
this.item = textField.getText(); this.item = textField.getText();
setPopupVisible(true); setPopupVisible(true);

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

@ -4,12 +4,14 @@ 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;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.worker.save.CallbackSaveWorker; import com.fr.design.worker.save.CallbackSaveWorker;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler; import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.rpc.RPCInvokerExceptionInfo;
@ -21,7 +23,6 @@ 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.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -40,7 +41,7 @@ public class CheckButton extends UIButton {
private UILabel message; private UILabel message;
private UIButton okButton; private UIButton okButton;
private JDialog dialog; private JDialog dialog;
private UILabel uiLabel; private UILabel imageLabel;
public CheckButton() { public CheckButton() {
this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png")); this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png"));
@ -71,7 +72,7 @@ public class CheckButton extends UIButton {
} }
if (set.isEmpty()) { if (set.isEmpty()) {
okButton.setEnabled(true); okButton.setEnabled(true);
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png"));
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) {
@ -161,7 +162,6 @@ public class CheckButton extends UIButton {
}); });
checkThread.execute(); checkThread.execute();
dialog.setVisible(true); dialog.setVisible(true);
dialog.dispose();
} }
}; };
@ -171,7 +171,7 @@ public class CheckButton extends UIButton {
@Override @Override
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) {
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png"));
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;
@ -183,7 +183,7 @@ public class CheckButton extends UIButton {
private void initDialogPane() { private void initDialogPane() {
message = new UILabel(); message = new UILabel();
message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "..."); message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "...");
uiLabel = new UILabel(); imageLabel = new UILabel();
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
okButton.setEnabled(false); okButton.setEnabled(false);
okButton.addActionListener(new ActionListener() { okButton.addActionListener(new ActionListener() {
@ -194,13 +194,13 @@ public class CheckButton extends UIButton {
dialog = new JDialog(); dialog = new JDialog();
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font"));
dialog.setModal(true); dialog.setModal(true);
dialog.setSize(new Dimension(268, 118)); 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();
uiLabel = new UILabel(BaseUtils.readIcon("com/fr/design/images/waiting.png")); imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png"));
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10));
upPane.add(uiLabel); upPane.add(imageLabel);
upPane.add(message); upPane.add(message);
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0));
downPane.add(okButton); downPane.add(okButton);

12
designer-base/src/main/java/com/fr/design/mainframe/check/CheckFontInfoDialog.java

@ -3,11 +3,11 @@ package com.fr.design.mainframe.check;
import com.fr.design.dialog.link.MessageWithLink; import com.fr.design.dialog.link.MessageWithLink;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -17,13 +17,11 @@ import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.UIManager; import javax.swing.UIManager;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Frame; import java.awt.Frame;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Locale;
/** /**
* 字体缺失检测的具体结果对话框 * 字体缺失检测的具体结果对话框
@ -52,7 +50,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"), MessageWithLink linkMessage = new MessageWithLink(Toolkit.i18nText("Fine_Designer_Check_Font_Message"),
Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"), Toolkit.i18nText("Fine_Designer_Check_Font_Install_Font"),
CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html")); CloudCenter.getInstance().acquireUrlByKind("help.install.font", "https://help.fanruan.com/finereport/doc-view-3999.html"));
linkMessage.setPreferredSize(new Dimension(380, 31)); linkMessage.setPreferredSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink"));
messagePanel.add(linkMessage); messagePanel.add(linkMessage);
// 查看详情按钮 // 查看详情按钮
@ -89,11 +87,11 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (hiddenPanel.isVisible()) { if (hiddenPanel.isVisible()) {
hiddenPanel.setVisible(false); hiddenPanel.setVisible(false);
CheckFontInfoDialog.this.setSize(new Dimension(380, 185)); CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Look_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.right"));
} else { } else {
CheckFontInfoDialog.this.setSize(new Dimension(380, 280)); CheckFontInfoDialog.this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.unfold"));
hiddenPanel.setVisible(true); hiddenPanel.setVisible(true);
detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail")); detailLabel.setText(Toolkit.i18nText("Fine_Designer_Hide_Detail"));
directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down")); directUiLabel.setIcon(UIManager.getIcon("OptionPane.narrow.down"));
@ -114,7 +112,7 @@ public class CheckFontInfoDialog extends JDialog implements ActionListener {
this.add(topPanel, BorderLayout.NORTH); this.add(topPanel, BorderLayout.NORTH);
this.add(hiddenPanel, BorderLayout.CENTER); this.add(hiddenPanel, BorderLayout.CENTER);
this.add(bottomPanel, BorderLayout.SOUTH); this.add(bottomPanel, BorderLayout.SOUTH);
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US)? 400:380, 185)); this.setSize(DesignSizeI18nManager.getInstance().i18nDimension("com.fr.design.mainframe.check.CheckFontInfoDialog.collapse"));
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
} }

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_en.properties

@ -1 +1,5 @@
com.fr.design.mainframe.check.CheckButton=305*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=630*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=630*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=630*280
com.fr.design.report.ReportColumnsPane=800*600 com.fr.design.report.ReportColumnsPane=800*600

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ja_JP.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=280*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=610*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=610*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=610*280

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_ko_KR.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=230*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=490*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=490*35
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=490*280

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

@ -1 +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.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280

4
designer-base/src/main/resources/com/fr/design/i18n/dimension_zh_TW.properties

@ -0,0 +1,4 @@
com.fr.design.mainframe.check.CheckButton=250*118
com.fr.design.mainframe.check.CheckFontInfoDialog.collapse=385*185
com.fr.design.mainframe.check.CheckFontInfoDialog.messageWithLink=385*31
com.fr.design.mainframe.check.CheckFontInfoDialog.unfold=385*280

2
designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java

@ -235,6 +235,8 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
} else { } else {
container.add(creator, creator.toData().getWidgetName(),0); container.add(creator, creator.toData().getWidgetName(),0);
} }
//这边将组件添加到container后,需要做下layout处理,否则其内部的一些组件的宽高可能为0,从而导致在updateChildBounds的时候出现问题
LayoutUtils.layoutRootContainer(creator);
XWAbsoluteLayout layout = (XWAbsoluteLayout) container; XWAbsoluteLayout layout = (XWAbsoluteLayout) container;
layout.updateBoundsWidget(creator); layout.updateBoundsWidget(creator);
updateCreatorBackBound(); updateCreatorBackBound();

2
designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java

@ -121,7 +121,7 @@ public class XWFitLayout extends XLayoutContainer {
* 更新组件的backupBound * 更新组件的backupBound
* 拖动滑块改变容器大小改变的是界面显示大小更新bound再次拖入或拉伸边框用到 * 拖动滑块改变容器大小改变的是界面显示大小更新bound再次拖入或拉伸边框用到
*/ */
private void updateCreatorsBackupBound() { public void updateCreatorsBackupBound() {
for (int i=0,size=this.getComponentCount(); i<size; i++) { for (int i=0,size=this.getComponentCount(); i<size; i++) {
Component comp = this.getComponent(i); Component comp = this.getComponent(i);
XCreator creator = (XCreator) comp; XCreator creator = (XCreator) comp;

20
designer-form/src/main/java/com/fr/design/mainframe/FormArea.java

@ -36,6 +36,7 @@ import javax.swing.event.ChangeListener;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.Adjustable; import java.awt.Adjustable;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Container; import java.awt.Container;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.Insets; import java.awt.Insets;
@ -268,8 +269,26 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
} }
} }
LayoutUtils.layoutContainer(root); LayoutUtils.layoutContainer(root);
updateCreatorsBackupBound(root);
} }
/**
* 给所有自适应布局内部的组件设置backupBounds
* @param creator
*/
private void updateCreatorsBackupBound(XCreator creator) {
if (creator.acceptType(XWFitLayout.class)) {
((XWFitLayout) creator).updateCreatorsBackupBound();
}
for (int i = 0; i < creator.getComponentCount(); i++) {
Component object = creator.getComponent(i);
if(object instanceof XCreator){
updateCreatorsBackupBound((XCreator) object);
}
}
}
//设置宽度的控件及响应事件 //设置宽度的控件及响应事件
private void addWidthPaneListener() { private void addWidthPaneListener() {
widthPane.addActionListener( widthPane.addActionListener(
@ -449,7 +468,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent {
layout.setContainerPercent(1.0); layout.setContainerPercent(1.0);
traverAndAdjust(layout, 0.0); traverAndAdjust(layout, 0.0);
layout.adjustCreatorsWhileSlide(0.0); layout.adjustCreatorsWhileSlide(0.0);
// 拖动滑块,先将内部组件百分比大小计算,再计算容器大小 // 拖动滑块,先将内部组件百分比大小计算,再计算容器大小
Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); Dimension d = new Dimension(layout.getWidth(), layout.getHeight());

27
designer-realize/src/main/java/com/fr/design/mainframe/TemplateLockedHandler.java

@ -0,0 +1,27 @@
package com.fr.design.mainframe;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.i18n.Toolkit;
import com.fr.design.ui.util.UIUtil;
/**
* @author hades
* @version 10.0
* Created by hades on 2021/5/14
*/
public class TemplateLockedHandler {
public static void generateTipAndRefresh() {
UIUtil.invokeLaterIfNeeded(new Runnable() {
@Override
public void run() {
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine_Designer_Remote_Design_Locked_Message"),
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"),
FineJOptionPane.WARNING_MESSAGE);
DesignerFrameFileDealerPane.getInstance().refresh();
}
});
}
}

2
designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java

@ -13,6 +13,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DecodeDialog; import com.fr.design.mainframe.DecodeDialog;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.exception.DecryptTemplateException; import com.fr.exception.DecryptTemplateException;
@ -68,6 +69,7 @@ class CptApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp);
} catch (TplLockedException exp) { } catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp);
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java

@ -10,6 +10,7 @@ import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.DecodeDialog; import com.fr.design.mainframe.DecodeDialog;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.design.worker.open.OpenResult; import com.fr.design.worker.open.OpenResult;
import com.fr.design.worker.open.OpenWorker; import com.fr.design.worker.open.OpenWorker;
import com.fr.exception.DecryptTemplateException; import com.fr.exception.DecryptTemplateException;
@ -107,6 +108,7 @@ class FormApp extends AbstractAppProvider {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + file, exp);
} catch (TplLockedException exp) { } catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); FineLoggerFactory.getLogger().error(file + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate frm from " + file, exp); FineLoggerFactory.getLogger().error("Failed to generate frm from " + file, exp);
return null; return null;

2
designer-realize/src/main/java/com/fr/design/mainframe/app/XlsApp.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.app;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.exception.RemoteDesignPermissionDeniedException; import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.exception.TplLockedException; import com.fr.exception.TplLockedException;
import com.fr.file.FILE; import com.fr.file.FILE;
@ -30,6 +31,7 @@ class XlsApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp);
} catch (TplLockedException exp) { } catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate xls from " + tplFile, exp); FineLoggerFactory.getLogger().error("Failed to generate xls from " + tplFile, exp);
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/app/XlsxApp.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.app;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.TemplateLockedHandler;
import com.fr.exception.RemoteDesignPermissionDeniedException; import com.fr.exception.RemoteDesignPermissionDeniedException;
import com.fr.exception.TplLockedException; import com.fr.exception.TplLockedException;
import com.fr.file.FILE; import com.fr.file.FILE;
@ -31,6 +32,7 @@ class XlsxApp extends AbstractWorkBookApp {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + tplFile, exp);
} catch (TplLockedException exp) { } catch (TplLockedException exp) {
FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp); FineLoggerFactory.getLogger().error(tplFile + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), exp);
TemplateLockedHandler.generateTipAndRefresh();
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error("Failed to generate xlsx from " + tplFile, exp); FineLoggerFactory.getLogger().error("Failed to generate xlsx from " + tplFile, exp);
} }

Loading…
Cancel
Save