Browse Source

Merge branch 'release/9.0' of http://cloud.finedevelop.com:2015/scm/~mango/m_design into release/9.0

master
mengao 7 years ago
parent
commit
d0be93c224
  1. 828
      designer/src/com/fr/design/module/DesignerModule.java
  2. 25
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  3. 320
      designer/src/com/fr/poly/creator/ChartBlockCreator.java
  4. 2
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  5. 54
      designer/src/com/fr/quickeditor/ChartQuickEditor.java
  6. 51
      designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java
  7. 34
      designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java
  8. 31
      designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java
  9. 6
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  10. 2
      designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java
  11. BIN
      designer_base/src/com/fr/design/images/buttonicon/anas.png
  12. BIN
      designer_base/src/com/fr/design/images/chart/ChartType.png
  13. 2
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  14. 3
      designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java
  15. BIN
      designer_chart/src/com/fr/plugin/chart/map/images/mapData.png
  16. 157
      designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java
  17. 40
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  18. 17
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  19. 17
      designer_form/src/com/fr/design/mainframe/JForm.java
  20. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java
  21. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java
  22. 2
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  23. 16
      designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java
  24. 16
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

828
designer/src/com/fr/design/module/DesignerModule.java

@ -1,415 +1,415 @@
package com.fr.design.module; package com.fr.design.module;
import com.fr.base.*; import com.fr.base.*;
import com.fr.base.io.XMLEncryptUtils; import com.fr.base.io.XMLEncryptUtils;
import com.fr.base.process.ProcessOperator; import com.fr.base.process.ProcessOperator;
import com.fr.base.remote.RemoteDeziConstants; import com.fr.base.remote.RemoteDeziConstants;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.*; import com.fr.design.actions.insert.cell.*;
import com.fr.design.actions.insert.flot.ChartFloatAction; import com.fr.design.actions.insert.flot.ChartFloatAction;
import com.fr.design.actions.insert.flot.FormulaFloatAction; import com.fr.design.actions.insert.flot.FormulaFloatAction;
import com.fr.design.actions.insert.flot.ImageFloatAction; import com.fr.design.actions.insert.flot.ImageFloatAction;
import com.fr.design.actions.insert.flot.TextBoxFloatAction; import com.fr.design.actions.insert.flot.TextBoxFloatAction;
import com.fr.design.actions.server.StyleListAction; import com.fr.design.actions.server.StyleListAction;
import com.fr.design.fun.ElementUIProvider; import com.fr.design.fun.ElementUIProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.javascript.ProcessTransitionAdapter; import com.fr.design.javascript.ProcessTransitionAdapter;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.bbs.BBSGuestPane; import com.fr.design.mainframe.bbs.BBSGuestPane;
import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.form.FormElementCaseDesigner; import com.fr.design.mainframe.form.FormElementCaseDesigner;
import com.fr.design.mainframe.form.FormReportComponentComposite; import com.fr.design.mainframe.form.FormReportComponentComposite;
import com.fr.design.mainframe.loghandler.DesignerLogImpl; import com.fr.design.mainframe.loghandler.DesignerLogImpl;
import com.fr.design.parameter.WorkBookParameterReader; import com.fr.design.parameter.WorkBookParameterReader;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.general.*; import com.fr.general.*;
import com.fr.general.xml.GeneralXMLTools; import com.fr.general.xml.GeneralXMLTools;
import com.fr.io.importer.Excel2007ReportImporter; import com.fr.io.importer.Excel2007ReportImporter;
import com.fr.io.importer.ExcelReportImporter; import com.fr.io.importer.ExcelReportImporter;
import com.fr.main.impl.WorkBook; import com.fr.main.impl.WorkBook;
import com.fr.quickeditor.ChartQuickEditor; import com.fr.quickeditor.chartquick.BasicChartQuickEditor;
import com.fr.quickeditor.cellquick.*; import com.fr.quickeditor.chartquick.FloatChartQuickEditor;
import com.fr.quickeditor.floatquick.FloatImageQuickEditor; import com.fr.quickeditor.cellquick.*;
import com.fr.quickeditor.floatquick.FloatStringQuickEditor; import com.fr.quickeditor.floatquick.FloatImageQuickEditor;
import com.fr.report.cell.CellElementValueConverter; import com.fr.quickeditor.floatquick.FloatStringQuickEditor;
import com.fr.report.cell.cellattr.core.RichText; import com.fr.report.cell.CellElementValueConverter;
import com.fr.report.cell.cellattr.core.SubReport; import com.fr.report.cell.cellattr.core.RichText;
import com.fr.report.cell.cellattr.core.group.DSColumn; import com.fr.report.cell.cellattr.core.SubReport;
import com.fr.report.cell.painter.BiasTextPainter; import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.stable.ArrayUtils; import com.fr.report.cell.painter.BiasTextPainter;
import com.fr.stable.ParameterProvider; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.ParameterProvider;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.StringUtils;
import com.fr.stable.fun.LogProvider; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.script.CalculatorProviderContext; import com.fr.stable.fun.LogProvider;
import com.fr.stable.script.ValueConverter; import com.fr.stable.script.CalculatorProviderContext;
import com.fr.stable.web.ServletContext; import com.fr.stable.script.ValueConverter;
import com.fr.stable.web.ServletContextAdapter; import com.fr.stable.web.ServletContext;
import com.fr.stable.xml.ObjectTokenizer; import com.fr.stable.web.ServletContextAdapter;
import com.fr.stable.xml.ObjectXMLWriterFinder; import com.fr.stable.xml.ObjectTokenizer;
import com.fr.start.BBSGuestPaneProvider; import com.fr.stable.xml.ObjectXMLWriterFinder;
import com.fr.xml.ReportXMLUtils; import com.fr.start.BBSGuestPaneProvider;
import com.fr.xml.ReportXMLUtils;
import javax.swing.*;
import java.awt.*; import javax.swing.*;
import java.awt.event.ActionEvent; import java.awt.*;
import java.awt.event.ActionListener; import java.awt.event.ActionEvent;
import java.awt.image.BufferedImage; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.awt.image.BufferedImage;
import java.util.Iterator; import java.util.ArrayList;
import java.util.Set; import java.util.Iterator;
import java.util.Set;
public class DesignerModule extends DesignModule {
public class DesignerModule extends DesignModule {
static {
ServletContext.addServletContextListener(new ServletContextAdapter() { static {
ServletContext.addServletContextListener(new ServletContextAdapter() {
public void onServletStart() {
ModuleContext.startModule(DesignerModule.class.getName()); public void onServletStart() {
} ModuleContext.startModule(DesignerModule.class.getName());
}); }
} });
}
/**
* 启动设计器模块 /**
*/ * 启动设计器模块
public void start() { */
super.start(); public void start() {
super.start();
justStartModules4Engine();
justStartModules4Designer(); justStartModules4Engine();
justStartModules4Designer();
CalculatorProviderContext.setValueConverter(valueConverter());
GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer(); CalculatorProviderContext.setValueConverter(valueConverter());
GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder(); GeneralXMLTools.Object_Tokenizer = startXMLReadObjectTokenizer();
addAdapterForPlate(); GeneralXMLTools.Object_XML_Writer_Finder = startObjectXMLWriterFinder();
addAdapterForPlate();
registerCellEditor();
registerFloatEditor(); registerCellEditor();
registerData4Form(); registerFloatEditor();
registerOtherPane(); registerData4Form();
registerOtherPane();
InformationCollector.getInstance().collectStartTime();
InformationCollector.getInstance().collectStartTime();
ExtraDesignClassManager.getInstance().getFeedback().didFeedback();
StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance()); ExtraDesignClassManager.getInstance().getFeedback().didFeedback();
} StableFactory.registerMarkedObject(LogProvider.MARK_STRING, DesignerLogImpl.getInstance());
}
private void registerOtherPane() {
StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class); private void registerOtherPane() {
} StableFactory.registerMarkedClass(BBSGuestPaneProvider.XML_TAG, BBSGuestPane.class);
}
/**
* kunsnat:注册单元格选中Editor /**
*/ * kunsnat:注册单元格选中Editor
*/
private void registerCellEditor() {
ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class); private void registerCellEditor() {
ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class); ActionFactory.registerCellEditor(String.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(Formula.class, CellFormulaQuickEditor.class); ActionFactory.registerCellEditor(Number.class, CellStringQuickEditor.class);
ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class); ActionFactory.registerCellEditor(Formula.class, CellFormulaQuickEditor.class);
ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class); ActionFactory.registerCellEditor(SubReport.class, CellSubReportEditor.class);
ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class); ActionFactory.registerCellEditor(RichText.class, CellRichTextEditor.class);
ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.class); ActionFactory.registerCellEditor(DSColumn.class, CellDSColumnEditor.class);
ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class); ActionFactory.registerCellEditor(Image.class, CellImageQuickEditor.class);
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class); ActionFactory.registerCellEditor(BiasTextPainter.class, CellBiasTextPainterEditor.class);
ActionFactory.registerCellEditor(BufferedImage.class, CellImageQuickEditor.class);
ActionFactory.registerChartCellEditorInEditor(ChartQuickEditor.class);
ActionFactory.registerChartCellEditorInEditor(BasicChartQuickEditor.class);
Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
for (ElementUIProvider provider : providers) { Set<ElementUIProvider> providers = ExtraDesignClassManager.getInstance().getArray(ElementUIProvider.MARK_STRING);
ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor()); for (ElementUIProvider provider : providers) {
} ActionFactory.registerCellEditor(provider.targetObjectClass(), provider.quickEditor());
} }
}
public String getInterNationalName() {
return Inter.getLocText("FR-Module_Designer"); public String getInterNationalName() {
} return Inter.getLocText("FR-Module_Designer");
}
/**
* kunnat: 注册悬浮选中Editor /**
*/ * kunnat: 注册悬浮选中Editor
private void registerFloatEditor() { */
ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class); private void registerFloatEditor() {
ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class); ActionFactory.registerFloatEditor(String.class, FloatStringQuickEditor.class);
ActionFactory.registerFloatEditor(Formula.class, FloatStringQuickEditor.class);
FloatImageQuickEditor floatImageQuickEditor = new FloatImageQuickEditor(); ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class);
ActionFactory.registerFloatEditor(Image.class, FloatImageQuickEditor.class); ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class);
ActionFactory.registerFloatEditor(BufferedImage.class, FloatImageQuickEditor.class);
ActionFactory.registerChartFloatEditorInEditor(ChartQuickEditor.class); ActionFactory.registerChartFloatEditorInEditor(FloatChartQuickEditor.class);
} }
/** /**
* kunsnat: 一些模块信息 必须跟随设计器启动, * kunsnat: 一些模块信息 必须跟随设计器启动,
* 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息 * 比如 读取CC.XML, 设计器启动之后, 马上会读取XML, 需要Chart_Module中的注册信息
*/ */
private void justStartModules4Engine() { private void justStartModules4Engine() {
ModuleContext.startModule(ENGINE_MODULE); ModuleContext.startModule(ENGINE_MODULE);
} }
private void justStartModules4Designer() { private void justStartModules4Designer() {
ModuleContext.startModule(CHART_DESIGNER_MODULE); ModuleContext.startModule(CHART_DESIGNER_MODULE);
ModuleContext.startModule(FORM_DESIGNER_MODULE); ModuleContext.startModule(FORM_DESIGNER_MODULE);
} }
/** /**
* CellElementValueConverter用来处理设计器格子里的值将公式/数组/其他元素转换成对应的值 * CellElementValueConverter用来处理设计器格子里的值将公式/数组/其他元素转换成对应的值
* *
* @return 返回处理格子值的转换器 * @return 返回处理格子值的转换器
*/ */
public ValueConverter valueConverter() { public ValueConverter valueConverter() {
return new CellElementValueConverter(); return new CellElementValueConverter();
} }
@Override @Override
/* /*
* 针对不同的对象在读取Object对象的xml的时候需要使用不同的对象生成器 * 针对不同的对象在读取Object对象的xml的时候需要使用不同的对象生成器
* @return 返回对象生成器 * @return 返回对象生成器
*/ */
public ObjectTokenizer startXMLReadObjectTokenizer() { public ObjectTokenizer startXMLReadObjectTokenizer() {
return new ReportXMLUtils.ReportObjectTokenizer(); return new ReportXMLUtils.ReportObjectTokenizer();
} }
/** /**
* 针对不同的对象在写对象的XML时需要使用不同的XML生成器 * 针对不同的对象在写对象的XML时需要使用不同的XML生成器
* *
* @return 返回xml生成器 * @return 返回xml生成器
*/ */
@Override @Override
public ObjectXMLWriterFinder startObjectXMLWriterFinder() { public ObjectXMLWriterFinder startObjectXMLWriterFinder() {
return new ReportXMLUtils.ReportObjectXMLWriterFinder(); return new ReportXMLUtils.ReportObjectXMLWriterFinder();
} }
//wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加 //wei:fs的模块中可能有需要设计器界面做设置的地方,在这边添加
private void addAdapterForPlate() { private void addAdapterForPlate() {
ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() { ProcessTransitionAdapter.setProcessTransitionAdapter(new ProcessTransitionAdapter() {
@Override @Override
protected String[] getTransitionNamesByBook(String book) { protected String[] getTransitionNamesByBook(String book) {
return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book); return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getTransitionNamesByBook(book);
} }
@Override @Override
protected String[] getParaNames(String book) { protected String[] getParaNames(String book) {
return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book); return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParaNames(book);
} }
@Override @Override
protected ParameterProvider[] getParas(String book) { protected ParameterProvider[] getParas(String book) {
return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book); return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getParas(book);
} }
protected MultiFieldParameter[] getAllMultiFieldParas(String book) { protected MultiFieldParameter[] getAllMultiFieldParas(String book) {
return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book); return StableFactory.getMarkedObject(ProcessOperator.MARK_STRING, ProcessOperator.class, ProcessOperator.EMPTY).getAllMultiFieldParas(book);
} }
}); });
} }
private static abstract class AbstractWorkBookApp implements App<WorkBook> { private static abstract class AbstractWorkBookApp implements App<WorkBook> {
@Override @Override
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; return CURRENT_LEVEL;
} }
@Override @Override
public JTemplate<WorkBook, ?> openTemplate(FILE tplFile) { public JTemplate<WorkBook, ?> openTemplate(FILE tplFile) {
return new JWorkBook(asIOFile(tplFile), tplFile); return new JWorkBook(asIOFile(tplFile), tplFile);
} }
@Override @Override
public String mark4Provider() { public String mark4Provider() {
return getClass().getName(); return getClass().getName();
} }
@Override @Override
public void process() { public void process() {
} }
@Override @Override
public void undo() { public void undo() {
} }
} }
@Override @Override
/* /*
* 返回设计器能打开的模板类型的一个数组列表 * 返回设计器能打开的模板类型的一个数组列表
* @return 可以打开的模板类型的数组 * @return 可以打开的模板类型的数组
*/ */
public App[] apps4TemplateOpener() { public App[] apps4TemplateOpener() {
return new App[]{getCptApp(), getXlsApp(), getXlsxApp()}; return new App[]{getCptApp(), getXlsApp(), getXlsxApp()};
} }
private AbstractWorkBookApp getXlsxApp() { private AbstractWorkBookApp getXlsxApp() {
return new AbstractWorkBookApp() { return new AbstractWorkBookApp() {
@Override @Override
public String[] defaultExtentions() { public String[] defaultExtentions() {
return new String[]{"xlsx"}; return new String[]{"xlsx"};
} }
@Override @Override
public WorkBook asIOFile(FILE tplFile) { public WorkBook asIOFile(FILE tplFile) {
WorkBook workbook = null; WorkBook workbook = null;
try { try {
workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream()); workbook = new Excel2007ReportImporter().generateWorkBookByStream(tplFile.asInputStream());
} catch (Exception exp) { } catch (Exception exp) {
FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp); FRContext.getLogger().error("Failed to generate xlsx from " + tplFile, exp);
} }
return workbook; return workbook;
} }
}; };
} }
private AbstractWorkBookApp getXlsApp() { private AbstractWorkBookApp getXlsApp() {
return new AbstractWorkBookApp() { return new AbstractWorkBookApp() {
@Override @Override
public String[] defaultExtentions() { public String[] defaultExtentions() {
return new String[]{"xls"}; return new String[]{"xls"};
} }
@Override @Override
public WorkBook asIOFile(FILE tplFile) { public WorkBook asIOFile(FILE tplFile) {
WorkBook workbook = null; WorkBook workbook = null;
try { try {
workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream()); workbook = new ExcelReportImporter().generateWorkBookByStream(tplFile.asInputStream());
} catch (Exception exp) { } catch (Exception exp) {
FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp); FRContext.getLogger().error("Failed to generate xls from " + tplFile, exp);
} }
return workbook; return workbook;
} }
}; };
} }
private AbstractWorkBookApp getCptApp() { private AbstractWorkBookApp getCptApp() {
return new AbstractWorkBookApp() { return new AbstractWorkBookApp() {
public String[] defaultExtentions() { public String[] defaultExtentions() {
return new String[]{"cpt"}; return new String[]{"cpt"};
} }
public WorkBook asIOFile(FILE file) { public WorkBook asIOFile(FILE file) {
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()) {
FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd")); FRContext.getLogger().error(Inter.getLocText("ECP-error_pwd"));
return new WorkBook(); return new WorkBook();
} }
} }
WorkBook tpl = new WorkBook(); WorkBook tpl = new WorkBook();
// richer:打开报表通知 // richer:打开报表通知
FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."})); FRContext.getLogger().info(Inter.getLocText(new String[]{"LOG-Is_Being_Openned", "LOG-Please_Wait"}, new String[]{"\"" + file.getName() + "\"" + ",", "..."}));
TempNameStyle namestyle = TempNameStyle.getInstance(); TempNameStyle namestyle = TempNameStyle.getInstance();
namestyle.clear(); namestyle.clear();
String checkStr = StringUtils.EMPTY; String checkStr = StringUtils.EMPTY;
try { try {
checkStr = IOUtils.inputStream2String(file.asInputStream()); checkStr = IOUtils.inputStream2String(file.asInputStream());
tpl.readStream(file.asInputStream()); tpl.readStream(file.asInputStream());
} catch (Exception exp) { } catch (Exception exp) {
String errorMessage = StringUtils.EMPTY; String errorMessage = StringUtils.EMPTY;
errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege") errorMessage = ComparatorUtils.equals(RemoteDeziConstants.INVALID_USER, checkStr) ? Inter.getLocText("FR-Designer_No-Privilege")
: Inter.getLocText("NS-exception_readError"); : Inter.getLocText("NS-exception_readError");
FRContext.getLogger().error(errorMessage + file, exp); FRContext.getLogger().error(errorMessage + file, exp);
} }
checkNameStyle(namestyle); checkNameStyle(namestyle);
return tpl; return tpl;
} }
}; };
} }
private static void checkNameStyle(TempNameStyle namestyle) { private static void checkNameStyle(TempNameStyle namestyle) {
Iterator it = namestyle.getIterator(); Iterator it = namestyle.getIterator();
ArrayList<String> al = new ArrayList<String>(); ArrayList<String> al = new ArrayList<String>();
while (it.hasNext()) { while (it.hasNext()) {
al.add((String) it.next()); al.add((String) it.next());
} }
if (!al.isEmpty()) { if (!al.isEmpty()) {
showConfirmDialog(al); showConfirmDialog(al);
} }
} }
private static void showConfirmDialog(final ArrayList<String> namelist) { private static void showConfirmDialog(final ArrayList<String> namelist) {
final JDialog jd = new JDialog(); final JDialog jd = new JDialog();
// 模态一下,因为可能会多个样式丢失 // 模态一下,因为可能会多个样式丢失
// jd.setModal(true); // jd.setModal(true);
jd.setAlwaysOnTop(true); jd.setAlwaysOnTop(true);
jd.setSize(450, 150); jd.setSize(450, 150);
jd.setResizable(false); jd.setResizable(false);
jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png")); jd.setIconImage(BaseUtils.readImage("/com/fr/base/images/oem/logo.png"));
String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", ""); String message = namelist.toString().replaceAll("\\[", "").replaceAll("\\]", "");
UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message})); UILabel jl = new UILabel(Inter.getLocText(new String[]{"Current_custom_global", "Has_been_gone"}, new String[]{message}));
jl.setHorizontalAlignment(SwingConstants.CENTER); jl.setHorizontalAlignment(SwingConstants.CENTER);
jd.add(jl, BorderLayout.CENTER); jd.add(jl, BorderLayout.CENTER);
JPanel jp = new JPanel(); JPanel jp = new JPanel();
// ”是“按钮,点击之后将生成一个全局样式,并写入xml // ”是“按钮,点击之后将生成一个全局样式,并写入xml
UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes")); UIButton confirmButton = new UIButton(Inter.getLocText("FR-Designer_Yes"));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
for (int i = 0; i < namelist.size(); i++) { for (int i = 0; i < namelist.size(); i++) {
ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE); ConfigManager.getProviderInstance().putStyle(namelist.get(i), Style.DEFAULT_STYLE);
FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance()); FRContext.getCurrentEnv().writeResource(ConfigManager.getProviderInstance());
} }
} catch (Exception ex) { } catch (Exception ex) {
FRLogger.getLogger().error(ex.getMessage()); FRLogger.getLogger().error(ex.getMessage());
} }
jd.dispose(); jd.dispose();
new StyleListAction().actionPerformed(e);// 弹窗 new StyleListAction().actionPerformed(e);// 弹窗
} }
}); });
UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No")); UIButton noButton = new UIButton(Inter.getLocText("FR-Designer_No"));
noButton.addActionListener(new ActionListener() { noButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
jd.dispose(); jd.dispose();
} }
}); });
jp.add(confirmButton); jp.add(confirmButton);
jp.add(noButton); jp.add(noButton);
jd.setTitle(Inter.getLocText("FR-Custom_styles_lost")); jd.setTitle(Inter.getLocText("FR-Custom_styles_lost"));
jd.add(jp, BorderLayout.SOUTH); jd.add(jp, BorderLayout.SOUTH);
GUICoreUtils.centerWindow(jd); GUICoreUtils.centerWindow(jd);
jd.setVisible(true); jd.setVisible(true);
} }
public Class<?>[] actionsForInsertCellElement() { public Class<?>[] actionsForInsertCellElement() {
return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{ return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{
DSColumnCellAction.class, DSColumnCellAction.class,
GeneralCellAction.class, GeneralCellAction.class,
RichTextCellAction.class, RichTextCellAction.class,
FormulaCellAction.class, FormulaCellAction.class,
ChartCellAction.class, ChartCellAction.class,
ImageCellAction.class, ImageCellAction.class,
BiasCellAction.class, BiasCellAction.class,
SubReportCellAction.class SubReportCellAction.class
}, super.actionsForInsertCellElement()); }, super.actionsForInsertCellElement());
} }
public Class<?>[] actionsForInsertFloatElement() { public Class<?>[] actionsForInsertFloatElement() {
return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{ return (Class<?>[]) ArrayUtils.addAll(new Class<?>[]{
TextBoxFloatAction.class, TextBoxFloatAction.class,
FormulaFloatAction.class, FormulaFloatAction.class,
ChartFloatAction.class, ChartFloatAction.class,
ImageFloatAction.class ImageFloatAction.class
}, super.actionsForInsertFloatElement()); }, super.actionsForInsertFloatElement());
} }
private void registerData4Form() { private void registerData4Form() {
StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class); StableFactory.registerMarkedClass(FormECDesignerProvider.XML_TAG, FormElementCaseDesigner.class);
StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class); StableFactory.registerMarkedClass(FormECCompositeProvider.XML_TAG, FormReportComponentComposite.class);
DesignModuleFactory.registerParameterReader(new WorkBookParameterReader()); DesignModuleFactory.registerParameterReader(new WorkBookParameterReader());
} }
} }

25
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -75,12 +75,23 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
this.setBorder(null); this.setBorder(null);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
setComponentBg(this); setComponentBg(this);
// formParaDesignEditor = new FormParaDesigner(new FormParameterUI());
paraDesignEditor = DesignModuleFactory.getFormParaDesigner(); paraDesignEditor = DesignModuleFactory.getFormParaDesigner();
if (paraDesignEditor == null) { if (paraDesignEditor == null) {
return; return;
} }
paraDesignEditor.initWidgetToolbarPane(); paraDesignEditor.initWidgetToolbarPane();
this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER);
setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png"));
setButton.set4ToolbarButton();
isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window"));
isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing"));
initListeners();
}
private void initListeners() {
((TargetComponent) paraDesignEditor).addTargetModifiedListener(new TargetModifiedListener() { ((TargetComponent) paraDesignEditor).addTargetModifiedListener(new TargetModifiedListener() {
@Override @Override
public void targetModified(TargetModifiedEvent e) { public void targetModified(TargetModifiedEvent e) {
@ -93,7 +104,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
paraDesignEditor.addListener(this); paraDesignEditor.addListener(this);
propertyChangeListener = new PropertyChangeAdapter() { propertyChangeListener = new PropertyChangeAdapter() {
@Override @Override
public void propertyChange() { public void propertyChange() {
if (isEditing) { if (isEditing) {
@ -102,12 +112,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
} }
}; };
this.add(paraDesignEditor.createWrapper(), BorderLayout.CENTER);
// WidgetToolBarPane.getRecentSearchManger(formParaDesignEditor);
setButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/parametersetting.png"));
setButton.set4ToolbarButton();
isshowWindowItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Show_Parameter_Window"));
isshowWindowItem.addItemListener(new ItemListener() { isshowWindowItem.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
@ -116,9 +121,8 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
} }
}); });
isdelayItem = new JCheckBoxMenuItem(Inter.getLocText("ParameterD-Delay_Playing"));
isdelayItem.addItemListener(new ItemListener() {
isdelayItem.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if (propertyChangeListener != null) { if (propertyChangeListener != null) {
@ -128,7 +132,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
} }
}); });
setButton.addActionListener(new ActionListener() { setButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -298,7 +301,7 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
*/ */
public void refreshParameter() { public void refreshParameter() {
if (paraDesignEditor != null) { if (paraDesignEditor != null) {
paraDesignEditor.refreshParameter(this); paraDesignEditor.refreshParameter(this, this.workBook);
} }
} }

320
designer/src/com/fr/poly/creator/ChartBlockCreator.java

@ -1,166 +1,156 @@
/* package com.fr.poly.creator;
* Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved.
*/ import com.fr.design.DesignState;
package com.fr.poly.creator; import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.MiddleChartComponent;
import java.awt.*; import com.fr.design.menu.MenuDef;
import java.awt.image.BufferedImage; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef;
import javax.swing.*; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.base.ScreenResolution; import com.fr.quickeditor.chartquick.PolyChartQuickEditor;
import com.fr.design.DesignState; import com.fr.report.poly.PolyChartBlock;
import com.fr.design.designer.TargetComponent; import com.fr.stable.unit.FU;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.stable.unit.UNIT;
import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.stable.unit.UnitRectangle;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import javax.swing.*;
import com.fr.design.menu.ToolBarDef; import java.awt.*;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor; /**
import com.fr.quickeditor.ChartQuickEditor; * @author richer
import com.fr.report.poly.PolyChartBlock; * @since 6.5.4 创建于2011-5-10
import com.fr.stable.unit.FU; */
import com.fr.stable.unit.UNIT; public class ChartBlockCreator extends BlockCreator<PolyChartBlock> {
import com.fr.stable.unit.UnitRectangle; private MiddleChartComponent cpm;
private ChartBlockEditor editor;
/**
* @author richer //图表默认宽高330*240
* @since 6.5.4 创建于2011-5-10 private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000);
*/ private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000);
public class ChartBlockCreator extends BlockCreator<PolyChartBlock> {
private MiddleChartComponent cpm;
private ChartBlockEditor editor; public ChartBlockCreator() {
//图表默认宽高330*240 }
private static final UNIT DEFAULT_WIDTH = FU.getInstance(12573000);
private static final UNIT DEFAULT_HEIGHT = FU.getInstance(9144000); public ChartBlockCreator(PolyChartBlock block) {
super(block);
}
public ChartBlockCreator() {
public void setResolution(int resolution) {
} this.resolution = resolution;
}
public ChartBlockCreator(PolyChartBlock block) {
super(block); /**
} * 初始化
*
public void setResolution(int resolution){ * @return 初始化的控件.
this.resolution = resolution; */
} public JComponent initMonitor() {
cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection());
/** cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray));
* 初始化 return cpm;
* @return 初始化的控件. }
*/
public JComponent initMonitor() { public UnitRectangle getDefaultBlockBounds() {
cpm = DesignModuleFactory.getChartComponent(getValue().getChartCollection()); return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT);
cpm.setBorder(BorderFactory.createLineBorder(Color.lightGray)); }
return cpm;
} @Override
public BlockEditor getEditor() {
public UnitRectangle getDefaultBlockBounds() { if (editor == null) {
return new UnitRectangle(UNIT.ZERO, UNIT.ZERO, DEFAULT_WIDTH, DEFAULT_HEIGHT); editor = new ChartBlockEditor(designer, this);
} }
return editor;
@Override }
public BlockEditor getEditor() {
if (editor == null) { @Override
editor = new ChartBlockEditor(designer, this); public int getX(float time) {
} return (int) (this.getX() * time);
return editor; }
}
@Override
@Override public int getY(float time) {
public int getX(float time) { return (int) (this.getY() * time);
return (int) (this.getX() * time); }
}
@Override /**
public int getY(float time) { * 检测按钮状态
return (int) (this.getY() * time); *
} * @date 2015-2-5-上午11:33:46
*/
public void checkButtonEnable() {
/** if (editor == null) {
* 检测按钮状态 editor = new ChartBlockEditor(designer, this);
* }
* @date 2015-2-5-上午11:33:46 editor.checkChartButtonsEnable();
* }
*/
public void checkButtonEnable() { @Override
if (editor == null) { public PolyChartBlock getValue() {
editor = new ChartBlockEditor(designer, this); return block;
} }
editor.checkChartButtonsEnable();
} @Override
public void setValue(PolyChartBlock block) {
@Override this.block = block;
public PolyChartBlock getValue() { cpm.populate(this.block.getChartCollection());
return block; }
}
@Override /**
public void setValue(PolyChartBlock block) { * 获取当前工具栏组
this.block = block; *
cpm.populate(this.block.getChartCollection()); * @return 工具栏组
} * @date 2015-2-5-上午11:29:07
*/
public ToolBarDef[] toolbars4Target() {
return new ToolBarDef[0];
/** }
* 获取当前工具栏组
* /**
* @return 工具栏组 * 在Form的工具栏组
* *
* @date 2015-2-5-上午11:29:07 * @return 组件数组
* * @date 2015-2-5-上午11:31:46
*/ */
public ToolBarDef[] toolbars4Target() { public JComponent[] toolBarButton4Form() {
return new ToolBarDef[0]; return new JComponent[0];
} }
/** /**
* 在Form的工具栏组 * 目标的列表
* *
* @return 组件数组 * @return 返回列表.
* */
* @date 2015-2-5-上午11:31:46 public MenuDef[] menus4Target() {
* return new MenuDef[0];
*/ }
public JComponent[] toolBarButton4Form() {
return new JComponent[0]; public int getMenuState() {
} return DesignState.POLY_SHEET;
}
/**
* 目标的列表 /**
* @return 返回列表. * 模板的Menu
*/ *
public MenuDef[] menus4Target() { * @return 模板的menu
return new MenuDef[0]; */
} public ShortCut[] shortcut4TemplateMenu() {
return new ShortCut[0];
public int getMenuState(){ }
return DesignState.POLY_SHEET;
} @Override
public PolyElementCasePane getEditingElementCasePane() {
/** return null;
* 模板的Menu }
* @return 模板的menu
*/ @Override
public ShortCut[] shortcut4TemplateMenu() { public QuickEditor getQuickEditor(TargetComponent tc) {
return new ShortCut[0]; PolyChartQuickEditor quitEditor = new PolyChartQuickEditor();
} quitEditor.populate(tc);
return quitEditor;
@Override }
public PolyElementCasePane getEditingElementCasePane() {
return null;
}
@Override
public QuickEditor getQuickEditor(TargetComponent tc) {
ChartQuickEditor quitEditor = new ChartQuickEditor();
quitEditor.populate(tc);
return quitEditor;
}
} }

2
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -66,7 +66,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p}; double[] rowSize = {p, f};
JComponent centerBody = createCenterBody(); JComponent centerBody = createCenterBody();
JPanel topContent = initTopContent(); JPanel topContent = initTopContent();
if (isScrollAll()) { if (isScrollAll()) {

54
designer/src/com/fr/quickeditor/ChartQuickEditor.java

@ -1,54 +0,0 @@
package com.fr.quickeditor;
import com.fr.base.chart.BaseChartCollection;
//import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.ChartBlockEditor;
import com.fr.report.cell.Elem;
import java.awt.*;
public class ChartQuickEditor extends QuickEditor<TargetComponent>{
// kunsnat: editingPropertyPane初始化 避开设计器启动, 在用到的时候再初始化.
//private BaseChartPropertyPane editingPropertyPane = null;
public ChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane = null;
BaseChartCollection collection = null;
if(tc instanceof PolyDesigner) {
ChartBlockEditor chartBlockEditor = (ChartBlockEditor)((PolyDesigner)tc).getSelection().getEditor();
collection = chartBlockEditor.getValue().getChartCollection();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.setSupportCellData(false);
} else {
Selection selection = ((ElementCasePane)tc).getSelection();
Elem element = null;
if(selection instanceof CellSelection) {
CellSelection cs = (CellSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow());
} else if(selection instanceof FloatSelection){
FloatSelection fs = (FloatSelection)selection;
element = ((ElementCasePane)tc).getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
}
collection = (BaseChartCollection) element.getValue();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
}
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

51
designer/src/com/fr/quickeditor/chartquick/BasicChartQuickEditor.java

@ -0,0 +1,51 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.insert.cell.ChartCellAction;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.Elem;
import javax.swing.*;
public class BasicChartQuickEditor extends CellQuickEditor {
private BaseChartPropertyPane editingPropertyPane;
public BasicChartQuickEditor() {
super();
}
@Override
public JComponent createCenterBody() {
editingPropertyPane = DesignModuleFactory.getChartPropertyPane();
editingPropertyPane.setBorder(BorderFactory.createEmptyBorder());
return editingPropertyPane;
}
@Override
public boolean isScrollAll() {
return false;
}
@Override
public Object getComboBoxSelected() {
return ActionFactory.createAction(ChartCellAction.class);
}
@Override
protected void refreshDetails() {
BaseChartCollection collection;
Selection selection = tc.getSelection();
Elem element;
CellSelection cs = (CellSelection) selection;
element = tc.getEditingElementCase().getCellElement(cs.getColumn(), cs.getRow());
collection = (BaseChartCollection) element.getValue();
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

34
designer/src/com/fr/quickeditor/chartquick/FloatChartQuickEditor.java

@ -0,0 +1,34 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.Elem;
import java.awt.*;
public class FloatChartQuickEditor extends QuickEditor<ElementCasePane> {
public FloatChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane;
BaseChartCollection collection;
Selection selection = tc.getSelection();
Elem element;
FloatSelection fs = (FloatSelection) selection;
element = tc.getEditingElementCase().getFloatElement(fs.getSelectedFloatName());
collection = (BaseChartCollection) element.getValue();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

31
designer/src/com/fr/quickeditor/chartquick/PolyChartQuickEditor.java

@ -0,0 +1,31 @@
package com.fr.quickeditor.chartquick;
import com.fr.base.chart.BaseChartCollection;
import com.fr.design.designer.TargetComponent;
import com.fr.design.gui.chart.BaseChartPropertyPane;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.selection.QuickEditor;
import com.fr.poly.PolyDesigner;
import com.fr.poly.creator.ChartBlockEditor;
import java.awt.*;
public class PolyChartQuickEditor extends QuickEditor<TargetComponent> {
public PolyChartQuickEditor() {
setLayout(new BorderLayout());
setBorder(null);
}
@Override
protected void refresh() {
BaseChartPropertyPane editingPropertyPane;
BaseChartCollection collection;
ChartBlockEditor chartBlockEditor = (ChartBlockEditor) ((PolyDesigner) tc).getSelection().getEditor();
collection = chartBlockEditor.getValue().getChartCollection();
add(editingPropertyPane = DesignModuleFactory.getChartPropertyPane(), BorderLayout.CENTER);
editingPropertyPane.setSupportCellData(false);
editingPropertyPane.populateChartPropertyPane(collection, tc);
}
}

6
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -24,11 +24,11 @@ public class ActionFactory {
private ActionFactory() { private ActionFactory() {
} }
private static Map<Class, Class<? extends QuickEditor>> floatEditor = new HashMap<Class, Class<? extends QuickEditor>>(); private static Map<Class, Class<? extends QuickEditor>> floatEditor = new HashMap<>();
private static Class chartCollectionClass = null; private static Class chartCollectionClass = null;
private static Map<Class, Class<? extends QuickEditor>> cellEditor = new HashMap<Class, Class<? extends QuickEditor>>(); private static Map<Class, Class<? extends QuickEditor>> cellEditor = new HashMap<>();
private static UpdateAction chartPreStyleAction = null; private static UpdateAction chartPreStyleAction = null;
@ -98,7 +98,7 @@ public class ActionFactory {
} }
/** /**
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollection和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册.
* *
* @param editor 待说明 * @param editor 待说明
*/ */

2
designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java

@ -302,6 +302,8 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH
ShortCut addItem = addItemShortCut().getShortCut(); ShortCut addItem = addItemShortCut().getShortCut();
addItem.intoJToolBar(topToolBar); addItem.intoJToolBar(topToolBar);
topToolBar.validate(); topToolBar.validate();
this.controlUpdatePane = createControlUpdatePane();//REPORT-4841 刷新一下编辑面板
cardPane.add(controlUpdatePane, "EDIT");
this.repaint(); this.repaint();
} }

BIN
designer_base/src/com/fr/design/images/buttonicon/anas.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 454 B

BIN
designer_base/src/com/fr/design/images/chart/ChartType.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 B

After

Width:  |  Height:  |  Size: 138 B

2
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -28,7 +28,7 @@ public class BasicPropertyPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField(); widgetName = new UITextField();
widgetName.setGlobalName(Inter.getLocText("FR-Designer_Widget_Name")); widgetName.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p}; double[] rowSize = {p};

3
designer_base/src/com/fr/design/parameter/ParameterDesignerProvider.java

@ -3,6 +3,7 @@ package com.fr.design.parameter;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.JTemplate;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -31,6 +32,8 @@ public interface ParameterDesignerProvider {
void refreshParameter(ParaDefinitePane paraDefinitePane); void refreshParameter(ParaDefinitePane paraDefinitePane);
void refreshParameter(ParaDefinitePane paraDefinitePane, JTemplate jt);
boolean isWithQueryButton(); boolean isWithQueryButton();
java.util.List<String> getAllXCreatorNameList(); java.util.List<String> getAllXCreatorNameList();

BIN
designer_chart/src/com/fr/plugin/chart/map/images/mapData.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 493 B

157
designer_form/src/com/fr/design/designer/beans/models/SelectionModel.java

@ -136,37 +136,7 @@ public class SelectionModel {
private void unselectedPaste() { private void unselectedPaste() {
if (designer.getClass().equals(FormDesigner.class)) { if (designer.getClass().equals(FormDesigner.class)) {
if (selection.getSelectedCreator() instanceof XWFitLayout) { if (selection.getSelectedCreator() instanceof XWFitLayout) {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) { pasteXWFitLayout();
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, container, clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
} else {
//自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
}
} else { } else {
//绝对布局 //绝对布局
//编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层 //编辑器外面还有两层容器,使用designer.getRootComponent()获取到的是编辑器中层的容器,不是编辑器表层
@ -186,6 +156,40 @@ public class SelectionModel {
} }
} }
private void pasteXWFitLayout() {
if (selection.getSelectedCreator().getClass().equals(XWTabFitLayout.class)) {
XLayoutContainer container = (XLayoutContainer) selection.getSelectedCreator();
//tab布局编辑器内部左上角第一个坐标点
int leftUpX = container.toData().getMargin().getLeft() + 1;
int leftUpY = container.toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) container.getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, container, clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
} else {
//自适应布局编辑器内部左上角第一个坐标点
int leftUpX = designer.getRootComponent().toData().getMargin().getLeft() + 1;
int leftUpY = designer.getRootComponent().toData().getMargin().getTop() + 1;
//选中第一个坐标点坐在的组件
selection.setSelectedCreator((XCreator) designer.getRootComponent().getComponentAt(leftUpX, leftUpY));
Rectangle rectangle = selection.getRelativeBounds();
if (hasSelectedPasteSource()) {
selectedPaste();
} else {
FormSelectionUtils.paste2Container(designer, designer.getRootComponent(),
clipboard,
rectangle.x + rectangle.width / 2,
rectangle.y + DELTA_X_Y);
}
}
}
/** /**
* 粘贴时选择组件 * 粘贴时选择组件
*/ */
@ -227,7 +231,11 @@ public class SelectionModel {
XCreator[] roots = selection.getSelectedCreators(); XCreator[] roots = selection.getSelectedCreators();
if (roots.length > 0) { if (roots.length > 0) {
boolean isInPara = true; // 在参数面板内删除控件
for (XCreator creator : roots) { for (XCreator creator : roots) {
if (isInPara && !(creator.getParent() instanceof XWParameterLayout)) {
isInPara = false;
}
if (creator.acceptType(XWParameterLayout.class)) { if (creator.acceptType(XWParameterLayout.class)) {
designer.removeParaComponent(); designer.removeParaComponent();
} }
@ -236,8 +244,7 @@ public class SelectionModel {
// 清除被选中的组件 // 清除被选中的组件
selection.reset(); selection.reset();
} }
setSelectedCreator(designer.getRootComponent()); setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent());
FormSelectionUtils.rebuildSelection(designer);
// 触发事件 // 触发事件
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED);
designer.repaint(); designer.repaint();
@ -401,45 +408,57 @@ public class SelectionModel {
if (x < (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) { if (x < (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer; return Location.outer;
} else if ((x >= (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) && (x <= bounds.x)) { } else if ((x >= (bounds.x - XCreatorConstants.RESIZE_BOX_SIZ)) && (x <= bounds.x)) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionLeft(bounds, y);
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.left_top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.left;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.left_bottom;
} else {
return Location.outer;
}
} else if ((x > bounds.x) && (x < (bounds.x + bounds.width))) { } else if ((x > bounds.x) && (x < (bounds.x + bounds.width))) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionCenter(bounds, y);
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.inner;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.bottom;
} else {
return Location.outer;
}
} else if ((x >= (bounds.x + bounds.width)) } else if ((x >= (bounds.x + bounds.width))
&& (x <= (bounds.x + bounds.width + XCreatorConstants.RESIZE_BOX_SIZ))) { && (x <= (bounds.x + bounds.width + XCreatorConstants.RESIZE_BOX_SIZ))) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) { return getDirectionRight(bounds, y);
return Location.outer; } else {
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) { return Location.outer;
return Location.right_top; }
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) { }
return Location.right;
} else if ((y >= (bounds.y + bounds.height)) private Direction getDirectionRight(Rectangle bounds, int y) {
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) { if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.right_bottom; return Location.outer;
} else { } else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.outer; return Location.right_top;
} } else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.right;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.right_bottom;
} else {
return Location.outer;
}
}
private Direction getDirectionCenter(Rectangle bounds, int y) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.inner;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.bottom;
} else {
return Location.outer;
}
}
private Direction getDirectionLeft(Rectangle bounds, int y) {
if (y < (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) {
return Location.outer;
} else if ((y >= (bounds.y - XCreatorConstants.RESIZE_BOX_SIZ)) && (y <= bounds.y)) {
return Location.left_top;
} else if ((y > bounds.y) && (y < (bounds.y + bounds.height))) {
return Location.left;
} else if ((y >= (bounds.y + bounds.height))
&& (y <= (bounds.y + bounds.height + XCreatorConstants.RESIZE_BOX_SIZ))) {
return Location.left_bottom;
} else { } else {
return Location.outer; return Location.outer;
} }

40
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -37,16 +37,7 @@ import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormDesignerModeForSpecial;
import com.fr.design.mainframe.FormParaPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParaDefinitePane;
import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
@ -79,6 +70,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
private static final int SECOND_H_LOCATION = 170; private static final int SECOND_H_LOCATION = 170;
private static final int ADD_HEIGHT = 20; private static final int ADD_HEIGHT = 20;
private static final int H_GAP = 105; private static final int H_GAP = 105;
private static final int SUBMIT_BUTTON_H_LOCATION = 270;
private static final int PARA_IMAGE_SHIFT_X = -4;
private static final int FORM_AREA_PADDING_LEFT = 13;
private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png");
@ -175,12 +169,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_ADDED if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_DELETED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_EDITED
|| evt.getCreatorEventID() == DesignerEvent.CREATOR_RENAMED) {
paraDefinitePane.setParameterArray( paraDefinitePane.setParameterArray(
paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));
paraDefinitePane.refreshParameter(); paraDefinitePane.refreshParameter();
@ -196,7 +185,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
*/ */
public Component createWrapper() { public Component createWrapper() {
FormArea area = new FormArea(this, false); FormArea area = new FormArea(this, false);
area.setBorder(BorderFactory.createEmptyBorder(0, 13, 0, 0)); area.setBorder(BorderFactory.createEmptyBorder(0, FORM_AREA_PADDING_LEFT, 0, 0));
return area; return area;
} }
@ -224,6 +213,16 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
* @param p 参数面板 * @param p 参数面板
*/ */
public void refreshParameter(ParaDefinitePane p) { public void refreshParameter(ParaDefinitePane p) {
refreshParameter(p, DesignerContext.getDesignerFrame().getSelectedJTemplate());
}
/**
* 刷新参数
*
* @param p 参数面板
* @param jt 当前模版
*/
public void refreshParameter(ParaDefinitePane p, JTemplate jt) {
XLayoutContainer rootContainer = this.getRootComponent(); XLayoutContainer rootContainer = this.getRootComponent();
java.util.List<String> namelist = getAllXCreatorNameList(rootContainer); java.util.List<String> namelist = getAllXCreatorNameList(rootContainer);
// parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名 // parameterArray是报表的所有参数, nameList是已经在参数面板添加过控件的参数名
@ -240,8 +239,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean( ParameterPropertyPane.getInstance().getParameterToolbarPane().populateBean(
p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray()); p.getParameterArray() == null ? new Parameter[0] : p.getParameterArray());
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height); ParameterPropertyPane.getInstance().refreshState(jt);
} }
/** /**
@ -439,7 +437,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
for (Parameter p : paras) { for (Parameter p : paras) {
if (p.getName().equalsIgnoreCase(creator.toData().getWidgetName())) { if (p.getName().equalsIgnoreCase(creator.toData().getWidgetName())) {
g.drawImage(paraImage, creator.getX() - 4, creator.getY() + 2, null); g.drawImage(paraImage, creator.getX() + PARA_IMAGE_SHIFT_X, creator.getY() + 2, null);
break; break;
} }
} }
@ -617,7 +615,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query"));
xCreator = XCreatorUtils.createXCreator(formSubmitButton); xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP
* (currentIndex / NUM_IN_A_LINE)))) { * (currentIndex / NUM_IN_A_LINE)))) {
return false; return false;
} }

17
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -123,6 +123,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
private static final int SECOND_H_LOCATION = 170; private static final int SECOND_H_LOCATION = 170;
private static final int ADD_HEIGHT = 20; private static final int ADD_HEIGHT = 20;
private static final int H_GAP = 105; private static final int H_GAP = 105;
private static final int SUBMIT_BUTTON_H_LOCATION = 270;
public FormDesigner(Form form) { public FormDesigner(Form form) {
this(form, null); this(form, null);
@ -257,7 +258,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
currentIndex++; currentIndex++;
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter);
refreshParameter(); refreshParameter();
EastRegionContainerPane.getInstance().refreshDownPane(); fireTargetModified();
} }
/** /**
@ -294,14 +295,14 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
formSubmitButton.setWidgetName("Search"); formSubmitButton.setWidgetName("Search");
formSubmitButton.setText(Inter.getLocText("FR-Designer_Query")); formSubmitButton.setText(Inter.getLocText("FR-Designer_Query"));
xCreator = XCreatorUtils.createXCreator(formSubmitButton); xCreator = XCreatorUtils.createXCreator(formSubmitButton);
if (!(this.autoAddComponent(xCreator, 270, FIRST_V_LOCATION + V_COMPONENT_GAP if (!(this.autoAddComponent(xCreator, SUBMIT_BUTTON_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP
* (currentIndex / NUM_IN_A_LINE)))) { * (currentIndex / NUM_IN_A_LINE)))) {
return; return;
} }
currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE; currentIndex = currentIndex + NUM_IN_A_LINE - currentIndex % NUM_IN_A_LINE;
parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter); parameterArray = (Parameter[]) ArrayUtils.removeElement(parameterArray, parameter);
refreshParameter(); refreshParameter();
EastRegionContainerPane.getInstance().refreshDownPane(); fireTargetModified();
} }
/** /**
@ -667,9 +668,8 @@ 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();
//bug59192 setParameterArray(getNoRepeatParas(getTarget().getParameters()));
//setParameterArray(getNoRepeatParas(getTarget().getParameters())); refreshParameter();
//refreshParameter();
} }
} }
@ -1147,7 +1147,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 同步 * 同步
*/ */
public void populateRootSize() { public void populateRootSize() {
// do nothing
} }
/** /**
@ -1233,6 +1233,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/ */
@Override @Override
public void stopEditing() { public void stopEditing() {
// do nothing
} }
/** /**
@ -1412,7 +1413,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
parent = parent.getParent(); parent = parent.getParent();
} }
Object[] components = path.toArray(); Object[] components = (Object[]) path.toArray();
if (components.length == 0) { if (components.length == 0) {
return null; return null;
} }

17
designer_form/src/com/fr/design/mainframe/JForm.java

@ -328,10 +328,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private void setPropertyPaneChange(XComponent comp) { private void setPropertyPaneChange(XComponent comp) {
if (comp == null) { if (comp == null) {
ParameterPropertyPane.getInstance().setAddParaPaneVisible(false); ParameterPropertyPane.getInstance().setAddParaPaneVisible(false, this);
return; return;
} }
ParameterPropertyPane.getInstance().setAddParaPaneVisible(comp instanceof XWParameterLayout); ParameterPropertyPane.getInstance().setAddParaPaneVisible(isAddParaPaneVisible(comp), this);
editingComponent = comp.createToolPane(this, formDesign); editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) { if (BaseUtils.isAuthorityEditing()) {
@ -342,6 +342,16 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
} }
} }
private boolean isAddParaPaneVisible(XComponent comp) {
boolean isVisible = false;
try {
isVisible = comp instanceof XWParameterLayout || ((XCreator) comp).getParent() instanceof XWParameterLayout;
} catch (Throwable throwable) {
// 发生异常则返回 false
}
return isVisible;
}
public JComponent getEditingPane() { public JComponent getEditingPane() {
return editingComponent; return editingComponent;
} }
@ -546,6 +556,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
//撤销的时候要重新选择的body布局 //撤销的时候要重新选择的body布局
this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(),
formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()})); formDesign.getRootComponent() == selectedBodyLayout() ? u.getSelectWidgets() : new Widget[]{selectedBodyLayout().toData()}));
refreshToolArea();
} else { } else {
String widgetName = this.formDesign.getElementCaseContainerName(); String widgetName = this.formDesign.getElementCaseContainerName();
//这儿太坑了,u.getForm() 与 getTarget内容不一样 //这儿太坑了,u.getForm() 与 getTarget内容不一样
@ -718,7 +729,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign)); EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign); ParameterPropertyPane parameterPropertyPane = ParameterPropertyPane.getInstance(formDesign);
parameterPropertyPane.setAddParaPaneVisible(false); parameterPropertyPane.setAddParaPaneVisible(false, this);
EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane); EastRegionContainerPane.getInstance().addParameterPane(parameterPropertyPane);
EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(parameterPropertyPane.getPreferredSize().height);

2
designer_form/src/com/fr/design/mainframe/widget/ui/BasicSetVisiblePropertyPane.java

@ -27,6 +27,8 @@ public class BasicSetVisiblePropertyPane extends FormBasicPropertyPane {
pane2.add(otherOtherConfig); pane2.add(otherOtherConfig);
} }
visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true); visibleCheckBox = new UICheckBox(Inter.getLocText("Widget-Visible"), true);
visibleCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); visibleCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
pane2.add(visibleCheckBox); pane2.add(visibleCheckBox);
this.add(pane2, BorderLayout.CENTER); this.add(pane2, BorderLayout.CENTER);

2
designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicWidgetPropertyPane.java

@ -17,6 +17,8 @@ public class FormBasicWidgetPropertyPane extends BasicSetVisiblePropertyPane {
public UICheckBox createOtherConfig() { public UICheckBox createOtherConfig() {
enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true); enableCheckBox = new UICheckBox(Inter.getLocText("Enabled"), true);
enableCheckBox.setGlobalName(Inter.getLocText("FR-Designer_Basic"));
enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); enableCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
return enableCheckBox; return enableCheckBox;
} }

2
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -210,7 +210,7 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
public void updateCreator() { public void updateCreator() {
currentEditorDefinePane.setGlobalName(getGlobalName()); currentEditorDefinePane.setGlobalName(getGlobalName());
Widget widget = currentEditorDefinePane.updateBean(); Widget widget = currentEditorDefinePane.updateBean();
if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Widget_Name")) && widgetPropertyPane != null) { if (ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Basic")) && widgetPropertyPane != null) {
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetCreatorName(widget.getWidgetName());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED); designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);

16
designer_form/src/com/fr/design/parameter/ParameterPropertyPane.java

@ -4,10 +4,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.dialog.BasicScrollPane; import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormHierarchyTreePane;
import com.fr.design.mainframe.JForm;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -87,18 +84,23 @@ public class ParameterPropertyPane extends JPanel{
} }
// 显示或隐藏添加参数面板 // 显示或隐藏添加参数面板
public void refreshState(JTemplate jt) {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem(), jt);
}
// 显示或隐藏添加参数面板
public void refreshState() { public void refreshState() {
setAddParaPaneVisible(toolbarPane.hasSelectedLabelItem()); refreshState(DesignerContext.getDesignerFrame().getSelectedJTemplate());
} }
public void setAddParaPaneVisible(boolean isVisible) { public void setAddParaPaneVisible(boolean isVisible, JTemplate jt) {
if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) { if (isVisible == addParaPane.isVisible() || formHierarchyTreePaneWrapper == null) {
return; return;
} }
// 表单中,只有添加并选中参数面板时,才显示 // 表单中,只有添加并选中参数面板时,才显示
boolean hideInJForm; boolean hideInJForm;
try { try {
hideInJForm = DesignerContext.getDesignerFrame().getSelectedJTemplate() instanceof JForm && hideInJForm = jt instanceof JForm &&
!(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout); !(FormHierarchyTreePane.getInstance().getComponentTree().getSelectionPath().getLastPathComponent() instanceof XWParameterLayout);
} catch (NullPointerException ex) { } catch (NullPointerException ex) {
hideInJForm = true; hideInJForm = true;

16
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -35,6 +35,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private static final int BUTTON_HEIGHT = 20; private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225; private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
private static final int LABEL_PADDING_LEFT = 4;
public ParameterToolBarPane() { public ParameterToolBarPane() {
this.setLayout(new FlowParameterPaneLayout()); this.setLayout(new FlowParameterPaneLayout());
@ -47,9 +48,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
return new Dimension(super.getPreferredSize().width, 18); return new Dimension(super.getPreferredSize().width, 18);
} }
}; };
label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":"); label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated") + ":");
label.setHorizontalAlignment(SwingConstants.LEFT); label.setHorizontalAlignment(SwingConstants.LEFT);
label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, LABEL_PADDING_LEFT, 0, 0));
this.add(label); this.add(label);
addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all"));
@ -68,7 +69,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
public Parameter getTargetParameter(UIButton button) { public Parameter getTargetParameter(UIButton button) {
int index = parameterSelectedLabellist.indexOf(button); int index = parameterSelectedLabellist.indexOf(button);
if(index < 0 || index > parameterList.length - 1) { if (index < 0 || index > parameterList.length - 1) {
return null; return null;
} }
return parameterList[index]; return parameterList[index];
@ -82,7 +83,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
ParameterPropertyPane.getInstance().refreshState();
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
return; return;
@ -103,7 +103,6 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
this.add(addAll); this.add(addAll);
this.doLayout(); this.doLayout();
ParameterPropertyPane.getInstance().refreshState();
this.repaint(); this.repaint();
} }
@ -124,12 +123,15 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private class FlowParameterPaneLayout implements LayoutManager { private class FlowParameterPaneLayout implements LayoutManager {
public FlowParameterPaneLayout() { public FlowParameterPaneLayout() {
// do nothing
} }
public void addLayoutComponent(String name, Component comp) { public void addLayoutComponent(String name, Component comp) {
// do nothing
} }
public void removeLayoutComponent(Component comp) { public void removeLayoutComponent(Component comp) {
// do nothing
} }
public Dimension preferredLayoutSize(Container parent) { public Dimension preferredLayoutSize(Container parent) {
@ -137,7 +139,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
layoutContainer(parent); layoutContainer(parent);
int h= ((parameterSelectedLabellist.size() == 0) ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); int h= (parameterSelectedLabellist.isEmpty() ? 0 : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h); return new Dimension(w, h);
} }
@ -155,7 +157,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
breakid = 1; breakid = 1;
for (UIButton tab : parameterSelectedLabellist) { for (UIButton tab : parameterSelectedLabellist) {
Dimension dim = tab.getPreferredSize(); Dimension dim = tab.getPreferredSize();
if(x + dim.width > width) { if (x + dim.width > width) {
breakid++; breakid++;
x = 0; x = 0;
y += (dim.height + GAP_V); y += (dim.height + GAP_V);

Loading…
Cancel
Save