Browse Source

Merge pull request #15082 in DESIGN/design from release/11.0 to final/11.0

* commit '011edc36e55b4f1b7ddf6c372a116d190c8936ff': (22 commits)
  REPORT-135591 控件显示增强不支持改变按钮组控件的字体 && REPORT-125065 自定义样式和主题预览效果不一致
  alpha搜索增加fvs文件
  REPORT-134932【设计器】参数面板的背景颜色会在“撤回"报表主体设计时消失
  REPORT-135106 表格字体加载问题和语言导致的图表消失问题
  配置放在设计器模块
  配置放在设计器模块
  REPORT-135046 feat:设计器语言切换支持扩展新语种
  REPORT-130762 feat:JNDI数据连接提供禁用配置
  REPORT-130762 feat:JNDI数据连接提供禁用配置
  REPORT-132457 fix:设计器参数栏组件小窗设置展示不全
  REPORT-131817 高德国产图层替换Mapbox图层
  REPORT-134777 超链名称支持公式计算-全局查找匹配不到控件里的公式
  按钮不用加tooltip,回滚一下
  REPORT-106743 fix:设计器地图英文显示问题
  增加AppTypeFilter过滤插件类型,如果为空则不过滤
  REPORT-132109 fix: FVS插件 浅色主题-表格内合并单元格导致键入文字颜色为白色(非默认)
  REPORT-126773 fix: 修复自定义主题修改配色预览不生效问题
  控件剪切、复制按钮fix
  控件剪切、复制按钮fix
  控件剪切、复制按钮fix
  ...
final/11.0
superman 1 month ago
parent
commit
1a1c0f52aa
  1. 17
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 2
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java
  3. 6
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 18
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  5. 19
      designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java
  6. 13
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  7. 56
      designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java
  8. 1
      designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  10. 31
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  11. 17
      designer-base/src/main/java/com/fr/design/utils/DesignUtils.java
  12. 1
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java
  13. 5
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java
  14. 3
      designer-chart/src/main/resources/com/fr/design/editor/script/editor.js
  15. 86
      designer-chart/src/main/resources/com/fr/design/editor/script/i18n.js
  16. 22
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  17. 12
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  18. 2
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  19. 2
      designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java
  20. 2
      designer-form/src/main/java/com/fr/design/widgettheme/ParaTreeEditorSettingPane.java
  21. 41
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java
  22. 13
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java
  23. 15
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java
  24. 27
      designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java
  25. 4
      designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java
  26. 2
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  27. 4
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

17
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -40,19 +40,17 @@ import com.fr.design.mainframe.vcs.ui.UIPositiveIntEditor;
import com.fr.design.mainframe.vcs.ui.VcsMovePanel; import com.fr.design.mainframe.vcs.ui.VcsMovePanel;
import com.fr.design.os.impl.SupportOSImpl; import com.fr.design.os.impl.SupportOSImpl;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.design.utils.DesignUtils;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.widget.FRWidgetFactory; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.io.attr.ImageExportAttr; import com.fr.io.attr.ImageExportAttr;
import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager; import com.fr.report.ReportConfigManager;
import com.fr.scheduler.tool.FineScheduler;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.logging.log4j.Level; import com.fr.third.apache.logging.log4j.Level;
@ -76,7 +74,6 @@ import javax.swing.ButtonGroup;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JProgressBar; import javax.swing.JProgressBar;
@ -89,7 +86,15 @@ import javax.swing.UIManager;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Window;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
@ -816,7 +821,7 @@ public class PreferencePane extends BasicPane {
} }
private UIDictionaryComboBox<Locale> createLanguageComboBox() { private UIDictionaryComboBox<Locale> createLanguageComboBox() {
Map<Locale, String> map = InterProviderFactory.getProvider().getSupportLocaleMap(); Map<Locale, String> map = DesignUtils.getAvailableLanguages();
int size = map.size(); int size = map.size();
Locale[] keys = new Locale[size]; Locale[] keys = new Locale[size];
String[] values = new String[size]; String[] values = new String[size];

2
designer-base/src/main/java/com/fr/design/actions/help/alphafine/AlphaFineConstants.java

@ -143,7 +143,7 @@ public class AlphaFineConstants {
public static final String FIRST_PAGE = "-1"; public static final String FIRST_PAGE = "-1";
public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM}; public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.VIS};
public static final int RECOMMEND_MAX_ITEM_NUM = 3; public static final int RECOMMEND_MAX_ITEM_NUM = 3;

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

@ -8,6 +8,7 @@ import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.metric.utils.DatabaseConnectionMetricHandler; import com.fr.data.metric.utils.DatabaseConnectionMetricHandler;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.decision.webservice.exception.security.SecurityRestrictionException;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.general.MapCompareUtils; import com.fr.general.MapCompareUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -25,6 +26,7 @@ import com.fr.license.database.DBTypes;
import com.fr.license.database.DataBaseTypePointManager; import com.fr.license.database.DataBaseTypePointManager;
import com.fr.license.exception.DataBaseNotSupportedException; import com.fr.license.exception.DataBaseNotSupportedException;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.security.SecurityConfig;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -233,6 +235,10 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
if (connection instanceof JDBCDatabaseConnection) { if (connection instanceof JDBCDatabaseConnection) {
DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null); DatabaseConnectionMetricHandler.handleSaveConnection((JDBCDatabaseConnection) connection, null);
} }
// JNDI禁用提示
if (connection instanceof JNDIDatabaseConnection && SecurityConfig.getInstance().isDisableJNDI()) {
throw new SecurityRestrictionException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_JNDI_Disabled"));
}
default: default:
break; break;
} }

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

@ -14,6 +14,7 @@ import com.fr.data.solution.entity.DriverPage;
import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor; import com.fr.data.solution.processor.ClassNotFoundExceptionSolutionProcessor;
import com.fr.data.solution.processor.SolutionProcessor; import com.fr.data.solution.processor.SolutionProcessor;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
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.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -25,6 +26,7 @@ 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.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo; import com.fr.rpc.RPCInvokerExceptionInfo;
import com.fr.security.SecurityConfig;
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;
@ -42,6 +44,7 @@ import javax.swing.SwingConstants;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import javax.swing.UIManager; import javax.swing.UIManager;
import javax.swing.JOptionPane;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -95,7 +98,11 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
@Override @Override
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
if (mainPanel instanceof JNDIDefPane && SecurityConfig.getInstance().isDisableJNDI()) {
FineJOptionPane.showMessageDialog(mainPanel, Toolkit.i18nText("Fine-Design_Basic_Database_Connection_JNDI_Disabled"),
Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
return;
}
// Try the java connection. // Try the java connection.
final SwingWorker<Void, Void> connectionThread = new TestConnectionWorker(); final SwingWorker<Void, Void> connectionThread = new TestConnectionWorker();
midPane.setVisible(false); midPane.setVisible(false);
@ -493,7 +500,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
driverTips.setText(Toolkit.i18nText("Fine_Designer_Not_Found_Driver")); driverTips.setText(Toolkit.i18nText("Fine_Designer_Not_Found_Driver"));
gridJpanel.add(driverTips); gridJpanel.add(driverTips);
UILabel deatail = new UILabel(); UILabel deatail = new UILabel();
String content = Toolkit.i18nText("Fine_Designer_Not_Found") + " " + detailMessage+ " " + Toolkit.i18nText("Fine_Designer_Driver"); String content = Toolkit.i18nText("Fine_Designer_Not_Found") + " " + detailMessage + " " + Toolkit.i18nText("Fine_Designer_Driver");
deatail.setText(content); deatail.setText(content);
deatail.setToolTipText(content); deatail.setToolTipText(content);
gridJpanel.add(deatail); gridJpanel.add(deatail);
@ -538,7 +545,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); jsp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
Connection con = DatabaseConnectionPane.this.updateBean(); Connection con = DatabaseConnectionPane.this.updateBean();
if(con instanceof JDBCDatabaseConnection && WorkContext.getCurrent().isLocal()) { if (con instanceof JDBCDatabaseConnection && WorkContext.getCurrent().isLocal()) {
String driverPath = JarFileParseUtil.getDriverClassPath((JDBCDatabaseConnection) con); String driverPath = JarFileParseUtil.getDriverClassPath((JDBCDatabaseConnection) con);
jta.append(Toolkit.i18nText("Fine_Designer_Current_Driver_Path") + ":" + driverPath + "\n"); jta.append(Toolkit.i18nText("Fine_Designer_Current_Driver_Path") + ":" + driverPath + "\n");
JPanel testDriverPanel = generateTestDriverPanel((JDBCDatabaseConnection) con, driverPath); JPanel testDriverPanel = generateTestDriverPanel((JDBCDatabaseConnection) con, driverPath);
@ -581,16 +588,17 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
driverTestTip.setCursor(Cursor.getDefaultCursor()); driverTestTip.setCursor(Cursor.getDefaultCursor());
} }
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
try { try {
String path; String path;
if(driverPath.endsWith(JarFileParseUtil.JAR_MARKER)) { if (driverPath.endsWith(JarFileParseUtil.JAR_MARKER)) {
path = new File(driverPath).getParent(); path = new File(driverPath).getParent();
} else { } else {
path = driverPath; path = driverPath;
} }
if(hasDuplicateDriver(con.getDriver(), path)) { if (hasDuplicateDriver(con.getDriver(), path)) {
testResult.setForeground(Color.RED); testResult.setForeground(Color.RED);
testResult.setText(Toolkit.i18nText("Fine_Designer_Driver_Conflict")); testResult.setText(Toolkit.i18nText("Fine_Designer_Driver_Conflict"));
} else { } else {

19
designer-base/src/main/java/com/fr/design/data/datapane/preview/PreviewTablePane.java

@ -7,10 +7,14 @@ import com.fr.base.TableData;
import com.fr.base.svg.IconUtils; import com.fr.base.svg.IconUtils;
import com.fr.data.TableDataSource; import com.fr.data.TableDataSource;
import com.fr.data.desensitize.base.DesensitizationTableData; import com.fr.data.desensitize.base.DesensitizationTableData;
import com.fr.data.impl.Connection;
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.JNDIDatabaseConnection;
import com.fr.data.impl.NameDataModel; import com.fr.data.impl.NameDataModel;
import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.decision.webservice.exception.security.SecurityRestrictionException;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager; import com.fr.design.data.datapane.preview.desensitization.TableDataPreviewDesensitizeManager;
@ -39,6 +43,7 @@ import com.fr.general.FRFont;
import com.fr.general.data.DataModel; import com.fr.general.data.DataModel;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.security.SecurityConfig;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -589,11 +594,25 @@ public class PreviewTablePane extends BasicPane {
if (tableData instanceof DBTableData) { if (tableData instanceof DBTableData) {
boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase()); boolean status = DataOperator.getInstance().testConnection(((DBTableData) tableData).getDatabase());
if (!status) { if (!status) {
validateJndiDisabled(((DBTableData) tableData).getDatabase());
throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed")); throw new Exception(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Failed"));
} }
} }
} }
/**
* 校验下是否为JNDI连接且禁用该功能若是显示禁用信息提示
*
* @param connection
*/
private void validateJndiDisabled(Connection connection) throws SecurityRestrictionException {
if (SecurityConfig.getInstance().isDisableJNDI()) {
if (connection instanceof NameDatabaseConnection && ((NameDatabaseConnection) connection).getConnection() instanceof JNDIDatabaseConnection) {
throw new SecurityRestrictionException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_JNDI_Disabled"));
}
}
}
/** /**
* 处理预览Model的列类型 * 处理预览Model的列类型
* *

13
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -7,6 +7,7 @@ import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.App; import com.fr.design.mainframe.App;
import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager; import com.fr.design.mainframe.manager.search.TemplateTreeSearchManager;
import com.fr.file.filetree.AppTypeFilter;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -19,6 +20,7 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -38,6 +40,8 @@ public class TemplateFileTree extends EnvFileTree {
private static final int MAX_NODE_EXPAND_NUM = 50; private static final int MAX_NODE_EXPAND_NUM = 50;
private static final int MAX_MATCHED_NODE_NUM = 500; private static final int MAX_MATCHED_NODE_NUM = 500;
protected AppTypeFilter appTypeFilter;
public TemplateFileTree() { public TemplateFileTree() {
super(ProjectConstants.REPORTLETS_NAME, null, null); super(ProjectConstants.REPORTLETS_NAME, null, null);
} }
@ -155,12 +159,17 @@ public class TemplateFileTree extends EnvFileTree {
supportTypes.add(FileExtension.parse(temp)); supportTypes.add(FileExtension.parse(temp));
} }
} }
if (appTypeFilter != null) {
Collections.addAll(supportTypes, appTypeFilter.getSupportedTypes());
} else {
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING); Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App temp : apps) { for (App temp : apps) {
for (String extendsion : temp.defaultExtensions()) { for (String extendsion : temp.defaultExtensions()) {
supportTypes.add(FileExtension.parse(extendsion)); supportTypes.add(FileExtension.parse(extendsion));
} }
} }
}
return supportTypes; return supportTypes;
} }
@ -360,6 +369,10 @@ public class TemplateFileTree extends EnvFileTree {
} }
} }
public void setAppTypeFilter(AppTypeFilter filter) {
appTypeFilter = filter;
}
private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) { private boolean notContained(String parentPath, ExpandMutableTreeNode treeNode) {
List<String> childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>()); List<String> childList = currentTreeMode.getOrDefault(parentPath, new ArrayList<>());
String name = ((FileNode) (treeNode.getUserObject())).getName(); String name = ((FileNode) (treeNode.getUserObject())).getName();

56
designer-base/src/main/java/com/fr/design/i18n/DesignExtendLanguageConfig.java

@ -0,0 +1,56 @@
package com.fr.design.i18n;
import com.fr.config.ConfigContext;
import com.fr.config.DefaultConfiguration;
import com.fr.config.Identifier;
import com.fr.config.holder.factory.Holders;
import com.fr.config.holder.impl.MapConf;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* 设计器语言扩展配置
*
* @author obo
* @since 11.0
* Created on 2024/09/26
*/
public class DesignExtendLanguageConfig extends DefaultConfiguration {
private static volatile DesignExtendLanguageConfig designExtendLanguageConfig = null;
/**
* 获取实例
*/
public static DesignExtendLanguageConfig getInstance() {
if (designExtendLanguageConfig == null) {
designExtendLanguageConfig = ConfigContext.getConfigInstance(DesignExtendLanguageConfig.class);
}
return designExtendLanguageConfig;
}
/**
* 设计器扩展的语言
* key为localeString例如en_US或envalue为改语言对应的国际化翻译key
*/
@Identifier("extendDesignLocales")
private MapConf<Map<String, String>> extendDesignLocales = Holders.map(new HashMap<>(), String.class, String.class);
public Map<String, String> getExtendedDesignLocales() {
return Collections.unmodifiableMap(extendDesignLocales.get());
}
public void setExtendedDesignLocales(Map<String, String> map) {
extendDesignLocales.set(map);
}
@Override
public Object clone() throws CloneNotSupportedException {
DesignExtendLanguageConfig cloned = (DesignExtendLanguageConfig) super.clone();
cloned.extendDesignLocales = ( MapConf<Map<String, String>>) extendDesignLocales.clone();
return cloned;
}
}

1
designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java

@ -968,6 +968,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane<ExportJavaScript
templateReportletTree = new TemplateFileTree(); templateReportletTree = new TemplateFileTree();
IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt"}); IOFileNodeFilter filter = new IOFileNodeFilter(new String[]{".cpt"});
templateReportletTree.setFileNodeFilter(filter); templateReportletTree.setFileNodeFilter(filter);
templateReportletTree.setAppTypeFilter(() -> new FileExtension[]{});
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
this.refreshEnv(); this.refreshEnv();

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

@ -84,7 +84,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30;
// 弹出对话框高度 // 弹出对话框高度
private static final int POPUP_MIN_HEIGHT = 145; private static final int POPUP_MIN_HEIGHT = 145;
private static final int POPUP_DEFAULT_HEIGHT = 356; private static final int POPUP_DEFAULT_HEIGHT = 600;
public static final String KEY_CELL_ELEMENT = "cellElement"; public static final String KEY_CELL_ELEMENT = "cellElement";
public static final String KEY_CELL_ATTR = "cellAttr"; public static final String KEY_CELL_ATTR = "cellAttr";
public static final String KEY_FLOAT_ELEMENT = "floatElement"; public static final String KEY_FLOAT_ELEMENT = "floatElement";

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

@ -268,9 +268,14 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
TemplateTheme usingTheme = getTemplateTheme(); TemplateTheme usingTheme = getTemplateTheme();
boolean isUsingThemeChanged = StringUtils.equals(event.themName, usingTheme.getName()); boolean isUsingThemeChanged = StringUtils.equals(event.themName, usingTheme.getName());
if (isUsingThemeChanged && (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE || if (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE ||
event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE)) { event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE) {
if (isUsingThemeChanged) {
checkAndResetTheme(); checkAndResetTheme();
} else {
// 修改主题配置,但是没有修改主题名称 , 需要重新保存文件
fireSuperTargetModified();
}
} }
} }
}; };
@ -470,6 +475,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 用于 切换工作目录 时的模板资源暂存 * 用于 切换工作目录 时的模板资源暂存
*
* @return * @return
*/ */
public FILE templateToStashFile4Envchange() { public FILE templateToStashFile4Envchange() {
@ -545,6 +551,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 刷新 模板资源 EditingFILE * 刷新 模板资源 EditingFILE
* 仅在切换工作目录reload模板时使用 * 仅在切换工作目录reload模板时使用
*
* @param file * @param file
*/ */
public void refreshResourceAndEditingFILE(FILE file) { public void refreshResourceAndEditingFILE(FILE file) {
@ -718,7 +725,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public void undo() { public void undo() {
this.getUndoManager().undo(); this.getUndoManager().undo();
// 撤销前模版使用主题可能已经被删除或修改,需要重置模版样式 // 撤销前模版使用主题可能已经被删除或修改,需要重置模版样式
checkAndResetTheme(); checkAndResetTheme(true);
fireSuperTargetModified(); fireSuperTargetModified();
} }
@ -728,7 +735,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
public void redo() { public void redo() {
this.getUndoManager().redo(); this.getUndoManager().redo();
// 重做前模版使用主题可能已经被删除或修改,需要重置模版样式 // 重做前模版使用主题可能已经被删除或修改,需要重置模版样式
checkAndResetTheme(); checkAndResetTheme(true);
fireSuperTargetModified(); fireSuperTargetModified();
} }
@ -1785,7 +1792,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
private CallbackSaveWorker saveAs(boolean showLoc) { private CallbackSaveWorker saveAs(boolean showLoc) {
FILE editingFILE = this.getEditingFILE(); FILE editingFILE = this.getEditingFILE();
if (editingFILE == null) { if (editingFILE == null) {
@ -1975,7 +1981,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} }
@Override @Override
public void saveDirectly() { public void saveDirectly() {
if (isSaving()) { if (isSaving()) {
@ -2125,17 +2130,19 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 获取此模板所使用的tab栏操作类型 * 获取此模板所使用的tab栏操作类型
*
* @return * @return
*/ */
public String getTemplateTabOperatorType(){ public String getTemplateTabOperatorType() {
return DEFAULT_TAB_OPERATOR; return DEFAULT_TAB_OPERATOR;
} }
/** /**
* 当前模板是否可以被保存 * 当前模板是否可以被保存
*
* @return / * @return /
*/ */
public boolean canBeSaved(){ public boolean canBeSaved() {
return true; return true;
} }
@ -2144,15 +2151,16 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
* *
* @return / * @return /
*/ */
public boolean supportCache(){ public boolean supportCache() {
return true; return true;
} }
/** /**
* 获取此模板在tab栏中显示的名称 * 获取此模板在tab栏中显示的名称
*
* @return * @return
*/ */
public String getTabShowName(JTemplate<?, ?> jTemplate){ public String getTabShowName(JTemplate<?, ?> jTemplate) {
String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName()); String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName());
if (!jTemplate.isSaved() && !name.endsWith(" *")) { if (!jTemplate.isSaved() && !name.endsWith(" *")) {
name += " *"; name += " *";
@ -2162,9 +2170,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 切换环境之前是否需要保存 * 切换环境之前是否需要保存
*
* @return * @return
*/ */
public boolean needSaveBeforeSwitchEnv(){ public boolean needSaveBeforeSwitchEnv() {
return false; return false;
} }

17
designer-base/src/main/java/com/fr/design/utils/DesignUtils.java

@ -11,6 +11,7 @@ import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.fun.DefaultValueAdjustProvider; import com.fr.design.fun.DefaultValueAdjustProvider;
import com.fr.design.fun.DesignerEnvProcessor; import com.fr.design.fun.DesignerEnvProcessor;
import com.fr.design.gui.UILookAndFeel; import com.fr.design.gui.UILookAndFeel;
import com.fr.design.i18n.DesignExtendLanguageConfig;
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.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
@ -19,10 +20,12 @@ import com.fr.file.FileFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.SupportLocale;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.CommonCodeUtils; import com.fr.stable.CommonCodeUtils;
import com.fr.stable.CommonUtils;
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.ObjectHolder; import com.fr.stable.bridge.ObjectHolder;
@ -50,8 +53,11 @@ import java.net.ServerSocket;
import java.net.Socket; import java.net.Socket;
import java.net.URI; import java.net.URI;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
@ -496,4 +502,15 @@ public class DesignUtils {
return Utils.getAvailableFontFamilyNames4Report(); return Utils.getAvailableFontFamilyNames4Report();
} }
/**
* 获取设计器可用的开放的语言配置包括默认开放的五种语言和finedb扩展项
* @return Locale和翻译对应的key
*/
public static Map<Locale, String> getAvailableLanguages() {
Map<Locale, String> map = new LinkedHashMap<>(SupportLocale.getInstance().getLocaleMap());
for (Map.Entry<String, String> entry : DesignExtendLanguageConfig.getInstance().getExtendedDesignLocales().entrySet()) {
map.put(CommonUtils.stringToLocale(entry.getKey()), entry.getValue());
}
return Collections.unmodifiableMap(map);
}
} }

1
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/GisLayerPane.java

@ -254,6 +254,7 @@ public class GisLayerPane extends JPanel implements UIObserver {
} }
public void populate(GisLayer layer) { public void populate(GisLayer layer) {
layer.convertMapboxLayer();
switch (layer.getGisLayerType()) { switch (layer.getGisLayerType()) {
case AUTO: case AUTO:
gisButton.setSelectedIndex(0); gisButton.setSelectedIndex(0);

5
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/WMSLayerPane.java

@ -57,14 +57,13 @@ public class WMSLayerPane extends JPanel implements UIObserver {
public WMSLayerPane() { public WMSLayerPane() {
final double p = TableLayout.PREFERRED; final double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p};
double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 44}; double[] COLUMN_SIZE = {TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH, 84, 95};
wmsUrl = new UITextArea(); wmsUrl = new UITextArea();
connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP")); connectButton = new UIButton(Toolkit.i18nText("Fine-Design_Chart_Connect_WMP"));
Component[][] comps = new Component[][]{ Component[][] comps = new Component[][]{
new Component[]{new UILabel("url"), wmsUrl, connectButton} new Component[]{new UILabel("URL"), wmsUrl, connectButton}
}; };
JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE); JPanel northPane = TableLayout4VanChartHelper.createGapTableLayoutPane(comps, rowSize, COLUMN_SIZE);
northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER); northPane.setBorder(TableLayout4VanChartHelper.SECOND_EDIT_AREA_BORDER);

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

@ -128,6 +128,9 @@
if (key === "src") { if (key === "src") {
return; return;
} }
value = window.transformI18nText(value);
str += " " + key + "=\"" + value + "\""; str += " " + key + "=\"" + value + "\"";
if (key === "alt" && dataIdMap[value.trim()]) { if (key === "alt" && dataIdMap[value.trim()]) {

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

@ -21,7 +21,12 @@
"BI-Basic_Save": "保存", "BI-Basic_Save": "保存",
"BI-Basic_More": "更多", "BI-Basic_More": "更多",
"BI-Custom_Color": "自定义颜色", "BI-Custom_Color": "自定义颜色",
"BI-Transparent_Color": "透明" "BI-Transparent_Color": "透明",
"Fine-Design_Chart_Category_Use_Name": "分类名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "值",
"Fine-Design_Chart_Use_Percent": "百分比",
"Fine-Design_Chart_Use_Summary_Value": "汇总值"
}; };
var taiwan = { var taiwan = {
@ -45,7 +50,12 @@
"BI-Basic_Save": "保存", "BI-Basic_Save": "保存",
"BI-Basic_More": "更多", "BI-Basic_More": "更多",
"BI-Custom_Color": "自定義顏色", "BI-Custom_Color": "自定義顏色",
"BI-Transparent_Color": "透明" "BI-Transparent_Color": "透明",
"Fine-Design_Chart_Category_Use_Name": "分類名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "值",
"Fine-Design_Chart_Use_Percent": "百分比",
"Fine-Design_Chart_Use_Summary_Value": "匯總值"
}; };
var english = { var english = {
@ -69,7 +79,12 @@
"BI-Basic_Save": "Save", "BI-Basic_Save": "Save",
"BI-Basic_More": "More", "BI-Basic_More": "More",
"BI-Custom_Color": "Custom Color", "BI-Custom_Color": "Custom Color",
"BI-Transparent_Color": "Transparent Color" "BI-Transparent_Color": "Transparent Color",
"Fine-Design_Chart_Category_Use_Name": "Category Name",
"Fine-Design_Chart_Series_Name": "Series",
"Fine-Design_Chart_Use_Value": "Value",
"Fine-Design_Chart_Use_Percent": "Percentage",
"Fine-Design_Chart_Use_Summary_Value": "Summary Value"
}; };
var japanese = { var japanese = {
@ -93,7 +108,12 @@
"BI-Basic_Save": "セーブ", "BI-Basic_Save": "セーブ",
"BI-Basic_More": "もっと", "BI-Basic_More": "もっと",
"BI-Custom_Color": "カスタムカラー", "BI-Custom_Color": "カスタムカラー",
"BI-Transparent_Color": "トランスペアレント" "BI-Transparent_Color": "トランスペアレント",
"Fine-Design_Chart_Category_Use_Name": "分類名",
"Fine-Design_Chart_Series_Name": "系列名",
"Fine-Design_Chart_Use_Value": "値",
"Fine-Design_Chart_Use_Percent": "パーセンテージ",
"Fine-Design_Chart_Use_Summary_Value": "まとめ値"
}; };
var korean = { var korean = {
@ -117,7 +137,12 @@
"BI-Basic_Save": "저장", "BI-Basic_Save": "저장",
"BI-Basic_More": "더", "BI-Basic_More": "더",
"BI-Custom_Color": "맞춤 색상", "BI-Custom_Color": "맞춤 색상",
"BI-Transparent_Color": "투명한" "BI-Transparent_Color": "투명한",
"Fine-Design_Chart_Category_Use_Name": "카테고리 명",
"Fine-Design_Chart_Series_Name": "표시값",
"Fine-Design_Chart_Use_Value": "값",
"Fine-Design_Chart_Use_Percent": "백분율",
"Fine-Design_Chart_Use_Summary_Value": "요약 값"
}; };
function transformI18n(language) { function transformI18n(language) {
@ -144,5 +169,56 @@
} }
} }
/**
* 将一个text转换成当前国际化语言环境的text
* @param text
* @returns {*}
*/
function transformI18nText(text) {
var i18nKey = _findI18nKey(text);
return window.BI.i18nText(i18nKey);
}
/**
* 根据text找到i18n的key
* @param text
* @returns {string}
* @private
*/
function _findI18nKey(text) {
for (var [key, value] of Object.entries(chinese)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(taiwan)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(english)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(japanese)) {
if (value === text) {
return key;
}
}
for ([key, value] of Object.entries(korean)) {
if (value === text) {
return key;
}
}
return '';
}
window.transformI18n = transformI18n; window.transformI18n = transformI18n;
window.transformI18nText = transformI18nText;
}()); }());

22
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -88,6 +88,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png");
private UpdateAction[] basicMainPaneActions;
public FormParaDesigner() { public FormParaDesigner() {
this(new FormParameterUI()); this(new FormParameterUI());
} }
@ -342,6 +344,18 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return designerActions.toArray(new UpdateAction[designerActions.size()]); return designerActions.toArray(new UpdateAction[designerActions.size()]);
} }
/**
* 主面板区域控件按钮action组
* @return
*/
public UpdateAction[] getBasicMainActions() {
if (basicMainPaneActions == null) {
basicMainPaneActions = new UpdateAction[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
new FormDeleteAction(this)};
}
return basicMainPaneActions;
}
private boolean searchQueryCreators(XLayoutContainer rootContainer) { private boolean searchQueryCreators(XLayoutContainer rootContainer) {
boolean b = false; boolean b = false;
for (int i = 0; i < rootContainer.getXCreatorCount(); i++) { for (int i = 0; i < rootContainer.getXCreatorCount(); i++) {
@ -736,8 +750,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @return 按钮组 a * @return 按钮组 a
*/ */
public JComponent[] toolBarButton4Form() { public JComponent[] toolBarButton4Form() {
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), UpdateAction[] actions = getBasicMainActions();
new FormDeleteAction(this).createToolBarComponent()}; JComponent[] components = new JComponent[actions.length];
for (int i = 0; i < actions.length; i++) {
components[i] = actions[i].createToolBarComponent();
}
return components;
} }
@Override @Override

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

@ -777,6 +777,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
for (UpdateAction action : getActions()) { for (UpdateAction action : getActions()) {
action.update(); action.update();
} }
UpdateAction[] actions = getBasicMainActions();
if (actions != null) {
for (UpdateAction action : actions) {
action.update();
}
}
} }
} }
@ -1485,6 +1493,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
return designerActions.toArray(new UpdateAction[designerActions.size()]); return designerActions.toArray(new UpdateAction[designerActions.size()]);
} }
public UpdateAction[] getBasicMainActions() {
return null;
}
private List<UpdateAction> getBasicActions(){ private List<UpdateAction> getBasicActions(){
if (basicActions == null) { if (basicActions == null) {
basicActions = new ArrayList<UpdateAction>(); basicActions = new ArrayList<UpdateAction>();

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

@ -686,7 +686,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
protected void applyUndoState(FormUndoState u) { protected void applyUndoState(FormUndoState u) {
try { try {
Form undoForm = (Form) u.getForm().clone(); Form undoForm = (Form) u.getForm().clone();
undoForm.checkAndResetTheme(); undoForm.checkAndResetTheme(true);
undoForm = (Form) FineColorSynchronizer.flush(undoForm, undoForm.getTemplateTheme()); undoForm = (Form) FineColorSynchronizer.flush(undoForm, undoForm.getTemplateTheme());
if (this.index == FORM_TAB) { if (this.index == FORM_TAB) {
//JForm的target重置 //JForm的target重置

2
designer-form/src/main/java/com/fr/design/widgettheme/ParaButtonSettingPane.java

@ -38,6 +38,7 @@ public class ParaButtonSettingPane<T extends Widget> extends ButtonSettingPane<T
fontColorButton.setColor(textStyle.getFontColor()); fontColorButton.setColor(textStyle.getFontColor());
bold.setSelected(textStyle.isBold()); bold.setSelected(textStyle.isBold());
italic.setSelected(textStyle.isItalic()); italic.setSelected(textStyle.isItalic());
fontNameSelectBox.setSelectedItem(textStyle.getName());
} }
@Override @Override
@ -48,6 +49,7 @@ public class ParaButtonSettingPane<T extends Widget> extends ButtonSettingPane<T
textStyle.setFontColor(fontColorButton.getColor()); textStyle.setFontColor(fontColorButton.getColor());
textStyle.setBold(bold.isSelected()); textStyle.setBold(bold.isSelected());
textStyle.setItalic(italic.isSelected()); textStyle.setItalic(italic.isSelected());
textStyle.setName((String) fontNameSelectBox.getSelectedItem());
paraButtonTheme.setTextStyle(textStyle); paraButtonTheme.setTextStyle(textStyle);
} }

2
designer-form/src/main/java/com/fr/design/widgettheme/ParaTreeEditorSettingPane.java

@ -36,6 +36,7 @@ public class ParaTreeEditorSettingPane<T extends TreeEditor> extends TreeEditorS
ThemeTextStyle textStyle = widgetTheme.getTextStyle(); ThemeTextStyle textStyle = widgetTheme.getTextStyle();
fontSizePane.setValue(textStyle.getFontSize()); fontSizePane.setValue(textStyle.getFontSize());
fontColorButton.setColor(textStyle.getFontColor()); fontColorButton.setColor(textStyle.getFontColor());
fontNameSelectBox.setSelectedItem(textStyle.getName());
} }
@Override @Override
@ -43,6 +44,7 @@ public class ParaTreeEditorSettingPane<T extends TreeEditor> extends TreeEditorS
ThemeTextStyle textStyle = new ThemeTextStyle(); ThemeTextStyle textStyle = new ThemeTextStyle();
textStyle.setFontSize(fontSizePane.getValue()); textStyle.setFontSize(fontSizePane.getValue());
textStyle.setFontColor(fontColorButton.getColor()); textStyle.setFontColor(fontColorButton.getColor());
textStyle.setName((String) fontNameSelectBox.getSelectedItem());
widgetTheme.setTextStyle(textStyle); widgetTheme.setTextStyle(textStyle);
} }
} }

41
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaReplaceObject.java

@ -4,27 +4,24 @@ import com.fr.base.BaseFormula;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.StoreProcedureParameter; import com.fr.base.StoreProcedureParameter;
import com.fr.base.core.KV;
import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.base.present.FormulaPresent; import com.fr.base.present.FormulaPresent;
import com.fr.base.present.Present;
import com.fr.data.condition.FormulaCondition; import com.fr.data.condition.FormulaCondition;
import com.fr.data.core.Compare; import com.fr.data.core.Compare;
import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.DealWithInfoValue;
import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.file.HistoryTemplateListCache;
import com.fr.form.main.Form;
import com.fr.function.IF;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.js.NameJavaScript;
import com.fr.js.SingleJavaScript; import com.fr.js.SingleJavaScript;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.report.cell.cellattr.CellInsertPolicyAttr; import com.fr.report.cell.cellattr.CellInsertPolicyAttr;
import com.fr.report.cell.cellattr.core.RichChar;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.stable.FormulaProvider; import com.fr.stable.FormulaProvider;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.collections.combination.Pair; import com.fr.stable.collections.combination.Pair;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@ -545,6 +542,40 @@ public enum FormulaReplaceObject implements DealWithInfoValue {
} }
return false; return false;
} }
},
/**
* 超链名字
*/
NAMEJAVASCRIPT("NameJavaScript") {
@Override
public Map<String, String> getValue(Object... o) {
HashMap<String, String> map = new HashMap<>();
if (StringUtils.isNotEmpty(((NameJavaScript) o[0]).getName())) {
map.put("content", ((NameJavaScript) o[0]).getName());
}
return map;
}
@Override
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
Object replaceObject = info.getContent().getReplaceObject();
info.updateOldStr(((NameJavaScript)replaceObject).getName(), findStr);
String str = ((NameJavaScript)replaceObject).getName();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
((NameJavaScript)replaceObject).setName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
@Override
public boolean check(Info info) {
if (info.getContent().getReplaceObject() instanceof NameJavaScript) {
NameJavaScript nameJavaScript = (NameJavaScript) info.getContent().getReplaceObject();
if (StableUtils.canBeFormula(nameJavaScript.getName())) {
return StringUtils.equals(nameJavaScript.getName(), info.getContent().getOldShowStr());
}
}
return false;
}
}; };

13
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/FormulaTag.java

@ -1,12 +1,12 @@
package com.fr.design.actions.replace.action.content.formula; package com.fr.design.actions.replace.action.content.formula;
import com.fr.chart.chartdata.MeterReportDefinition;
import com.fr.data.VerifyItem; import com.fr.data.VerifyItem;
import com.fr.data.impl.FormulaDictionary; import com.fr.data.impl.FormulaDictionary;
import com.fr.design.actions.replace.info.DealWithInfoValue; import com.fr.design.actions.replace.info.DealWithInfoValue;
import com.fr.design.actions.replace.info.Info; import com.fr.design.actions.replace.info.Info;
import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.actions.replace.utils.ShowValueUtils; import com.fr.design.actions.replace.utils.ShowValueUtils;
import com.fr.form.ui.Widget;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.plugin.chart.map.data.VanMapReportDefinition; import com.fr.plugin.chart.map.data.VanMapReportDefinition;
@ -173,6 +173,17 @@ public enum FormulaTag implements DealWithInfoValue {
dictionary.setProduceFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr)); dictionary.setProduceFormula(ShowValueUtils.replaceAll(str, findStr, replaceStr));
} }
} }
},
WIDGET_LABEL(SearchTag.WIDGET_LABEL) {
@Override
public void setValue(Info info, String findStr, String replaceStr, List<Pair<Integer, Integer>> operatorArray) {
if (info.getContent().getHoldObject() instanceof Widget) {
Widget widget = (Widget) info.getContent().getHoldObject();
String str = widget.getLabelName();
ShowValueUtils.updateAfterReplaceStr(info, str, findStr, replaceStr);
widget.setLabelName(ShowValueUtils.replaceAll(str, findStr, replaceStr));
}
}
}; };
int index; int index;

15
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/cell/SearchCellFormulaAction.java

@ -6,13 +6,13 @@ import com.fr.base.present.FormulaPresent;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.actions.replace.action.content.cell.SearchCellAction; import com.fr.design.actions.replace.action.content.cell.SearchCellAction;
import com.fr.design.actions.replace.action.content.formula.chart.SearchChartCollectionFormulaAction; import com.fr.design.actions.replace.action.content.formula.chart.SearchChartCollectionFormulaAction;
import com.fr.design.actions.replace.action.content.formula.highlight.condition.*;
import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormulaAction; import com.fr.design.actions.replace.action.content.formula.highlight.SearchHighlightFormulaAction;
import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionFormula;
import com.fr.design.actions.replace.action.content.formula.highlight.condition.SearchConditionManager;
import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction;
import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType; import com.fr.design.actions.replace.action.content.formula.widget.DictionaryType;
import com.fr.design.actions.replace.info.CellInfo; import com.fr.design.actions.replace.info.CellInfo;
import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.actions.replace.info.base.SearchTag; import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
@ -29,7 +29,7 @@ import com.fr.report.core.sort.common.CellSortAttr;
import com.fr.report.core.sort.sortexpression.FormulaSortExpression; import com.fr.report.core.sort.sortexpression.FormulaSortExpression;
import com.fr.report.core.sort.sortexpression.SortExpression; import com.fr.report.core.sort.sortexpression.SortExpression;
import com.fr.stable.CommonUtils; import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -119,7 +119,14 @@ public class SearchCellFormulaAction implements SearchCellFormula {
for (int i = 0; i < nameJavaScriptGroup.size(); i++) { for (int i = 0; i < nameJavaScriptGroup.size(); i++) {
SearchJSHighlightAction action = SearchJSHighlightAction.getInstance(); SearchJSHighlightAction action = SearchJSHighlightAction.getInstance();
ITContent content = ITContent.copy(cellInfo.getContent()); ITContent content = ITContent.copy(cellInfo.getContent());
content.addOtherPos(nameJavaScriptGroup.getNameHyperlink(i).getName()); String name = nameJavaScriptGroup.getNameHyperlink(i).getName();
if(StableUtils.canBeFormula(name)){
ITContent newContent = ITContent.copy(content);
newContent.setReplaceObject(nameJavaScriptGroup.getNameHyperlink(i));
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Hyperlink"));
formulaInfos.add(new FormulaInfo(newContent));
}
content.addOtherPos(name);
action.searchJSFormulaFromOther(formulaInfos, content, nameJavaScriptGroup.getNameHyperlink(i).getJavaScript()); action.searchJSFormulaFromOther(formulaInfos, content, nameJavaScriptGroup.getNameHyperlink(i).getJavaScript());
} }
} }

27
designer-realize/src/main/java/com/fr/design/actions/replace/action/content/formula/widget/AbstractSearchWidgetFormulaAction.java

@ -4,12 +4,14 @@ import com.fr.base.Formula;
import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction; import com.fr.design.actions.replace.action.content.formula.highlight.javascript.SearchJSHighlightAction;
import com.fr.design.actions.replace.info.FormulaInfo; import com.fr.design.actions.replace.info.FormulaInfo;
import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.actions.replace.info.base.ITContent;
import com.fr.design.actions.replace.info.base.SearchTag;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.form.event.Listener; import com.fr.form.event.Listener;
import com.fr.form.ui.DataControl; import com.fr.form.ui.DataControl;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.stable.StableUtils;
import java.util.List; import java.util.List;
@ -33,12 +35,13 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF
Widget widget = (Widget) content.getReplaceObject(); Widget widget = (Widget) content.getReplaceObject();
//控件值中的公式 //控件值中的公式
searchFormulaFromWidgetValue(content, formulaInfos); searchFormulaFromWidgetValue(content, formulaInfos);
searchFormulaFromWidgetLabel(content, formulaInfos);
for (int i = 0; i < widget.getListenerSize(); i++) { for (int i = 0; i < widget.getListenerSize(); i++) {
Listener listener = widget.getListener(i); Listener listener = widget.getListener(i);
ITContent newContent = ITContent.copy(content); ITContent newContent = ITContent.copy(content);
//控件的事件可以使用的JS有五种,这边统一交给Highlight那边判断超级链接并进行处理 //控件的事件可以使用的JS有五种,这边统一交给Highlight那边判断超级链接并进行处理
SearchJSHighlightAction jsHighlightAction = SearchJSHighlightAction.getInstance(); SearchJSHighlightAction jsHighlightAction = SearchJSHighlightAction.getInstance();
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Event"),listener.getName()); newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Report_Event"), listener.getName());
jsHighlightAction.searchJSFormulaFromOther(formulaInfos, newContent, listener.getAction()); jsHighlightAction.searchJSFormulaFromOther(formulaInfos, newContent, listener.getAction());
} }
@ -53,8 +56,8 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF
@Override @Override
public void searchFormulaFromWidgetValue(ITContent content, List<FormulaInfo> formulaInfos) { public void searchFormulaFromWidgetValue(ITContent content, List<FormulaInfo> formulaInfos) {
Widget widget = (Widget) content.getReplaceObject(); Widget widget = (Widget) content.getReplaceObject();
if (widget instanceof WScaleLayout){ if (widget instanceof WScaleLayout) {
widget = ((CRBoundsWidget)((WScaleLayout)widget).getWidget(0)).getWidget(); widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget();
} }
if (widget instanceof DataControl) { if (widget instanceof DataControl) {
if (isWidgetValueValid(((DataControl) widget))) { if (isWidgetValueValid(((DataControl) widget))) {
@ -66,7 +69,23 @@ public abstract class AbstractSearchWidgetFormulaAction implements SearchWidgetF
} }
} }
private boolean isWidgetValueValid(DataControl control){ public void searchFormulaFromWidgetLabel(ITContent content, List<FormulaInfo> formulaInfos) {
Widget widget = (Widget) content.getReplaceObject();
if (widget instanceof WScaleLayout) {
widget = ((CRBoundsWidget) ((WScaleLayout) widget).getWidget(0)).getWidget();
}
if (StableUtils.canBeFormula(widget.getLabelName())) {
ITContent newContent = ITContent.copy(content);
newContent.addOtherPos(Toolkit.i18nText("Fine-Design_Form_Label_Name"));
newContent.setHoldObject(widget);
newContent.setReplaceObject(widget.getLabelName());
newContent.setTag(SearchTag.WIDGET_LABEL);
formulaInfos.add(new FormulaInfo(newContent));
}
}
private boolean isWidgetValueValid(DataControl control) {
return control.getWidgetValue() != null return control.getWidgetValue() != null
&& control.getWidgetValue().getValue() instanceof Formula; && control.getWidgetValue().getValue() instanceof Formula;
} }

4
designer-realize/src/main/java/com/fr/design/actions/replace/info/base/SearchTag.java

@ -56,6 +56,10 @@ public class SearchTag {
* 引用JS * 引用JS
*/ */
public static final int IMPORT_JS = 11; public static final int IMPORT_JS = 11;
/**
* 控件-标签名称
*/
public static final int WIDGET_LABEL = 12;

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

@ -790,7 +790,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
protected void applyUndoState(WorkBookUndoState u) { protected void applyUndoState(WorkBookUndoState u) {
try { try {
WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone(); WorkBook undoWorkBook = (WorkBook) u.getWorkBook().clone();
undoWorkBook.checkAndResetTheme(); undoWorkBook.checkAndResetTheme(true);
undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme()); undoWorkBook = (WorkBook) FineColorSynchronizer.flush(undoWorkBook, undoWorkBook.getTemplateTheme());
this.setTarget(undoWorkBook); this.setTarget(undoWorkBook);
if (!DesignerMode.isAuthorityEditing()) { if (!DesignerMode.isAuthorityEditing()) {

4
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -407,7 +407,9 @@ public class CellSelection extends Selection {
if (hasCellElement) { if (hasCellElement) {
ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1); ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1);
} else { } else {
ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null), true); TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null);
AdjustWorkBookDefaultStyleUtils.adjustCellElement(cellElement);
ec.addCellElement(cellElement, true);
} }
return true; return true;

Loading…
Cancel
Save