Browse Source

Merge pull request #155 in BA/design from ~NEIL/design:release to master

* commit 'ea3f19be1e9faf42e512fb6d285e11853590f24a': (31 commits)
  冲突
  冲突
  1
  1
  冲突
  滚动条
  远程设计插件加载解耦
  远程设计插件加载
  bug:96398 设计器国际化问题
  填报属性抽取通用属性接口,定时器依赖填报
  校验改进
  校验引擎部分继续改进
  填报校验改进,designer暂时依赖engine-write
  update
  重新初始化列名
  打開多種佈局方式
  自定义校验接口
  自定义校验接口
  对接打包
  缩放属性面板
  ...
master
superman 9 years ago
parent
commit
9fe0e839ae
  1. 1
      designer/designer.iml
  2. 2
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  3. 2
      designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java
  4. 35
      designer/src/com/fr/design/report/BuildInVerifierPane.java
  5. 37
      designer/src/com/fr/design/report/CustomVerifierPane.java
  6. 117
      designer/src/com/fr/design/report/ValueVerifierEditPane.java
  7. 2
      designer/src/com/fr/design/report/VerifierListPane.java
  8. 38
      designer/src/com/fr/design/webattr/ReportWriteAttrPane.java
  9. 508
      designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java
  10. 19
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  11. 40
      designer_base/src/com/fr/design/fun/VerifyDefineProvider.java
  12. 20
      designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java
  13. 2
      designer_base/src/com/fr/design/gui/style/AlignmentPane.java
  14. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/H0.png
  15. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/H1.png
  16. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/H2.png
  17. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/H3.png
  18. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/V0.png
  19. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/V1.png
  20. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/V2.png
  21. BIN
      designer_base/src/com/fr/design/images/dialog/appfit/V3.png
  22. 30
      designer_base/src/com/fr/env/RemoteEnv.java
  23. 25
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

1
designer/designer.iml

@ -17,5 +17,6 @@
<orderEntry type="module" module-name="designer_base" />
<orderEntry type="module" module-name="engine" />
<orderEntry type="library" name="lib" level="project" />
<orderEntry type="module" module-name="engine-write" />
</component>
</module>

2
designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -45,7 +45,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{
final ReportMobileAttrPane mobileAttrPane = new ReportMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr);
BasicDialog dialog = mobileAttrPane.showMediumWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
wbTpl.setReportMobileAttr(mobileAttrPane.updateBean());

2
designer/src/com/fr/design/actions/report/ReportWriteAttrAction.java

@ -51,7 +51,7 @@ public class ReportWriteAttrAction extends ReportComponentAction<WorkSheetDesign
@Override
public void doOk() {
isChange = true;
tplEC.setReportWriteAttr(reportWritePane.update());
tplEC.addAttributeTarget(reportWritePane.update());
if (hasActionPerformed) {
final JTemplate targetComponent = DesignerContext.getDesignerFrame().getSelectedJTemplate();
if (targetComponent != null) {

35
designer/src/com/fr/design/report/BuildInVerifierPane.java

@ -0,0 +1,35 @@
package com.fr.design.report;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.write.ValueVerifier;
import java.awt.*;
/**
* Created by richie on 16/6/12.
*/
public class BuildInVerifierPane extends BasicBeanPane<ValueVerifier> {
private ValueVerifierEditPane valueVerifierEditPane;
public BuildInVerifierPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
valueVerifierEditPane = new ValueVerifierEditPane();
this.add(valueVerifierEditPane, BorderLayout.CENTER);
}
@Override
public void populateBean(ValueVerifier ob) {
valueVerifierEditPane.populate(ob);
}
@Override
public ValueVerifier updateBean() {
return valueVerifierEditPane.update();
}
@Override
protected String title4PopupWindow() {
return "BuiltIn";
}
}

37
designer/src/com/fr/design/report/CustomVerifierPane.java

@ -0,0 +1,37 @@
package com.fr.design.report;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.report.write.WClassVerifier;
import java.awt.*;
/**
* Created by richie on 16/6/12.
*/
public class CustomVerifierPane extends BasicBeanPane<WClassVerifier> {
private CustomVerifyJobPane pane;
public CustomVerifierPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
pane = new CustomVerifyJobPane();
this.add(pane, BorderLayout.CENTER);
}
@Override
public void populateBean(WClassVerifier ob) {
this.pane.populateBean(ob.getClassVerifyJob());
}
@Override
public WClassVerifier updateBean() {
WClassVerifier verifier = new WClassVerifier();
verifier.setClassVerifyJob(this.pane.updateBean());
return verifier;
}
@Override
protected String title4PopupWindow() {
return "custom";
}
}

117
designer/src/com/fr/design/report/ValueVerifierEditPane.java

@ -1,15 +1,15 @@
package com.fr.design.report;
import com.fr.base.Formula;
import com.fr.data.Verifier;
import com.fr.data.VerifyItem;
import com.fr.design.gui.itableeditorpane.ActionStyle;
import com.fr.design.gui.itableeditorpane.UIArrayTableModel;
import com.fr.design.gui.itableeditorpane.UITableEditorPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.GeneralUtils;
import com.fr.general.Inter;
import com.fr.stable.bridge.StableFactory;
import com.fr.write.ReportWriteAttrProvider;
import com.fr.write.ValueVerifierProvider;
import com.fr.report.write.ValueVerifier;
import com.fr.stable.FormulaProvider;
import javax.swing.*;
import java.awt.*;
@ -32,116 +32,35 @@ public class ValueVerifierEditPane extends JPanel {
/**
* populate
*/
public void populate(ReportWriteAttrProvider reportWriteAttr) {
if (reportWriteAttr == null) {
public void populate(ValueVerifier valueVerifier) {
if (valueVerifier == null) {
return;
}
int rowCount = reportWriteAttr.getVerifierCount();
Object[][] os = new Object[reportWriteAttr.getValueVerifierCount()][];
int cnt = 0;
for (int i = 0; i < rowCount; i++) {
if (!(reportWriteAttr.getVerifier(i) instanceof ValueVerifierProvider)) {
continue;
}
Formula formula = ((ValueVerifierProvider)reportWriteAttr.getVerifier(i)).getFormula();
int rowCount = valueVerifier.getVerifyItemsCount();
Object[][] os = new Object[rowCount][];
int tableDataCount = 0;
for (int i = 0; i < rowCount; i ++) {
VerifyItem item = valueVerifier.getVerifyItem(i);
FormulaProvider formula = item.getFormula();
if (formula == null) {
continue;
}
String formulaContent = formula.getContent().substring(1);
String message = reportWriteAttr.getVerifier(i).getMessage();
os[cnt++] = new Object[] { formulaContent, message };
os[tableDataCount++] = new Object[]{formula.getPureContent(), item.getMessage()};
}
this.tableEditorPane.populate(os);
}
/**
* update
*/
public void update(ReportWriteAttrProvider reportWriteAttr, String name) {
public ValueVerifier update() {
ValueVerifier valueVerifier = new ValueVerifier();
java.util.List<Object[]> list = tableEditorPane.update();
reportWriteAttr.clearVerifiers(true);
for (int i = 0; i < list.size(); i++) {
Object[] o = list.get(i);
if (o == null || o[0] == null) {
continue;
}
ValueVerifierProvider p = StableFactory.getMarkedInstanceObjectFromClass(ValueVerifierProvider.TAG, ValueVerifierProvider.class);
p.setFormula(new Formula(readValueVerifyObject(o[0])));
p.setMessage(readValueVerifyObject(o[1]));
reportWriteAttr.addVerifier(name, (Verifier) p);
// reportWriteAttr.addVerifier(name, new ValueVerifier(readValueVerifyObject(o[0]), readValueVerifyObject(o[1])));
VerifyItem item = new VerifyItem(new Formula(GeneralUtils.objectToString(o[0])), GeneralUtils.objectToString(o[1]));
valueVerifier.addVerifyItem(item);
}
}
private String readValueVerifyObject(Object obj) {
if (obj == null) {
return null;
}
return obj.toString();
return valueVerifier;
}
}
//public class ValueVerifierEditPane extends BasicBeanPane<ValueVerifier> {
// private ValueVerifier valueVerifier;
// private UITextArea formula = new UITextArea();
// private UITextArea message = new UITextArea();
// private int col = 60;
// private int row = 5;
//
// public ValueVerifierEditPane() {
// valueVerifier = new ValueVerifier();
//
// this.setLayout(new FlowLayout());
//
// JPanel formulaPane = new JPanel();
// UIScrollPane formulaScrollPane = new UIScrollPane(formula);
// formula.setRows(row);
// formula.setColumns(col);
// formula.setLineWrap(true);
// formula.setToolTipText(Inter.getLocText("Verify-ToolTips"));
// UILabel fl = new UILabel(Inter.getLocText("Verify-Verify_Formula"));
// fl.setPreferredSize(new Dimension(80, 20));
// formulaPane.add(fl);
// formulaPane.add(formulaScrollPane);
//
// JPanel messagePane = new JPanel();
// UIScrollPane messageScrollPane = new UIScrollPane(message);
// message.setRows(row);
// message.setColumns(col);
// message.setLineWrap(true);
// UILabel ml = new UILabel(Inter.getLocText("Verify-Error_Information"));
// ml.setPreferredSize(new Dimension(80, 20));
// messagePane.add(ml);
// messagePane.add(messageScrollPane);
//
// this.add(formulaPane);
// this.add(messagePane);
// }
//
// @Override
// public void populateBean(ValueVerifier ob) {
// valueVerifier = ob;
// if (ob != null) {
// if (ob.getFormula() != null) {
// String content = ob.getFormula().getContent();
// formula.setText(content.startsWith("=") ? content.substring(1) : content);
// } else {
// formula.setText("");
// }
// message.setText(ob.getMessage());
// }
// }
//
// @Override
// public ValueVerifier updateBean() {
// valueVerifier.setFormula(new Formula(formula.getText()));
// valueVerifier.setMessage(message.getText());
// return valueVerifier;
// }
//
// @Override
// protected String title4PopupWindow() {
// return "valueVerifierPane";
// }
//}

2
designer/src/com/fr/design/report/VerifierListPane.java

File diff suppressed because one or more lines are too long

38
designer/src/com/fr/design/webattr/ReportWriteAttrPane.java

@ -6,17 +6,16 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.report.VerifierListPane;
import com.fr.design.report.WriteShortCutsPane;
import com.fr.design.write.submit.SubmiterListPane;
import com.fr.design.write.submit.SubmitVisitorListPane;
import com.fr.general.Inter;
import com.fr.report.worksheet.WorkSheet;
import com.fr.stable.bridge.StableFactory;
import com.fr.write.ReportWriteAttrProvider;
import com.fr.report.write.ReportWriteAttr;
import javax.swing.*;
import java.awt.*;
public class ReportWriteAttrPane extends LoadingBasicPane {
private SubmiterListPane submiterListPane;
private SubmitVisitorListPane submiterListPane;
// private ValueVerifierEditPane valueVerifierEditPane;
private VerifierListPane verifierListPane;
private WriteShortCutsPane writeShortCutsPane;
@ -33,7 +32,7 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
// peter: writeSQLAttrList的编辑.
if (submiterListPane == null) {
submiterListPane = new SubmiterListPane(ePane);
submiterListPane = new SubmitVisitorListPane(ePane);
}
// valueVerifierEditPane = new ValueVerifierEditPane();
if (verifierListPane == null) {
@ -44,27 +43,6 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
tabbedPane.addTab(Inter.getLocText("FR-Utils_Submit"), submiterListPane);
tabbedPane.addTab(Inter.getLocText("Verify-Data_Verify"), verifierListPane);
tabbedPane.addTab(Inter.getLocText("Writer-ShortCuts_Setting"), writeShortCutsPane);
// tabbedPane.addChangeListener(new ChangeListener() {
// @Override
// public void stateChanged(ChangeEvent e) {
// // 切换的时候这里会先于UITabbedPaneUI的MousePressed事件
// // 会导致弹窗两次
// int idx = ReportWriteAttrPane.this.getInvalidIndex();
// if (idx >= 0 && idx != tabbedPane.getSelectedIndex()) {
// try {
// if (idx == 0) {
// ReportWriteAttrPane.this.submiterListPane.checkValid();
// } else {
// ReportWriteAttrPane.this.verifierListPane.checkValid();
// }
// } catch (Exception exp) {
// JOptionPane.showMessageDialog(ReportWriteAttrPane.this, exp.getMessage());
// tabbedPane.setSelectedIndex(idx);
// }
// }
// }
// });
}
@Override
@ -77,9 +55,9 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
return;
}
ReportWriteAttrProvider reportWriteAttr = report.getReportWriteAttr();
ReportWriteAttr reportWriteAttr = report.getAttributeTarget(ReportWriteAttr.XML_TAG);
if (reportWriteAttr == null) {
reportWriteAttr = StableFactory.getMarkedInstanceObjectFromClass(ReportWriteAttrProvider.XML_TAG, ReportWriteAttrProvider.class);
reportWriteAttr = new ReportWriteAttr();
}
this.submiterListPane.populate(reportWriteAttr);
@ -87,8 +65,8 @@ public class ReportWriteAttrPane extends LoadingBasicPane {
}
public ReportWriteAttrProvider update() {
ReportWriteAttrProvider reportWriteAttr = StableFactory.getMarkedInstanceObjectFromClass(ReportWriteAttrProvider.XML_TAG, ReportWriteAttrProvider.class);
public ReportWriteAttr update() {
ReportWriteAttr reportWriteAttr = new ReportWriteAttr();
this.submiterListPane.updateReportWriteAttr(reportWriteAttr);
this.verifierListPane.updateReportWriteAttr(reportWriteAttr);

508
designer/src/com/fr/design/write/submit/SubmiterListPane.java → designer/src/com/fr/design/write/submit/SubmitVisitorListPane.java

@ -1,255 +1,255 @@
package com.fr.design.write.submit;
import com.fr.data.SubmitJob;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.SubmitProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.SubmitVisitor;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.stable.bridge.StableFactory;
import com.fr.write.BuiltInSQLSubmiterProvider;
import com.fr.write.DBManipulation;
import com.fr.write.ReportWriteAttrProvider;
import com.fr.write.WClassSubmiterProvider;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SubmiterListPane extends ObjectJControlPane {
public SubmiterListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new NameObjectCreator(Inter.getLocText("RWA-BuildIn_SQL"),
"/com/fr/web/images/reportlet.png",
// BuiltInSQLSubmiter.class,
StableFactory.getRegisteredClass(BuiltInSQLSubmiterProvider.TAG),
BuildInSQLPane.class),
new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "RWA-Submit"}),
"/com/fr/web/images/reportlet.png",
// WClassSubmiter.class,
StableFactory.getRegisteredClass(WClassSubmiterProvider.TAG),
CustomPane.class)
};
}
@Override
protected String title4PopupWindow() {
return "write";
}
public void populate(ReportWriteAttrProvider reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
List<NameObject> nameObjectList = new ArrayList<NameObject>();
int submiterCount = reportWriteAttr.getSubmitVisitorCount();
for (int i = 0; i < submiterCount; i++) {
SubmitVisitor submiter = reportWriteAttr.getSubmitVisitor(i);
String name = reportWriteAttr.getSubmitVisitorNameList(i);
nameObjectList.add(new NameObject(name, submiter));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
/**
* 更新填报属性
*
* @param reportWriteAttr 报表填报属性
*/
public void updateReportWriteAttr(ReportWriteAttrProvider reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearSubmitVisitors();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof SubmitVisitor) {
reportWriteAttr.addSubmitVisitor(nameObject.getName(), (SubmitVisitor) nameObject.getObject());
}
}
}
public static class BuildInSQLPane extends BasicBeanPane<BuiltInSQLSubmiterProvider> {
protected DBManipulationPane dbManipulationPane;
private BuiltInSQLSubmiterProvider editing;
public BuildInSQLPane() {
}
public BuildInSQLPane(ElementCasePane ePane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
dbManipulationPane = new SmartInsertDBManipulationPane(ePane);
this.add(dbManipulationPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return "builtinsql";
}
@Override
public void populateBean(BuiltInSQLSubmiterProvider ob) {
editing = ob;
DBManipulation dbManipulation = ob.getDBManipulation();
dbManipulationPane.populateBean(dbManipulation);
}
@Override
public BuiltInSQLSubmiterProvider updateBean() {
DBManipulation dbManipulation = dbManipulationPane.updateBean();
//复制对象用于撤销
try{
editing = (BuiltInSQLSubmiterProvider)editing.clone();
}catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
editing.setDBManipulation(dbManipulation);
return editing;
}
/**
* 检查是否符合规范
*
* @throws Exception
*/
public void checkValid() throws Exception {
this.dbManipulationPane.checkValid();
}
}
public static class CustomPane extends BasicBeanPane<WClassSubmiterProvider> {
private UIComboBox csjConfigComboBox = null;
private JPanel customCardPane = null;
private Map<String, BasicBeanPane> customSubmitPanes = null;
private final Map<String, String> comboItemsMap;
private List<String> configTypes = null;
private WClassSubmiterProvider editing;
private static final String DEFAULT_PANE_TYPE = "submitnormal";
public CustomPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
customSubmitPanes = new HashMap<String, BasicBeanPane>();
comboItemsMap = new HashMap<String, String>();
SubmitProvider[] providers = ExtraDesignClassManager.getInstance().getSubmitProviders();
providers = (SubmitProvider[])ArrayUtils.add(providers, new DefaultSubmit());
for (SubmitProvider provider : providers) {
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit());
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit());
}
configTypes = new ArrayList<String>();
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
String key = entry.getKey();
configTypes.add(comboItemsMap.get(key));
customCardPane.add(entry.getValue(), key);
}
csjConfigComboBox = new UIComboBox(configTypes.toArray());
JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(Inter.getLocText(new String[]{"Choose", "Type"}) + ":"), csjConfigComboBox},
FlowLayout.LEFT, 10);
typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText(new String[]{"Submit", "Type"})));
this.add(typePane, BorderLayout.NORTH);
this.add(customCardPane, BorderLayout.CENTER);
csjConfigComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
Object ob = e.getItem();
CardLayout c1 = (CardLayout) customCardPane.getLayout();
for (String key : customSubmitPanes.keySet()) {
String item = comboItemsMap.get(key);
if ((ComparatorUtils.equals(ob, item))) {
c1.show(customCardPane, key);
}
}
}
}
});
}
@Override
public void populateBean(WClassSubmiterProvider ob) {
editing = ob;
SubmitJob submitJob = ob.getSubmitJob();
if (submitJob == null) {
csjConfigComboBox.setSelectedItem(comboItemsMap.get(DEFAULT_PANE_TYPE));
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
entry.getValue().populateBean(submitJob);
}
return;
}
String pantype=submitJob.getJobType();
BasicBeanPane pane = customSubmitPanes.get(pantype);
if (pane != null) {
csjConfigComboBox.setSelectedItem(comboItemsMap.get(pantype));
pane.populateBean(submitJob);
}
}
@Override
public WClassSubmiterProvider updateBean() {
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
BasicBeanPane pane = entry.getValue();
if (pane != null && pane.isVisible()) {
editing.setSubmitJob((SubmitJob) pane.updateBean());
}
}
return editing;
}
@Override
protected String title4PopupWindow() {
return "custom";
}
}
package com.fr.design.write.submit;
import com.fr.data.SubmitJob;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.fun.SubmitProvider;
import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.controlpane.ObjectJControlPane;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.NameObject;
import com.fr.report.write.BuiltInSQLSubmiter;
import com.fr.report.write.ReportWriteAttr;
import com.fr.report.write.SubmitVisitor;
import com.fr.report.write.WClassSubmiter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import com.fr.write.BuiltInSQLSubmiterProvider;
import com.fr.write.DBManipulation;
import com.fr.write.WClassSubmiterProvider;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SubmitVisitorListPane extends ObjectJControlPane {
public SubmitVisitorListPane(ElementCasePane ePane) {
super(ePane);
}
/**
* 创建选项
*
* @return 选项
*/
public NameableCreator[] createNameableCreators() {
return new NameableCreator[]{
new NameObjectCreator(Inter.getLocText("RWA-BuildIn_SQL"),
"/com/fr/web/images/reportlet.png",
BuiltInSQLSubmiter.class,
BuildInSQLPane.class),
new NameObjectCreator(
Inter.getLocText(new String[]{"Custom", "RWA-Submit"}),
"/com/fr/web/images/reportlet.png",
WClassSubmiter.class,
CustomPane.class)
};
}
@Override
protected String title4PopupWindow() {
return "write";
}
public void populate(ReportWriteAttr reportWriteAttr) {
if (reportWriteAttr == null) {
return;
}
List<NameObject> nameObjectList = new ArrayList<>();
int submiterCount = reportWriteAttr.getSubmitVisitorCount();
for (int i = 0; i < submiterCount; i++) {
SubmitVisitor visitor = reportWriteAttr.getSubmitVisitor(i);
nameObjectList.add(new NameObject(visitor.getName(), visitor));
}
this.populate(nameObjectList.toArray(new NameObject[nameObjectList.size()]));
}
/**
* 更新填报属性
*
* @param reportWriteAttr 报表填报属性
*/
public void updateReportWriteAttr(ReportWriteAttr reportWriteAttr) {
// Nameable[]居然不能强转成NameObject[],一定要这么写...
Nameable[] res = this.update();
NameObject[] res_array = new NameObject[res.length];
java.util.Arrays.asList(res).toArray(res_array);
reportWriteAttr.clearSubmitVisitors();
for (int i = 0; i < res_array.length; i++) {
NameObject nameObject = res_array[i];
if (nameObject.getObject() instanceof SubmitVisitor) {
SubmitVisitor visitor = (SubmitVisitor) nameObject.getObject();
visitor.setName(nameObject.getName());
reportWriteAttr.addSubmitVisitor(visitor);
}
}
}
public static class BuildInSQLPane extends BasicBeanPane<BuiltInSQLSubmiterProvider> {
protected DBManipulationPane dbManipulationPane;
private BuiltInSQLSubmiterProvider editing;
public BuildInSQLPane() {
}
public BuildInSQLPane(ElementCasePane ePane) {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
dbManipulationPane = new SmartInsertDBManipulationPane(ePane);
this.add(dbManipulationPane, BorderLayout.CENTER);
}
@Override
protected String title4PopupWindow() {
return "builtinsql";
}
@Override
public void populateBean(BuiltInSQLSubmiterProvider ob) {
editing = ob;
DBManipulation dbManipulation = ob.getDBManipulation();
dbManipulationPane.populateBean(dbManipulation);
}
@Override
public BuiltInSQLSubmiterProvider updateBean() {
DBManipulation dbManipulation = dbManipulationPane.updateBean();
//复制对象用于撤销
try {
editing = (BuiltInSQLSubmiterProvider) editing.clone();
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
editing.setDBManipulation(dbManipulation);
return editing;
}
/**
* 检查是否符合规范
*
* @throws Exception
*/
public void checkValid() throws Exception {
this.dbManipulationPane.checkValid();
}
}
public static class CustomPane extends BasicBeanPane<WClassSubmiterProvider> {
private UIComboBox csjConfigComboBox = null;
private JPanel customCardPane = null;
private Map<String, BasicBeanPane> customSubmitPanes = null;
private final Map<String, String> comboItemsMap;
private List<String> configTypes = null;
private WClassSubmiterProvider editing;
private static final String DEFAULT_PANE_TYPE = "submitnormal";
public CustomPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
customCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
customSubmitPanes = new HashMap<String, BasicBeanPane>();
comboItemsMap = new HashMap<String, String>();
SubmitProvider[] providers = ExtraDesignClassManager.getInstance().getSubmitProviders();
providers = (SubmitProvider[]) ArrayUtils.add(providers, new DefaultSubmit());
for (SubmitProvider provider : providers) {
customSubmitPanes.put(provider.keyForSubmit(), provider.appearanceForSubmit());
comboItemsMap.put(provider.keyForSubmit(), provider.dataForSubmit());
}
configTypes = new ArrayList<String>();
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
String key = entry.getKey();
configTypes.add(comboItemsMap.get(key));
customCardPane.add(entry.getValue(), key);
}
csjConfigComboBox = new UIComboBox(configTypes.toArray());
JPanel typePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(Inter.getLocText(new String[]{"Choose", "Type"}) + ":"), csjConfigComboBox},
FlowLayout.LEFT, 10);
typePane.setBorder(BorderFactory.createTitledBorder(new ModLineBorder(ModLineBorder.TOP), Inter.getLocText(new String[]{"Submit", "Type"})));
this.add(typePane, BorderLayout.NORTH);
this.add(customCardPane, BorderLayout.CENTER);
csjConfigComboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
Object ob = e.getItem();
CardLayout c1 = (CardLayout) customCardPane.getLayout();
for (String key : customSubmitPanes.keySet()) {
String item = comboItemsMap.get(key);
if ((ComparatorUtils.equals(ob, item))) {
c1.show(customCardPane, key);
}
}
}
}
});
}
@Override
public void populateBean(WClassSubmiterProvider ob) {
editing = ob;
SubmitJob submitJob = ob.getSubmitJob();
if (submitJob == null) {
csjConfigComboBox.setSelectedItem(comboItemsMap.get(DEFAULT_PANE_TYPE));
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
entry.getValue().populateBean(submitJob);
}
return;
}
String pantype = submitJob.getJobType();
BasicBeanPane pane = customSubmitPanes.get(pantype);
if (pane != null) {
csjConfigComboBox.setSelectedItem(comboItemsMap.get(pantype));
pane.populateBean(submitJob);
}
}
@Override
public WClassSubmiterProvider updateBean() {
for (Map.Entry<String, BasicBeanPane> entry : customSubmitPanes.entrySet()) {
BasicBeanPane pane = entry.getValue();
if (pane != null && pane.isVisible()) {
editing.setSubmitJob((SubmitJob) pane.updateBean());
}
}
return editing;
}
@Override
protected String title4PopupWindow() {
return "custom";
}
}
}

19
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -130,6 +130,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private Set<ElementUIProvider> elementUIProviders;
private Set<VerifyDefineProvider> verifyDefineProviders;
private Set<WidgetPropertyUIProvider> widgetAttrProviders;
private Set<ExportAttrTabProvider> exportAttrTabProviders;
@ -814,6 +816,21 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
backgroundUIProviders.add((BackgroundUIProvider) level);
}
public VerifyDefineProvider[] getVerifyDefineProviders() {
if (verifyDefineProviders == null) {
return new VerifyDefineProvider[0];
}
return verifyDefineProviders.toArray(new VerifyDefineProvider[verifyDefineProviders.size()]);
}
private void addVerifyDefineProvider(Level level, PluginSimplify simplify) throws Exception {
if (verifyDefineProviders == null) {
verifyDefineProviders = new HashSet<>();
}
validAPILevel(level, VerifyDefineProvider.CURRENT_LEVEL, simplify.getPluginName());
verifyDefineProviders.add((VerifyDefineProvider) level);
}
/**
* 文件名
*
@ -914,6 +931,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addWidgetAttrProvider(impl, simplify);
} else if (tagName.equals(ExportAttrTabProvider.XML_TAG)) {
addExportAttrTabProvider(impl, simplify);
} else if (tagName.equals(VerifyDefineProvider.MARK_STRING)) {
addVerifyDefineProvider(impl, simplify);
}
} catch (PluginInvalidLevelException e) {
PluginMessage.remindUpdate(e.getMessage());

40
designer_base/src/com/fr/design/fun/VerifyDefineProvider.java

@ -0,0 +1,40 @@
package com.fr.design.fun;
import com.fr.data.Verifier;
import com.fr.design.beans.BasicBeanPane;
import com.fr.stable.fun.Level;
import com.fr.stable.fun.Provider;
/**
* Created by richie on 16/6/8.
*/
public interface VerifyDefineProvider extends Level, Provider {
String MARK_STRING = "VerifyDefineProvider";
int CURRENT_LEVEL = 1;
/**
* 对应的校验类
* @return 校验类
*/
Class<? extends Verifier> classForVerifier();
/**
* 校验设置的界面
* @return 界面
*/
Class<? extends BasicBeanPane> appearanceForVerifier();
/**
* 此种类型的校验的名字
* @return 名字
*/
String nameForVerifier();
/**
* 菜单图标
* @return 图标路径
*/
String iconPath();
}

20
designer_base/src/com/fr/design/fun/impl/AbstractVerifyDefineProvider.java

@ -0,0 +1,20 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.VerifyDefineProvider;
import com.fr.stable.fun.impl.AbstractProvider;
/**
* Created by richie on 16/6/8.
*/
public abstract class AbstractVerifyDefineProvider extends AbstractProvider implements VerifyDefineProvider {
@Override
public int currentAPILevel() {
return CURRENT_LEVEL;
}
@Override
public String mark4Provider() {
return getClass().getName();
}
}

2
designer_base/src/com/fr/design/gui/style/AlignmentPane.java

@ -81,7 +81,7 @@ public class AlignmentPane extends AbstractBasicStylePane implements GlobalNameO
BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/defaultAlignment.png")};
Integer[] hAlignment = new Integer[]{Constants.LEFT, Constants.CENTER, Constants.RIGHT, Integer.valueOf(Constants.DISTRIBUTED), Constants.NULL};
hAlignmentPane = new UIButtonGroup<Integer>(hAlignmentIconArray, hAlignment);
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Left"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("StyleAlignment-Tooltips_Right"),
hAlignmentPane.setAllToolTips(new String[]{Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Left"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Right"),
Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_Distributed"),Inter.getLocText("FR-Designer-StyleAlignment_Tooltips_DEFAULT")});
hPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
vPaneContainer = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));

BIN
designer_base/src/com/fr/design/images/dialog/appfit/H0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 745 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/H1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 810 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/H2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/H3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/V0.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/V1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 818 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/V2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

BIN
designer_base/src/com/fr/design/images/dialog/appfit/V3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 842 B

30
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -28,6 +28,8 @@ import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginLoader;
import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider;
@ -2044,25 +2046,25 @@ public class RemoteEnv implements Env {
}
public InputStream readPluginConfig() throws Exception {
public void readPluginLicenses() throws Exception {
ByteArrayOutputStream out = new ByteArrayOutputStream();
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_get_plugin_info");
return postBytes2ServerB(out.toByteArray(), para);
para.put("cmd", "design_plugin_licenses");
InputStream inputStream = postBytes2ServerB(out.toByteArray(), para);
String pluginsLicensesStr = IOUtils.inputStream2String(inputStream, EncodeConstants.ENCODING_UTF_8);
if (StringUtils.isNotBlank(pluginsLicensesStr) && pluginsLicensesStr.startsWith("[")) {
JSONArray jsonArray = new JSONArray(pluginsLicensesStr);
for (int i = 0; i < jsonArray.length(); i++) {
PluginLicense pluginLicense = new PluginLicense();
pluginLicense.parseJSON(jsonArray.getJSONObject(i));
PluginLicenseManager.getInstance().addRemotePluginLicense(pluginLicense);
}
}
}
/**
* 远程设计先不需要检测MD5
*
* @return 是否正确
* @throws Exception MD5算法异常
*/
@Override
public boolean isTruePluginMD5(Plugin plugin, File file) throws Exception {
return true;
public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception {
}
}

25
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -7,6 +7,7 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.ChartEditPane;
@ -37,8 +38,28 @@ public class ChartTypePane extends AbstractChartAttrPane{
content.add(buttonPane, BorderLayout.NORTH);
chartTypePane = new ComboBoxPane();
chartTypePane.setBorder(BorderFactory.createEmptyBorder(0,0, 0, 10));
content.add(chartTypePane, BorderLayout.CENTER);
BasicScrollPane scrollPane = new BasicScrollPane() {
@Override
protected JPanel createContentPane() {
return chartTypePane;
}
@Override
protected void layoutContentPane() {
leftcontentPane = createContentPane();
this.add(leftcontentPane);
}
@Override
public void populateBean(Object ob) {
}
@Override
protected String title4PopupWindow() {
return null;
}
};
content.add(scrollPane, BorderLayout.CENTER);
buttonPane.setEditingChartPane(chartTypePane);

Loading…
Cancel
Save