Browse Source

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

* commit 'c1d09df65974433e1e6d0ce53cd6261b50ef4836': (27 commits)
  CHART-17118 试管型仪表盘标签左右位置增加居中
  REPORT-42237 代码提到release
  REPORT-42913 之前想多了,这个在调用的时候还没开始渲染整个左侧的面板,此时拿不到父容器高度
  REPORT-42913 为设置上一次关闭设计器时upPane高度加上一个判断,避免upPane高度超过容器总高度
  REPORT-42913 改变电脑分辨率导致设计器的数据集面板丢失 【问题原因】数据集面板的位置与高度都跟parent.getHeight() - toolPaneY有关,而在Windows下,如果先把数据集面板的高度调的比较小,然后减小分辨率或者调大dpi使整个界面放大时,parent.getHeight()会减小,而toolPaneY在这种操作下是不会变的,此时toolPaneY会接近甚至大于parent.getHeight(),导致了数据集面板的位置位于整个屏幕之外,并且高度为负,显示不出来,表现为丢失 【改动思路】用一个成员变量parentHeight存储父容器的高度parent.getHeight(),在layoutContainer()方法中增加一个判断,当发现父容器高度有变化时,及时调整toolPaneY的大小,避免数据集面板无法显示
  REPORT-44051 远程打开含数据集多的模板慢
  REPORT-44298 alpha-fine搜不到帮助文档 【问题原因】之前的搜索帮助文档的url发生变化了 【改动思路】在crm里提交云端配置中对应value值修改的申请,代码中也需要调整一下url,以及修改一下返回数据中获取搜索结果的key
  REPORT-44225 出现npe
  KERNEL-6188 补充泛型
  KERNEL-6188 去除无用的try-catch
  KERNEL-6188 修改一下doInBackground()方法与done()方法之间传递参数的类型,去除冗余代码
  KERNEL-6188 DatabaseConnectionPane中的SwingWorker问题 【问题原因】在Swingworker的doInBackground中更新UI会导致出现卡死等问题 【改动方案】将doInBackground中与UI交互的部分移到done方法中,在EDT线程处理UI,比较安全;另外修改了dialog.show()过时方法和一些导包相关问题
  CHART-16853 处理富文本国际化
  增加空判断
  CHART-16853 处理富文本国际化
  CHART-16939 条件属性标签宽高问题
  REPORT-43905 重试错误输出改成warn
  REPORT-43754 【二轮冒烟】远程新建目录重复的名字不会提醒 【问题原因】在Listener中判断重复的逻辑有点问题,它会把用户修改了某一项名字后,点击的另一项的名字置为空,然后再遍历allListNames,看是否有重复的名字,例如,aa、bb、cc的列表中,用户将aa修改为bb,然后点击bb,这时候bb被置为空,再将aa、""、cc与bb比较,发现没有重复,即不会显示命名重复弹窗 【改动方案】把重命名后,allListNames中选中项的名字置为空的逻辑,修改为,重命名后,allListNames中重命名项的名字置为空。即修改aa为bb后,将bb与""、bb、cc比较,判断有重复,然后给出命名重复提示
  REPORT-43516 【视觉优化】页面设置与重复与冻结设置图标优化 【问题原因】页面设置和重复与冻结设置的图标重复了 【改动方案】更换重复与冻结设置的图标
  REPORT-41512 存储过程返回多个数据集在fr中调用只能返回一个
  ...
feature/big-screen
Hades 4 years ago
parent
commit
3e9218acad
  1. 4
      build.gradle
  2. 2
      designer-base/src/main/java/com/fr/design/data/datapane/TableDataNameObjectCreator.java
  3. 63
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  4. 18
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  5. 16
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  6. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  7. 29
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java
  8. 8
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  9. 2
      designer-base/src/main/java/com/fr/env/EnvListPane.java
  10. BIN
      designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png
  11. 20
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java
  12. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java
  13. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  14. 19
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html
  15. 2
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  16. 6
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js
  17. 15
      designer-chart/src/main/resources/com/fr/design/editor/script/enums.js
  18. 123
      designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js
  19. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  20. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  21. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  22. 2
      designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java
  23. 3
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  24. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  25. 2
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  26. 2
      designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java
  27. 4
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java
  28. 37
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java
  29. 3
      designer-realize/src/main/java/com/fr/poly/PolyDesigner.java
  30. 1
      designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

4
build.gradle

@ -72,7 +72,9 @@ allprojects {
implementation 'com.fr.datasource:fine-datasource:' + frVersion
implementation 'com.fr.decision:fine-decision:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + frVersion
implementation 'com.fr.report:fine-report-engine:' + frDevVersion
implementation 'com.fr.report:engine-report:' + frDevVersion
implementation 'com.fr.report:engine-chart:' + frDevVersion
implementation 'com.fr.report:engine-i18n:' + frDevVersion
implementation 'com.fr.design:design-i18n:' + frDevVersion
testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1'

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

@ -157,8 +157,10 @@ public class TableDataNameObjectCreator extends NameObjectCreator {
* @param names 名字
*/
public void addNames(String names) {
if (names != null) {
this.names.add(names);
}
}
/**
* 清除

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

@ -3,6 +3,7 @@
*/
package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.operator.DataOperator;
@ -10,6 +11,7 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
@ -19,12 +21,24 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import javax.swing.UIManager;
import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
/**
* Database Connection pane.
@ -48,9 +62,9 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
protected void initComponents() {
message = new UILabel();
uiLabel = new UILabel();
okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK"));
cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel"));
String[] defaultEncode = new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encode_Auto")};
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
String[] defaultEncode = new String[] {Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
@ -59,7 +73,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// 按钮.
JPanel testPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
northPane.add(testPane, BorderLayout.NORTH);
UIButton testButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
UIButton testButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"));
testPane.add(testButton);
testButton.addActionListener(testConnectionActionListener);
testPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 4));
@ -71,9 +85,9 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
northPane.add(chartSetPane);
chartSetPane.setBorder(BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Advanced")
Toolkit.i18nText("Fine-Design_Basic_Advanced")
));
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":"));
chartSetPane.add(GUICoreUtils.createNamedPane(charSetComboBox, Toolkit.i18nText("Fine-Design_Basic_Datasource_Charset") + ":"));
}
protected abstract JPanel mainPanel();
@ -84,7 +98,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
public void populateBean(com.fr.data.impl.Connection ob) {
this.originalCharSet = ob.getOriginalCharsetName();
if (StringUtils.isBlank(originalCharSet)) {
this.charSetComboBox.setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encode_Auto"));
this.charSetComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Encode_Auto"));
} else {
this.charSetComboBox.setSelectedItem(ob.getOriginalCharsetName());
}
@ -117,24 +131,29 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
public void actionPerformed(ActionEvent evt) {
// Try the java connection.
final SwingWorker connectionThread = new SwingWorker() {
protected Object doInBackground() throws Exception {
final SwingWorker<Boolean, Void> connectionThread = new SwingWorker<Boolean, Void>() {
@Override
protected Boolean doInBackground() throws Exception {
Connection database = DatabaseConnectionPane.this.updateBean();
// 返回连接结果
return DataOperator.getInstance().testConnection(database);
}
@Override
protected void done() {
try {
com.fr.data.impl.Connection database = DatabaseConnectionPane.this.updateBean();
boolean connect = DataOperator.getInstance().testConnection(database);
boolean connect = get();
okButton.setEnabled(true);
message.setText(database.connectMessage(connect));
if (connect) {
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon"));
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully"));
message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Connection_Successfully"));
}else{
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon"));
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Connection_Failed"));
message.setText(Toolkit.i18nText("Fine-Design_Basic_Connection_Failed"));
}
} catch (Exception exp) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp);
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return null;
}
};
@ -158,18 +177,18 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
}
});
dialog.show();
dialog.setVisible(true);
dialog.dispose();
}
};
private void initDialogPane() {
message.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection") + "...");
message.setText(Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection") + "...");
message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(DatabaseConnectionPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"), true);
dialog = new JDialog((Dialog) SwingUtilities.getWindowAncestor(DatabaseConnectionPane.this), Toolkit.i18nText("Fine-Design_Basic_Datasource_Test_Connection"), true);
dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false);
JPanel jp = new JPanel();

18
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java

@ -5,6 +5,7 @@ import com.fr.base.StoreProcedureParameter;
import com.fr.data.core.db.TableProcedure;
import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator;
import com.fr.design.actions.UpdateAction;
@ -29,13 +30,19 @@ import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JToolBar;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true);
sp.creatDataModel(Calculator.createCalculator());
ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false);
sp.refreshDataModelListAndResultNames(dataModels);
return null;
}

16
designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -45,6 +45,7 @@ public class UIResizableContainer extends JPanel {
private boolean isLeftRightDragEnabled = true;
private boolean isDownPaneVisible = true ;
private int paraHeight;
private int parentHeight = -1;
public UIResizableContainer(int direction) {
this(new JPanel(), new JPanel(), direction);
@ -207,7 +208,8 @@ public class UIResizableContainer extends JPanel {
if (verticalToolPane == null || downPane == null) {
return;
}
// REPORT-42913 如果用户修改了分辨率或者dpi,可能造成toolPaneY大于parent.getHeight,整个downPane将丢失,因此这里调整下toolPaneY
adjustToolPaneY(parent);
if (direction == Constants.RIGHT) {
if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);
@ -236,6 +238,18 @@ public class UIResizableContainer extends JPanel {
}
}
private void adjustToolPaneY(Container parent) {
if (parentHeight == -1) {
// 初始化下parentheight,存一下当前的父容器height
parentHeight = parent.getHeight();
} else if (parentHeight != parent.getHeight()) {
// parentHeight与父容器height不等时,代表用户调整分辨率或者dpi了,此时调整toolPaneY
toolPaneY = toolPaneY * parent.getHeight() / parentHeight;
toolPaneY = Math.min(toolPaneY, (parent.getHeight() - toolPaneHeight));
parentHeight = parent.getHeight();
}
}
@Override
public void addLayoutComponent(String name, Component comp) {
}

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

@ -136,9 +136,9 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
this.editingFILE = file;
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder());
designModel = createDesignModel();
addCenterPane();
this.undoState = createUndoState();
designModel = createDesignModel();
consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile));
initAndStartPlugin();

29
designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java

@ -44,6 +44,7 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane<Mobile
private JPanel centerPane;
protected MobileTemplatePreviewPane previewPane;
private WCardTagLayout tagLayout;
private MobileTemplateStyle customTempStyle;
public MobileTemplatePreviewPane getPreviewPane() {
@ -87,6 +88,14 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane<Mobile
custom.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
// 自定义 -> 标准
if (custom.getSelectedIndex() == 0) {
customTempStyle = getCustomMobileTemplateStyle();
}
// 标准 -> 自定义
if (custom.getSelectedIndex() == 1 && customTempStyle != null) {
populateBean(customTempStyle);
}
boolean isCustom = custom.getSelectedIndex() == 1;
centerPane.setVisible(isCustom);
updatePreviewPane();
@ -182,8 +191,24 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane<Mobile
protected abstract MobileTemplatePreviewPane createPreviewPane();
public MobileTemplateStyle getCustomMobileTemplateStyle() {
MobileTemplateStyle ob = updateSubStyle();
ob.setCustom(true);
if (initialColorBox != null) {
ob.setInitialColor(initialColorBox.getSelectObject());
}
if (fontConfPane != null) {
TabFontConfig config = new TabFontConfig();
config.setSelectColor(ob.getTabFontConfig().getSelectColor());
config.setFont(fontConfPane.update());
ob.setTabFontConfig(config);
}
return ob;
}
@Override
public void populateBean(MobileTemplateStyle ob) {
customTempStyle = ob.getCustomTemplateStyle();
centerPane.setVisible(ob.isCustom());
populateSubStyle(ob);
custom.setSelectedItem(!ob.isCustom() ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default") :
@ -211,7 +236,9 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane<Mobile
public MobileTemplateStyle updateConfig(){
if (custom.getSelectedIndex() == 0) {
return getDefaultTemplateStyle();
MobileTemplateStyle mobileTemplateStyle = getDefaultTemplateStyle();
mobileTemplateStyle.setCustomTemplateStyle(customTempStyle);
return mobileTemplateStyle;
}
MobileTemplateStyle ob = updateSubStyle();
ob.setCustom(custom.getSelectedIndex() == 1);

8
designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java

@ -298,7 +298,11 @@ public final class GUICoreUtils {
* @param win the current window august:现在要考虑左边日志模板的影响
*/
public static void centerWindow(Window win) {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// Toolkit.getDefaultToolkit().getScreenSize()在有多个显示器也只能获取到主屏的大小
// getGraphicsConfiguration().getBounds()能获取多个屏时 设计器主体界面所在屏的大小和对应的坐标
Rectangle rectangle = win.getGraphicsConfiguration().getBounds();
Dimension screenSize = rectangle.getSize();
Dimension winSize = win.getSize();
@ -308,7 +312,7 @@ public final class GUICoreUtils {
if (winSize.width > screenSize.width) {
winSize.width = screenSize.width;
}
win.setLocation((screenSize.width - winSize.width) / 2, (screenSize.height - winSize.height) / 2 - WINDOW_GAP);
win.setLocation(rectangle.x + (screenSize.width - winSize.width) / 2, rectangle.y + (screenSize.height - winSize.height) / 2 - WINDOW_GAP);
}
/**

2
designer-base/src/main/java/com/fr/env/EnvListPane.java vendored

@ -34,7 +34,7 @@ public class EnvListPane extends JListControlPane {
public void propertyChange() {
String tempName = getEditingName();
String[] allListNames = nameableList.getAllNames();
allListNames[nameableList.getSelectedIndex()] = StringUtils.EMPTY;
allListNames[editingIndex] = StringUtils.EMPTY;
if (StringUtils.isEmpty(tempName)) {
nameableList.stopEditing();
FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(EnvListPane.this), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Empty_Name_Warn_Text"));

BIN
designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

20
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartRichEditorPane.java

@ -1,7 +1,9 @@
package com.fr.van.chart.designer.component;
import com.fr.concurrent.NamedThreadFactory;
import com.fr.design.DesignerEnvManager;
import com.fr.design.ui.ModernUIPane;
import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.type.TextAlign;
@ -11,6 +13,7 @@ import com.teamdev.jxbrowser.chromium.JSValue;
import com.teamdev.jxbrowser.chromium.events.ScriptContextAdapter;
import com.teamdev.jxbrowser.chromium.events.ScriptContextEvent;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@ -63,6 +66,11 @@ public class VanChartRichEditorPane {
browser = event.getBrowser();
browser.getCacheStorage().clearCache();
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/fineui.min.js"));
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/design/editor/script/i18n.js"));
browser.executeJavaScript(generateTransformI18nJS());
browser.executeJavaScript(IOUtils.readResourceAsString("/com/fr/web/ui/materials.min.js"));
JSValue ns = browser.executeJavaScriptAndReturnValue("window." + namespace);
ns.asObject().setProperty(variable, model);
}
@ -110,6 +118,18 @@ public class VanChartRichEditorPane {
return new RichEditorModel(content, richText.isAuto(), paramsStr.toString(), initParams, align);
}
public static String generateTransformI18nJS() {
String language = "zh_CN";
Locale locale = DesignerEnvManager.getEnvManager().getLanguage();
if (locale != null) {
language = locale.toString();
}
return "!(function () { window.transformI18n && window.transformI18n('" + language + "' || 'zh_CN'); }());";
}
public static class RichEditorModel {
private String content = StringUtils.EMPTY;
private boolean auto = true;

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTooltipContentPane.java

@ -270,7 +270,7 @@ public class VanChartTooltipContentPane extends BasicBeanPane<AttrTooltipContent
} else if (content.getSelectedIndex() == RICH_EDITOR_INDEX) {
return editorPanel.getPreferredSize();
} else {
return new Dimension(commonPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height);
return new Dimension(editorPanel.getPreferredSize().width, htmlLabelPane.getPreferredSize().height);
}
}
};

10
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java

@ -195,8 +195,14 @@ public class VanChartGaugeLabelDetailPane extends VanChartPlotLabelDetailPane {
}
private TwoTuple<String[], Integer[]> getAlignNamesAndValues() {
String[] names = new String[]{Toolkit.i18nText("Fine-Design_Chart_Follow"), Toolkit.i18nText("Fine-Design_Chart_Align_Left"), Toolkit.i18nText("Fine-Design_Chart_Align_Right")};
Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT};
String[] names = new String[]{
Toolkit.i18nText("Fine-Design_Chart_Follow"),
Toolkit.i18nText("Fine-Design_Chart_Align_Left"),
Toolkit.i18nText("Fine-Design_Chart_StyleAlignment_Center"),
Toolkit.i18nText("Fine-Design_Chart_Align_Right")
};
Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.CENTER, Constants.RIGHT};
return new TwoTuple<>(names, values);
}

19
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -5,26 +5,9 @@
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="./rich_editor.css"/>
<script src="http://fanruan.design/fineui/2.0/fineui.js"></script>
<script src="https://fanruan.design/fineui/materials.bundle.min.js"></script>
</head>
<body>
<script>
BICst.RICH_TEXT_INFO = {
DATA_ID: "data-id",
DATA_NAME: "data-name",
DATA_FULL_NAME: "data-full-name",
DATA_ORIGIN_ID: "data-origin-id",
DATA_ORIGIN_NAME: "data-origin-name",
DATA_ORIGIN_FULL_NAME: "data-origin-full-name",
DATA_IS_INSERT_PARAM: "data-is-insert-param",
DATA_IS_MISSING_FIELD: "data-is-missing-field",
DATA_UN_VALID: "data-unvalid",
NAME: "name",
ALT: "alt",
SRC: "src"
};
</script>
<script src="script/enums.js"></script>
<script src="script/insertcombo/item/item.js"></script>
<script src="script/insertcombo/combo.insert_param.js"></script>
<script src="script/insertcombo/combo.insert_param.model.js"></script>

2
designer-chart/src/main/resources/com/fr/design/editor/script/editor.js

@ -52,7 +52,7 @@
type: "bi.htape",
items: [{
type: "bi.label",
text: "字体样式: ",
text: BI.i18nText("BI-Design_Font_Style") + ": ",
textAlign: "left",
width: 70
}, {

6
designer-chart/src/main/resources/com/fr/design/editor/script/editor.model.js

@ -17,8 +17,9 @@
fontStyleItems: function () {
return [{
type: "bi.single_select_radio_item",
text: "自动",
text: BI.i18nText("BI-Basic_Auto"),
hgap: 5,
width: 50,
logic: {
dynamic: true
},
@ -26,8 +27,9 @@
selected: this.options.isAuto
}, {
type: "bi.single_select_radio_item",
text: "自定义",
text: BI.i18nText("BI-Basic_Custom"),
hgap: 5,
width: 60,
logic: {
dynamic: true
},

15
designer-chart/src/main/resources/com/fr/design/editor/script/enums.js

@ -0,0 +1,15 @@
window.BICst = window.BICst || {};
BICst.RICH_TEXT_INFO = {
DATA_ID: "data-id",
DATA_NAME: "data-name",
DATA_FULL_NAME: "data-full-name",
DATA_ORIGIN_ID: "data-origin-id",
DATA_ORIGIN_NAME: "data-origin-name",
DATA_ORIGIN_FULL_NAME: "data-origin-full-name",
DATA_IS_INSERT_PARAM: "data-is-insert-param",
DATA_IS_MISSING_FIELD: "data-is-missing-field",
DATA_UN_VALID: "data-unvalid",
NAME: "name",
ALT: "alt",
SRC: "src"
};

123
designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js

@ -0,0 +1,123 @@
!(function () {
var chinese = {
"BI-Design_Font_Style": "字体样式",
"BI-Font_Size": "字号",
"BI-Basic_Auto": "自动",
"BI-Basic_Custom": "自定义",
"BI-Basic_Default": "默认",
"BI-Basic_Sim_Hei": "黑体",
"BI-Basic_Sim_Sun": "宋体",
"BI-Basic_Fang_Song": "仿宋",
"BI-Basic_Kai_Ti": "楷体",
"BI-Basic_Bold": "加粗",
"BI-Basic_Italic": "斜体",
"BI-Basic_Underline": "下划线",
"BI-Basic_Font_Color": "文字颜色",
"BI-Word_Align_Left": "文字居左",
"BI-Word_Align_Center": "文字居中",
"BI-Word_Align_Right": "文字居右"
};
var taiwan = {
"BI-Design_Font_Style": "字體樣式",
"BI-Font_Size": "字號",
"BI-Basic_Auto": "自動",
"BI-Basic_Custom": "自定義",
"BI-Basic_Default": "默認",
"BI-Basic_Sim_Hei": "黑體",
"BI-Basic_Sim_Sun": "宋體",
"BI-Basic_Fang_Song": "仿宋",
"BI-Basic_Kai_Ti": "楷體",
"BI-Basic_Bold": "加粗",
"BI-Basic_Italic": "斜體",
"BI-Basic_Underline": "下劃線",
"BI-Basic_Font_Color": "文字顏色",
"BI-Word_Align_Left": "文字居左",
"BI-Word_Align_Center": "文字居中",
"BI-Word_Align_Right": "文字居右"
};
var english = {
"BI-Design_Font_Style": "Font style",
"BI-Font_Size": "Font size",
"BI-Basic_Auto": "auto",
"BI-Basic_Custom": "custom",
"BI-Basic_Default": "default",
"BI-Basic_Sim_Hei": "Sim_Hei",
"BI-Basic_Sim_Sun": "Sim_Sun",
"BI-Basic_Fang_Song": "Fang_Song",
"BI-Basic_Kai_Ti": "Kai_Ti",
"BI-Basic_Bold": "Bold",
"BI-Basic_Italic": "Italic",
"BI-Basic_Underline": "UnderLine",
"BI-Basic_Font_Color": "Font Color",
"BI-Word_Align_Left": "Align Left",
"BI-Word_Align_Center": "Align Center",
"BI-Word_Align_Right": "Align Right"
};
var japanese = {
"BI-Design_Font_Style": "フォントスタイル",
"BI-Font_Size": "フォントサイズ",
"BI-Basic_Auto": "自動",
"BI-Basic_Custom": "カスタマイズ",
"BI-Basic_Default": "デフォルト",
"BI-Basic_Sim_Hei": "黒い体",
"BI-Basic_Sim_Sun": "ソンティ",
"BI-Basic_Fang_Song": "イミテーションソング",
"BI-Basic_Kai_Ti": "イタリック",
"BI-Basic_Bold": "大胆な",
"BI-Basic_Italic": "イタリック",
"BI-Basic_Underline": "アンダースコア",
"BI-Basic_Font_Color": "テキストの色",
"BI-Word_Align_Left": "左のテキスト",
"BI-Word_Align_Center": "テキスト中心",
"BI-Word_Align_Right": "右のテキスト"
};
var korean = {
"BI-Design_Font_Style": "글꼴 스타일",
"BI-Font_Size": "글꼴 크기",
"BI-Basic_Auto": "자동적 인",
"BI-Basic_Custom": "맞춤 설정",
"BI-Basic_Default": "기본",
"BI-Basic_Sim_Hei": "블랙 바디",
"BI-Basic_Sim_Sun": "송티",
"BI-Basic_Fang_Song": "모조 노래",
"BI-Basic_Kai_Ti": "기울임 꼴",
"BI-Basic_Bold": "굵게",
"BI-Basic_Italic": "이탤릭체",
"BI-Basic_Underline": "밑줄",
"BI-Basic_Font_Color": "텍스트 색상",
"BI-Word_Align_Left": "왼쪽 텍스트",
"BI-Word_Align_Center": "텍스트 중심",
"BI-Word_Align_Right": "오른쪽 텍스트"
};
function transformI18n(language) {
var BI = window.BI;
if (BI == null) {
return;
}
if (language == null) {
BI.addI18n(chinese);
}
if (language.indexOf('zh_TW') > -1) {
BI.addI18n(taiwan);
} else if (language.indexOf('en_US') > -1) {
BI.addI18n(english);
} else if (language.indexOf('ja_JP') > -1) {
BI.addI18n(japanese);
} else if (language.indexOf('ko_KR') > -1) {
BI.addI18n(korean);
} else {
BI.addI18n(chinese);
}
}
window.transformI18n = transformI18n;
}());

4
designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java

@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.CoverReportPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.EditingMouseListener;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.HelpDialogManager;
@ -267,6 +268,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator {
if (this != (XCreator) designer.getRootComponent()) {
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this);
editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter);
if (isEditing) {
EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS);
}
}
}
HelpDialogManager.getInstance().setPane(coverPanel);

5
designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java

@ -3,6 +3,7 @@ package com.fr.design.mainframe;
import com.fr.base.Parameter;
import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/
public void populateParameterPropertyPane() {
//参数
setParameterArray(getNoRepeatParas(getTarget().getParameters()));
setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter();
//容器
ParameterPropertyPane.getInstance().populateBean(this);
@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified();
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
setParameterArray(getNoRepeatParas(getTarget().getParameters()));
setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
refreshParameter();
}
} else {

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

@ -36,10 +36,10 @@ public class FormModelAdapter extends DesignModelAdapter<Form, BaseJForm<Form>>
* 参数改变.
*/
public void parameterChanged() {
//实时更新参数
jTemplate.populateParameter();
// 更新缓存的参数
updateCachedParameter();
//实时更新参数
jTemplate.populateParameter();
}
/**

2
designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java

@ -27,7 +27,7 @@ public class ReportPageAttrAction extends ReportComponentAction<WorkSheetDesigne
this.setMenuKeySet(KeySetUtils.REPORT_PAGE);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/pageSetup.png"));
this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/m_file/repeatAndFrozen.png"));
this.generateAndSetSearchText(RepeatAndFreezeSettingPane.class.getName());
}

3
designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java

@ -66,9 +66,10 @@ public class WorkBookModelAdapter extends DesignModelAdapter<WorkBook, JWorkBook
* 参数改变.
*/
public void parameterChanged() {
// 参数改变 先更新缓存
updateCachedParameter();
jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr();
updateCachedParameter();
}
/**

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java

@ -65,12 +65,12 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
}
SearchResult searchResult = new SearchResult();
for (int j = 0; j < searchText.length; j++) {
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j] + AlphaFineConstants.FIRST_PAGE;
String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j];
try {
String result = HttpToolbox.get(url);
AlphaFineHelper.checkCancel();
JSONObject jsonObject = new JSONObject(result);
JSONArray jsonArray = jsonObject.optJSONArray("docdata");
JSONArray jsonArray = jsonObject.optJSONArray("list");
if (jsonArray != null) {
for (int i = 0; i < jsonArray.length(); i++) {

2
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -131,7 +131,7 @@ public class DesignerSocketIO {
private static final Emitter.Listener failRetry = new Emitter.Listener() {
@Override
public void call(Object... args) {
FineLoggerFactory.getLogger().error("failed args: {}", Arrays.toString(args));
FineLoggerFactory.getLogger().warn("failed args: {}", Arrays.toString(args));
status = Status.Disconnecting;
socket.close();
count++;

2
designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java

@ -275,7 +275,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
paraDesignEditor.populate(parameterUI);
parameterArray = getNoRepeatParas(getTargetParameter(workBook));
parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter();
allParameters = reportParameterAttr.getParameters();

4
designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java

@ -40,6 +40,10 @@ public class PolyBlockProperPane extends DockingView {
polyBlockProperTable.populate(designer);
}
public void update(){
polyBlockProperTable.update();
}
@Override
public String getViewTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Property_Table");

37
designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java

@ -1,17 +1,24 @@
package com.fr.poly;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils;
import com.fr.poly.group.PolyBoundsGroup;
import com.fr.report.poly.TemplateBlock;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Container;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.*;
import java.awt.*;
public class PolyBlockProperTable extends JPanel {
private PolyDesigner designer;
@ -104,7 +111,12 @@ public class PolyBlockProperTable extends JPanel {
if (isPopulating || block == null) {
return;
}
block.setBlockName(blockPropertyPane.getWidgetNameField().getText());
if (blockPropertyPane.getWidgetNameField() != null) {
String toSetWidgetName = blockPropertyPane.getWidgetNameField().getText();
if (isBlockNameValid(toSetWidgetName, block.getBlockName())) {
block.setBlockName(toSetWidgetName);
}
}
PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
boundsgroup.setValue(x.getValue(), 0, 1);
boundsgroup.setValue(y.getValue(), 1, 1);
@ -112,4 +124,23 @@ public class PolyBlockProperTable extends JPanel {
boundsgroup.setValue(height.getValue(), 3, 1);
firePropertyEdit();
}
/**
*校验一下要设置的名称不能为空不能重名
*
*/
private boolean isBlockNameValid(String toSetWidgetName, String currentWidgetName) {
if (toSetWidgetName == null || toSetWidgetName.isEmpty()) {
blockPropertyPane.getWidgetNameField().setText(currentWidgetName);
return false;
}
for (int i = 0; i < this.designer.getTarget().getBlockCount(); i++) {
if (!ComparatorUtils.equals(currentWidgetName, toSetWidgetName) && ComparatorUtils.equals(toSetWidgetName, this.designer.getTarget().getBlock(i).getBlockName())) {
blockPropertyPane.getWidgetNameField().setText(currentWidgetName);
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Rename_Failure"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Joption_News"), FineJOptionPane.ERROR_MESSAGE, IOUtils.readIcon("com/fr/design/form/images/joption_failure.png"));
return false;
}
}
return true;
}
}

3
designer-realize/src/main/java/com/fr/poly/PolyDesigner.java

@ -623,6 +623,9 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
// 在停止编辑的时候,要把编辑器的值赋值给显示器
TemplateBlock block = selection.getValue();
selection.setValue(block);
if (isChooseBlock()){
((PolyBlockProperPane) this.getEastDownPane()).update();
}
this.removeEditor(selection.getEditor());
selection = null;
this.repaint();

1
designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java

@ -317,6 +317,7 @@ public class ImagePreLoader {
"com/fr/web/images/print.png",
"com/fr/design/images/m_report/watermark.png",
"com/fr/design/images/m_file/pageSetup.png",
"com/fr/design/images/m_file/repeatAndFrozen.png",
"com/fr/design/images/m_report/header.png",
"com/fr/design/images/m_report/footer.png",
"com/fr/design/images/m_report/background.png",

Loading…
Cancel
Save