Browse Source

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

* commit 'e721b210ab6fe3e14b5eeee6fe5aa1b89dbd7305': (54 commits)
  CHART-17231 默认不选中任何项
  CHART-17429   仪表盘轴重置面板时候重置html页面监听
  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里面有很多残留的埋点文件
  ...
persist/10.0 10.0.12.2020.12.17
superman 4 years ago
parent
commit
f1043ff9f6
  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. 65
      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. 38
      designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java
  7. 21
      designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java
  8. 5
      designer-base/src/main/java/com/fr/design/gui/icontainer/UIResizableContainer.java
  9. 11
      designer-base/src/main/java/com/fr/design/mainframe/App.java
  10. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  11. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  12. 14
      designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java
  13. 29
      designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java
  14. 2
      designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java
  15. 6
      designer-base/src/main/java/com/fr/design/present/DictPresentPane.java
  16. 7
      designer-base/src/main/java/com/fr/design/present/dict/DictionaryPane.java
  17. 108
      designer-base/src/main/java/com/fr/design/present/dict/TableDataDictPane.java
  18. 8
      designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java
  19. BIN
      designer-base/src/main/resources/com/fr/design/images/m_file/repeatAndFrozen.png
  20. 10
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  21. 14
      designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java
  22. 1
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnPlotLabelDetailPane.java
  23. 1
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java
  24. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugeLabelDetailPane.java
  25. 13
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartPlotLabelDetailPane.java
  26. 9
      designer-form/src/main/java/com/fr/design/designer/beans/models/StateModel.java
  27. 4
      designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java
  28. 1
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java
  29. 5
      designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java
  30. 4
      designer-form/src/main/java/com/fr/design/mainframe/FormModelAdapter.java
  31. 4
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  32. 6
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ChartEditorDefinePane.java
  33. 4
      designer-realize/src/main/java/com/fr/design/actions/report/ReportPageAttrAction.java
  34. 3
      designer-realize/src/main/java/com/fr/design/mainframe/WorkBookModelAdapter.java
  35. 7
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/DocumentModel.java
  36. 8
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java
  37. 24
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  38. 8
      designer-realize/src/main/java/com/fr/design/mainframe/app/CptApp.java
  39. 4
      designer-realize/src/main/java/com/fr/design/mainframe/messagecollect/impl/AbstractSendDataToCloud.java
  40. 2
      designer-realize/src/main/java/com/fr/design/parameter/ParameterDefinitePane.java
  41. 4
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperPane.java
  42. 37
      designer-realize/src/main/java/com/fr/poly/PolyBlockProperTable.java
  43. 3
      designer-realize/src/main/java/com/fr/poly/PolyDesigner.java
  44. 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) {

65
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();
@ -250,4 +269,4 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
} }
} }
} }

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;
} }

38
designer-base/src/main/java/com/fr/design/data/tabledata/wrapper/AbstractTableDataWrapper.java

@ -35,18 +35,18 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
/** /**
* 获取数据集的所有列名list * 获取数据集的所有列名list
* *
* @return 数据集的所有列名list * @return 数据集的所有列名list
* *
* *
* @date 2014-11-24-下午3:51:41 * @date 2014-11-24-下午3:51:41
* *
*/ */
public List<String> calculateColumnNameList() { public List<String> calculateColumnNameList() {
if(columnNameList != null){ if(columnNameList != null){
return columnNameList; return columnNameList;
} }
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
TableDataSource tds = adapter == null ? null : adapter.getBook(); TableDataSource tds = adapter == null ? null : adapter.getBook();
String[] colNames = tabledata.getColumnNames(tds); String[] colNames = tabledata.getColumnNames(tds);
@ -56,13 +56,13 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
} else if (ArrayUtils.isNotEmpty(colNamesInCache)) { } else if (ArrayUtils.isNotEmpty(colNamesInCache)) {
return toColumnNameList(colNamesInCache); return toColumnNameList(colNamesInCache);
} }
EmbeddedTableData embeddedTableData = null; EmbeddedTableData embeddedTableData = null;
try { try {
embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false); embeddedTableData = DesignTableDataManager.previewTableDataNotNeedInputParameters(tds, tabledata, TableData.RESULT_NOT_NEED, false);
} catch (Exception e) { } catch (Exception e) {
if (e.getMessage()!=null) { if (e.getMessage()!=null) {
DesignUtils.errorMessage(e.getMessage()); DesignUtils.errorMessage(e.getMessage());
} }
} }
columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData); columnNameList = DesignTableDataManager.getColumnNamesByTableData(embeddedTableData);
@ -78,12 +78,12 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
/** /**
* 生成子节点 * 生成子节点
* *
* @return 生成子节点 * @return 生成子节点
* *
* *
* @date 2014-11-24-下午3:51:17 * @date 2014-11-24-下午3:51:17
* *
*/ */
public ExpandMutableTreeNode[] load() { public ExpandMutableTreeNode[] load() {
List<String> namelist = calculateColumnNameList(); List<String> namelist = calculateColumnNameList();
@ -97,10 +97,10 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
/** /**
* 预览数据集 * 预览数据集
* *
* *
* @date 2014-11-24-下午3:50:20 * @date 2014-11-24-下午3:50:20
* *
*/ */
public void previewData() { public void previewData() {
PreviewTablePane.previewTableData(tabledata); PreviewTablePane.previewTableData(tabledata);
@ -108,30 +108,30 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
/** /**
* 预览数据集,带有显示值和实际值的标记结果 * 预览数据集,带有显示值和实际值的标记结果
* *
* @param keyIndex 实际值 * @param keyIndex 实际值
* @param valueIndex 显示值 * @param valueIndex 显示值
* *
* *
* @date 2014-11-24-下午3:50:20 * @date 2014-11-24-下午3:50:20
* *
*/ */
public void previewData(final int keyIndex,final int valueIndex){ public void previewData(final int keyIndex,final int valueIndex){
PreviewTablePane.previewTableData(tabledata, keyIndex, valueIndex); PreviewTablePane.previewTableData(tabledata, keyIndex, valueIndex);
} }
@Override @Override
public String getTableDataName(){ public String getTableDataName(){
return name; return name;
} }
/** /**
* 获取数据集的面板 * 获取数据集的面板
* *
* @return 数据集面板 * @return 数据集面板
* *
* *
* @date 2014-11-24-下午3:50:00 * @date 2014-11-24-下午3:50:00
* *
*/ */
public AbstractTableDataPane<?> creatTableDataPane() { public AbstractTableDataPane<?> creatTableDataPane() {
return TableDataFactory.creatTableDataPane(tabledata, name); return TableDataFactory.creatTableDataPane(tabledata, name);
@ -143,4 +143,4 @@ public abstract class AbstractTableDataWrapper implements TableDataWrapper {
&& ComparatorUtils.equals(this.tabledata, ((AbstractTableDataWrapper) obj).getTableData()); && ComparatorUtils.equals(this.tabledata, ((AbstractTableDataWrapper) obj).getTableData());
} }
} }

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;
} }

14
designer-base/src/main/java/com/fr/design/mainframe/WestRegionContainerPane.java

@ -32,11 +32,11 @@ public class WestRegionContainerPane extends UIResizableContainer {
public WestRegionContainerPane() { public WestRegionContainerPane() {
super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT); super(DesignerFrameFileDealerPane.getInstance(), Constants.RIGHT);
setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); setDownPane(TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
GeneralContext.listenPluginRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) { GeneralContext.listenPluginRunningChanged(new PluginEventListener(TableDataTreePane.PLUGIN_LISTENER_PRIORITY - 1) {
@Override @Override
public void on(PluginEvent event) { public void on(PluginEvent event) {
@ -47,15 +47,15 @@ public class WestRegionContainerPane extends UIResizableContainer {
} }
} }
}, new PluginFilter() { }, new PluginFilter() {
@Override @Override
public boolean accept(PluginContext context) { public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraDesign); return context.contain(PluginModule.ExtraDesign);
} }
}); });
setContainerWidth(165); setContainerWidth(165);
setBackground(UIConstants.TREE_BACKGROUND); setBackground(UIConstants.TREE_BACKGROUND);
} }
} }

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);

2
designer-base/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleDictionaryEditor.java

@ -58,4 +58,4 @@ public class AccessibleDictionaryEditor extends UneditableAccessibleEditor {
public Dictionary updateBean() { public Dictionary updateBean() {
return (Dictionary) this.getValue(); return (Dictionary) this.getValue();
} }
} }

6
designer-base/src/main/java/com/fr/design/present/DictPresentPane.java

@ -10,7 +10,7 @@ import com.fr.design.present.dict.DictionaryPane;
/** /**
* *
* @author zhou * @author zhou
* @since 2012-5-31上午10:54:20 * @since 2012-5-31上午10:54:20
*/ */
@ -42,7 +42,7 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implement
public boolean accept(Object ob) { public boolean accept(Object ob) {
return ob instanceof DictPresent; return ob instanceof DictPresent;
} }
public void addTabChangeListener(ItemListener l){ public void addTabChangeListener(ItemListener l){
dictionaryPane.addTabChangeListener(l); dictionaryPane.addTabChangeListener(l);
} }
@ -55,4 +55,4 @@ public class DictPresentPane extends FurtherBasicBeanPane<DictPresent> implement
public void registerDSChangeListener() { public void registerDSChangeListener() {
dictionaryPane.registerDSChangeListener(); dictionaryPane.registerDSChangeListener();
} }
} }

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));

108
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,11 +93,9 @@ 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()});
@ -158,39 +169,58 @@ public class TableDataDictPane extends FurtherBasicBeanPane<TableDataDictionary>
if (tableDataWrappe == null) { if (tableDataWrappe == null) {
return; return;
} }
if (itemListener != null) {
List<String> namelist = tableDataWrappe.calculateColumnNameList(); itemListener.itemStateChanged(e);
String[] columnNames = null; localFormulaEditor.addChangeListener(event -> itemListener.itemStateChanged(e));
if (!namelist.isEmpty()) { }
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY); if (isNeedTableDataChange()) {
} else { changeColumnsName();
columnNames = new String[]{""};
} }
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")); private void changeColumnsName() {
formulaEditor.setEnabled(true); TableDataWrapper tableDataWrappe = this.tableDataNameComboBox.getSelectedItem();
formulaEditor.addChangeListener(new ChangeListener() { SwingWorker<List<String>, Object> worker = new SwingWorker<List<String>, Object>() {
@Override
protected List<String> doInBackground() {
if (tableDataWrappe == null) {
return new ArrayList<>();
}
return tableDataWrappe.calculateColumnNameList();
}
@Override @Override
public void stateChanged(ChangeEvent ee) { protected void done() {
if (itemListener != null) { try {
itemListener.itemStateChanged(e); List<String> namelist = get();
String[] columnNames = null;
if (!namelist.isEmpty()) {
columnNames = namelist.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
} else {
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 columnNameEditor2 = new ColumnNameEditor(columnNames); worker.execute();
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);
}
} }
@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();

14
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,15 @@ public class UIComboBoxWithNone extends UIComboBox {
public UIComboBoxWithNone() { public UIComboBoxWithNone() {
super(); super();
addDefaultItem(); addDefaultItem();
setDefaultSelectedItem();
}
protected void setDefaultSelectedItem() {
// JComboBox.setSelectedItem(o)
// if(o!=null)寻找o对应的下拉选项 如果找不到 还是选中之前选中的
// 所以空字符串 不是选中空 是选中上次选中的
// 所以这边 可以写setSelectedItem(null) or setSelectedIndex(-1)
setSelectedIndex(-1);
} }
@Override @Override
@ -43,7 +54,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();
} }
} }

1
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/gauge/VanChartGaugeDetailAxisPane.java

@ -176,6 +176,7 @@ public class VanChartGaugeDetailAxisPane extends VanChartValueAxisPane {
gaugeStyle = gaugePlot.getGaugeStyle(); gaugeStyle = gaugePlot.getGaugeStyle();
reLayoutPane(false); reLayoutPane(false);
parent.initAllListeners(); parent.initAllListeners();
setParentPane(parent);
} }
populateBean(gaugePlot.getGaugeAxis()); populateBean(gaugePlot.getGaugeAxis());
} }

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();
} }
/** /**

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

@ -29,9 +29,9 @@ 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
public String title4PopupWindow() { public String title4PopupWindow() {
return "CheckBoxGroup"; return "CheckBoxGroup";

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());

4
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());
} }
@ -58,4 +58,4 @@ public class ReportPageAttrAction extends ReportComponentAction<WorkSheetDesigne
dlg.setVisible(true); dlg.setVisible(true);
return returnValue; return returnValue;
} }
} }

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);
} }

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

@ -45,9 +45,9 @@ import java.util.List;
*/ */
public class RecentSearchManager implements AlphaFineSearchProvider { public class RecentSearchManager implements AlphaFineSearchProvider {
private static final int MAX_SIZE = 100; private static final int MAX_SIZE = 100;
private static final RecentSearchManager INSTANCE = new RecentSearchManager(); private static final RecentSearchManager INSTANCE = new RecentSearchManager();
private IndexReader indexReader = null; private IndexReader indexReader = null;
//索引存储路径 //索引存储路径
private String path = ProductConstants.getEnvHome() + File.separator + "searchIndex"; private String path = ProductConstants.getEnvHome() + File.separator + "searchIndex";
@ -58,18 +58,18 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer);
private IndexWriter indexWriter = null; private IndexWriter indexWriter = null;
private SearchResult recentModelList = new SearchResult(); private SearchResult recentModelList = new SearchResult();
public static RecentSearchManager getInstance() { public static RecentSearchManager getInstance() {
return INSTANCE; return INSTANCE;
} }
@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")));
@ -86,9 +86,13 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
public SearchResult getMoreSearchResult(String searchText) { public SearchResult getMoreSearchResult(String searchText) {
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);

8
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);
} }
checkNameStyle(namestyle); if (needCheck) {
checkNameStyle(namestyle);
}
return tpl; return tpl;
} }

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

@ -126,9 +126,9 @@ 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