Browse Source

Merge pull request #3094 in DESIGN/design from release/10.0 to final/10.0

* commit '73d81b94ce6bcef8bc80b55fd597634d3315911d': (52 commits)
  REPORT-44961 把TableDataDictPane中的needTableDataChange默认设置为true,在CheckBoxGroupDefinePane中创建DictionaryPane的时候传入一个false,这样就不会影响其它使用了DictionaryPane的地方了
  REPORT-44961 为单元格属性-形态-数据字典中的DictionaryPane也设置needChangeTableData变量为true
  REPORT-44961 修改一些变量名,删去无用导包
  CHART-17393 边框和背景隐藏后占用面板位置
  REPORT-44961 这个问题里先不处理二级弹窗
  REPORT-44961 【10.0.12冒烟】附件模板打开设计器卡死,且布局发生变化 【问题原因】带有数据字典的表单控件,在选中的时候会去连接获取字段信息,当系统中有同名数据连接但是无法连接到数据库的时候,会发生假死。如果没有这个数据连接的名字,那么会直接报错不会假死。主要还是这个数据字典获取数据的操作是耗时操作,不应该在UI线程进行耗时操作。 【改动思路】主要分为两部分,第一是将原本的tdChange()方法中的耗时操作放到SwingWorker中的工作线程中,这样的话即使后台数据连接失败,设计器也不会一直阻塞直到重连超时;第二是应产品的要求,将选中控件就会去请求连接并获取属于当前控件的列名这部分逻辑,修改为用户点击右侧面板中的数据字典旁边的button的时候才会去请求连接,并更换当前数据字典中的列名
  REPORT-45095 修复代码质量&优化传递
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 将对一些文件的误改动回退一下
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 与产品沟通后,确认修改方案为,当发生了足以造成数据集面板丢失的容器高度变化时,至少保证水平拖拽面板不丢失
  REPORT-45095 表单控件设置提交事件,添加字段后编辑字段,事件弹框消失
  REPORT-44961 【10.0.12冒烟】附件模板打开设计器卡死,且布局发生变化 【问题原因】带有数据字典的设计器控件,在选中的时候会去连接获取字段信息,当系统中有同名数据连接但是无法连接到数据库的时候,会发生假死。如果没有这个数据连接的名字,那么会直接报错不会假死。主要还是这个数据字典获取数据的操作是耗时操作,不应该在UI线程进行耗时操作。 【改动方案】主要分为两部分,第一是将原本的tdChange()方法中的耗时操作放到SwingWorker中的工作线程中,这样的话即使后台数据连接失败,设计器也不会一直阻塞直到重连超时;第二是应产品的要求,将选中控件就会去请求连接并获取属于当前控件的列名这部分逻辑,修改为用户点击右侧面板中的数据字典旁边的button,showDictPane的时候才会去请求连接
  CHART-17340 补充富文本国际化翻译
  REPORT-44714 修改错误注释
  REPORT-44714 删除调试语句
  REPORT-44714 【10.0.12冒烟】设计器缓存文件记录设计器设置失效 【问题原因】实际上缓存文件的存取没有问题,但是因为此前缓存文件中记录的是上子面板的高度值,而在设计器的打开过程中,父容器的高度会变化(且有时候变为负数),导致了关闭设计器前,上子面板相对于父容器高度的比例与打开设计器之后的比例不同,视觉上就出现了面板高度的偏差 【改动思路】将之前的思路修改为,在容器高度发生变化时,根据上子面板占容器高度的比例去调整上子面板的高度,且将缓存文件中存储上子面板高度修改为存储比例
  CHART-17340 富文本颜色组件增加国际化
  CHART-17315 标签边框背景面板在更新后增加check
  REPORT-44988 .FineReport100里面有很多残留的埋点文件
  REPORT-42381 删除tab页之后选中body布局
  代码质量
  ...
final/10.0
superman 4 years ago
parent
commit
f892180f27
  1. 4
      build.gradle
  2. 12
      designer-base/src/main/java/com/fr/design/DesignerEnvManager.java
  3. 9
      designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java
  4. 63
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  5. 18
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java
  6. 21
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  7. 5
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  8. 11
      designer-base/src/main/java/com/fr/design/mainframe/App.java
  9. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  10. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  11. 29
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java
  12. 7
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  13. 102
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  14. 8
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  15. BIN
      designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png
  16. 10
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  17. 10
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  18. 1
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  19. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  20. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  21. 9
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java
  22. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  23. 1
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  24. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  25. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  26. 2
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  27. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  28. 2
      designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java
  29. 3
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  30. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  31. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  32. 14
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  33. 6
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  34. 4
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java
  35. 2
      designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java
  36. 4
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java
  37. 37
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java
  38. 3
      designer-realize/src/main/java/com/fr/poly/PolyDesigner.java
  39. 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.datasource:fine-datasource:' + frVersion
implementation 'com.fr.decision:fine-decision:' + frVersion implementation 'com.fr.decision:fine-decision:' + frVersion
implementation 'com.fr.schedule:fine-schedule:' + 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 implementation 'com.fr.design:design-i18n:' + frDevVersion
testImplementation 'org.easymock:easymock:3.5.1' testImplementation 'org.easymock:easymock:3.5.1'
testImplementation 'org.powermock:powermock-module-junit4:1.7.1' testImplementation 'org.powermock:powermock-module-junit4:1.7.1'

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

@ -240,7 +240,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String installHome = StableUtils.getInstallHome(); String installHome = StableUtils.getInstallHome();
//这里不判断路径是.的情况,放在checkValid方法里面,重新选 //这里不判断路径是.的情况,放在checkValid方法里面,重新选
if (installHome != null) { if (installHome != null) {
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT"); String name = Toolkit.i18nText("Fine-Design_Basic_Engine_DEFAULT");
String envPath = designerEnvManager.getDefaultenvPath(installHome); String envPath = designerEnvManager.getDefaultenvPath(installHome);
designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath)); designerEnvManager.putEnv(name, LocalDesignerWorkspaceInfo.create(name, envPath));
designerEnvManager.setCurEnvName(name); designerEnvManager.setCurEnvName(name);
@ -304,8 +304,8 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH); String today = calender.get(Calendar.YEAR) + "-" + (calender.get(Calendar.MONTH) + 1) + "-" + calender.get(Calendar.DAY_OF_MONTH);
String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log"); String fileName = StableUtils.pathJoin(logLocation, "fr_" + today + "_%g.log");
if (!new java.io.File(fileName).exists()) { if (!new File(fileName).exists()) {
StableUtils.makesureFileExist(new java.io.File(fileName)); StableUtils.makesureFileExist(new File(fileName));
} }
Handler handler = new FileHandler(fileName, true); Handler handler = new FileHandler(fileName, true);
@ -529,7 +529,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
return env; return env;
} }
} }
String name = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); String name = Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath); LocalDesignerWorkspaceInfo newDefaultEnv = LocalDesignerWorkspaceInfo.create(name, defaultenvPath);
this.putEnv(name, newDefaultEnv); this.putEnv(name, newDefaultEnv);
return newDefaultEnv; return newDefaultEnv;
@ -552,7 +552,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
} }
} }
} }
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Workspace_Default"); return Toolkit.i18nText("Fine-Design_Basic_Workspace_Default");
} }
@ -1643,7 +1643,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) { if ((tmpVal = reader.getAttrAsString("webinfLocation", null)) != null) {
// marks:兼容6.1的 // marks:兼容6.1的
// marks:设置默认的目录. // marks:设置默认的目录.
String curReportServerName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"); String curReportServerName = Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server");
LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal); LocalDesignerWorkspaceInfo reportServer = LocalDesignerWorkspaceInfo.create(curReportServerName, tmpVal);
this.putEnv(curReportServerName, reportServer); this.putEnv(curReportServerName, reportServer);

9
designer-base/src/main/java/com/fr/design/condition/ConditionAttributesPane.java

@ -14,10 +14,10 @@ import javax.swing.BoxLayout;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import java.awt.Dimension;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map;
import java.awt.Dimension;
@Open @Open
public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> { public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
@ -69,7 +69,12 @@ public abstract class ConditionAttributesPane<T> extends BasicBeanPane<T> {
selectedItemScrollPane.setViewportView(selectedItemPane); selectedItemScrollPane.setViewportView(selectedItemPane);
selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); selectedItemScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT)); selectedItemScrollPane.setMinimumSize(new Dimension((int) selectedItemScrollPane.getPreferredSize().getWidth(), MIN_HEIGHT));
dealScrollPane(selectedItemScrollPane);
propertyChangePane.add(selectedItemScrollPane); propertyChangePane.add(selectedItemScrollPane);
}
protected void dealScrollPane(JScrollPane scrollPane){
} }
public void updateBean(T ob) { public void updateBean(T ob) {

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; package com.fr.design.data.datapane.connect;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection; import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection; import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
@ -10,6 +11,7 @@ import com.fr.design.beans.BasicBeanPane;
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.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
@ -19,12 +21,24 @@ import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; 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.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutionException;
/** /**
* Database Connection pane. * Database Connection pane.
@ -48,9 +62,9 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
protected void initComponents() { protected void initComponents() {
message = new UILabel(); message = new UILabel();
uiLabel = new UILabel(); uiLabel = new UILabel();
okButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_OK")); okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK"));
cancelButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cancel")); cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Cancel"));
String[] defaultEncode = new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encode_Auto")}; String[] defaultEncode = new String[] {Toolkit.i18nText("Fine-Design_Encode_Auto")};
charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY)); charSetComboBox = new UIComboBox(ArrayUtils.addAll(defaultEncode, EncodeConstants.ENCODING_ARRAY));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); 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(); JPanel testPane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
northPane.add(testPane, BorderLayout.NORTH); 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); testPane.add(testButton);
testButton.addActionListener(testConnectionActionListener); testButton.addActionListener(testConnectionActionListener);
testPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 3, 4)); 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); northPane.add(chartSetPane);
chartSetPane.setBorder(BorderFactory.createTitledBorder( chartSetPane.setBorder(BorderFactory.createTitledBorder(
new ModLineBorder(ModLineBorder.TOP), 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(); 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) { public void populateBean(com.fr.data.impl.Connection ob) {
this.originalCharSet = ob.getOriginalCharsetName(); this.originalCharSet = ob.getOriginalCharsetName();
if (StringUtils.isBlank(originalCharSet)) { 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 { } else {
this.charSetComboBox.setSelectedItem(ob.getOriginalCharsetName()); 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) { public void actionPerformed(ActionEvent evt) {
// Try the java connection. // Try the java connection.
final SwingWorker connectionThread = new SwingWorker() { final SwingWorker<Boolean, Void> connectionThread = new SwingWorker<Boolean, Void>() {
protected Object doInBackground() throws Exception { @Override
protected Boolean doInBackground() throws Exception {
Connection database = DatabaseConnectionPane.this.updateBean();
// 返回连接结果
return DataOperator.getInstance().testConnection(database);
}
@Override
protected void done() {
try { try {
com.fr.data.impl.Connection database = DatabaseConnectionPane.this.updateBean(); boolean connect = get();
boolean connect = DataOperator.getInstance().testConnection(database);
okButton.setEnabled(true); okButton.setEnabled(true);
message.setText(database.connectMessage(connect));
if (connect) { if (connect) {
uiLabel.setIcon(UIManager.getIcon("OptionPane.informationIcon")); 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{ }else{
uiLabel.setIcon(UIManager.getIcon("OptionPane.errorIcon")); 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) { } catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(exp.getMessage(), exp); 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(); dialog.dispose();
} }
}; };
private void initDialogPane() { 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)); message.setBorder(BorderFactory.createEmptyBorder(8, 5, 0, 0));
okButton.setEnabled(false); 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)); dialog.setSize(new Dimension(268, 118));
okButton.setEnabled(false); okButton.setEnabled(false);
JPanel jp = new JPanel(); 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.core.db.TableProcedure;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.impl.NameDatabaseConnection; import com.fr.data.impl.NameDatabaseConnection;
import com.fr.data.impl.storeproc.ProcedureDataModel;
import com.fr.data.impl.storeproc.StoreProcedure; import com.fr.data.impl.storeproc.StoreProcedure;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.actions.UpdateAction; 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.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; 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.ActionEvent;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -273,7 +280,8 @@ public class ProcedureDataPane extends AbstractTableDataPane<StoreProcedure> imp
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
sp.setCalculating(true); sp.setCalculating(true);
sp.creatDataModel(Calculator.createCalculator()); ProcedureDataModel[] dataModels = DesignTableDataManager.createLazyDataModel(sp, false);
sp.refreshDataModelListAndResultNames(dataModels);
return null; return null;
} }

21
designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java vendored

@ -25,13 +25,19 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
private static final String HOST_NAME = "127.0.0.1"; private static final String HOST_NAME = "127.0.0.1";
private static final String LOCAL_HOTS_NAME = "localhost"; private static final String LOCAL_HOTS_NAME = "localhost";
private static final String QUOTATION = ":"; private static final String QUOTATION = ":";
private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); private static String port = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
static { static {
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); initFilerSet(port);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); }
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); private static void initFilerSet(String newPort) {
FILTER_SET.clear();
FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + newPort + PATH);
port = newPort;
} }
private String name; private String name;
@ -164,6 +170,11 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo {
@Override @Override
public boolean checkValid() { public boolean checkValid() {
boolean result = false; boolean result = false;
String newPort = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort());
if (!ComparatorUtils.equals(port, newPort)) {
// 使用过程中 更改了内置服务器端口 重新初始化下
initFilerSet(newPort);
}
if (FILTER_SET.contains(connection.getUrl())) { if (FILTER_SET.contains(connection.getUrl())) {
FineLoggerFactory.getLogger().error("url is same with local designer"); FineLoggerFactory.getLogger().error("url is same with local designer");
return result; return result;

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

@ -1,12 +1,10 @@
package com.fr.design.gui.icontainer; package com.fr.design.gui.icontainer;
import com.fr.base.BaseUtils;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.collections.utils.MathUtils;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -159,8 +157,7 @@ public class UIResizableContainer extends JPanel {
} }
/** /**
* 设置关闭设计器前最后一次上下子面板的高度 * 设置关闭设计器前最新的上子面板的高度比例
*
* @param toolPaneY * @param toolPaneY
*/ */
public void setLastToolPaneY(int toolPaneY) { public void setLastToolPaneY(int toolPaneY) {

11
designer-base/src/main/java/com/fr/design/mainframe/App.java

@ -41,4 +41,15 @@ public interface App<T extends BaseBook> extends Mutable, Aftermath {
* @return 报表 * @return 报表
*/ */
T asIOFile(FILE tplFile); T asIOFile(FILE tplFile);
/**
* 输出workbook等对象
* @param tplFile 文件
* @param needCheck 是否需要check
* @return
*/
default T asIOFile(FILE tplFile, boolean needCheck) {
return asIOFile(tplFile);
}
} }

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.editingFILE = file;
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder()); this.setBorder(BorderFactory.createEmptyBorder());
designModel = createDesignModel();
addCenterPane(); addCenterPane();
this.undoState = createUndoState(); this.undoState = createUndoState();
designModel = createDesignModel();
consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile)); consumeTimer.setEnabled(shouldInitForCollectInfo(isNewFile));
initAndStartPlugin(); initAndStartPlugin();

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

@ -56,7 +56,7 @@ public final class JTemplateFactory {
String[] defaultAppExtensions = app.defaultExtensions(); String[] defaultAppExtensions = app.defaultExtensions();
for (String defaultAppExtension : defaultAppExtensions) { for (String defaultAppExtension : defaultAppExtensions) {
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) { if (defaultAppExtension.equalsIgnoreCase(fileExtension)) {
BaseBook bb = app.asIOFile(file); BaseBook bb = app.asIOFile(file, false);
if (bb != null) { if (bb != null) {
return (T) bb; return (T) bb;
} }

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

7
designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java

@ -24,6 +24,13 @@ import java.util.List;
public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange { public class DictionaryPane extends UIComboBoxPane<Dictionary> implements DataCreatorUI, Prepare4DataSourceChange {
private TableDataDictPane tableDataDictPane; private TableDataDictPane tableDataDictPane;
public DictionaryPane() {
}
public DictionaryPane(boolean needTableDataChange) {
this.tableDataDictPane.setNeedTableDataChange(needTableDataChange);
}
@Override @Override
protected void initLayout() { protected void initLayout() {
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));

102
designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java

@ -31,17 +31,20 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.JFrame;
import javax.swing.event.ChangeEvent; import javax.swing.JPanel;
import javax.swing.event.ChangeListener; import javax.swing.SwingWorker;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException;
/** /**
* 数据字典的数据查询面板 * 数据字典的数据查询面板
@ -60,6 +63,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
private DoubleDeckValueEditorPane valueDictPane; private DoubleDeckValueEditorPane valueDictPane;
private ItemListener itemListener; private ItemListener itemListener;
private UIObserverListener uiObserverListener; private UIObserverListener uiObserverListener;
private FormulaEditor localFormulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
private boolean needTableDataChange = true;
public TableDataDictPane() { public TableDataDictPane() {
initBasicComponets(); initBasicComponets();
@ -67,6 +72,14 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
iniListener(); iniListener();
} }
/**
* 设置为true后一旦触发TableDataComboBox的itemChange就会通过数据连接更换当前数据字典的列名List
* @param needTableDataChange
*/
public void setNeedTableDataChange(boolean needTableDataChange) {
this.needTableDataChange = needTableDataChange;
}
public static void main(String[] args) { public static void main(String[] args) {
JFrame jf = new JFrame("test"); JFrame jf = new JFrame("test");
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -80,12 +93,10 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
private void initBasicComponets() { private void initBasicComponets() {
tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource()); tableDataNameComboBox = new TableDataComboBox(DesignTableDataManager.getEditingTableDataSource());
tableDataNameComboBox.addItemListener(new ItemListener() { tableDataNameComboBox.addItemListener(e -> {
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
tdChange(e); tdChange(e);
} }
}
}); });
// keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); // keyColumnPane = ValueEditorPaneFactory.createValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
keyColumnPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()}); keyColumnPane = new DoubleDeckValueEditorPane(new Editor[]{new ColumnNameEditor(), new ColumnIndexEditor()});
@ -158,39 +169,58 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
if (tableDataWrappe == null) { if (tableDataWrappe == null) {
return; return;
} }
if (itemListener != null) {
itemListener.itemStateChanged(e);
localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e));
}
if (isNeedTableDataChange()) {
changeColumnsName();
}
}
private void changeColumnsName() {
TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
SwingWorker<List<String>, Object> worker = new SwingWorker<List<String>, Object>() {
@Override
protected List<String> doInBackground() {
if (tableDataWrappe == null) {
return new ArrayList<>();
}
return tableDataWrappe.calculateColumnNameList();
}
List<String> namelist = tableDataWrappe.calculateColumnNameList(); @Override
protected void done() {
try {
List<String> namelist = get();
String[] columnNames = null; String[] columnNames = null;
if (!namelist.isEmpty()) { if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else { } else {
columnNames = new String[]{""}; columnNames = new String[]{StringUtils.EMPTY};
}
// 实际值列名
ColumnNameEditor actualColumnNameEditor = new ColumnNameEditor(columnNames);
actualColumnNameEditor.addItemListener(itemListener);
// 实际值列序号
ColumnIndexEditor actualColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
actualColumnIndexEditor.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{actualColumnNameEditor, actualColumnIndexEditor}, columnNames[0]);
localFormulaEditor.setEnabled(true);
// 显示值列名
ColumnNameEditor displayColumnNameEditor = new ColumnNameEditor(columnNames);
displayColumnNameEditor.addItemListener(itemListener);
// 显示值列序号
ColumnIndexEditor displayColumnIndexEditor = new ColumnIndexEditor(columnNames.length);
displayColumnIndexEditor.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{displayColumnNameEditor, displayColumnIndexEditor, localFormulaEditor}, columnNames[0]);
} catch (InterruptedException | ExecutionException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
ColumnNameEditor columnNameEditor1 = new ColumnNameEditor(columnNames);
columnNameEditor1.addItemListener(itemListener);
ColumnIndexEditor columnIndexEditor1 = new ColumnIndexEditor(columnNames.length);
columnIndexEditor1.addItemListener(itemListener);
keyColumnPane.setEditors(new Editor[]{columnNameEditor1, columnIndexEditor1}, columnNames[0]);
FormulaEditor formulaEditor = new FormulaEditor(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_Formula"));
formulaEditor.setEnabled(true);
formulaEditor.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent ee) {
if (itemListener != null) {
itemListener.itemStateChanged(e);
}
}
});
ColumnNameEditor columnNameEditor2 = new ColumnNameEditor(columnNames);
columnNameEditor2.addItemListener(itemListener);
ColumnIndexEditor columnIndexEditor2 = new ColumnIndexEditor(columnNames.length);
columnIndexEditor2.addItemListener(itemListener);
valueDictPane.setEditors(new Editor[]{columnNameEditor2, columnIndexEditor2, formulaEditor}, columnNames[0]);
if (itemListener != null) {
itemListener.itemStateChanged(e);
} }
};
worker.execute();
} }
@Override @Override
@ -374,4 +404,8 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
public void registerDSChangeListener() { public void registerDSChangeListener() {
tableDataNameComboBox.registerGlobalDSChangeListener(); tableDataNameComboBox.registerGlobalDSChangeListener();
} }
public boolean isNeedTableDataChange() {
return needTableDataChange;
}
} }

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:现在要考虑左边日志模板的影响 * @param win the current window august:现在要考虑左边日志模板的影响
*/ */
public static void centerWindow(Window win) { 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(); Dimension winSize = win.getSize();
@ -308,7 +312,7 @@ public final class GUICoreUtils {
if (winSize.width > screenSize.width) { if (winSize.width > screenSize.width) {
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);
} }
/** /**

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

10
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -15,9 +15,10 @@ import com.fr.log.FineLoggerFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane;
import java.util.Iterator;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.Iterator;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -27,6 +28,9 @@ import java.util.Iterator;
* Time : 上午9:16 * Time : 上午9:16
*/ */
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> { public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
private static final int SCROLL_BAR_UNIT_INCREMENT = 16;
protected Plot plot; protected Plot plot;
public DataSeriesConditionPane(Plot plot) { public DataSeriesConditionPane(Plot plot) {
@ -43,6 +47,10 @@ public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAt
this(null); this(null);
} }
protected void dealScrollPane(JScrollPane scrollPane){
scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_UNIT_INCREMENT);
}
private void initAvailableActionList() { private void initAvailableActionList() {
addBasicAction(); addBasicAction();
addAxisPositionAction(); addAxisPositionAction();

10
designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java

@ -2,6 +2,8 @@ package com.fr.extended.chart;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.general.GeneralUtils;
import com.fr.stable.StringUtils;
import java.util.List; import java.util.List;
@ -17,6 +19,11 @@ public class UIComboBoxWithNone extends UIComboBox {
public UIComboBoxWithNone() { public UIComboBoxWithNone() {
super(); super();
addDefaultItem(); addDefaultItem();
setDefaultSelectedItem();
}
protected void setDefaultSelectedItem() {
setSelectedItem(StringUtils.EMPTY);
} }
@Override @Override
@ -43,7 +50,8 @@ public class UIComboBoxWithNone extends UIComboBox {
//找不到的都选中无。中文的无 英文下是none。 //找不到的都选中无。中文的无 英文下是none。
//改正:找不到的且anObject不是null的 全部选中无。 //改正:找不到的且anObject不是null的 全部选中无。
if (getSelectedIndex() == -1 && anObject != null) { //改正:找不到的且anObject不是null的且anObject不是空字符串的 全部选中无。
if (getSelectedIndex() == -1 && StringUtils.isNotEmpty(GeneralUtils.objectToString(anObject))) {
super.setSelectedItem(getDefaultLocaleString()); super.setSelectedItem(getDefaultLocaleString());
} }
} }

1
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java

@ -73,5 +73,6 @@ public class VanChartColumnPlotLabelDetailPane extends VanChartPlotLabelDetailPa
public void update(AttrLabelDetail detail) { public void update(AttrLabelDetail detail) {
super.update(detail); super.update(detail);
checkOrientationEnable(detail); checkOrientationEnable(detail);
checkOrientation();
} }
} }

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() { 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")}; String[] names = new String[]{
Integer[] values = new Integer[]{ChartConstants.AUTO_LABEL_POSITION, Constants.LEFT, Constants.RIGHT}; 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); return new TwoTuple<>(names, values);
} }

13
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java

@ -122,8 +122,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
return new Component[][]{ return new Component[][]{
new Component[]{dataLabelContentPane, null}, new Component[]{dataLabelContentPane, null},
new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null}, new Component[]{createLabelPositionPane(Toolkit.i18nText("Fine-Design_Chart_Layout_Position"), plot), null},
new Component[]{createLabelBorderPane(), null}, new Component[]{createBorderAndBackgroundPane(), null},
new Component[]{createLabelBackgroundPane(), null}
}; };
} }
@ -138,6 +137,14 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
}; };
} }
private JPanel createBorderAndBackgroundPane() {
JPanel jPanel = new JPanel();
jPanel.setLayout(new BorderLayout(0, 5));
jPanel.add(createLabelBorderPane(), BorderLayout.NORTH);
jPanel.add(createLabelBackgroundPane(), BorderLayout.CENTER);
return jPanel;
}
private JPanel createLabelBorderPane() { private JPanel createLabelBorderPane() {
borderPane = new VanChartBorderWithShapePane(); borderPane = new VanChartBorderWithShapePane();
borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane); borderPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Border"), borderPane);
@ -334,7 +341,7 @@ public class VanChartPlotLabelDetailPane extends BasicPane {
checkPositionEnabled(); checkPositionEnabled();
} }
private void checkOrientation() { protected void checkOrientation() {
if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) { if (orientation != null && borderPaneWithTitle != null && backgroundPaneWithTitle != null) {
boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX; boolean horizontal = orientation.getSelectedIndex() == HORIZONTAL_INDEX;

9
designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java

@ -4,6 +4,7 @@ import com.fr.design.beans.location.Absorptionline;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.HoverPainter; import com.fr.design.designer.beans.HoverPainter;
import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRParameterLayoutAdapter;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.beans.location.Location; import com.fr.design.designer.beans.location.Location;
@ -136,6 +137,14 @@ public class StateModel {
private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) { private boolean addBean(XLayoutContainer container, int mouseX, int mouseY) {
LayoutAdapter adapter = container.getLayoutAdapter(); LayoutAdapter adapter = container.getLayoutAdapter();
Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container); Rectangle rectangleContainer = ComponentUtils.getRelativeBounds(container);
// 判断是否能把控件从表单布局中拖拽到参数面板中
if (adapter instanceof FRParameterLayoutAdapter) {
for (XCreator xCreator : selectionModel.getSelection().getSelectedCreators()) {
if (!xCreator.canEnterIntoParaPane()) {
return false;
}
}
}
if (selectionModel.getSelection().size() == 1) { if (selectionModel.getSelection().size() == 1) {
return adapter.addBean(selectionModel.getSelection().getSelectedCreator(), return adapter.addBean(selectionModel.getSelection().getSelectedCreator(),
mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x, mouseX + designer.getArea().getHorizontalValue() - rectangleContainer.x,

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

1
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java

@ -160,6 +160,7 @@ public class XCardSwitchButton extends XButton {
return; return;
} }
deleteCard(this, index); deleteCard(this, index);
selectionModel.setSelectedCreator(designer.getRootComponent());
designer.fireTargetModified(); designer.fireTargetModified();
LayoutUtils.layoutRootContainer(designer.getRootComponent()); LayoutUtils.layoutRootContainer(designer.getRootComponent());
FormHierarchyTreePane.getInstance().refreshRoot(); FormHierarchyTreePane.getInstance().refreshRoot();

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.Parameter;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
@ -204,7 +205,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/ */
public void populateParameterPropertyPane() { public void populateParameterPropertyPane() {
//参数 //参数
setParameterArray(getNoRepeatParas(getTarget().getParameters())); setParameterArray(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter(); refreshParameter();
//容器 //容器
ParameterPropertyPane.getInstance().populateBean(this); ParameterPropertyPane.getInstance().populateBean(this);
@ -728,7 +729,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified(); FormDesigner.this.fireTargetModified();
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED) {
setParameterArray(getNoRepeatParas(getTarget().getParameters())); setParameterArray(getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
refreshParameter(); refreshParameter();
} }
} else { } 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() { public void parameterChanged() {
//实时更新参数
jTemplate.populateParameter();
// 更新缓存的参数 // 更新缓存的参数
updateCachedParameter(); updateCachedParameter();
//实时更新参数
jTemplate.populateParameter();
} }
/** /**

2
designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java

@ -29,7 +29,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
protected void initComponents() { protected void initComponents() {
super.initComponents(); super.initComponents();
dictPane = new DictionaryPane(); dictPane = new DictionaryPane(false);
} }
@Override @Override

6
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java

@ -176,8 +176,10 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated); this.functionalWhenUnactivatedCheckBox.setSelected(!isFunctionalWhenUnactivated);
this.bindListeners2Widgets(); this.bindListeners2Widgets();
this.addAttributeChangeListener(changeListener); this.addAttributeChangeListener(changeListener);
// 直接return时 也要处理下相应数据
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) { if (!FormDesignerUtils.isAppRelayout(designer) || isInAbsoluteLayout()) {
fix(style);
return; return;
} }
@ -199,8 +201,6 @@ public class ChartEditorDefinePane extends MobileWidgetDefinePane {
} }
} }
}); });
MobileCollapsedStyle style = ((ChartEditor) xCreator.toData()).getMobileCollapsedStyle();
this.mobileCollapsedStyleEditor.setStyle(style); this.mobileCollapsedStyleEditor.setStyle(style);
fix(style); fix(style);
this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork()); this.mobileCollapsedStyleEditor.setSelected(style.isCollapsedWork());

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.setMenuKeySet(KeySetUtils.REPORT_PAGE);
this.setName(getMenuKeySet().getMenuKeySetName() + "..."); this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic()); 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()); 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() { public void parameterChanged() {
// 参数改变 先更新缓存
updateCachedParameter();
jTemplate.updateReportParameterAttr(); jTemplate.updateReportParameterAttr();
jTemplate.populateReportParameterAttr(); jTemplate.populateReportParameterAttr();
updateCachedParameter();
} }
/** /**

7
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java

@ -19,6 +19,11 @@ public class DocumentModel extends AlphaCellModel {
private String informationUrl; private String informationUrl;
private int documentId; private int documentId;
public static final String TITLE = "title";
public static final String CONTENT = "content";
public static final String DID = "did";
public static final String SEARCHCOUNT = "searchcount";
public DocumentModel(String name, String content, int documentId) { public DocumentModel(String name, String content, int documentId) {
super(name, content, CellType.DOCUMENT); super(name, content, CellType.DOCUMENT);
this.documentId = documentId; this.documentId = documentId;
@ -43,7 +48,7 @@ public class DocumentModel extends AlphaCellModel {
public JSONObject modelToJson() { public JSONObject modelToJson() {
JSONObject object = JSONObject.create(); JSONObject object = JSONObject.create();
JSONObject modelObject = JSONObject.create(); JSONObject modelObject = JSONObject.create();
modelObject.put("title", getName()).put("summary", getContent()).put("did", getDocumentId()).put("searchCount", getSearchCount()); modelObject.put(TITLE, getName()).put(CONTENT, getContent()).put(DID, getDocumentId()).put(SEARCHCOUNT, getSearchCount());
object.put("result", modelObject).put("cellType", getType().getTypeValue()); object.put("result", modelObject).put("cellType", getType().getTypeValue());
return object; return object;
} }

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

@ -43,10 +43,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider {
* @return * @return
*/ */
public static DocumentModel getModelFromCloud(JSONObject object) { public static DocumentModel getModelFromCloud(JSONObject object) {
String name = object.optString("title"); String name = object.optString(DocumentModel.TITLE);
String content = object.optString("summary"); String content = object.optString(DocumentModel.CONTENT);
int documentId = object.optInt("did"); int documentId = object.optInt(DocumentModel.DID);
int searchCount = object.optInt("searchCount"); int searchCount = object.optInt(DocumentModel.SEARCHCOUNT);
return new DocumentModel(name, content, documentId, searchCount); return new DocumentModel(name, content, documentId, searchCount);
} }

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

@ -66,10 +66,10 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
@Override @Override
public SearchResult getLessSearchResult(String[] searchText) { public SearchResult getLessSearchResult(String[] searchText) {
this.recentModelList = new SearchResult();
SearchResult modelList = new SearchResult(); SearchResult modelList = new SearchResult();
for (String aSearchText : searchText) { for (String aSearchText : searchText) {
recentModelList = getRecentModelList(aSearchText); addToRecentModelList(aSearchText);
} }
if (recentModelList != null && recentModelList.size() > 0) { if (recentModelList != null && recentModelList.size() > 0) {
modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest")));
@ -87,8 +87,12 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
return new SearchResult(); return new SearchResult();
} }
private synchronized SearchResult getRecentModelList(String searchText) { /**
return searchBySort(searchText); * 将单次遍历的关键词的搜索结果添加到结果集中
* @param searchText
*/
private synchronized void addToRecentModelList(String searchText) {
searchBySort(searchText);
} }
public List<AlphaCellModel> getRecentModelList() { public List<AlphaCellModel> getRecentModelList() {
@ -161,7 +165,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
* 按序搜索 * 按序搜索
*/ */
private synchronized SearchResult searchBySort(String key) { private synchronized SearchResult searchBySort(String key) {
recentModelList = new SearchResult();
try { try {
initReader(); initReader();
@ -175,7 +178,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
Query query = new TermQuery(term); Query query = new TermQuery(term);
TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey); TopFieldDocs docs = searcher.search(query, MAX_SIZE, sortKey);
ScoreDoc[] scores = docs.scoreDocs; ScoreDoc[] scores = docs.scoreDocs;
this.recentModelList = new SearchResult();
//遍历结果 //遍历结果
for (ScoreDoc scoreDoc : scores) { for (ScoreDoc scoreDoc : scores) {
Document document = searcher.doc(scoreDoc.doc); Document document = searcher.doc(scoreDoc.doc);

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

@ -42,7 +42,11 @@ class CptApp extends AbstractWorkBookApp {
@Override @Override
public WorkBook asIOFile(FILE file) { public WorkBook asIOFile(FILE file) {
return asIOFile(file, true);
}
@Override
public WorkBook asIOFile(FILE file, boolean needCheck) {
if (XMLEncryptUtils.isCptEncoded() && if (XMLEncryptUtils.isCptEncoded() &&
!XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) { !XMLEncryptUtils.checkVaild(DesignerEnvManager.getEnvManager().getEncryptionKey())) {
if (!new DecodeDialog(file).isPwdRight()) { if (!new DecodeDialog(file).isPwdRight()) {
@ -67,7 +71,9 @@ class CptApp extends AbstractWorkBookApp {
} catch (Exception exp) { } catch (Exception exp) {
FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp); FineLoggerFactory.getLogger().error(Toolkit.i18nText("Fine-Design_Report_NS_Exception_ReadError") + file, exp);
} }
if (needCheck) {
checkNameStyle(namestyle); checkNameStyle(namestyle);
}
return tpl; return tpl;
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java

@ -126,10 +126,10 @@ public abstract class AbstractSendDataToCloud implements XMLable {
} }
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
return; } finally {
}
fileEntityBuilder.deleteFileAndZipFile(file, pathName); fileEntityBuilder.deleteFileAndZipFile(file, pathName);
} }
}
} }

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); paraDesignEditor.populate(parameterUI);
parameterArray = getNoRepeatParas(getTargetParameter(workBook)); parameterArray = getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters());
refreshParameter(); refreshParameter();
allParameters = reportParameterAttr.getParameters(); 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); polyBlockProperTable.populate(designer);
} }
public void update(){
polyBlockProperTable.update();
}
@Override @Override
public String getViewTitle() { public String getViewTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Property_Table"); 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; package com.fr.poly;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.design.mainframe.widget.BasicPropertyPane;
import com.fr.design.widget.WidgetBoundsPaneFactory; 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.poly.group.PolyBoundsGroup;
import com.fr.report.poly.TemplateBlock; 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 { public class PolyBlockProperTable extends JPanel {
private PolyDesigner designer; private PolyDesigner designer;
@ -104,7 +111,12 @@ public class PolyBlockProperTable extends JPanel {
if (isPopulating || block == null) { if (isPopulating || block == null) {
return; 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()); PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget());
boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(x.getValue(), 0, 1);
boundsgroup.setValue(y.getValue(), 1, 1); boundsgroup.setValue(y.getValue(), 1, 1);
@ -112,4 +124,23 @@ public class PolyBlockProperTable extends JPanel {
boundsgroup.setValue(height.getValue(), 3, 1); boundsgroup.setValue(height.getValue(), 3, 1);
firePropertyEdit(); 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(); TemplateBlock block = selection.getValue();
selection.setValue(block); selection.setValue(block);
if (isChooseBlock()){
((PolyBlockProperPane) this.getEastDownPane()).update();
}
this.removeEditor(selection.getEditor()); this.removeEditor(selection.getEditor());
selection = null; selection = null;
this.repaint(); 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/web/images/print.png",
"com/fr/design/images/m_report/watermark.png", "com/fr/design/images/m_report/watermark.png",
"com/fr/design/images/m_file/pageSetup.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/header.png",
"com/fr/design/images/m_report/footer.png", "com/fr/design/images/m_report/footer.png",
"com/fr/design/images/m_report/background.png", "com/fr/design/images/m_report/background.png",

Loading…
Cancel
Save