From 81e5c2aacf71ce0ee3b6b9349b3017a8e309952b Mon Sep 17 00:00:00 2001 From: yaohwu Date: Mon, 27 Feb 2017 20:21:52 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E2=80=9CREPORT-2030=E5=88=A0=E9=99=A4des?= =?UTF-8?q?igner=E5=AF=B9=E8=AF=9D=E6=A1=86=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/exe/ModifyStatusExecutor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java b/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java index c544858dd8..a61f35e2d1 100644 --- a/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java +++ b/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java @@ -42,7 +42,9 @@ public class ModifyStatusExecutor implements Executor { plugin.setActive(active); try { FRContext.getCurrentEnv().writePlugin(plugin); - PluginWebBridge.getHelper().showRestartMessage(plugin.isActive() ? Inter.getLocText("FR-Designer-Plugin_Has_Been_Actived") : Inter.getLocText("FR-Designer-Plugin_Has_Been_Disabled")); + /* + * PluginWebBridge.getHelper().showRestartMessage(plugin.isActive() ? Inter.getLocText("FR-Designer-Plugin_Has_Been_Actived") : Inter.getLocText("FR-Designer-Plugin_Has_Been_Disabled")); + **/ } catch (Exception e) { FRContext.getLogger().error(e.getMessage()); } From af03d197f0d5ff87fbd368ed87432a461d1050c3 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 28 Feb 2017 15:59:10 +0800 Subject: [PATCH 02/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E5=AE=8C=E6=88=90=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E6=9C=AC=E5=9C=B0=E5=AD=98=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JPolyWorkBook.java | 1 - .../com/fr/design/mainframe/JWorkBook.java | 64 ++++++++- .../com/fr/design/mainframe/JTemplate.java | 45 +++++- .../templateinfo/TemplateInfoCollector.java | 133 ++++++++++++++++++ .../src/com/fr/design/mainframe/JForm.java | 30 ++++ 5 files changed, 267 insertions(+), 6 deletions(-) create mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java diff --git a/designer/src/com/fr/design/mainframe/JPolyWorkBook.java b/designer/src/com/fr/design/mainframe/JPolyWorkBook.java index bfdb396645..aa5a727e8d 100644 --- a/designer/src/com/fr/design/mainframe/JPolyWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JPolyWorkBook.java @@ -24,7 +24,6 @@ public class JPolyWorkBook extends JWorkBook { super(new WorkBook(new PolyWorkSheet()), DEFAULT_NAME); populateReportParameterAttr(); } - /** * 创建sheet名称tab面板 diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index f3722c4ac2..2494e20a0e 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -3,6 +3,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; import com.fr.base.FRContext; import com.fr.base.Parameter; +import com.fr.base.parameter.ParameterUI; import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.AllowAuthorityEditAction; @@ -54,7 +55,10 @@ import com.fr.main.impl.WorkBook; import com.fr.main.parameter.ReportParameterAttr; import com.fr.poly.PolyDesigner; import com.fr.privilege.finegrain.WorkSheetPrivilegeControl; +import com.fr.report.cellcase.CellCase; import com.fr.report.elementcase.TemplateElementCase; +import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.report.Report; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; import com.fr.stable.StableUtils; @@ -66,10 +70,7 @@ import javax.swing.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.FileOutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * JWorkBook used to edit WorkBook. @@ -129,6 +130,61 @@ public class JWorkBook extends JTemplate { return centerPane; } + // 获取模板类型 + public int getReportType() { + return template.isElementCaseBook() ? 0 : 1; + } + + // 获取模板格子数 + public int getCellCount() { + int cellCount = 0; + if (template.isElementCaseBook()) { // 如果是普通报表 + for (int i = 0; i < template.getReportCount(); i++) { + WorkSheet r = (WorkSheet) template.getReport(i); + CellCase cc = r.getBlock().getCellCase(); + for (int j = 0; j < cc.getRowCount(); j++) { + Iterator iter = cc.getRow(j); + while (iter.hasNext()) { + cellCount ++; + iter.next(); + } + } + } + } + return cellCount; + } + // 获取模板悬浮元素个数 + public int getFloatCount() { + int chartCount = 0; + if (template.isElementCaseBook()) { // 如果是普通报表 + for (int i = 0; i < template.getReportCount(); i++) { + WorkSheet r = (WorkSheet) template.getReport(i); + Iterator fiter = r.getBlock().floatIterator(); + while (fiter.hasNext()) { + chartCount ++; + fiter.next(); + } + } + } + return chartCount; + } + // 获取模板聚合块个数 + public int getBlockCount() { + int blockCount = 0; + if (!template.isElementCaseBook()) { // 如果是聚合报表 + for (int i = 0; i < template.getReportCount(); i++) { + PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); + blockCount += r.getBlockCount(); + } + } + return blockCount; + } + // 获取模板控件数 + public int getWidgetCount() { + ParameterUI pui = template.getReportParameterAttr().getParameterUI(); + return pui == null ? 0 : (pui.getAllWidgets().length - 1); + } + /** * 判断sheet权限 * diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index 58060d91a9..3f016812c0 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -27,6 +27,7 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.MenuDef; import com.fr.design.menu.NameSeparator; @@ -72,16 +73,25 @@ public abstract class JTemplate> ex private UndoManager authorityUndoManager; protected U undoState; protected U authorityUndoState = null; + protected T template; // 当前模板 private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; + private long openTime = 0L; // 打开模板的时间点(包括新建模板) + private TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); public JTemplate(T t, String defaultFileName) { - this(t, new MemFILE(newTemplateNameByIndex(defaultFileName))); + this(t, new MemFILE(newTemplateNameByIndex(defaultFileName)), true); + initForCollect(); } public JTemplate(T t, FILE file) { + this(t, file, false); + } + + public JTemplate(T t, FILE file, boolean isNewFile) { super(t); + this.template = t; this.previewType = parserPreviewProvider(t.getPreviewType()); this.editingFILE = file; this.setLayout(FRGUIPaneFactory.createBorderLayout()); @@ -89,8 +99,38 @@ public abstract class JTemplate> ex this.add(createCenterPane(), BorderLayout.CENTER); this.undoState = createUndoState(); designModel = createDesignModel(); + // 如果不是新建模板,并且在收集列表中 + if (!isNewFile && tic.inList(t)) { + openTime = System.currentTimeMillis(); + } } + // 为收集模版信息作准备 + private void initForCollect() { + if (template.getReportletsid() == null) { + template.initReportletsid(); // 为新模板设置 reportletsid 属性 + } + if (openTime == 0) { + openTime = System.currentTimeMillis(); + } + } + private void collectInfo() { // 执行收集操作 + long saveTime = System.currentTimeMillis(); // 保存模板的时间点 + tic.collectInfo(template, this, openTime, saveTime); + openTime = saveTime; // 更新 openTime,准备下一次计算 + } + + // 获取模板类型。0 代表普通报表,1 代表聚合报表,2 代表表单 + public abstract int getReportType(); + // 获取模板格子数 + public abstract int getCellCount(); + // 获取模板悬浮元素个数 + public abstract int getFloatCount(); + // 获取模板聚合块个数 + public abstract int getBlockCount(); + // 获取模板控件数 + public abstract int getWidgetCount(); + public U getUndoState() { return undoState; } @@ -439,6 +479,7 @@ public abstract class JTemplate> ex JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_No-Privilege") + "!", Inter.getLocText("FR-Designer_Message"), JOptionPane.WARNING_MESSAGE); return false; } + collectInfo(); return this.saveFile(); } @@ -487,6 +528,8 @@ public abstract class JTemplate> ex boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); + initForCollect(); // 如果是旧模板另存为新模板,则添加 reportletsid + collectInfo(); } //更换最近打开 DesignerEnvManager.getEnvManager().replaceRecentOpenedFilePath(oldName, this.getFullPathName()); diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java new file mode 100644 index 0000000000..52542e14d1 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -0,0 +1,133 @@ +package com.fr.design.mainframe.templateinfo; + +import com.fr.base.io.IOFile; +import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.JTemplate; +import com.fr.general.FRLogger; +import com.fr.general.GeneralUtils; +import com.fr.stable.ProductConstants; +import com.fr.stable.StableUtils; + +import java.io.*; +import java.util.Date; +import java.util.HashMap; + +/** + * 做模板的过程和耗时收集,辅助类 + * Created by plough on 2017/2/21. + */ +public class TemplateInfoCollector implements Serializable { + private static final String FILE_NAME = "tplInfo.ser"; + private static TemplateInfoCollector instance; + private HashMap> templateInfoList; + + @SuppressWarnings("unchecked") + private TemplateInfoCollector() { + // 先尝试从文件读取 + try{ + ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); + templateInfoList = (HashMap>) is.readObject(); + } catch (FileNotFoundException ex) { + // 如果之前没有存储过,则创建新对象 + templateInfoList = new HashMap<>(); + } catch (Exception ex) { + FRLogger.getLogger().error(ex.getMessage(), ex); + } + } + + /** + * 获取缓存文件存放路径 + */ + private static File getInfoFile() { + return new File(StableUtils.pathJoin(ProductConstants.getEnvHome(), FILE_NAME)); + } + + public static TemplateInfoCollector getInstance() { + if (instance == null) { + instance = new TemplateInfoCollector(); + } + return instance; + } + + /** + * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 + */ + public boolean inList(T t) { + return templateInfoList.containsKey(t.getReportletsid()); + } + + // 将包含所有信息的对象保存到文件 + private void saveInfo() { + try { + ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); + System.out.println("写入:" + instance.templateInfoList); + os.writeObject(instance.templateInfoList); + os.close(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + + public HashMap getInfoList() { + for (String key : templateInfoList.keySet()) { + System.out.println(templateInfoList.get(key)); + } + return templateInfoList; + } + + /** + * 收集模板信息。如果之前没有记录,则新增;如果已有记录,则更新。 + * 同时将最新数据保存到文件中。 + */ + public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { + HashMap templateInfo; + + if (inList(t)) { // 已有记录 + templateInfo = templateInfoList.get(t.getReportletsid()); + } else { // 新增 + templateInfo = new HashMap<>(); + + String username = DesignerEnvManager.getEnvManager().getBBSName(); + String uuid = DesignerEnvManager.getEnvManager().getUUID(); + String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); + String reportletsid = t.getReportletsid(); + String createTime = new Date(openTime).toString(); + int reportType = jt.getReportType(); + String jarTime = GeneralUtils.readBuildNO(); + String version = ProductConstants.VERSION; + templateInfo.put("username", username); + templateInfo.put("uuid", uuid); + templateInfo.put("activitykey", activitykey); + templateInfo.put("reportletsid", reportletsid); + templateInfo.put("create_time", createTime); + templateInfo.put("report_type", reportType); + templateInfo.put("jar_time", jarTime); + templateInfo.put("version", version); + } + + long timeConsume = saveTime - openTime; + // 如果已存有数据,则加上本次编辑时间 + if (templateInfo.get("time_consume") != null) { + timeConsume += (long)templateInfo.get("time_consume"); + } + +// String process; + int cellCount = jt.getCellCount(); + int floatCount = jt.getFloatCount(); + int blockCount = jt.getBlockCount(); + int widgetCount = jt.getWidgetCount(); + templateInfo.put("time_consume", timeConsume); + templateInfo.put("cell_count", cellCount); + templateInfo.put("float_count", floatCount); + templateInfo.put("block_count", blockCount); + templateInfo.put("widget_count", widgetCount); + templateInfoList.put(t.getReportletsid(), templateInfo); + + saveInfo(); // 每次更新之后,都同步到暂存文件中 + } + + public static void main(String[] args) { + TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); + tic.getInfoList(); + } +} diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 7c912ede0b..c19f7f43b5 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -38,6 +38,7 @@ import com.fr.form.FormElementCaseProvider; import com.fr.form.main.Form; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; @@ -88,6 +89,35 @@ public class JForm extends JTemplate implements BaseJForm { return DesignState.JFORM; } + // 获取模板类型 + public int getReportType() { + return 2; + } + + // 获取模板格子数 + public int getCellCount() { + return 0; + } + // 获取模板悬浮元素个数 + public int getFloatCount() { + return 0; + } + // 获取模板聚合块个数 + public int getBlockCount() { + return 0; + } + // 获取模板控件数 + public int getWidgetCount() { + int widgetCount = 0; + for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { + WFitLayout wf = (WFitLayout) template.getContainer().getWidget(i); + widgetCount += wf.getWidgetCount(); + } + int a = 1; + int b = 2; + return widgetCount; + } + @Override protected boolean accept(Object o) { return !(o instanceof FloatElementsProvider); From 7f7841b8036b2f4d3a7e788ba0143ec33774ecf8 Mon Sep 17 00:00:00 2001 From: mengao Date: Wed, 1 Mar 2017 09:20:48 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E5=88=86=E4=B8=A4=E8=A1=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BAcheckbox=E5=92=8C=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=9B=BD=E9=99=85=E5=8C=96=E6=83=85=E5=86=B5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/chart/axis/MinMaxValuePane.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java index d717d31a8d..73235dc31f 100644 --- a/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java +++ b/designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java @@ -42,14 +42,14 @@ public class MinMaxValuePane extends JPanel { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { p, f }; - double[] rowSize = { p, p, p, p}; + double[] rowSize = { p, p, p, p, p, p, p, p}; Component[][] components = getPanelComponents(); JPanel panel = TableLayoutHelper.createTableLayoutPane(components ,rowSize,columnSize); this.setLayout(new BorderLayout()); this.add(panel,BorderLayout.CENTER); - for(int i = 0; i < components.length; i++) { + for(int i = 0; i < components.length; i+=2) { ((UICheckBox)components[i][0]).addActionListener(new ActionListener() { @Override @@ -57,18 +57,21 @@ public class MinMaxValuePane extends JPanel { checkBoxUse(); } }); - ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i][1]); + ChartSwingUtils.addListener((UICheckBox)components[i][0], (UITextField)components[i+1][0]); } } - - protected Component[][] getPanelComponents() { - return new Component[][]{ - new Component[]{minCheckBox, minValueField}, - new Component[]{maxCheckBox, maxValueField}, - new Component[]{isCustomMainUnitBox, mainUnitField}, - new Component[]{isCustomSecUnitBox, secUnitField}, - }; - } + protected Component[][] getPanelComponents() { + return new Component[][]{ + new Component[]{minCheckBox}, + new Component[]{minValueField}, + new Component[]{maxCheckBox}, + new Component[]{maxValueField}, + new Component[]{isCustomMainUnitBox}, + new Component[]{mainUnitField}, + new Component[]{isCustomSecUnitBox}, + new Component[]{secUnitField}, + }; + } private void checkBoxUse() { minValueField.setEnabled(minCheckBox.isSelected()); From 505dd7e910bbce249e9886b229d278bc20c58cb9 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 1 Mar 2017 17:03:59 +0800 Subject: [PATCH 04/39] =?UTF-8?q?REPORT-1957=EF=BC=8C=E5=B9=B6=E4=B8=94?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E8=AF=B4=E6=98=8E=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E6=96=87=E4=BB=B6=E7=9A=84=E7=BC=96=E7=A0=81=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=E4=B8=BAutf-8,=E5=8A=A0=E8=BD=BD=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=97=B6=E4=BD=BF=E7=94=A8utf-8=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/formula/FormulaPane.java | 221 +++++++++--------- .../design/insert/formula/variable/cn/$$$.txt | 2 +- .../formula/variable/cn/$$page_number.txt | 2 +- .../variable/cn/$$totalPage_number.txt | 2 +- .../formula/variable/cn/$fr_authority.txt | 2 +- .../formula/variable/cn/$fr_username.txt | 2 +- .../formula/variable/cn/$fr_userposition.txt | 4 +- .../insert/formula/variable/cn/NOFILTER.txt | 2 +- .../insert/formula/variable/cn/NULL.txt | 2 +- .../formula/variable/cn/contextPath.txt | 4 +- .../insert/formula/variable/cn/curReport.txt | 2 +- .../formula/variable/cn/formletName.txt | 4 +- .../formula/variable/cn/fr_submitinfo.txt | 2 +- .../insert/formula/variable/cn/reportName.txt | 4 +- .../insert/formula/variable/cn/serverName.txt | 4 +- .../insert/formula/variable/cn/serverPort.txt | 2 +- .../formula/variable/cn/serverSchema.txt | 4 +- .../insert/formula/variable/cn/serverURL.txt | 4 +- .../insert/formula/variable/cn/servletURL.txt | 3 +- .../insert/formula/variable/cn/sessionID.txt | 5 +- .../design/insert/formula/variable/en/$$$.txt | 2 +- .../formula/variable/en/$fr_authority.txt | 2 +- .../formula/variable/en/$fr_username.txt | 2 +- .../formula/variable/en/$fr_userposition.txt | 2 +- .../insert/formula/variable/en/NOFILTER.txt | 2 +- .../formula/variable/en/contextPath.txt | 2 +- .../formula/variable/en/formletName.txt | 4 +- .../formula/variable/en/fr_submitinfo.txt | 2 +- .../insert/formula/variable/en/reportName.txt | 4 +- .../insert/formula/variable/en/serverName.txt | 4 +- .../formula/variable/en/serverSchema.txt | 4 +- .../insert/formula/variable/en/serverURL.txt | 4 +- .../insert/formula/variable/en/servletURL.txt | 3 +- 33 files changed, 146 insertions(+), 168 deletions(-) diff --git a/designer_base/src/com/fr/design/formula/FormulaPane.java b/designer_base/src/com/fr/design/formula/FormulaPane.java index 9aec1972a0..9ef2e4b2be 100644 --- a/designer_base/src/com/fr/design/formula/FormulaPane.java +++ b/designer_base/src/com/fr/design/formula/FormulaPane.java @@ -22,6 +22,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.Inter; import com.fr.parser.FRLexer; import com.fr.parser.FRParser; +import com.fr.stable.EncodeConstants; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.script.Expression; @@ -38,12 +39,14 @@ import java.awt.event.*; import java.io.*; import java.util.Locale; import java.util.Set; + /** * 公式编辑面板 + * * @editor zhou * @since 2012-3-29下午1:50:53 */ -public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ +public class FormulaPane extends BasicPane implements KeyListener, UIFormula { protected VariableTreeAndDescriptionArea variableTreeAndDescriptionArea; protected RSyntaxTextArea formulaTextArea; @@ -62,17 +65,17 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ public FormulaPane() { initComponents(); } - - private void initFormulaTextAreaKeyListener(){ - formulaTextArea.addKeyListener(this); - formulaTextArea.addKeyListener(new KeyAdapter() { + + private void initFormulaTextAreaKeyListener() { + formulaTextArea.addKeyListener(this); + formulaTextArea.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent e) { formulaTextArea.setForeground(Color.black); String text = formulaTextArea.getText(); // 判断在中文输入状态是否还包含提示符 要删掉 //Tips:You_Can_Input_B1_To_Input_The_Data_Of_The_First_Row_Second_Column String tip = "\n\n\n" + Inter.getLocText("FR-Designer_FormulaPane_Tips"); - if(text.contains(tip)) { + if (text.contains(tip)) { text = text.substring(0, text.indexOf(tip)); insertPosition = 0; formulaTextArea.setText(text); @@ -80,9 +83,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initFormulaTextAreaMouseListener(){ - formulaTextArea.addMouseListener(new MouseAdapter() { + + private void initFormulaTextAreaMouseListener() { + formulaTextArea.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent e) { insertPosition = formulaTextArea.getCaretPosition(); @@ -106,22 +109,24 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initFormulaTextArea(){ - formulaTextArea = new RSyntaxTextArea(); + + private void initFormulaTextArea() { + formulaTextArea = new RSyntaxTextArea(); configFormulaArea(); initFormulaTextAreaKeyListener(); initFormulaTextAreaMouseListener(); } - - private void initKeyWordTextFieldKeyListener(){ - keyWordTextField.addKeyListener(new KeyListener() { + + private void initKeyWordTextFieldKeyListener() { + keyWordTextField.addKeyListener(new KeyListener() { @Override public void keyTyped(KeyEvent e) { } + @Override public void keyReleased(KeyEvent e) { } + @Override public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_ENTER) { @@ -133,9 +138,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initTipsPane(){ - // tipsPane + + private void initTipsPane() { + // tipsPane JPanel tipsPane = new JPanel(new BorderLayout(4, 4)); this.add(tipsPane, BorderLayout.EAST); @@ -161,7 +166,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - + protected void initComponents() { this.setLayout(new BorderLayout(4, 4)); // text @@ -172,7 +177,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ + " "); formulaLabel.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); initFormulaTextArea(); - + UIScrollPane formulaTextAreaScrollPane = new UIScrollPane(formulaTextArea); formulaTextAreaScrollPane.setBorder(null); textPane.add(formulaLabel, BorderLayout.NORTH); @@ -259,6 +264,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ this.formulaTextArea.setText(StringUtils.EMPTY); } } + //hugh:为啥会是10呢?搞不懂~~~ private static final int KEY_10 = 10; //上下左右 @@ -266,6 +272,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ private static final int KEY_38 = 38; private static final int KEY_39 = 39; private static final int KEY_40 = 40; + @Override public void keyReleased(KeyEvent e) { int key = e.getKeyCode(); @@ -452,10 +459,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ formulaTextArea.requestFocus(); insertPosition = formulaTextArea.getCaretPosition(); } - + @Override protected String title4PopupWindow() { - return Inter.getLocText("FormulaD-Formula_Definition"); + return Inter.getLocText("FormulaD-Formula_Definition"); } /** @@ -561,9 +568,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ public VariableTreeAndDescriptionArea() { this.initComponents(); } - - private void initFunctionTypeList(JPanel functionPane){ - functionTypeList = new QuickList(functionTypeListModel); + + private void initFunctionTypeList(JPanel functionPane) { + functionTypeList = new QuickList(functionTypeListModel); UIScrollPane functionTypeScrollPane = new UIScrollPane(functionTypeList); functionTypeScrollPane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); functionTypeScrollPane.setPreferredSize(new Dimension(140, 200)); @@ -572,23 +579,23 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ initGroupTypeModel(); initTypeListSelectionListener(); } - - private void initTypeListCellRenderer(){ - functionTypeList.setCellRenderer( - new DefaultListCellRenderer() { - @Override - public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { - super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof FunctionGroup) { - this.setText(((FunctionGroup) value).getGroupName()); - } - return this; - } - }); + + private void initTypeListCellRenderer() { + functionTypeList.setCellRenderer( + new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + if (value instanceof FunctionGroup) { + this.setText(((FunctionGroup) value).getGroupName()); + } + return this; + } + }); } - - private void initTypeListSelectionListener(){ - functionTypeList.addListSelectionListener(new ListSelectionListener() { + + private void initTypeListSelectionListener() { + functionTypeList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { Object selectedValue = ((JList) evt.getSource()).getSelectedValue(); if (!(selectedValue instanceof FunctionGroup)) { @@ -607,22 +614,22 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initGroupTypeModel(){ - functionTypeListModel.addElement(FunctionConstants.COMMON); - for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) { - functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]); - } - functionTypeListModel.addElement(FunctionConstants.ALL); - functionTypeListModel.addElement(FunctionConstants.CUSTOM); - functionTypeListModel.addElement(FunctionConstants.PLUGIN); - - //hugh: 从函数分组插件中添加分组 - FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel); - } - - private void initFunctionNameListCellRenderer(){ - functionNameList.setCellRenderer(new DefaultListCellRenderer() { + + private void initGroupTypeModel() { + functionTypeListModel.addElement(FunctionConstants.COMMON); + for (int i = 0; i < FunctionConstants.EMBFUNCTIONS.length; i++) { + functionTypeListModel.addElement(FunctionConstants.EMBFUNCTIONS[i]); + } + functionTypeListModel.addElement(FunctionConstants.ALL); + functionTypeListModel.addElement(FunctionConstants.CUSTOM); + functionTypeListModel.addElement(FunctionConstants.PLUGIN); + + //hugh: 从函数分组插件中添加分组 + FunctionConstants.addFunctionGroupFromPlugins(functionTypeListModel); + } + + private void initFunctionNameListCellRenderer() { + functionNameList.setCellRenderer(new DefaultListCellRenderer() { @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { @@ -633,10 +640,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ return this; } }); - } - - private void initFunctionNameListSelectionListener(){ - functionNameList.addListSelectionListener(new ListSelectionListener() { + } + + private void initFunctionNameListSelectionListener() { + functionNameList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent evt) { Object selectedValue = functionNameList.getSelectedValue(); @@ -651,9 +658,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initFunctionNameListMouseListener(){ - functionNameList.addMouseListener(new MouseAdapter() { + + private void initFunctionNameListMouseListener() { + functionNameList.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() >= 2) { Object selectedValue = functionNameList.getSelectedValue(); @@ -675,9 +682,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initFunctionNameList(JPanel functionPane){ - functionNameList = new JList(new DefaultListModel()); + + private void initFunctionNameList(JPanel functionPane) { + functionNameList = new JList(new DefaultListModel()); UIScrollPane functionNameScrollPane = new UIScrollPane(functionNameList); functionNameScrollPane.setPreferredSize(new Dimension(140, 200)); functionPane.add( @@ -688,9 +695,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ initFunctionNameListSelectionListener(); initFunctionNameListMouseListener(); } - - private void initDescriptionTextArea(){ - // Description + + private void initDescriptionTextArea() { + // Description descriptionTextArea = new UITextArea(16, 27); UIScrollPane desScrollPane = new UIScrollPane(descriptionTextArea); @@ -710,16 +717,16 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ }); } - - private StringBuilder getText(TextUserObject selectedValue,String path) throws IOException{ - Reader desReader; - StringBuilder desBuf = new StringBuilder(); - InputStream desInputStream = BaseUtils.readResource(path+ ((TextUserObject) selectedValue).displayText+".txt"); + + private StringBuilder getText(TextUserObject selectedValue, String path) throws IOException { + Reader desReader; + StringBuilder desBuf = new StringBuilder(); + InputStream desInputStream = BaseUtils.readResource(path + ((TextUserObject) selectedValue).displayText + ".txt"); if (desInputStream == null) { String description = ""; desReader = new StringReader(description); } else { - desReader = new InputStreamReader(desInputStream); + desReader = new InputStreamReader(desInputStream, EncodeConstants.ENCODING_UTF_8); } BufferedReader reader = new BufferedReader(desReader); String lineText; @@ -732,12 +739,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ reader.close(); desReader.close(); return desBuf; - } - - private void initVariablesTreeSelectionListener(){ - variablesTree.addTreeSelectionListener(new TreeSelectionListener() { - public void valueChanged(TreeSelectionEvent e) { - Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject(); + } + + private void initVariablesTreeSelectionListener() { + variablesTree.addTreeSelectionListener(new TreeSelectionListener() { + public void valueChanged(TreeSelectionEvent e) { + Object selectedValue = ((DefaultMutableTreeNode) variablesTree.getLastSelectedPathComponent()).getUserObject(); if (selectedValue == null) { return; } @@ -751,7 +758,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ path = "/com/fr/design/insert/formula/variable/en/"; } if (selectedValue instanceof TextUserObject) { - desBuf = getText((TextUserObject)selectedValue,path); + desBuf = getText((TextUserObject) selectedValue, path); } } catch (IOException exp) { FRContext.getLogger().error(exp.getMessage(), exp); @@ -761,9 +768,9 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ } }); } - - private void initVariablesTree(){ - // vairable. + + private void initVariablesTree() { + // vairable. variablesTree = new JTree(); UIScrollPane variablesTreePane = new UIScrollPane(variablesTree); variablesTreePane.setBorder(new UIRoundedBorder(UIConstants.LINE_COLOR, 1, UIConstants.ARC)); @@ -773,12 +780,12 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ variablesTree.setShowsRootHandles(true); variablesTree.addMouseListener(applyTextMouseListener); variablesTree.setCellRenderer(applyTreeCellRenderer); - + initDescriptionTextArea(); - + initVariablesTreeSelectionListener(); } - + private void initComponents() { this.setLayout(new BorderLayout(4, 4)); // Function @@ -810,10 +817,10 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ private void showPopupPane() { BasicPane basicPane = new BasicPane() { - @Override - protected String title4PopupWindow() { - return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail"); - } + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_FormulaPane_Function_Detail"); + } }; basicPane.setLayout(FRGUIPaneFactory.createBorderLayout()); UITextArea desArea = new UITextArea(); @@ -889,7 +896,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ return this; } }; - + public void populate(VariableResolver variableResolver) { // varibale tree. DefaultTreeModel variableModel = (DefaultTreeModel) variablesTree.getModel(); @@ -902,28 +909,28 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{ DefaultMutableTreeNode bindCellNode = new DefaultMutableTreeNode(new TextUserObject("$$$")); rootNode.add(bindCellNode); } - + rootNode.add(new TextFolderUserObject(Inter.getLocText("FormulaD-Data_Fields"), - BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"), + BaseUtils.readIcon("/com/fr/design/images/dialog/table.png"), variableResolver.resolveColumnNames()).createMutableTreeNode()); - + // Set cutReport Variable rootNode.add(new TextFolderUserObject(Inter.getLocText("FR-Designer_FormulaPane_Variables"), - BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"), - variableResolver.resolveCurReportVariables()).createMutableTreeNode()); - + BaseUtils.readIcon("/com/fr/design/images/dialog/variable.png"), + variableResolver.resolveCurReportVariables()).createMutableTreeNode()); + rootNode.add(new TextFolderUserObject(Inter.getLocText(new String[]{"Datasource-Datasource", "Parameter"}), - BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), - variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); - + BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), + variableResolver.resolveTableDataParameterVariables()).createMutableTreeNode()); + rootNode.add(new TextFolderUserObject(Inter.getLocText("ParameterD-Report_Parameter"), - BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), - variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); - + BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"), + variableResolver.resolveReportParameterVariables()).createMutableTreeNode()); + rootNode.add(new TextFolderUserObject(Inter.getLocText("M_Server-Global_Parameters"), BaseUtils.readIcon("/com/fr/design/images/dialog/parameter.gif"), variableResolver.resolveGlobalParameterVariables()).createMutableTreeNode()); - + variableModel.reload(); // Expand for (int row = 0; row < this.variablesTree.getRowCount(); row++) { diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt index ea95070daf..48d884dc40 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$$.txt @@ -1 +1 @@ -ǰֵ \ No newline at end of file +当前值 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt index 322c867f48..0e45e0871a 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$page_number.txt @@ -1 +1 @@ -ǰҳ +当前的页数。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt index a6a8244be1..11c6fb59bd 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$$totalPage_number.txt @@ -1 +1 @@ -ҳ \ No newline at end of file +总页数。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt index eadf192eb1..abafe8eff2 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_authority.txt @@ -1 +1 @@ -ʹȨʱɫIJ \ No newline at end of file +使用权限时保存角色的参数 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt index 586198ed0d..9dadd38832 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_username.txt @@ -1 +1 @@ -ʹȨʱûIJ \ No newline at end of file +使用权限时保存用户名的参数 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt index 07b3122abf..73cb5a6d29 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/$fr_userposition.txt @@ -1,3 +1 @@ -ʹȨʱ,$fr_userpositionDzŽɫ -ʽ磺{"departments":"","jobTitle":"۾"} -ŽɫԲźְɵ顣 \ No newline at end of file +使用权限时,$fr_userposition就是部门角色,格式如:{"jobTitle":"销售经理","departments":"销售"},部门角色是以部门和职务组成的数组。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt index ccda7162b3..13caca6bc0 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/NOFILTER.txt @@ -1 +1 @@ -NOFILTERһֵȽ϶ΪtrueIJ +NOFILTER是一个与任意值比较都为true的参数。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt index 90e31a9b21..40ea67ca4a 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/NULL.txt @@ -1 +1 @@ -ֵIJ \ No newline at end of file +空值的参数。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt index 0257c7e842..2faf5629e5 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/contextPath.txt @@ -1,3 +1 @@ -contextPathָ·ķĿ¼. -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -contextPath/WebReport \ No newline at end of file +contextPath是指绝对路径的服务器别名,即虚拟目录.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,contextPath是/WebReport \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt index cc01b67263..4a0b82a923 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/curReport.txt @@ -1 +1 @@ -ǰ \ No newline at end of file +当前报表。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt index 95c5feec3a..c9921354ad 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/formletName.txt @@ -1,3 +1 @@ - -ʣhttp://localhost:8080/WebReport/ReportServer?formlet=Form1.frm -formNameForm1.frm \ No newline at end of file +表单名字假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName就是Form1.frm \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt index 4a1e38b99d..41212da237 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/fr_submitinfo.txt @@ -1 +1 @@ -ύ¼ķϢ fr_submitinfo.success¼ɹ fr_submitinfo.failinfo򵥼¼Ϣ \ No newline at end of file +提交入库事件的返回信息。fr_submitinfo.success记录成功与否fr_submitinfo.failinfo简单记录出错信息 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt index 982b43b722..d2bb66ad34 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/reportName.txt @@ -1,3 +1 @@ - -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -reportNameWorkBook1.cpt \ No newline at end of file +报表名字假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName就是WorkBook1.cpt \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt index 89eb2f98df..d6fca71888 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverName.txt @@ -1,3 +1 @@ -serverNameַָ. -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverNameָǣlocalhostʻӵIP \ No newline at end of file +serverName,是指服务器地址或名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName指的是:localhost,即访问机子的IP \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt index 8a0dd40cf7..24552e730e 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverPort.txt @@ -1 +1 @@ -serverPortָǷʵĶ˿ \ No newline at end of file +serverPort指的是访问的端口 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt index 02cecc67e8..15bcc7e9fb 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverSchema.txt @@ -1,3 +1 @@ -serverSchemaָЭ. -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverSchemaָǣhttp \ No newline at end of file +serverSchema,是指协议名称.假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema指的是:http \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt index 5fd3852e92..02c7db49f2 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/serverURL.txt @@ -1,3 +1 @@ -serverURLָʷURL -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverURLhttp://localhost:8080 +serverURL是指访问服务的URL假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL就是http://localhost:8080 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt index 73a1c0fffe..2a1e5dfd49 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/servletURL.txt @@ -1,2 +1 @@ -ʣhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -servletURLָǣ/WebReport/ReportServer \ No newline at end of file +假如访问:http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL指的是:/WebReport/ReportServer \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt b/designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt index a27a6b408a..eb0b42cf66 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/cn/sessionID.txt @@ -1,4 +1 @@ -SessionIDǷûỰıʶ -ڴỰʱΪÿһỰһıʶ -ỰʶԳͷءSessionIDڱλỰIDļ¼ -SessionID WEBҳͳơ \ No newline at end of file +SessionID属性是返回用户会话的标识。在创建会话时,服务器会为每一个会话生成一个单独的标识,会话标识以长整形数据类型返回。SessionID等于本次会话ID的记录,SessionID 多数情况是用于WEB页面的统计。 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt index 4148f61d3a..7f4e9bf6a0 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/$$$.txt @@ -1 +1 @@ -The current value \ No newline at end of file +The current value \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt index c7c8074a07..4cd04a675a 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_authority.txt @@ -1 +1 @@ -Parameter of user authority \ No newline at end of file +Parameter of user authority \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt index 8b8e172deb..4acc4b6a8f 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_username.txt @@ -1 +1 @@ -Parameter of username \ No newline at end of file +Parameter of username \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt index 1071578ed5..065c000817 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/$fr_userposition.txt @@ -1 +1 @@ -department role of user \ No newline at end of file +department role of user \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt index 8902cd963c..e2fdaa0c63 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/NOFILTER.txt @@ -1 +1 @@ -The result is aways true when NOFILTER is compared with any other values. +The result is aways true when NOFILTER is compared with any other values. \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt index 8b37a4d9eb..7c62560355 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/contextPath.txt @@ -1 +1 @@ -absolute path of the server http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt contextPath is /WebReport \ No newline at end of file +absolute path of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,contextPath is /WebReport \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt index 320a270d6f..48e90583c7 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/formletName.txt @@ -1,3 +1 @@ -form name -http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm -formName is Form1.frm \ No newline at end of file +form namehttp://localhost:8080/WebReport/ReportServer?formlet=Form1.frm,formName is Form1.frm \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt index a4dc1dc072..ce8c81728e 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/fr_submitinfo.txt @@ -1 +1 @@ -callback status of form submit contains fr_submitinfo.success and fr_submitinfo.failinfo \ No newline at end of file +callback status of form submitcontains fr_submitinfo.success and fr_submitinfo.failinfo \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt index bd15a40250..88afaad378 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/reportName.txt @@ -1,3 +1 @@ -report name -http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -reportName is WorkBook1.cpt \ No newline at end of file +report namehttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,reportName is WorkBook1.cpt \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt index 666c13b645..265bd4ad02 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/serverName.txt @@ -1,3 +1 @@ -address or name of the server -http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverName means localhost \ No newline at end of file +address or name of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverName means localhost \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt index 2b06eaa23c..85072e652c 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/serverSchema.txt @@ -1,3 +1 @@ -serverSchema -http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverSchema is http \ No newline at end of file +serverSchemahttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverSchema is http \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt index 347114b08b..f14f925834 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/serverURL.txt @@ -1,3 +1 @@ -URL of the server -http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -serverURL is http://localhost:8080 +URL of the serverhttp://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,serverURL is http://localhost:8080 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt b/designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt index b5ed4ec750..b9149deff3 100644 --- a/designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt +++ b/designer_base/src/com/fr/design/insert/formula/variable/en/servletURL.txt @@ -1,2 +1 @@ -http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt -servletURL is /WebReport/ReportServer \ No newline at end of file +http://localhost:8080/WebReport/ReportServer?reportlet=WorkBook1.cpt,servletURL is /WebReport/ReportServer \ No newline at end of file From 98dc9f981f4fa7da7e16091c971468e4e746a84b Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 1 Mar 2017 17:07:48 +0800 Subject: [PATCH 05/39] =?UTF-8?q?8.0=E6=8F=92=E4=BB=B6=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E9=87=8D=E5=90=AF=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?confirm=E5=AF=B9=E8=AF=9D=E6=A1=86=E4=BF=9D=E7=95=99=EF=BC=8C?= =?UTF-8?q?=E5=9C=A89.0=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/extra/exe/ModifyStatusExecutor.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java b/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java index a61f35e2d1..c544858dd8 100644 --- a/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java +++ b/designer_base/src/com/fr/design/extra/exe/ModifyStatusExecutor.java @@ -42,9 +42,7 @@ public class ModifyStatusExecutor implements Executor { plugin.setActive(active); try { FRContext.getCurrentEnv().writePlugin(plugin); - /* - * PluginWebBridge.getHelper().showRestartMessage(plugin.isActive() ? Inter.getLocText("FR-Designer-Plugin_Has_Been_Actived") : Inter.getLocText("FR-Designer-Plugin_Has_Been_Disabled")); - **/ + PluginWebBridge.getHelper().showRestartMessage(plugin.isActive() ? Inter.getLocText("FR-Designer-Plugin_Has_Been_Actived") : Inter.getLocText("FR-Designer-Plugin_Has_Been_Disabled")); } catch (Exception e) { FRContext.getLogger().error(e.getMessage()); } From 5993e65d4a602adef07c7218f2cb8ea06404a0b1 Mon Sep 17 00:00:00 2001 From: mengao Date: Fri, 3 Mar 2017 10:31:55 +0800 Subject: [PATCH 06/39] =?UTF-8?q?=E5=88=86=E4=B8=A4=E8=A1=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BAcheckbox=E5=92=8C=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=9B=BD=E9=99=85=E5=8C=96=E6=83=85=E5=86=B5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/axis/ChartValuePane.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index b100518c1a..986f67f2dc 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -151,10 +151,11 @@ public class ChartValuePane extends ChartAxisUsePane{ double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = { LayoutConstants.CHART_ATTR_TOMARGIN,p,f}; - double[] rowSize = { p, p,}; + double[] rowSize = { p, p, p}; Component[][] component = new Component[][]{ new Component[]{null,initMinMaxValue(),null}, - new Component[]{null, addLogarithmicPane2ValuePane(), addLogText()}, + new Component[]{null, addLogarithmicPane2ValuePane(), null}, + new Component[]{null, null, addLogText()}, }; return TableLayoutHelper.createTableLayoutPane(component, rowSize, columnSize); } @@ -173,10 +174,10 @@ public class ChartValuePane extends ChartAxisUsePane{ JPanel labelLogPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); labelLogPane.add(logBox = new UICheckBox(Inter.getLocText("Logarithmic")+":")); labelLogPane.add(new UILabel(Inter.getLocText("Chart_Log_Base"))); - + logBaseField = new UITextField(4); logBaseField.setText("10"); - logBaseField.setPreferredSize(new Dimension(20, 20)); + logBaseField.setPreferredSize(new Dimension(50, 20)); logBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -185,7 +186,7 @@ public class ChartValuePane extends ChartAxisUsePane{ }); ChartSwingUtils.addListener(logBox, logBaseField); - + return labelLogPane; } From 9536b70257d75451f5b0d031b47c87d8636c5044 Mon Sep 17 00:00:00 2001 From: mengao Date: Fri, 3 Mar 2017 10:39:00 +0800 Subject: [PATCH 07/39] =?UTF-8?q?=E5=88=86=E4=B8=A4=E8=A1=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BAcheckbox=E5=92=8C=E8=BE=93=E5=85=A5=E6=A1=86=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=9B=BD=E9=99=85=E5=8C=96=E6=83=85=E5=86=B5?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/axis/ChartValuePane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java index 986f67f2dc..f798a0a07d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/axis/ChartValuePane.java @@ -177,7 +177,7 @@ public class ChartValuePane extends ChartAxisUsePane{ logBaseField = new UITextField(4); logBaseField.setText("10"); - logBaseField.setPreferredSize(new Dimension(50, 20)); + logBaseField.setPreferredSize(new Dimension(55, 20)); logBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { From 77b115e7d35f87a499a222a2c27c4eb7c08228c1 Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 6 Mar 2017 11:13:14 +0800 Subject: [PATCH 08/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=E4=B8=AD=E5=AD=97=E4=BD=93=E8=AE=BE=E7=BD=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/style/ChartTextAttrPane.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 5b1ba5aeea..bff37e3246 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -29,11 +29,10 @@ public class ChartTextAttrPane extends BasicPane { protected UIToggleButton bold; protected UIToggleButton italic; protected UIColorButton fontColor; - - public static Integer[] Font_Sizes = {new Integer(6), new Integer(8), new Integer(9), new Integer(10), new Integer(11), new Integer(12), new Integer(14), new Integer(16), - new Integer(18), new Integer(20), new Integer(22), new Integer(24), new Integer(26), new Integer(28), new Integer(36), new Integer(48), new Integer(72)}; + public static Integer[] Font_Sizes = new Integer[67]; public ChartTextAttrPane() { + setFont_Sizes(); initComponents(); } @@ -45,6 +44,11 @@ public class ChartTextAttrPane extends BasicPane { // TODO Auto-generated method stub return null; } + public static void setFont_Sizes() { + for (int i =0; i < 67;i++){ + Font_Sizes [i]= new Integer(i+6); + } + } public void populate(TextAttr textAttr) { if (textAttr == null) { From d6c2d969ad04c3175d7f57d9370c428880f63267 Mon Sep 17 00:00:00 2001 From: mengao Date: Mon, 6 Mar 2017 14:05:06 +0800 Subject: [PATCH 09/39] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E5=B8=83=E5=B1=80?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E5=9B=BE=E8=A1=A8=E8=B6=85=E9=93=BE=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 4a18611fa4..f57328e149 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -79,7 +79,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen eastPane.setLayout(new BorderLayout()); - eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 15)); + eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 10)); JPanel button = new JPanel(); button.setPreferredSize(new Dimension(45, 20)); button.setLayout(new GridLayout(1, 2, 5, 0)); From f0b588a3b2a80ff4f3ee8b16cfe88cdb13524d34 Mon Sep 17 00:00:00 2001 From: mengao Date: Tue, 7 Mar 2017 09:39:40 +0800 Subject: [PATCH 10/39] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E5=B8=83=E5=B1=80?= =?UTF-8?q?=EF=BC=8C=E4=BD=BF=E5=9B=BE=E8=A1=A8=E8=B6=85=E9=93=BE=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/chart/gui/style/ChartTextAttrPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index bff37e3246..df8b91707e 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -23,6 +23,7 @@ import com.fr.design.utils.gui.GUICoreUtils; public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; + private static final int SET_FONT = 6; protected UIComboBox fontNameComboBox; protected UIComboBox fontSizeComboBox; @@ -45,8 +46,8 @@ public class ChartTextAttrPane extends BasicPane { return null; } public static void setFont_Sizes() { - for (int i =0; i < 67;i++){ - Font_Sizes [i]= new Integer(i+6); + for (int i =0; i < Font_Sizes.length;i++){ + Font_Sizes [i]= new Integer(i+SET_FONT); } } From 266d3c8490ff83596a7074b34c99f31eabf5e490 Mon Sep 17 00:00:00 2001 From: mengao Date: Tue, 7 Mar 2017 15:31:06 +0800 Subject: [PATCH 11/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=AD=97=E5=8F=B7=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartTextAttrPane.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index df8b91707e..c4586d42ef 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -23,17 +23,20 @@ import com.fr.design.utils.gui.GUICoreUtils; public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; - private static final int SET_FONT = 6; + private static final int FONT_START = 6; + private static final int FONT_END = 72; protected UIComboBox fontNameComboBox; protected UIComboBox fontSizeComboBox; - protected UIToggleButton bold; protected UIToggleButton italic; protected UIColorButton fontColor; public static Integer[] Font_Sizes = new Integer[67]; - + static{ + for(int i = FONT_START; i <= FONT_END; i++){ + Font_Sizes [i - FONT_START] = new Integer(i); + } + } public ChartTextAttrPane() { - setFont_Sizes(); initComponents(); } @@ -45,11 +48,6 @@ public class ChartTextAttrPane extends BasicPane { // TODO Auto-generated method stub return null; } - public static void setFont_Sizes() { - for (int i =0; i < Font_Sizes.length;i++){ - Font_Sizes [i]= new Integer(i+SET_FONT); - } - } public void populate(TextAttr textAttr) { if (textAttr == null) { From c3001565b020c0eb98b073b3cfc50c8e58281b4c Mon Sep 17 00:00:00 2001 From: fr_shine Date: Tue, 7 Mar 2017 16:28:10 +0800 Subject: [PATCH 12/39] =?UTF-8?q?=E6=9B=B4=E6=94=B9qpilevel=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=A4=A7=E6=95=B0=E6=8D=AE=E5=88=A0=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/chart/fun/IndependentChartUIProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index 1b90382d6a..031ecd3d6e 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -22,7 +22,7 @@ public interface IndependentChartUIProvider extends Level { String XML_TAG = "IndependentChartUIProvider"; - int CURRENT_API_LEVEL = 3; + int CURRENT_API_LEVEL = 4; /** * 图表的类型定义界面类型,就是属性表的第一个界面 From 396368458a641c06256f69b8a36681e8dc3f9589 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 7 Mar 2017 16:49:07 +0800 Subject: [PATCH 13/39] =?UTF-8?q?REPORT-2093=20=E8=8B=B1=E6=96=87=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E6=97=B6=EF=BC=8C=E5=8F=B3?= =?UTF-8?q?=E4=B8=8B=E8=A7=92=E7=9A=84=E9=B8=A3=E8=B0=A2=E9=83=A8=E5=88=86?= =?UTF-8?q?=E8=AF=B7=E5=8E=BB=E6=8E=89=EF=BC=9B=E5=85=B3=E4=BA=8E=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E9=83=A8=E5=88=86=E7=9A=84=E9=B8=A3=E8=B0=A2?= =?UTF-8?q?=E4=B9=9F=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/start/ReportSplashPane.java | 22 +++++++++++++--- .../com/fr/design/actions/help/AboutPane.java | 25 ++++++++++++++----- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/designer/src/com/fr/start/ReportSplashPane.java b/designer/src/com/fr/start/ReportSplashPane.java index ab45bc453c..7ae0bc63c0 100644 --- a/designer/src/com/fr/start/ReportSplashPane.java +++ b/designer/src/com/fr/start/ReportSplashPane.java @@ -4,6 +4,7 @@ package com.fr.start; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.base.GraphHelper; import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.general.GeneralContext; @@ -18,6 +19,8 @@ import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.Locale; import java.util.Random; import java.util.TimerTask; @@ -117,9 +120,22 @@ public class ReportSplashPane extends SplashPane{ GraphHelper.drawString(splashG2d, showText, MODULE_INFO_X, y); //每次随机感谢一位论坛用户 - splashG2d.setPaint(THANK_COLOR); - String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST; - GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y); + if (shouldShowThanks()) { + splashG2d.setPaint(THANK_COLOR); + String content = Inter.getLocText("FR-Designer_Thanks-To") + GUEST; + GraphHelper.drawString(splashG2d, content, THANK_INFO_X, y); + } + } + + // 是否显示鸣谢文字 + private boolean shouldShowThanks() { + Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN}; + for (Locale loc : hideLocales) { + if (FRContext.getLocale().equals(loc)) { + return false; + } + } + return true; } private static String getRandomUser(){ diff --git a/designer_base/src/com/fr/design/actions/help/AboutPane.java b/designer_base/src/com/fr/design/actions/help/AboutPane.java index 5ee395f801..9c8953597d 100644 --- a/designer_base/src/com/fr/design/actions/help/AboutPane.java +++ b/designer_base/src/com/fr/design/actions/help/AboutPane.java @@ -68,10 +68,7 @@ public class AboutPane extends JPanel { Inter.getLocText("FR-Designer-Basic_Activation_Key_Copy_OK") })); - // 英文去掉服务电话和 QQ - if (FRContext.getLocale().equals(Locale.US)){ - // do nothing - } else { + if (shouldShowPhoneAndQQ()){ if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE); contentPane.add(boxCenterAlignmentPane); @@ -85,8 +82,24 @@ public class AboutPane extends JPanel { contentPane.add(actionLabel); contentPane.add(emailLabel); - - addThankPane(contentPane); + if (shouldShowThanks()) { + addThankPane(contentPane); + } + } + + // 是否显示服务电话和 qq + private boolean shouldShowPhoneAndQQ() { + return !FRContext.getLocale().equals(Locale.US); + } + // 是否显示鸣谢面板 + private boolean shouldShowThanks() { + Locale[] hideLocales = {Locale.US, Locale.KOREA, Locale.JAPAN}; + for (Locale loc : hideLocales) { + if (FRContext.getLocale().equals(loc)) { + return false; + } + } + return true; } //添加鸣谢面板 From baf564760bb4d7eefec8a6db88aa30747f854261 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 7 Mar 2017 16:50:55 +0800 Subject: [PATCH 14/39] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/ReportSplashPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer/src/com/fr/start/ReportSplashPane.java b/designer/src/com/fr/start/ReportSplashPane.java index 7ae0bc63c0..5f2f3acd2b 100644 --- a/designer/src/com/fr/start/ReportSplashPane.java +++ b/designer/src/com/fr/start/ReportSplashPane.java @@ -19,7 +19,6 @@ import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; import java.awt.image.BufferedImage; -import java.util.ArrayList; import java.util.Locale; import java.util.Random; import java.util.TimerTask; From b233da60eff5e1d9150f2eba8f2c31758c71b1a9 Mon Sep 17 00:00:00 2001 From: mengao Date: Tue, 7 Mar 2017 16:55:16 +0800 Subject: [PATCH 15/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E5=AD=97=E5=8F=B7=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index c4586d42ef..48ef44970d 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -30,7 +30,7 @@ public class ChartTextAttrPane extends BasicPane { protected UIToggleButton bold; protected UIToggleButton italic; protected UIColorButton fontColor; - public static Integer[] Font_Sizes = new Integer[67]; + public static Integer[] Font_Sizes = new Integer[FONT_END-FONT_START+1]; static{ for(int i = FONT_START; i <= FONT_END; i++){ Font_Sizes [i - FONT_START] = new Integer(i); From da8587f2c57f9b9bd1aa8487cb7aeb9c163812b5 Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 7 Mar 2017 17:34:25 +0800 Subject: [PATCH 16/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E5=AE=8C=E6=88=90=E6=89=80=E6=9C=89?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E6=9C=AC=E5=9C=B0=E5=AD=98=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/TemplateProcessTracker.aj | 73 +++++++++++++++++++ designer/src/com/fr/grid/Grid.java | 4 + .../designerbase/TemplateProcessTracker.aj | 61 ++++++++++++++++ .../tabledatapane/EmbeddedTableDataPane.java | 1 + .../com/fr/design/mainframe/JTemplate.java | 12 +++ .../templateinfo/TemplateInfoCollector.java | 22 +++++- .../templateinfo/TemplateProcessTracker.aj | 71 ++++++++++++++++++ .../designerchart/TemplateProcessTracker.aj | 56 ++++++++++++++ .../designerform/TemplateProcessTracker.aj | 60 +++++++++++++++ 9 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj create mode 100644 designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj create mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj create mode 100644 designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj create mode 100644 designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj diff --git a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj new file mode 100644 index 0000000000..a2c3565d9a --- /dev/null +++ b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj @@ -0,0 +1,73 @@ +package com.fr.aspectj.designer; + +/** + * 记录模板过程 + * Created by plough on 2017/3/3. + */ + +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import org.aspectj.lang.reflect.SourceLocation; + +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.util.Date; + +public aspect TemplateProcessTracker { + //声明一个pointcut,匹配你需要的方法 + pointcut onMouseClicked(MouseEvent e) : + execution(* mouseClicked(MouseEvent)) && args(e); + pointcut onMousePressed(MouseEvent e) : + execution(* mousePressed(MouseEvent)) && args(e); + pointcut onMouseReleased(MouseEvent e) : + execution(* mouseReleased(MouseEvent)) && args(e); + pointcut onActionPerformed(ActionEvent e) : + execution(* actionPerformed(ActionEvent)) && args(e); + pointcut onSetValueAt(Object v, int r, int c) : + execution(* setValueAt(java.lang.Object, int, int)) && args(v, r, c); + pointcut onSetValue4EditingElement(Object v) : + execution(* setValue4EditingElement(java.lang.Object)) && args(v); + + //before表示之前的意思 + //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 + before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + } + //同上 + before(ActionEvent e) : onActionPerformed(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 + if (e.getSource().toString().contains("javax.swing.Timer")) { + return; + } + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + + } + //同上 + before(Object v, int r, int c) : onSetValueAt(v, r, c) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 +// if (e.getSource().toString().contains("javax.swing.Timer")) { +// return; +// } + + String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + TemplateInfoCollector.appendProcess(log); + + } + //同上 + before(Object v) : onSetValue4EditingElement(v) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + +// String v = "test"; + String log = String.format("%s:\n%s\nset value: %s\n\n", new Date(), sl, v); + TemplateInfoCollector.appendProcess(log); + + } + + +} diff --git a/designer/src/com/fr/grid/Grid.java b/designer/src/com/fr/grid/Grid.java index a259cf63b0..432ea888c1 100644 --- a/designer/src/com/fr/grid/Grid.java +++ b/designer/src/com/fr/grid/Grid.java @@ -10,6 +10,7 @@ import com.fr.design.constants.UIConstants; import com.fr.design.fun.GridUIProcessor; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.mainframe.ElementCasePane; +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; import com.fr.grid.event.CellEditorEvent; @@ -35,6 +36,7 @@ import javax.swing.plaf.ComponentUI; import java.awt.*; import java.awt.event.MouseEvent; import java.awt.geom.Point2D; +import java.util.Date; import java.util.Hashtable; import java.util.Iterator; @@ -1072,6 +1074,8 @@ public class Grid extends BaseGridComponent { * @return true if the value changed */ private boolean setValue4EditingElement(Object newValue) { + String log = String.format("%s:\nGrid.java\nset value: %s at %s\n\n", new Date(), newValue, editingCellElement); + TemplateInfoCollector.appendProcess(log); if (newValue instanceof TemplateCellElement) { TemplateCellElement cellElement = (TemplateCellElement) newValue; editingCellElement.setValue(cellElement.getValue()); diff --git a/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj new file mode 100644 index 0000000000..04e3fa2e46 --- /dev/null +++ b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj @@ -0,0 +1,61 @@ +package com.fr.aspectj.designerbase; + +/** + * 记录模板过程 + * Created by plough on 2017/3/3. + */ + +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import org.aspectj.lang.reflect.SourceLocation; + +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.util.Date; + +public aspect TemplateProcessTracker { + //声明一个pointcut,匹配你需要的方法 + pointcut onMouseClicked(MouseEvent e) : + execution(* mouseClicked(MouseEvent)) && args(e); + pointcut onMousePressed(MouseEvent e) : + execution(* mousePressed(MouseEvent)) && args(e); + pointcut onMouseReleased(MouseEvent e) : + execution(* mouseReleased(MouseEvent)) && args(e); + pointcut onActionPerformed(ActionEvent e) : + execution(* actionPerformed(ActionEvent)) && args(e); + pointcut onSetValueAt(Object v, int r, int c) : + execution(* setValueAt(java.lang.Object, int, int)) && args(v, r, c); + + //before表示之前的意思 + //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 + before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + } + //同上 + before(ActionEvent e) : onActionPerformed(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 + if (e.getSource().toString().contains("javax.swing.Timer")) { + return; + } + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + + } + //同上 + before(Object v, int r, int c) : onSetValueAt(v, r, c) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 +// if (e.getSource().toString().contains("javax.swing.Timer")) { +// return; +// } + + String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + TemplateInfoCollector.appendProcess(log); + } + + +} diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index 3103f6850d..a4ddba1f74 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -96,6 +96,7 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane> ex private PreviewProvider previewType; private long openTime = 0L; // 打开模板的时间点(包括新建模板) private TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); + private StringBuilder process = new StringBuilder(""); // 制作模板的过程 public JTemplate(T t, String defaultFileName) { this(t, new MemFILE(newTemplateNameByIndex(defaultFileName)), true); @@ -102,6 +103,7 @@ public abstract class JTemplate> ex // 如果不是新建模板,并且在收集列表中 if (!isNewFile && tic.inList(t)) { openTime = System.currentTimeMillis(); + process.append(tic.loadProcess(t)); } } @@ -131,6 +133,16 @@ public abstract class JTemplate> ex // 获取模板控件数 public abstract int getWidgetCount(); + // 追加过程记录 + public void appendProcess(String s) { + process.append(s); + } + + // 获取过程记录 + public String getProcess() { + return process.toString(); + } + public U getUndoState() { return undoState; } diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 52542e14d1..95ced63309 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.templateinfo; import com.fr.base.io.IOFile; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; @@ -49,6 +50,22 @@ public class TemplateInfoCollector implements Serializable { return instance; } + public static void appendProcess(String log) { +// System.out.println(log); + // 获取当前编辑的模板 + JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate(); + // 追加过程记录 + jt.appendProcess(log); + } + + /** + * 加载已经存储的模板过程 + */ + public String loadProcess(T t) { +// return ""; + return (String)templateInfoList.get(t.getReportletsid()).get("process"); + } + /** * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 */ @@ -106,17 +123,18 @@ public class TemplateInfoCollector implements Serializable { } long timeConsume = saveTime - openTime; - // 如果已存有数据,则加上本次编辑时间 + // 如果已存有数据,则加上之前的累计编辑时间 if (templateInfo.get("time_consume") != null) { timeConsume += (long)templateInfo.get("time_consume"); } -// String process; + String process = jt.getProcess(); int cellCount = jt.getCellCount(); int floatCount = jt.getFloatCount(); int blockCount = jt.getBlockCount(); int widgetCount = jt.getWidgetCount(); templateInfo.put("time_consume", timeConsume); + templateInfo.put("process", process); templateInfo.put("cell_count", cellCount); templateInfo.put("float_count", floatCount); templateInfo.put("block_count", blockCount); diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj new file mode 100644 index 0000000000..d186f82981 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj @@ -0,0 +1,71 @@ +//package com.fr.design.mainframe.templateinfo; +// +//import org.aspectj.lang.reflect.SourceLocation; +// +//import java.awt.event.ActionEvent; +//import java.awt.event.MouseEvent; +//import java.util.Date; +// +///** +// * 记录模板过程 +// * Created by plough on 2017/2/27. +// */ +//public aspect TemplateProcessTracker { +// //声明一个pointcut,匹配你需要的方法 +// pointcut onMouseClicked(MouseEvent e) : +// execution(* mouseClicked(MouseEvent)) && args(e); +// pointcut onMousePressed(MouseEvent e) : +// execution(* mousePressed(MouseEvent)) && args(e); +// pointcut onMouseReleased(MouseEvent e) : +// execution(* mouseReleased(MouseEvent)) && args(e); +// pointcut onActionPerformed(ActionEvent e) : +// execution(* actionPerformed(ActionEvent)) && args(e); +// pointcut onSetValueAt(Object v, int r, int c) : +// execution(* setValueAt(Object, int, int)) && args(v, r, c); +// pointcut onSetValue4EditingElement(Object v) : +// execution(* setValue4EditingElement(Object)) && args(v); +// +// //before表示之前的意思 +// //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 +// before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { +// SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 +// +// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); +// TemplateInfoCollector.appendProcess(log); +// } +// //同上 +// before(ActionEvent e) : onActionPerformed(e) { +// SourceLocation sl = thisJoinPoint.getSourceLocation(); +// // !within(LogHandlerBar) 没用, 手动过滤 +// if (e.getSource().toString().contains("javax.swing.Timer")) { +// return; +// } +// +// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); +// TemplateInfoCollector.appendProcess(log); +// +// } +// //同上 +// before(Object v, int r, int c) : onSetValueAt(v, r, c) { +// SourceLocation sl = thisJoinPoint.getSourceLocation(); +// // !within(LogHandlerBar) 没用, 手动过滤 +//// if (e.getSource().toString().contains("javax.swing.Timer")) { +//// return; +//// } +// +// String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); +// TemplateInfoCollector.appendProcess(log); +// +// } +// //同上 +// before(Object v) : onSetValue4EditingElement(v) { +// SourceLocation sl = thisJoinPoint.getSourceLocation(); +// +//// String v = "test"; +// String log = String.format("%s:\n%s\nset value: %s\n\n", new Date(), sl, v); +// TemplateInfoCollector.appendProcess(log); +// +// } +// +// +//} diff --git a/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj b/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj new file mode 100644 index 0000000000..c192a190d0 --- /dev/null +++ b/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj @@ -0,0 +1,56 @@ +package com.fr.aspectj.designerchart; + +/** + * Created by plough on 2017/3/3. + */ +import com.fr.chart.chartattr.Chart; +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import org.aspectj.lang.reflect.SourceLocation; + +import javax.swing.event.ListSelectionEvent; +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.util.Date; + +public aspect TemplateProcessTracker { + //声明一个pointcut,匹配你需要的方法 + pointcut onMouseClicked(MouseEvent e) : + execution(* mouseClicked(MouseEvent)) && args(e); + pointcut onMousePressed(MouseEvent e) : + execution(* mousePressed(MouseEvent)) && args(e); + pointcut onMouseReleased(MouseEvent e) : + execution(* mouseReleased(MouseEvent)) && args(e); + pointcut onActionPerformed(ActionEvent e) : + execution(* actionPerformed(ActionEvent)) && args(e); + pointcut onChartUpdate(Chart c) : + execution(* update(Chart)) && args(c); + + //before表示之前的意思 + //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 + before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + } + //同上 + before(ActionEvent e) : onActionPerformed(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 + if (e.getSource().toString().contains("javax.swing.Timer")) { + return; + } + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + + } + //同上 + before(Chart c) : onChartUpdate(c) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + String log = String.format("%s:\n%s\n插入新图表:%s\n\n", new Date(), sl, c.getChartName()); + TemplateInfoCollector.appendProcess(log); + + } + +} diff --git a/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj b/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj new file mode 100644 index 0000000000..885d21ecd3 --- /dev/null +++ b/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj @@ -0,0 +1,60 @@ +package com.fr.aspectj.designerform; + +/** + * Created by plough on 2017/3/3. + */ +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import org.aspectj.lang.reflect.SourceLocation; + +import java.awt.event.ActionEvent; +import java.awt.event.MouseEvent; +import java.util.Date; + +public aspect TemplateProcessTracker { + //声明一个pointcut,匹配你需要的方法 + pointcut onMouseClicked(MouseEvent e) : + execution(* mouseClicked(MouseEvent)) && args(e); + pointcut onMousePressed(MouseEvent e) : + execution(* mousePressed(MouseEvent)) && args(e); + pointcut onMouseReleased(MouseEvent e) : + execution(* mouseReleased(MouseEvent)) && args(e); + pointcut onActionPerformed(ActionEvent e) : + execution(* actionPerformed(ActionEvent)) && args(e); + pointcut onSetValueAt(Object v, int r, int c) : + execution(* setValueAt(java.lang.Object, int, int)) && args(v, r, c); + + //before表示之前的意思 + //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 + before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + } + //同上 + before(ActionEvent e) : onActionPerformed(e) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 + if (e.getSource().toString().contains("javax.swing.Timer")) { + return; + } + + String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + TemplateInfoCollector.appendProcess(log); + + } + //同上 + before(Object v, int r, int c) : onSetValueAt(v, r, c) { + SourceLocation sl = thisJoinPoint.getSourceLocation(); + // !within(LogHandlerBar) 没用, 手动过滤 +// if (e.getSource().toString().contains("javax.swing.Timer")) { +// return; +// } + + String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + TemplateInfoCollector.appendProcess(log); + + } + + +} From f2c3c76e7d60e48a5b4f9d3ab8ddc653c398bcfb Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 8 Mar 2017 16:22:38 +0800 Subject: [PATCH 17/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=A0=BC=E7=BC=96=E8=BE=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/aspectj/designer/TemplateProcessTracker.aj | 9 +++++---- designer/src/com/fr/grid/Grid.java | 9 +++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj index a2c3565d9a..24dfc73518 100644 --- a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj +++ b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj @@ -6,6 +6,7 @@ package com.fr.aspectj.designer; */ import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; +import com.fr.grid.Grid; import org.aspectj.lang.reflect.SourceLocation; import java.awt.event.ActionEvent; @@ -24,8 +25,8 @@ public aspect TemplateProcessTracker { execution(* actionPerformed(ActionEvent)) && args(e); pointcut onSetValueAt(Object v, int r, int c) : execution(* setValueAt(java.lang.Object, int, int)) && args(v, r, c); - pointcut onSetValue4EditingElement(Object v) : - execution(* setValue4EditingElement(java.lang.Object)) && args(v); + pointcut onSetValue4EditingElement(Grid g, Object v) : + call(* setValue4EditingElement(java.lang.Object)) && target(g) && args(v); //before表示之前的意思 //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 @@ -60,11 +61,11 @@ public aspect TemplateProcessTracker { } //同上 - before(Object v) : onSetValue4EditingElement(v) { + before(Grid g, Object v) : onSetValue4EditingElement(g, v) { SourceLocation sl = thisJoinPoint.getSourceLocation(); // String v = "test"; - String log = String.format("%s:\n%s\nset value: %s\n\n", new Date(), sl, v); + String log = String.format("%s:\n%s\nset value: %s at %s\n\n", new Date(), sl, v, g.getEditingCellElement()); TemplateInfoCollector.appendProcess(log); } diff --git a/designer/src/com/fr/grid/Grid.java b/designer/src/com/fr/grid/Grid.java index 432ea888c1..178cd085ed 100644 --- a/designer/src/com/fr/grid/Grid.java +++ b/designer/src/com/fr/grid/Grid.java @@ -1067,6 +1067,13 @@ public class Grid extends BaseGridComponent { } + /** + * @return editingCellElement 的字符串表示 + */ + public String getEditingCellElement() { + return editingCellElement.toString(); + } + /** * 将新值赋给editingCellElement * @@ -1074,8 +1081,6 @@ public class Grid extends BaseGridComponent { * @return true if the value changed */ private boolean setValue4EditingElement(Object newValue) { - String log = String.format("%s:\nGrid.java\nset value: %s at %s\n\n", new Date(), newValue, editingCellElement); - TemplateInfoCollector.appendProcess(log); if (newValue instanceof TemplateCellElement) { TemplateCellElement cellElement = (TemplateCellElement) newValue; editingCellElement.setValue(cellElement.getValue()); From 0a1db37ffbff56c8ff1e2f1b1f5103462e63a0cc Mon Sep 17 00:00:00 2001 From: frharry Date: Wed, 8 Mar 2017 18:10:32 +0800 Subject: [PATCH 18/39] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/dialog/BasicDialog.java | 1 + .../src/com/fr/design/dialog/BasicPane.java | 24 + .../design/designer/creator/XElementCase.java | 4 +- .../com/fr/design/mainframe/FEditToolBar.java | 481 ++++++++++++++++++ .../fr/design/mainframe/FSettingToolBar.java | 84 +++ .../src/com/fr/design/mainframe/FToolBar.java | 68 +++ .../fr/design/mainframe/FToolBarButton.java | 159 ++++++ .../com/fr/design/mainframe/FToolBarPane.java | 233 +++++++++ .../mainframe/FormWebWidgetConstants.java | 54 ++ .../AccessibleECToolBarEditor.java | 57 +++ .../widget/editors/ECToolBarEditor.java | 13 + .../widget/editors/ECToolBarPane.java | 304 +++++++++++ .../widget/wrappers/ECToolBarWrapper.java | 34 ++ 13 files changed, 1515 insertions(+), 1 deletion(-) create mode 100644 designer_form/src/com/fr/design/mainframe/FEditToolBar.java create mode 100644 designer_form/src/com/fr/design/mainframe/FSettingToolBar.java create mode 100644 designer_form/src/com/fr/design/mainframe/FToolBar.java create mode 100644 designer_form/src/com/fr/design/mainframe/FToolBarButton.java create mode 100644 designer_form/src/com/fr/design/mainframe/FToolBarPane.java create mode 100644 designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java create mode 100644 designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java create mode 100644 designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java create mode 100644 designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java create mode 100644 designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java diff --git a/designer_base/src/com/fr/design/dialog/BasicDialog.java b/designer_base/src/com/fr/design/dialog/BasicDialog.java index 703b192055..bc9ec749d7 100644 --- a/designer_base/src/com/fr/design/dialog/BasicDialog.java +++ b/designer_base/src/com/fr/design/dialog/BasicDialog.java @@ -13,6 +13,7 @@ public abstract class BasicDialog extends UIDialog { public static final Dimension CHART = new Dimension(760, 560); public static final Dimension MAP_SIZE = new Dimension(760, 450); public static final Dimension UPDATE_ONLINE_SIZE = new Dimension(600,300); + public static final Dimension TOOLBAR_SIZE = new Dimension(660, 327); public BasicDialog(Frame parent) { super(parent); diff --git a/designer_base/src/com/fr/design/dialog/BasicPane.java b/designer_base/src/com/fr/design/dialog/BasicPane.java index eb1b413055..05c6a84f20 100644 --- a/designer_base/src/com/fr/design/dialog/BasicPane.java +++ b/designer_base/src/com/fr/design/dialog/BasicPane.java @@ -251,6 +251,30 @@ public abstract class BasicPane extends JPanel { return dg; } + /** + * 显示窗口 + * + * @param window 窗口 + * @param l 对话框监听器 + * @return 对话框 + */ + public BasicDialog showToolBarWindow(Window window, DialogActionListener l) { + BasicDialog dg; + if (window instanceof Frame) { + dg = new DIALOG((Frame) window); + } else { + dg = new DIALOG((Dialog) window); + } + + if (l != null) { + dg.addDialogActionListener(l); + } + dg.setBasicDialogSize(BasicDialog.TOOLBAR_SIZE); + GUICoreUtils.centerWindow(dg); + dg.setResizable(false); + return dg; + } + protected abstract String title4PopupWindow(); public String getTitle() { diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index a932548cc5..f30ddb758c 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -11,6 +11,7 @@ import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.*; import com.fr.design.mainframe.widget.editors.BooleanEditor; +import com.fr.design.mainframe.widget.editors.ECToolBarEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; @@ -92,11 +93,12 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void propertyChange() { initStyle(); } + }), new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("showToolBar", this.data.getClass()).setEditorClass(BooleanEditor.class) + new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ECToolBarEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; diff --git a/designer_form/src/com/fr/design/mainframe/FEditToolBar.java b/designer_form/src/com/fr/design/mainframe/FEditToolBar.java new file mode 100644 index 0000000000..4ca4ab9c1a --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FEditToolBar.java @@ -0,0 +1,481 @@ +package com.fr.design.mainframe; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.javascript.JavaScriptActionPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.menu.ToolBarDef; +import com.fr.design.style.background.BackgroundPane; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.design.widget.IconDefinePane; +import com.fr.form.ui.*; +import com.fr.form.ui.Button; +import com.fr.form.web.button.Export; +import com.fr.general.Background; +import com.fr.general.Inter; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.*; + +/** + * Created by harry on 2017-3-2. + */ +public class FEditToolBar extends BasicPane { + + private JList list; + private DefaultListModel listModel; + private JPanel right; + private CardLayout card; + private ButtonPane bp; + private FToolBarButton lastButton; + private Background background = null; + private UICheckBox defaultCheckBox; + + private ListSelectionListener listSelectionListener = new ListSelectionListener() { + public void valueChanged(ListSelectionEvent evt) { + if (lastButton != null) { + lastButton.setWidget(bp.update()); + } + if (list.getSelectedValue() instanceof FToolBarButton) { + lastButton = (FToolBarButton) list.getSelectedValue(); + if (lastButton.getWidget() instanceof Button) { + card.show(right, "button"); + bp.populate(lastButton.getWidget()); + } else { + bp.populate(lastButton.getWidget()); + card.show(right, "none"); + } + } + } + }; + + + private ActionListener actioner = new ActionListener() { + /** + * + */ + public void actionPerformed(ActionEvent arg0) { + final BackgroundPane backgroundPane = new BackgroundPane(); + BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame()); + backgroundPane.populate(FEditToolBar.this.background); + dialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + FEditToolBar.this.background = backgroundPane.update(); + if (FEditToolBar.this.background != null) { + FEditToolBar.this.defaultCheckBox.setSelected(false); + } + } + }); + dialog.setVisible(true); + } + }; + + public FEditToolBar() { + initComponent(); + } + + /** + * 初始化 + */ + public void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel left = FRGUIPaneFactory.createBorderLayout_S_Pane(); + listModel = new DefaultListModel(); + list = new JList(listModel); + list.setCellRenderer(render); + left.add(new JScrollPane(list), BorderLayout.CENTER); + if (listModel.getSize() > 0) { + list.setSelectedIndex(0); + } + + ToolBarDef toolbarDef = new ToolBarDef(); + toolbarDef.addShortCut(new MoveUpItemAction()); + toolbarDef.addShortCut(new MoveDownItemAction()); + toolbarDef.addShortCut(new RemoveAction()); + UIToolbar toolBar = ToolBarDef.createJToolBar(); + toolbarDef.updateToolBar(toolBar); + left.add(toolBar, BorderLayout.NORTH); + + right = FRGUIPaneFactory.createCardLayout_S_Pane(); + card = new CardLayout(); + right.setLayout(card); + bp = new ButtonPane(); + right.add("none", FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane()); + right.add("button", bp); + + JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, left, right); + // splitPane.setDividerLocation(left.getMinimumSize().width); + splitPane.setDividerLocation(120); + this.add(splitPane); + list.addListSelectionListener(listSelectionListener); + JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"})); + defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"})); + bgButton.addActionListener(actioner); + backgroundPane.add(defaultCheckBox); + backgroundPane.add(bgButton); + backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"}))); + this.add(backgroundPane, BorderLayout.SOUTH); + } + + ListCellRenderer render = new DefaultListCellRenderer() { + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + + if (value instanceof FToolBarButton) { + FToolBarButton button = (FToolBarButton) value; + this.setText(button.getNameOption().optionName()); + this.setIcon(button.getNameOption().optionIcon()); + } + return this; + } + }; + + @Override + protected String title4PopupWindow() { + return Inter.getLocText("FR-Designer_Edit"); + } + + public void populate(FToolBar ftoolbar) { + this.populate(ftoolbar, null); + } + + public void populate(FToolBar ftoolbar, FToolBarButton button) { + if (ftoolbar == null) { + return; + } + for (int i = 0; i < ftoolbar.getButtonlist().size(); i++) { + listModel.addElement(ftoolbar.getButtonlist().get(i)); + } + this.list.validate(); + this.list.repaint(); + if (ftoolbar.getButtonlist().size() > 0) { + this.list.setSelectedIndex(0); + } + if (button != null) { + this.list.setSelectedValue(button, true); + } + this.background = ftoolbar.getBackground(); + + this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false); + } + + public FToolBar update() { + if (this.list.getSelectedIndex() > -1) { + for (int i = 0; i < listModel.getSize(); i++) { + this.list.setSelectedIndex(i); + FToolBarButton toolBarButton = (FToolBarButton) this.list.getSelectedValue(); + Widget widget = this.bp.update(); + toolBarButton.setWidget(widget); + if (widget instanceof Button) { + String iconname = ((Button) widget).getIconName(); + if (StringUtils.isNotBlank(iconname)) { + Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconname); + toolBarButton.setIcon(new ImageIcon(iimage)); + } + } + } + } + java.util.List list = new ArrayList(); + for (int i = 0; i < listModel.size(); i++) { + list.add((FToolBarButton) listModel.get(i)); + } + FToolBar ftoolBar = new FToolBar(); + ftoolBar.setButtonlist(list); + + ftoolBar.setDefault(this.defaultCheckBox.isSelected()); + if (!ftoolBar.isDefault()) { + ftoolBar.setBackground(this.background); + } + return ftoolBar; + } + + private class MoveUpItemAction extends UpdateAction { + public MoveUpItemAction() { + this.setName(Inter.getLocText("Utils-Move_Up")); + this.setMnemonic('U'); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); + } + + /** + * + */ + public void actionPerformed(ActionEvent evt) { + int selectedIndex = list.getSelectedIndex(); + if (selectedIndex == -1) { + return; + } + + // 上移 + if (selectedIndex > 0) { + DefaultListModel listModel = (DefaultListModel) list.getModel(); + + Object selecteObj1 = listModel.get(selectedIndex - 1); + listModel.set(selectedIndex - 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); + + list.setSelectedIndex(selectedIndex - 1); + list.ensureIndexIsVisible(selectedIndex - 1); + list.validate(); + } + } + } + + private class MoveDownItemAction extends UpdateAction { + public MoveDownItemAction() { + this.setName(Inter.getLocText("Utils-Move_Down")); + this.setMnemonic('D'); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); + } + + /** + * + */ + public void actionPerformed(ActionEvent evt) { + int selectedIndex = list.getSelectedIndex(); + if (selectedIndex == -1) { + return; + } + + // 下移 + if (selectedIndex == -1) { + return; + } + + if (selectedIndex < list.getModel().getSize() - 1) { + DefaultListModel listModel = (DefaultListModel) list.getModel(); + + Object selecteObj1 = listModel.get(selectedIndex + 1); + listModel.set(selectedIndex + 1, listModel.get(selectedIndex)); + listModel.set(selectedIndex, selecteObj1); + + list.setSelectedIndex(selectedIndex + 1); + list.ensureIndexIsVisible(selectedIndex + 1); + list.validate(); + } + } + } + + public class RemoveAction extends UpdateAction { + public RemoveAction() { + this.setName(Inter.getLocText("FR-Designer_Delete")); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + } + + /** + * 动作 + * @param e 事件 + */ + public void actionPerformed(ActionEvent e) { + int i = list.getSelectedIndex(); + if (i < 0 || !(listModel.getElementAt(i) instanceof FToolBarButton)) { + return; + } + int val = JOptionPane.showConfirmDialog(FEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION); + if (val != JOptionPane.YES_OPTION) { + return; + } + listModel.removeElementAt(i); + list.validate(); + if (listModel.size() > 0) { + list.setSelectedIndex(0); + } else { + card.show(right, "none"); + } + } + } + + public class ButtonPane extends BasicPane { + private CardLayout card; + private JPanel centerPane; + private UICheckBox icon, text, excelP, excelO; + private Widget widget; + private UITextField nameField; + private IconDefinePane iconPane; + private UIButton button; + private JavaScriptActionPane javaScriptPane; + + public ButtonPane() { + this.initComponents(); + } + + /** + * 初始化元素 + */ + public void initComponents() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane(); + icon = new UICheckBox(Inter.getLocText("FR-Designer_Show_Icon")); + text = new UICheckBox(Inter.getLocText("FR-Designer_Show_Text")); + + north.add(icon, BorderLayout.NORTH); + north.add(text, BorderLayout.CENTER); + + nameField = new UITextField(8); + iconPane = new IconDefinePane(); + javaScriptPane = JavaScriptActionPane.createDefault(); + + double p = TableLayout.PREFERRED; + double rowSize[] = {p, p}; + double columnSize[] = {p, p}; + + Component[][] coms = new Component[][]{{new UILabel(Inter.getLocText(new String[]{"Widget", "Printer-Alias"}) + ":"), nameField}, {new UILabel(Inter.getLocText(new String[]{"Widget", "Icon"}) + ":"), iconPane}}; + + JPanel nameIconPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize); + + north.add(nameIconPane, BorderLayout.SOUTH); + + north.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"}))); + this.add(north, BorderLayout.NORTH); + JPanel none = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + centerPane = FRGUIPaneFactory.createCardLayout_S_Pane(); + card = new CardLayout(); + centerPane.setLayout(card); + centerPane.add("custom", getCustomPane()); + centerPane.add("export", getExport()); + centerPane.add("none", none); + + this.add(centerPane, BorderLayout.CENTER); + } + + + private JPanel getCustomPane() { + JPanel customPane = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); + + button = new UIButton(Inter.getLocText("FR-Designer_User_Defined_Event")); + customPane.add(button); + customPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Edit") + "JS", null)); + button.addActionListener(l); + return customPane; + } + + private JPanel getExport() { + JPanel export = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); + // export.setLayout(new BoxLayout(export, BoxLayout.Y_AXIS)); + excelP = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Page")); + excelO = new UICheckBox(Inter.getLocText("FR-Designer-Output_Excel_Simple")); + export.add(excelP); + export.add(Box.createVerticalStrut(2)); + export.add(excelO); + export.add(Box.createVerticalStrut(2)); + + export.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText(new String[]{"Form-Button", "Property", "Set"}), null)); + return export; + } + + @Override + protected String title4PopupWindow() { + return "Button"; + } + + ActionListener l = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (!(widget instanceof CustomToolBarButton)) { + return; + } + if (javaScriptPane == null || ((CustomToolBarButton)widget).getJSImpl() == null) { + javaScriptPane = JavaScriptActionPane.createDefault(); + } + javaScriptPane.setPreferredSize(new Dimension(750, 500)); + BasicDialog dialog = javaScriptPane.showWindow(SwingUtilities.getWindowAncestor(ButtonPane.this)); + dialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + ((CustomToolBarButton) widget).setJSImpl(javaScriptPane.updateBean()); + } + }); + dialog.setVisible(true); + } + }; + + /** + * 更新 + * @param widget 对应组件 + */ + public void populate(Widget widget) { + this.widget = widget; + card.show(centerPane, "none"); + if (widget instanceof Button) { + populateDefault(); + } + if (widget instanceof Export) { + populateExport(); + } else if (widget instanceof CustomToolBarButton) { + populateCustomToolBarButton(); + } + } + + private void populateExport(){ + card.show(centerPane, "export"); + Export export = (Export) widget; + this.excelP.setSelected(export.isExcelPAvailable()); + this.excelO.setSelected(export.isExcelOAvailable()); + } + + private void populateCustomToolBarButton(){ + card.show(centerPane, "custom"); + CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget; + if (customToolBarButton.getJSImpl() != null) { + this.javaScriptPane.populateBean(customToolBarButton.getJSImpl()); + } + } + + + + private void populateDefault(){ + Button button = (Button) widget; + this.icon.setSelected(button.isShowIcon()); + this.text.setSelected(button.isShowText()); + this.nameField.setText(button.getText()); + this.iconPane.populate(((Button) widget).getIconName()); + } + + /** + * 更新 + * + * @return 对应组件 + */ + public Widget update() { + if (widget instanceof Export) { + updateExport(); + } else if (widget instanceof CustomToolBarButton) { + ((CustomToolBarButton) widget).setJSImpl(this.javaScriptPane.updateBean()); + } + if (widget instanceof Button) { + updateDefault(); + } + + return widget; + } + + private void updateDefault(){ + ((Button) widget).setShowIcon(this.icon.isSelected()); + ((Button) widget).setShowText(this.text.isSelected()); + ((Button) widget).setText(this.nameField.getText()); + ((Button) widget).setIconName(this.iconPane.update()); + } + + + private void updateExport(){ + Export export = (Export) widget; + export.setExcelPAvailable(this.excelP.isSelected()); + export.setExcelOAvailable(this.excelO.isSelected()); + } + } +} diff --git a/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java b/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java new file mode 100644 index 0000000000..00f9dae612 --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java @@ -0,0 +1,84 @@ +package com.fr.design.mainframe; + +import com.fr.base.BaseUtils; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by harry on 2017-3-2. + */ +public class FSettingToolBar extends JPanel { + private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); + private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); + private UIButton setButton; + private UIButton delButton; + private FToolBarPane toolBarPane; + + public FSettingToolBar(String name,FToolBarPane toolBarPane) { + super(); + this.setBackground(Color.lightGray); + this.add(new UILabel(name)); + this.toolBarPane = toolBarPane; + setButton = GUICoreUtils.createTransparentButton(setIcon, setIcon, setIcon); + setButton.setToolTipText(Inter.getLocText("Edit_Button_ToolBar")); + setButton.setAction(new SetAction()); + delButton = GUICoreUtils.createTransparentButton(delIcon, delIcon, delIcon); + delButton.setToolTipText(Inter.getLocText("Remove_Button_ToolBar")); + delButton.setAction(new DelAction()); + this.add(setButton); + this.add(delButton); + } + + public void setEnabled(boolean b) { + setButton.setEnabled(b); + delButton.setEnabled(b); + } + + public void addActionListener(ActionListener l){ + setButton.addActionListener(l); + delButton.addActionListener(l); + } + + private class SetAction extends AbstractAction { + + public SetAction() { + this.putValue(Action.SMALL_ICON, setIcon); + } + + @Override + public void actionPerformed(ActionEvent arg0) { + final FEditToolBar tb = new FEditToolBar(); + tb.populate(toolBarPane.getFToolBar()); + BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame()); + dialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + toolBarPane.setFToolBar(tb.update()); + } + }); + dialog.setVisible(true); + } + } + + private class DelAction extends AbstractAction { + + public DelAction() { + this.putValue(Action.SMALL_ICON, delIcon); + } + + @Override + public void actionPerformed(ActionEvent arg0) { + toolBarPane.removeAll(); + toolBarPane.removeButtonList(); + toolBarPane.repaint(); + } + } +} diff --git a/designer_form/src/com/fr/design/mainframe/FToolBar.java b/designer_form/src/com/fr/design/mainframe/FToolBar.java new file mode 100644 index 0000000000..5eb5196800 --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FToolBar.java @@ -0,0 +1,68 @@ +package com.fr.design.mainframe; + +import com.fr.form.ui.ToolBar; +import com.fr.form.ui.Widget; +import com.fr.general.Background; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by harry on 2017-3-2. + */ +public class FToolBar { + private List buttonlist = new ArrayList(); + private Background background = null; + private boolean isDefault = true; + + public List getButtonlist() { + return buttonlist; + } + + public void setButtonlist(List buttonlist) { + if (buttonlist == null || buttonlist.size() < 0) { + this.buttonlist = new ArrayList(); + } else { + this.buttonlist = buttonlist; + } + } + + public void addButton(FToolBarButton toolBarButton) { + this.buttonlist.add(toolBarButton); + } + + public void removeButton(FToolBarButton toolBarButton) { + this.buttonlist.remove(toolBarButton); + } + + public void clearButton() { + this.buttonlist.clear(); + } + + public Background getBackground() { + return background; + } + + public void setBackground(Background background) { + this.background = background; + } + + public boolean isDefault() { + return isDefault; + } + + public void setDefault(boolean isDefault) { + this.isDefault = isDefault; + } + + public ToolBar getToolBar() { + Widget[] n = new Widget[this.getButtonlist().size()]; + for (int j = 0; j < this.getButtonlist().size(); j++) { + n[j] = this.getButtonlist().get(j).getWidget(); + } + ToolBar toolBar = new ToolBar(n); + toolBar.setBackground(this.background); + toolBar.setDefault(this.isDefault); + return toolBar; + } +} diff --git a/designer_form/src/com/fr/design/mainframe/FToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FToolBarButton.java new file mode 100644 index 0000000000..c65b31757d --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FToolBarButton.java @@ -0,0 +1,159 @@ +package com.fr.design.mainframe; + +import com.fr.base.BaseUtils; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.form.ui.Widget; +import com.fr.form.ui.WidgetManager; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; + +/** + * Created by harry on 2017-3-2. + */ +public class FToolBarButton extends UIButton implements MouseListener { + private Widget widget; + private WidgetOption no; + + public FToolBarButton(Icon icon, Widget widget) { + this(null, icon, widget); + } + + public FToolBarButton(String text, Icon icon, Widget widget) { + super(text, icon); + this.widget = widget; + if (widget instanceof com.fr.form.ui.Button) { + com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; + String iconName = button.getIconName(); + if (StringUtils.isNotEmpty(iconName)) { + Image iimage = WidgetManager.getProviderInstance().getIconManager().getIconImage(iconName); + if (iimage != null) { + setIcon(new ImageIcon(iimage)); + } + } + } + this.addMouseListener(this); + setMargin(new Insets(0, 0, 0, 0)); + } + + + /** + * 改变按钮的权限细粒度状态 + * + * @param selectedRole 选择的角色 + * @param isVisible 是否可见 + */ + public void changeAuthorityState(String selectedRole, boolean isVisible) { + this.widget.changeOnlyVisibleAuthorityState(selectedRole, isVisible); + } + + /** + * 是都做过权限细粒度 + * + * @param role 选择的角色 + * @return 若是对应的该角色做过权限细粒度,则返回true + */ + public boolean isDoneAuthorityEdited(String role) { + return this.widget.isDoneVisibleAuthority(role); + } + + public Widget getWidget() { + return this.widget; + } + + + public void setWidget(Widget widget) { + this.widget = widget; + } + + public WidgetOption getNameOption() { + return this.no; + } + + public void setNameOption(WidgetOption no) { + this.no = no; + } + + + protected void paintBorder(Graphics g) { + this.setBorderType(UIButton.NORMAL_BORDER); + super.paintBorder(g); + } + + /** + * 处理鼠标点击事件 + * + * @param e 鼠标点击事件 + */ + public void mouseClicked(MouseEvent e) { + if (BaseUtils.isAuthorityEditing()) { + auhtorityMouseAction(); + return; + } + if (e.getClickCount() >= 2) { + if (this.getParent() instanceof FToolBarPane) { + final FToolBarPane tb = (FToolBarPane) this.getParent(); + final FEditToolBar etb = new FEditToolBar(); + etb.populate(tb.getFToolBar(), this); + BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); + dialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + tb.setFToolBar(etb.update()); + } + }); + dialog.setVisible(true); + } + } + } + + + private void auhtorityMouseAction() { + if (this.getParent() instanceof FToolBarPane && this.isEnabled()) { + this.setSelected(!this.isSelected()); + + } + + } + + /** + * 鼠标进入事件 + * + * @param e 鼠标进入事件 + */ + public void mouseEntered(MouseEvent e) { + + } + + /** + * 鼠标退出事件 + * + * @param e 鼠标退出事件 + */ + public void mouseExited(MouseEvent e) { + + } + + /** + * 鼠标按下事件 + * + * @param e 鼠标事件 + */ + public void mousePressed(MouseEvent e) { + + } + + /** + * 鼠标释放事件 + * + * @param e 鼠标事件 + */ + public void mouseReleased(MouseEvent e) { + + } +} diff --git a/designer_form/src/com/fr/design/mainframe/FToolBarPane.java b/designer_form/src/com/fr/design/mainframe/FToolBarPane.java new file mode 100644 index 0000000000..f58651bde7 --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FToolBarPane.java @@ -0,0 +1,233 @@ +package com.fr.design.mainframe; + +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.form.ui.ToolBar; +import com.fr.form.ui.Widget; + +import javax.swing.*; +import java.awt.*; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.UnsupportedFlavorException; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.List; + +/** + * Created by harry on 2017-3-2. + */ +public class FToolBarPane extends BasicBeanPane { + + private FToolBar ftoolbar = new FToolBar(); + + public FToolBarPane() { + super(); + this.initComponent(); + } + + + /** + * 添加鼠标监听 + * + * @param mouselistener 鼠标监听 + */ + public void addAuthorityListener(MouseListener mouselistener) { + List list = ftoolbar.getButtonlist(); + for (int i = 0; i < list.size(); i++) { + list.get(i).addMouseListener(mouselistener); + } + } + + public FToolBarPane(FToolBarButton button) { + super(); + this.initComponent(); + this.add(button); + } + + /** + * 初始化组件 + */ + public void initComponent() { + this.addMouseListener(listener); + this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); + this.setTransferHandler(new ToolBarHandler(TransferHandler.COPY)); + this.setBorder(BorderFactory.createTitledBorder("")); + } + + /** + * 删除鼠标事件 + */ + public void removeDefaultMouseListener() { + this.removeMouseListener(listener); + } + + @Override + protected String title4PopupWindow() { + return "Toolbar"; + } + + public void setSelectedButton(FToolBarButton button) { + this.ftoolbar.addButton(button); + } + + /** + * 添加组件 + * + * @param comp 组件 + * + * @return 被添加的组件 + */ + public Component add(Component comp) { + if (comp instanceof FToolBarButton) { + this.ftoolbar.addButton((FToolBarButton) comp); + } + return super.add(comp); + } + + private Component addComp(Component comp) { + return super.add(comp); + } + + + public void removeButtonList() { + this.ftoolbar.clearButton(); + } + + protected void setFToolBar(FToolBar ftoolbar) { + if (ftoolbar == null) { + ftoolbar = new FToolBar(); + } + this.ftoolbar = ftoolbar; + this.setToolBar(this.ftoolbar.getButtonlist()); + } + + public List getToolBarButtons() { + return ftoolbar.getButtonlist(); + } + + protected FToolBar getFToolBar() { + return this.ftoolbar; + } + + public boolean isEmpty() { + return this.ftoolbar.getButtonlist().size() <= 0; + } + + private void setToolBar(List list) { + if (list == null || list.size() < 0) { + return; + } + this.removeAll(); + for (int i = 0; i < list.size(); i++) { + this.addComp(list.get(i)); + } + this.validate(); + this.repaint(); + + } + + @Override + public void populateBean(ToolBar toolbar) { + this.removeAll(); + this.getFToolBar().clearButton(); + for (int j = 0; j < toolbar.getWidgetSize(); j++) { + Widget widget = toolbar.getWidget(j); + WidgetOption no = WidgetOption.getToolBarButton(widget.getClass()); + if (no == null){ + //如果装了什么插件, 放到了工具栏上, 后来删除了插件, 模板里还存着之前的控件 + continue; + } + + FToolBarButton button = new FToolBarButton(no.optionIcon(), widget); + button.setNameOption(no); + this.add(button); + this.validate(); + this.repaint(); + } + this.getFToolBar().setBackground(toolbar.getBackground()); + this.getFToolBar().setDefault(toolbar.isDefault()); + } + + @Override + public ToolBar updateBean() { + return this.ftoolbar.getToolBar(); + } + + MouseListener listener = new MouseAdapter() { + @Override + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) { + final FEditToolBar tb = new FEditToolBar(); + tb.populate(getFToolBar()); + BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FToolBarPane.this)); + dialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + FToolBarPane.this.setFToolBar(tb.update()); + } + }); + dialog.setVisible(true); + } + } + }; + + + /* + * 拖拽属性设置 + */ + private class ToolBarHandler extends TransferHandler { + private int action; + + public ToolBarHandler(int action) { + this.action = action; + } + + + @Override + public boolean canImport(TransferHandler.TransferSupport support) { + if (!support.isDrop()) { + return false; + } + + if (!support.isDataFlavorSupported(DataFlavor.stringFlavor)) { + return false; + } + + boolean actionSupported = (action & support.getSourceDropActions()) == action; + if (actionSupported) { + support.setDropAction(action); + return true; + } + + return false; + } + + @Override + public boolean importData(TransferHandler.TransferSupport support) { + if (!canImport(support)) { + return false; + } + WidgetOption data; + try { + data = (WidgetOption) support.getTransferable().getTransferData(DataFlavor.stringFlavor); + } catch (UnsupportedFlavorException e) { + return false; + } catch (java.io.IOException e) { + return false; + } + + Widget widget = data.createWidget(); + FToolBarButton btn = new FToolBarButton(data.optionIcon(), widget); + btn.setNameOption(data); + FToolBarPane.this.add(btn); + FToolBarPane.this.validate(); + FToolBarPane.this.repaint(); + return true; + } + + } +} diff --git a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java new file mode 100644 index 0000000000..e94abdc999 --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java @@ -0,0 +1,54 @@ +package com.fr.design.mainframe; + +import com.fr.base.BaseUtils; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.core.WidgetOptionFactory; +import com.fr.form.ui.CustomToolBarButton; +import com.fr.form.web.button.ExcelO; +import com.fr.form.web.button.ExcelP; +import com.fr.form.web.button.Export; +import com.fr.form.web.button.page.*; +import com.fr.general.Inter; + +/** + * Created by harry on 2017-3-3. + */ +public class FormWebWidgetConstants { + + private FormWebWidgetConstants() { + } + + public static WidgetOption[] getFormECToolBarInstance() { + return new WidgetOption[]{FIRST, PREVIOUS, PAGENAVI, NEXT, LAST, EXPORT, EXCELP, EXCELO, CUSTOM_BUTTON}; + } + + // 当前页/总页数 + public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}), + BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); + // 首页 + public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), BaseUtils.readIcon("/com/fr/web/images/first.png"), + First.class); + // 末页 + public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), BaseUtils.readIcon("/com/fr/web/images/last.png"), + Last.class); + // 前一页 + public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"), + BaseUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); + // 后一页 + public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), BaseUtils.readIcon("/com/fr/web/images/next.png"), + Next.class); + + // 导出成Excel 分页导出 + public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}), + BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); + // 导出成Excel 原样导出 + public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}), + BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); + // 导出 + public static final WidgetOption EXPORT = WidgetOptionFactory + .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class); + + public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory + .createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class); + +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java new file mode 100644 index 0000000000..e7bf4662fa --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java @@ -0,0 +1,57 @@ +package com.fr.design.mainframe.widget.accessibles; + +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.mainframe.FormWebWidgetConstants; +import com.fr.design.mainframe.widget.editors.ECToolBarPane; +import com.fr.design.mainframe.widget.wrappers.ECToolBarWrapper; +import com.fr.form.web.FToolBarManager; +import com.fr.stable.ArrayUtils; + +import javax.swing.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * Created by harry on 2017-2-23. + */ +public class AccessibleECToolBarEditor extends UneditableAccessibleEditor { + private ECToolBarPane pane; + + public AccessibleECToolBarEditor() { + super(new ECToolBarWrapper()); + } + + @Override + protected void showEditorPane() { + if (pane == null) { + pane = new ECToolBarPane(); + pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance()); + } + BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { + + @Override + public void doOk() { + setValue(pane.updateBean()); + fireStateChanged(); + } + }); + FToolBarManager[] managers = (FToolBarManager[]) getValue(); + pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers)); + pane.populateBean((FToolBarManager[]) getValue()); + dlg.setVisible(true); + } + + private FToolBarManager getDefaultToolBarManager() { + return FToolBarManager.createDefaultToolBar(); + } + + private WidgetOption[] getToolBarInstance() { + List defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormECToolBarInstance()); + List options = new ArrayList(); + options.addAll(defaultOptions); + return options.toArray(new WidgetOption[options.size()]); + } +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java new file mode 100644 index 0000000000..eea19ced7e --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java @@ -0,0 +1,13 @@ +package com.fr.design.mainframe.widget.editors; + +import com.fr.design.mainframe.widget.accessibles.AccessibleECToolBarEditor; +import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; + +/** + * Created by harry on 2017-2-23. + */ +public class ECToolBarEditor extends AccessiblePropertyEditor { + public ECToolBarEditor() { + super(new AccessibleECToolBarEditor()); + } +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java new file mode 100644 index 0000000000..ea2bbe7a4b --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java @@ -0,0 +1,304 @@ +package com.fr.design.mainframe.widget.editors; + +import com.fr.base.BaseUtils; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.core.WidgetOption; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FSettingToolBar; +import com.fr.design.mainframe.FToolBarButton; +import com.fr.design.mainframe.FToolBarPane; +import com.fr.form.ui.Widget; +import com.fr.form.web.FLocation; +import com.fr.form.web.FToolBarManager; +import com.fr.general.Inter; +import com.fr.stable.ArrayUtils; +import com.fr.stable.Constants; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.DefaultTableModel; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.image.ImageObserver; +import java.util.*; +import java.util.List; + +/** + * Created by harry on 2017-2-23. + */ +public class ECToolBarPane extends BasicBeanPane { + private static final int COLUMN = 2; + private int row = 6; + private DefaultTableModel toolbarButtonTableModel; + private JTable layoutTable; + private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏 + + private FToolBarPane northToolBar; + private FToolBarPane southToolBar; + private FToolBarManager defaultToolBar; + + + public ECToolBarPane() { + toolbarButtonTableModel = new TableModel(row ,COLUMN); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane(); + UIButton defaultButton = new UIButton(Inter.getLocText("FR-Designer_Restore_Default")); + // 恢复默认按钮 + defaultButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + northToolBar.removeButtonList(); + northToolBar.removeAll(); + southToolBar.removeButtonList(); + southToolBar.removeAll(); + if (defaultToolBar == null) { + return; + } + FToolBarManager toolBarManager = defaultToolBar; + toolBarManager.setToolBarLocation(FLocation.createTopEmbedLocation()); + FToolBarManager[] tbm = new FToolBarManager[] { toolBarManager }; + populateBean(tbm); + ECToolBarPane.this.repaint(); + } + }); + + north.add(isUseToolBarCheckBox, BorderLayout.WEST); + JPanel aa = FRGUIPaneFactory.createRightFlowInnerContainer_S_Pane(); + aa.add(defaultButton); + north.add(aa, BorderLayout.CENTER); + this.add(north, BorderLayout.NORTH); + + northToolBar = new FToolBarPane(); + northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); + northToolBar.setBackground(Color.lightGray); + + UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); + topButton.setBorder(null); + topButton.setOpaque(false); + topButton.setContentAreaFilled(false); + topButton.setFocusPainted(false); + topButton.setRequestFocusEnabled(false); + topButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (isSelectedtable()) { + WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); + Widget widget = no.createWidget(); + FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + tb.setNameOption(no); + northToolBar.add(tb); + northToolBar.validate(); + northToolBar.repaint(); + } else { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_ChooseOneButton")); + } + } + }); + + UIButton downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); + downButton.setBorder(null); + downButton.setMargin(null); + downButton.setOpaque(false); + downButton.setContentAreaFilled(false); + downButton.setFocusPainted(false); + downButton.setRequestFocusEnabled(false); + downButton.addActionListener(new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (isSelectedtable()) { + WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); + Widget widget = no.createWidget(); + FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + tb.setNameOption(no); + southToolBar.add(tb); + southToolBar.validate(); + southToolBar.repaint(); + } else { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Designer_ChooseOneButton")); + } + } + }); + + initLayoutTable(); + + JPanel center = FRGUIPaneFactory.createBorderLayout_S_Pane(); + center.setBackground(Color.white); + center.add(topButton, BorderLayout.NORTH); + JPanel small = FRGUIPaneFactory.createBorderLayout_S_Pane(); + small.setBackground(Color.white); + small.add(new UILabel(StringUtils.BLANK), BorderLayout.NORTH); + small.add(layoutTable, BorderLayout.CENTER); + center.add(small, BorderLayout.CENTER); + center.add(downButton, BorderLayout.SOUTH); + southToolBar = new FToolBarPane(); + southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); + southToolBar.setBackground(Color.lightGray); + JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + FSettingToolBar top = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar); + northContentPane.add(top, BorderLayout.EAST); + northContentPane.add(northToolBar, BorderLayout.CENTER); + northContentPane.setBackground(Color.lightGray); + + JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + FSettingToolBar bottom = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar); + southContentPane.add(bottom, BorderLayout.EAST); + southContentPane.add(southToolBar, BorderLayout.CENTER); + southContentPane.setBackground(Color.lightGray); + + movePane.add(northContentPane, BorderLayout.NORTH); + movePane.add(center, BorderLayout.CENTER); + movePane.add(southContentPane, BorderLayout.SOUTH); + + this.add(new JScrollPane(movePane), BorderLayout.CENTER); + + isUseToolBarCheckBox.setSelected(false); + } + + private void initLayoutTable() { + layoutTable = new JTable(toolbarButtonTableModel); + layoutTable.setDefaultRenderer(Object.class, tableRenderer); + layoutTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); + layoutTable.setColumnSelectionAllowed(false); + layoutTable.setRowSelectionAllowed(false); + layoutTable.setBackground(Color.white); + int columnWidth = Integer.parseInt(Inter.getLocText("FR-Designer_LayoutTable_Column_Width")); + for (int i = 0; i < layoutTable.getColumnModel().getColumnCount(); i++) { + layoutTable.getColumnModel().getColumn(i).setPreferredWidth(columnWidth); + } + layoutTable.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) { + WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); + Widget widget = no.createWidget(); + FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + tb.setNameOption(no); + northToolBar.add(tb); + northToolBar.validate(); + northToolBar.repaint(); + } + } + }); + } + + private boolean isSelectedtable() { + for (int i = 0; i < layoutTable.getColumnCount(); i++) { + if (layoutTable.isColumnSelected(i)) { + return true; + } + } + return false; + } + + /** + * 是否被选中 + * @return 同上 + */ + public boolean isUseToolbar() { + return this.isUseToolBarCheckBox.isSelected(); + } + + public void setDefaultToolBar(FToolBarManager defaultToolBar, WidgetOption[] buttonArray) { + this.defaultToolBar = defaultToolBar; + if (buttonArray != null) { + for (int i = 0; i < buttonArray.length; i++) { + toolbarButtonTableModel.setValueAt(buttonArray[i], i % row, i / row); + } + } + + } + + DefaultTableCellRenderer tableRenderer = new DefaultTableCellRenderer() { + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { + super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + + if (value instanceof WidgetOption) { + WidgetOption nameOption = (WidgetOption)value; + this.setText(nameOption.optionName()); + + Icon icon = nameOption.optionIcon(); + if (icon != null) { + this.setIcon(icon); + } + } + if (value == null) { + this.setText(StringUtils.EMPTY); + this.setIcon(null); + } + return this; + } + }; + + @Override + protected String title4PopupWindow() { + return Inter.getLocText(new String[]{"Form-EC_toolbar", "Set"}); + } + + public void setCheckBoxSelected(boolean b) { + this.isUseToolBarCheckBox.setSelected(b); + } + + @Override + public void populateBean(FToolBarManager[] toolBarManager) { + if (ArrayUtils.isEmpty(toolBarManager)) { + defaultToolBar.setToolBarLocation(FLocation.createTopEmbedLocation()); + toolBarManager = new FToolBarManager[] { defaultToolBar }; + } + if (ArrayUtils.isEmpty(toolBarManager)) { + return; + } + for (int i = 0; i < toolBarManager.length; i++) { + FLocation location = toolBarManager[i].getToolBarLocation(); + if (location instanceof FLocation.Embed) { + if (((FLocation.Embed)location).getPosition() == Constants.TOP) { + northToolBar.populateBean(toolBarManager[i].getToolBar()); + } else if (((FLocation.Embed)location).getPosition() == Constants.BOTTOM) { + southToolBar.populateBean(toolBarManager[i].getToolBar()); + } + } + } + } + + @Override + public FToolBarManager[] updateBean() { + if(!isUseToolbar()){ + return new FToolBarManager[0]; + } + List toolBarManagerList = new ArrayList(); + if (!northToolBar.isEmpty()) { + FToolBarManager north = new FToolBarManager(); + north.setToolBar(northToolBar.updateBean()); + north.setToolBarLocation(FLocation.createTopEmbedLocation()); + toolBarManagerList.add(north); + } + + if (!southToolBar.isEmpty()) { + FToolBarManager south = new FToolBarManager(); + south.setToolBar(southToolBar.updateBean()); + south.setToolBarLocation(FLocation.createBottomEmbedLocation()); + toolBarManagerList.add(south); + } + return toolBarManagerList.toArray(new FToolBarManager[toolBarManagerList.size()]); + } + + private class TableModel extends DefaultTableModel { + public TableModel(int i, int j) { + super(i, j); + } + + // 禁止jtable的双击编辑功能 + public boolean isCellEditable(int row, int column) { + return false; + } + } +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java b/designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java new file mode 100644 index 0000000000..5faf543483 --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java @@ -0,0 +1,34 @@ +package com.fr.design.mainframe.widget.wrappers; + +import com.fr.design.Exception.ValidationException; +import com.fr.design.designer.properties.Decoder; +import com.fr.design.designer.properties.Encoder; +import com.fr.form.web.FToolBarManager; +import com.fr.general.Inter; + +/** + * Created by harry on 2017-3-1. + */ +public class ECToolBarWrapper implements Encoder, Decoder { + @Override + public Object decode(String txt) { + return null; + } + + @Override + public void validate(String txt) throws ValidationException { + + } + + @Override + public String encode(Object v) { + if (v == null) { + return null; + } + FToolBarManager[] toolBarManager = (FToolBarManager[])v; + if (toolBarManager.length != 0) { + return Inter.getLocText("FR-Designer_Open"); + } + return Inter.getLocText("FR-Designer_Close"); + } +} From 2a3fa77d2bca97524077af7d374aa13b8f543cdf Mon Sep 17 00:00:00 2001 From: frharry Date: Wed, 8 Mar 2017 19:33:42 +0800 Subject: [PATCH 19/39] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 2 ++ .../design/locale/designer_en_US.properties | 2 ++ .../design/locale/designer_ja_JP.properties | 2 ++ .../design/locale/designer_ko_KR.properties | 2 ++ .../design/locale/designer_zh_CN.properties | 2 ++ .../design/locale/designer_zh_TW.properties | 2 ++ .../fr/design/mainframe/FSettingToolBar.java | 4 ++-- .../fr/design/mainframe/FToolBarButton.java | 21 +++++++++++++++---- 8 files changed, 31 insertions(+), 6 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 0a66c326e8..3d488421b9 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary= FR-Designer_Data-confusion= FR-Designer_Data_Type= FR-Designer_Double_Click_Edit_OR_Clear= +FR-Designer_Edit_Button_ToolBar= FR-Designer_Email= FR-Designer_Enabled= FR-Designer_End-Date= @@ -161,6 +162,7 @@ FR-Designer_Refresh_Parameter_In_SQL= FR-Designer_Reg_Expressions= FR-Designer_Reg_Max_Length= FR-Designer_Reg_Min_Length= +FR-Designer_Remove_Button_ToolBar= FR-Designer_ReportColumns-Columns= FR-Designer_Return-Date= FR-Designer_RichText= diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index b0acea3ab4..6652599b9e 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=Data Dictionary FR-Designer_Data-confusion=Data Confusion FR-Designer_Data_Type=Data type FR-Designer_Double_Click_Edit_OR_Clear=Double Click to Edit or Clear +FR-Designer_Edit_Button_ToolBar=Edit Button ToolBar FR-Designer_Email=Mail FR-Designer_Enabled=Enabled FR-Designer_End-Date=End Date @@ -163,6 +164,7 @@ FR-Designer_Refresh_Parameter_In_SQL=Whether to refresh parameters in the SQL FR-Designer_Reg_Expressions=Regular expressions FR-Designer_Reg_Max_Length=max length FR-Designer_Reg_Min_Length=min length +FR-Designer_Remove_Button_ToolBar=Remove Button ToolBar FR-Designer_ReportColumns-Columns=Multi-columns/lines FR-Designer_Return-Date=Return Date FR-Designer_RichText=Insert Rich Text diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index d86d0a164c..a6051651ac 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u30C7\u30FC\u30BF\u5B57\u5178 FR-Designer_Data-confusion=\u30C7\u30FC\u30BF\u6DF7\u4EA4 FR-Designer_Data_Type=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 FR-Designer_Double_Click_Edit_OR_Clear=\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u7DE8\u96C6\u307E\u305F\u306F\u30AF\u30EA\u30A2\u3059\u308B +FR-Designer_Edit_Button_ToolBar=\u30DC\u30BF\u30F3\u306B\u3042\u308B\u30C4\u30FC\u30EB\u6B04\u7DE8\u96C6 FR-Designer_Email=\u30E1\u30FC\u30EB FR-Designer_Enabled=\u4F7F\u7528\u53EF\u80FD FR-Designer_End-Date=\u7D42\u4E86\u65E5\u671F @@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=SQL\u4E2D\u306E\u30D1\u30E9\u30E1\u30FC\u30 FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u73FE\u5F0F FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u3055 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u3055 +FR-Designer_Remove_Button_ToolBar=\u30DC\u30BF\u30F3\u304C\u3042\u308B\u30C4\u30FC\u30EB\u30D0\u30FC\u3092\u30EA\u30E0\u30FC\u30D6 FR-Designer_ReportColumns-Columns=\u6BB5\u7D44\u307F FR-Designer_Return-Date=\u65E5\u671F\u306B\u623B\u308B FR-Designer_RichText=\u30EA\u30C3\u30C1\u6587\u66F8\u633F\u5165 diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index dfb5ec78ff..388919ddc2 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\uB370\uC774\uD130\uC0AC\uC804 FR-Designer_Data-confusion=\uB370\uC774\uD130\uD63C\uD569 FR-Designer_Data_Type=\uB370\uC774\uD130\uC720\uD615 FR-Designer_Double_Click_Edit_OR_Clear=\uB354\uBE14\uD074\uB9AD\uD558\uC5EC\uD3B8\uC9D1\uB610\uB294\uD074\uB9AC\uC5B4\uC2E4\uD589 +FR-Designer_Edit_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uD3B8\uC9D1 FR-Designer_Email=\uBA54\uC77C FR-Designer_Enabled=\uC0AC\uC6A9\uAC00\uB2A5 FR-Designer_End-Date=\uC885\uB8CC\uB0A0\uC9DC @@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=SQL\uC758\uB9E4\uAC1C\uBCC0\uC218\uB97C\uC0 FR-Designer_Reg_Expressions=\uC815\uADDC\uD45C\uD604\uC2DD FR-Designer_Reg_Max_Length=\uCD5C\uB300\uAE38\uC774 FR-Designer_Reg_Min_Length=\uCD5C\uC18C\uAE38\uC774 +FR-Designer_Remove_Button_ToolBar=\uD0A4\uAC00\uC788\uB294\uD234\uBC14\uC81C\uAC70 FR-Designer_ReportColumns-Columns=\uC140\uB098\uB204\uAE30 FR-Designer_Return-Date=\uB0A0\uC9DC\uB3CC\uC544\uAC00\uAE30 FR-Designer_RichText=\uB9AC\uCE58\uD14D\uC2A4\uD2B8\uBC15\uC2A4\uC0BD\uC785 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index bdb97b094e..c114e3a41e 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u6570\u636E\u5B57\u5178 FR-Designer_Data-confusion=\u6570\u636E\u6DF7\u6DC6 FR-Designer_Data_Type=\u6570\u636E\u7C7B\u578B FR-Designer_Double_Click_Edit_OR_Clear=\u53CC\u51FB\u8FDB\u884C\u7F16\u8F91\u6216\u6E05\u9664 +FR-Designer_Edit_Button_ToolBar=\u7F16\u8F91\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F FR-Designer_Email=\u90AE\u4EF6 FR-Designer_Enabled=\u53EF\u7528 FR-Designer_End-Date=\u7ED3\u675F\u65E5\u671F @@ -163,6 +164,7 @@ FR-Designer_Refresh_Parameter_In_SQL=\u662F\u5426\u5237\u65B0SQL\u4E2D\u7684\u53 FR-Designer_Reg_Expressions=\u6B63\u5219\u8868\u8FBE\u5F0F FR-Designer_Reg_Max_Length=\u6700\u5927\u957F\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u957F\u5EA6 +FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u94AE\u6240\u5728\u5DE5\u5177\u680F FR-Designer_ReportColumns-Columns=\u5206\u680F FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_RichText=\u63D2\u5165\u5BCC\u6587\u672C diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 3acd7487c2..fc7c2046dc 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -91,6 +91,7 @@ FR-Designer_DS-Dictionary=\u8CC7\u6599\u5B57\u5178 FR-Designer_Data-confusion=\u8CC7\u6599\u6DF7\u6DC6 FR-Designer_Data_Type=\u8CC7\u6599\u985E\u578B FR-Designer_Double_Click_Edit_OR_Clear=\u96D9\u64CA\u9032\u884C\u7DE8\u8F2F\u6216\u6E05\u9664 +FR-Designer_Edit_Button_ToolBar=\u7DE8\u8F2F\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04 FR-Designer_Email=\u90F5\u4EF6 FR-Designer_Enabled=\u53EF\u7528 FR-Designer_End-Date=\u7D50\u675F\u65E5\u671F @@ -162,6 +163,7 @@ FR-Designer_Refresh_Parameter_In_SQL=\u5728SQL\u4E2D\u91CD\u65B0\u6574\u7406\u76 FR-Designer_Reg_Expressions=\u6B63\u5247\u8868\u9054\u5F0F FR-Designer_Reg_Max_Length=\u6700\u5927\u9577\u5EA6 FR-Designer_Reg_Min_Length=\u6700\u5C0F\u9577\u5EA6 +FR-Designer_Remove_Button_ToolBar=\u79FB\u9664\u6309\u9215\u6240\u5728\u5DE5\u5177\u6B04 FR-Designer_ReportColumns-Columns=\u5831\u8868\u6B04\u4F4D FR-Designer_Return-Date=\u8FD4\u56DE\u65E5\u671F FR-Designer_RichText= RTF diff --git a/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java b/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java index 00f9dae612..f059c9dff1 100644 --- a/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java @@ -29,10 +29,10 @@ public class FSettingToolBar extends JPanel { this.add(new UILabel(name)); this.toolBarPane = toolBarPane; setButton = GUICoreUtils.createTransparentButton(setIcon, setIcon, setIcon); - setButton.setToolTipText(Inter.getLocText("Edit_Button_ToolBar")); + setButton.setToolTipText(Inter.getLocText("FR-Designer_Edit_Button_ToolBar")); setButton.setAction(new SetAction()); delButton = GUICoreUtils.createTransparentButton(delIcon, delIcon, delIcon); - delButton.setToolTipText(Inter.getLocText("Remove_Button_ToolBar")); + delButton.setToolTipText(Inter.getLocText("FR-Designer_Remove_Button_ToolBar")); delButton.setAction(new DelAction()); this.add(setButton); this.add(delButton); diff --git a/designer_form/src/com/fr/design/mainframe/FToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FToolBarButton.java index c65b31757d..339a624bea 100644 --- a/designer_form/src/com/fr/design/mainframe/FToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FToolBarButton.java @@ -1,12 +1,15 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.GraphHelper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.core.WidgetOption; -import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.roleAuthority.ReportAndFSManagePane; +import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetManager; +import com.fr.stable.Constants; import com.fr.stable.StringUtils; import javax.swing.*; @@ -17,7 +20,7 @@ import java.awt.event.MouseListener; /** * Created by harry on 2017-3-2. */ -public class FToolBarButton extends UIButton implements MouseListener { +public class FToolBarButton extends JButton implements MouseListener { private Widget widget; private WidgetOption no; @@ -27,6 +30,7 @@ public class FToolBarButton extends UIButton implements MouseListener { public FToolBarButton(String text, Icon icon, Widget widget) { super(text, icon); + init(); this.widget = widget; if (widget instanceof com.fr.form.ui.Button) { com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; @@ -42,6 +46,11 @@ public class FToolBarButton extends UIButton implements MouseListener { setMargin(new Insets(0, 0, 0, 0)); } + private void init() { + setBackground(null); + setRolloverEnabled(true); + } + /** * 改变按钮的权限细粒度状态 @@ -82,8 +91,12 @@ public class FToolBarButton extends UIButton implements MouseListener { protected void paintBorder(Graphics g) { - this.setBorderType(UIButton.NORMAL_BORDER); - super.paintBorder(g); + paintBorder(g, this); + } + + protected void paintBorder(Graphics g, FToolBarButton b) { + String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); + GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), true, Constants.NULL, b.isDoneAuthorityEdited(selectedRoles)); } /** From 346e7337d9cf981624c2b5886c47e7ef753b7021 Mon Sep 17 00:00:00 2001 From: frharry Date: Wed, 8 Mar 2017 20:40:08 +0800 Subject: [PATCH 20/39] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XElementCase.java | 7 +- ...FEditToolBar.java => FormEditToolBar.java} | 40 +++++----- ...ngToolBar.java => FormSettingToolBar.java} | 8 +- .../{FToolBar.java => FormToolBar.java} | 14 ++-- ...lBarButton.java => FormToolBarButton.java} | 17 ++--- ...FToolBarPane.java => FormToolBarPane.java} | 42 +++++------ .../mainframe/FormWebWidgetConstants.java | 2 +- ...> AccessibleElementCaseToolBarEditor.java} | 26 +++---- .../widget/editors/ECToolBarEditor.java | 13 ---- .../editors/ElementCaseToolBarEditor.java | 13 ++++ ...rPane.java => ElementCaseToolBarPane.java} | 74 +++++++++---------- ...er.java => ElementCaseToolBarWrapper.java} | 6 +- 12 files changed, 129 insertions(+), 133 deletions(-) rename designer_form/src/com/fr/design/mainframe/{FEditToolBar.java => FormEditToolBar.java} (92%) rename designer_form/src/com/fr/design/mainframe/{FSettingToolBar.java => FormSettingToolBar.java} (92%) rename designer_form/src/com/fr/design/mainframe/{FToolBar.java => FormToolBar.java} (76%) rename designer_form/src/com/fr/design/mainframe/{FToolBarButton.java => FormToolBarButton.java} (87%) rename designer_form/src/com/fr/design/mainframe/{FToolBarPane.java => FormToolBarPane.java} (82%) rename designer_form/src/com/fr/design/mainframe/widget/accessibles/{AccessibleECToolBarEditor.java => AccessibleElementCaseToolBarEditor.java} (62%) delete mode 100644 designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java create mode 100644 designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java rename designer_form/src/com/fr/design/mainframe/widget/editors/{ECToolBarPane.java => ElementCaseToolBarPane.java} (80%) rename designer_form/src/com/fr/design/mainframe/widget/wrappers/{ECToolBarWrapper.java => ElementCaseToolBarWrapper.java} (79%) diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java index 584b630f8f..c7cd3b4934 100644 --- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java +++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java @@ -10,12 +10,9 @@ import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.impl.AbstractFormElementCaseEditorProvider; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.*; -import com.fr.design.mainframe.widget.editors.BooleanEditor; -import com.fr.design.mainframe.widget.editors.ECToolBarEditor; +import com.fr.design.mainframe.widget.editors.ElementCaseToolBarEditor; import com.fr.design.mainframe.widget.editors.PaddingMarginEditor; import com.fr.design.mainframe.widget.editors.WLayoutBorderStyleEditor; -import com.fr.design.mainframe.widget.renderer.LayoutBorderStyleRenderer; -import com.fr.design.mainframe.widget.renderer.PaddingMarginCellRenderer; import com.fr.form.FormElementCaseContainerProvider; import com.fr.form.FormElementCaseProvider; import com.fr.form.FormProvider; @@ -105,7 +102,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme new CRPropertyDescriptor("margin", this.data.getClass()).setEditorClass(PaddingMarginEditor.class) .setI18NName(Inter.getLocText("FR-Layout_Padding")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), - new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ECToolBarEditor.class) + new CRPropertyDescriptor("ToolBars", this.data.getClass()).setEditorClass(ElementCaseToolBarEditor.class) .setI18NName(Inter.getLocText("Form-EC_toolbar")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") }; diff --git a/designer_form/src/com/fr/design/mainframe/FEditToolBar.java b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java similarity index 92% rename from designer_form/src/com/fr/design/mainframe/FEditToolBar.java rename to designer_form/src/com/fr/design/mainframe/FormEditToolBar.java index 4ca4ab9c1a..d0e217f277 100644 --- a/designer_form/src/com/fr/design/mainframe/FEditToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java @@ -36,14 +36,14 @@ import java.util.*; /** * Created by harry on 2017-3-2. */ -public class FEditToolBar extends BasicPane { +public class FormEditToolBar extends BasicPane { private JList list; private DefaultListModel listModel; private JPanel right; private CardLayout card; private ButtonPane bp; - private FToolBarButton lastButton; + private FormToolBarButton lastButton; private Background background = null; private UICheckBox defaultCheckBox; @@ -52,8 +52,8 @@ public class FEditToolBar extends BasicPane { if (lastButton != null) { lastButton.setWidget(bp.update()); } - if (list.getSelectedValue() instanceof FToolBarButton) { - lastButton = (FToolBarButton) list.getSelectedValue(); + if (list.getSelectedValue() instanceof FormToolBarButton) { + lastButton = (FormToolBarButton) list.getSelectedValue(); if (lastButton.getWidget() instanceof Button) { card.show(right, "button"); bp.populate(lastButton.getWidget()); @@ -73,12 +73,12 @@ public class FEditToolBar extends BasicPane { public void actionPerformed(ActionEvent arg0) { final BackgroundPane backgroundPane = new BackgroundPane(); BasicDialog dialog = backgroundPane.showWindow(DesignerContext.getDesignerFrame()); - backgroundPane.populate(FEditToolBar.this.background); + backgroundPane.populate(FormEditToolBar.this.background); dialog.addDialogActionListener(new DialogActionAdapter() { public void doOk() { - FEditToolBar.this.background = backgroundPane.update(); - if (FEditToolBar.this.background != null) { - FEditToolBar.this.defaultCheckBox.setSelected(false); + FormEditToolBar.this.background = backgroundPane.update(); + if (FormEditToolBar.this.background != null) { + FormEditToolBar.this.defaultCheckBox.setSelected(false); } } }); @@ -86,7 +86,7 @@ public class FEditToolBar extends BasicPane { } }; - public FEditToolBar() { + public FormEditToolBar() { initComponent(); } @@ -138,8 +138,8 @@ public class FEditToolBar extends BasicPane { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - if (value instanceof FToolBarButton) { - FToolBarButton button = (FToolBarButton) value; + if (value instanceof FormToolBarButton) { + FormToolBarButton button = (FormToolBarButton) value; this.setText(button.getNameOption().optionName()); this.setIcon(button.getNameOption().optionIcon()); } @@ -152,11 +152,11 @@ public class FEditToolBar extends BasicPane { return Inter.getLocText("FR-Designer_Edit"); } - public void populate(FToolBar ftoolbar) { + public void populate(FormToolBar ftoolbar) { this.populate(ftoolbar, null); } - public void populate(FToolBar ftoolbar, FToolBarButton button) { + public void populate(FormToolBar ftoolbar, FormToolBarButton button) { if (ftoolbar == null) { return; } @@ -176,11 +176,11 @@ public class FEditToolBar extends BasicPane { this.defaultCheckBox.setSelected(ftoolbar.isDefault() ? true : false); } - public FToolBar update() { + public FormToolBar update() { if (this.list.getSelectedIndex() > -1) { for (int i = 0; i < listModel.getSize(); i++) { this.list.setSelectedIndex(i); - FToolBarButton toolBarButton = (FToolBarButton) this.list.getSelectedValue(); + FormToolBarButton toolBarButton = (FormToolBarButton) this.list.getSelectedValue(); Widget widget = this.bp.update(); toolBarButton.setWidget(widget); if (widget instanceof Button) { @@ -192,11 +192,11 @@ public class FEditToolBar extends BasicPane { } } } - java.util.List list = new ArrayList(); + java.util.List list = new ArrayList(); for (int i = 0; i < listModel.size(); i++) { - list.add((FToolBarButton) listModel.get(i)); + list.add((FormToolBarButton) listModel.get(i)); } - FToolBar ftoolBar = new FToolBar(); + FormToolBar ftoolBar = new FormToolBar(); ftoolBar.setButtonlist(list); ftoolBar.setDefault(this.defaultCheckBox.isSelected()); @@ -284,10 +284,10 @@ public class FEditToolBar extends BasicPane { */ public void actionPerformed(ActionEvent e) { int i = list.getSelectedIndex(); - if (i < 0 || !(listModel.getElementAt(i) instanceof FToolBarButton)) { + if (i < 0 || !(listModel.getElementAt(i) instanceof FormToolBarButton)) { return; } - int val = JOptionPane.showConfirmDialog(FEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION); + int val = JOptionPane.showConfirmDialog(FormEditToolBar.this, Inter.getLocText("FR-Designer_Are_You_Sure_To_Delete_The_Data") + "?", "Message", JOptionPane.YES_NO_OPTION); if (val != JOptionPane.YES_OPTION) { return; } diff --git a/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java similarity index 92% rename from designer_form/src/com/fr/design/mainframe/FSettingToolBar.java rename to designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java index f059c9dff1..2ed8a69842 100644 --- a/designer_form/src/com/fr/design/mainframe/FSettingToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java @@ -16,14 +16,14 @@ import java.awt.event.ActionListener; /** * Created by harry on 2017-3-2. */ -public class FSettingToolBar extends JPanel { +public class FormSettingToolBar extends JPanel { private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private UIButton setButton; private UIButton delButton; - private FToolBarPane toolBarPane; + private FormToolBarPane toolBarPane; - public FSettingToolBar(String name,FToolBarPane toolBarPane) { + public FormSettingToolBar(String name, FormToolBarPane toolBarPane) { super(); this.setBackground(Color.lightGray); this.add(new UILabel(name)); @@ -56,7 +56,7 @@ public class FSettingToolBar extends JPanel { @Override public void actionPerformed(ActionEvent arg0) { - final FEditToolBar tb = new FEditToolBar(); + final FormEditToolBar tb = new FormEditToolBar(); tb.populate(toolBarPane.getFToolBar()); BasicDialog dialog = tb.showWindow(DesignerContext.getDesignerFrame()); dialog.addDialogActionListener(new DialogActionAdapter() { diff --git a/designer_form/src/com/fr/design/mainframe/FToolBar.java b/designer_form/src/com/fr/design/mainframe/FormToolBar.java similarity index 76% rename from designer_form/src/com/fr/design/mainframe/FToolBar.java rename to designer_form/src/com/fr/design/mainframe/FormToolBar.java index 5eb5196800..5a172e5d41 100644 --- a/designer_form/src/com/fr/design/mainframe/FToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBar.java @@ -10,28 +10,28 @@ import java.util.List; /** * Created by harry on 2017-3-2. */ -public class FToolBar { - private List buttonlist = new ArrayList(); +public class FormToolBar { + private List buttonlist = new ArrayList(); private Background background = null; private boolean isDefault = true; - public List getButtonlist() { + public List getButtonlist() { return buttonlist; } - public void setButtonlist(List buttonlist) { + public void setButtonlist(List buttonlist) { if (buttonlist == null || buttonlist.size() < 0) { - this.buttonlist = new ArrayList(); + this.buttonlist = new ArrayList(); } else { this.buttonlist = buttonlist; } } - public void addButton(FToolBarButton toolBarButton) { + public void addButton(FormToolBarButton toolBarButton) { this.buttonlist.add(toolBarButton); } - public void removeButton(FToolBarButton toolBarButton) { + public void removeButton(FormToolBarButton toolBarButton) { this.buttonlist.remove(toolBarButton); } diff --git a/designer_form/src/com/fr/design/mainframe/FToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java similarity index 87% rename from designer_form/src/com/fr/design/mainframe/FToolBarButton.java rename to designer_form/src/com/fr/design/mainframe/FormToolBarButton.java index 339a624bea..a26b8d18f4 100644 --- a/designer_form/src/com/fr/design/mainframe/FToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.base.GraphHelper; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.core.WidgetOption; @@ -20,15 +19,15 @@ import java.awt.event.MouseListener; /** * Created by harry on 2017-3-2. */ -public class FToolBarButton extends JButton implements MouseListener { +public class FormToolBarButton extends JButton implements MouseListener { private Widget widget; private WidgetOption no; - public FToolBarButton(Icon icon, Widget widget) { + public FormToolBarButton(Icon icon, Widget widget) { this(null, icon, widget); } - public FToolBarButton(String text, Icon icon, Widget widget) { + public FormToolBarButton(String text, Icon icon, Widget widget) { super(text, icon); init(); this.widget = widget; @@ -94,7 +93,7 @@ public class FToolBarButton extends JButton implements MouseListener { paintBorder(g, this); } - protected void paintBorder(Graphics g, FToolBarButton b) { + protected void paintBorder(Graphics g, FormToolBarButton b) { String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); GUIPaintUtils.drawBorder((Graphics2D) g, 0, 0, b.getWidth(), b.getHeight(), true, Constants.NULL, b.isDoneAuthorityEdited(selectedRoles)); } @@ -110,9 +109,9 @@ public class FToolBarButton extends JButton implements MouseListener { return; } if (e.getClickCount() >= 2) { - if (this.getParent() instanceof FToolBarPane) { - final FToolBarPane tb = (FToolBarPane) this.getParent(); - final FEditToolBar etb = new FEditToolBar(); + if (this.getParent() instanceof FormToolBarPane) { + final FormToolBarPane tb = (FormToolBarPane) this.getParent(); + final FormEditToolBar etb = new FormEditToolBar(); etb.populate(tb.getFToolBar(), this); BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); dialog.addDialogActionListener(new DialogActionAdapter() { @@ -127,7 +126,7 @@ public class FToolBarButton extends JButton implements MouseListener { private void auhtorityMouseAction() { - if (this.getParent() instanceof FToolBarPane && this.isEnabled()) { + if (this.getParent() instanceof FormToolBarPane && this.isEnabled()) { this.setSelected(!this.isSelected()); } diff --git a/designer_form/src/com/fr/design/mainframe/FToolBarPane.java b/designer_form/src/com/fr/design/mainframe/FormToolBarPane.java similarity index 82% rename from designer_form/src/com/fr/design/mainframe/FToolBarPane.java rename to designer_form/src/com/fr/design/mainframe/FormToolBarPane.java index f58651bde7..e64259b27c 100644 --- a/designer_form/src/com/fr/design/mainframe/FToolBarPane.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarPane.java @@ -20,11 +20,11 @@ import java.util.List; /** * Created by harry on 2017-3-2. */ -public class FToolBarPane extends BasicBeanPane { +public class FormToolBarPane extends BasicBeanPane { - private FToolBar ftoolbar = new FToolBar(); + private FormToolBar ftoolbar = new FormToolBar(); - public FToolBarPane() { + public FormToolBarPane() { super(); this.initComponent(); } @@ -36,13 +36,13 @@ public class FToolBarPane extends BasicBeanPane { * @param mouselistener 鼠标监听 */ public void addAuthorityListener(MouseListener mouselistener) { - List list = ftoolbar.getButtonlist(); + List list = ftoolbar.getButtonlist(); for (int i = 0; i < list.size(); i++) { list.get(i).addMouseListener(mouselistener); } } - public FToolBarPane(FToolBarButton button) { + public FormToolBarPane(FormToolBarButton button) { super(); this.initComponent(); this.add(button); @@ -70,7 +70,7 @@ public class FToolBarPane extends BasicBeanPane { return "Toolbar"; } - public void setSelectedButton(FToolBarButton button) { + public void setSelectedButton(FormToolBarButton button) { this.ftoolbar.addButton(button); } @@ -82,8 +82,8 @@ public class FToolBarPane extends BasicBeanPane { * @return 被添加的组件 */ public Component add(Component comp) { - if (comp instanceof FToolBarButton) { - this.ftoolbar.addButton((FToolBarButton) comp); + if (comp instanceof FormToolBarButton) { + this.ftoolbar.addButton((FormToolBarButton) comp); } return super.add(comp); } @@ -97,19 +97,19 @@ public class FToolBarPane extends BasicBeanPane { this.ftoolbar.clearButton(); } - protected void setFToolBar(FToolBar ftoolbar) { + protected void setFToolBar(FormToolBar ftoolbar) { if (ftoolbar == null) { - ftoolbar = new FToolBar(); + ftoolbar = new FormToolBar(); } this.ftoolbar = ftoolbar; this.setToolBar(this.ftoolbar.getButtonlist()); } - public List getToolBarButtons() { + public List getToolBarButtons() { return ftoolbar.getButtonlist(); } - protected FToolBar getFToolBar() { + protected FormToolBar getFToolBar() { return this.ftoolbar; } @@ -117,7 +117,7 @@ public class FToolBarPane extends BasicBeanPane { return this.ftoolbar.getButtonlist().size() <= 0; } - private void setToolBar(List list) { + private void setToolBar(List list) { if (list == null || list.size() < 0) { return; } @@ -142,7 +142,7 @@ public class FToolBarPane extends BasicBeanPane { continue; } - FToolBarButton button = new FToolBarButton(no.optionIcon(), widget); + FormToolBarButton button = new FormToolBarButton(no.optionIcon(), widget); button.setNameOption(no); this.add(button); this.validate(); @@ -161,13 +161,13 @@ public class FToolBarPane extends BasicBeanPane { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() >= 2 && !SwingUtilities.isRightMouseButton(e)) { - final FEditToolBar tb = new FEditToolBar(); + final FormEditToolBar tb = new FormEditToolBar(); tb.populate(getFToolBar()); - BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FToolBarPane.this)); + BasicDialog dialog = tb.showWindow(SwingUtilities.getWindowAncestor(FormToolBarPane.this)); dialog.addDialogActionListener(new DialogActionAdapter() { @Override public void doOk() { - FToolBarPane.this.setFToolBar(tb.update()); + FormToolBarPane.this.setFToolBar(tb.update()); } }); dialog.setVisible(true); @@ -221,11 +221,11 @@ public class FToolBarPane extends BasicBeanPane { } Widget widget = data.createWidget(); - FToolBarButton btn = new FToolBarButton(data.optionIcon(), widget); + FormToolBarButton btn = new FormToolBarButton(data.optionIcon(), widget); btn.setNameOption(data); - FToolBarPane.this.add(btn); - FToolBarPane.this.validate(); - FToolBarPane.this.repaint(); + FormToolBarPane.this.add(btn); + FormToolBarPane.this.validate(); + FormToolBarPane.this.repaint(); return true; } diff --git a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java index e94abdc999..a84b7523dc 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java +++ b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java @@ -18,7 +18,7 @@ public class FormWebWidgetConstants { private FormWebWidgetConstants() { } - public static WidgetOption[] getFormECToolBarInstance() { + public static WidgetOption[] getFormElementCaseToolBarInstance() { return new WidgetOption[]{FIRST, PREVIOUS, PAGENAVI, NEXT, LAST, EXPORT, EXCELP, EXCELO, CUSTOM_BUTTON}; } diff --git a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java similarity index 62% rename from designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java rename to designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java index e7bf4662fa..1695892ba6 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleECToolBarEditor.java +++ b/designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java @@ -4,9 +4,9 @@ import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.FormWebWidgetConstants; -import com.fr.design.mainframe.widget.editors.ECToolBarPane; -import com.fr.design.mainframe.widget.wrappers.ECToolBarWrapper; -import com.fr.form.web.FToolBarManager; +import com.fr.design.mainframe.widget.editors.ElementCaseToolBarPane; +import com.fr.design.mainframe.widget.wrappers.ElementCaseToolBarWrapper; +import com.fr.form.web.FormToolBarManager; import com.fr.stable.ArrayUtils; import javax.swing.*; @@ -17,17 +17,17 @@ import java.util.List; /** * Created by harry on 2017-2-23. */ -public class AccessibleECToolBarEditor extends UneditableAccessibleEditor { - private ECToolBarPane pane; +public class AccessibleElementCaseToolBarEditor extends UneditableAccessibleEditor { + private ElementCaseToolBarPane pane; - public AccessibleECToolBarEditor() { - super(new ECToolBarWrapper()); + public AccessibleElementCaseToolBarEditor() { + super(new ElementCaseToolBarWrapper()); } @Override protected void showEditorPane() { if (pane == null) { - pane = new ECToolBarPane(); + pane = new ElementCaseToolBarPane(); pane.setDefaultToolBar(getDefaultToolBarManager(), getToolBarInstance()); } BasicDialog dlg = pane.showToolBarWindow(SwingUtilities.getWindowAncestor(this), new DialogActionAdapter() { @@ -38,18 +38,18 @@ public class AccessibleECToolBarEditor extends UneditableAccessibleEditor { fireStateChanged(); } }); - FToolBarManager[] managers = (FToolBarManager[]) getValue(); + FormToolBarManager[] managers = (FormToolBarManager[]) getValue(); pane.setCheckBoxSelected(ArrayUtils.isNotEmpty(managers)); - pane.populateBean((FToolBarManager[]) getValue()); + pane.populateBean((FormToolBarManager[]) getValue()); dlg.setVisible(true); } - private FToolBarManager getDefaultToolBarManager() { - return FToolBarManager.createDefaultToolBar(); + private FormToolBarManager getDefaultToolBarManager() { + return FormToolBarManager.createDefaultToolBar(); } private WidgetOption[] getToolBarInstance() { - List defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormECToolBarInstance()); + List defaultOptions = Arrays.asList(FormWebWidgetConstants.getFormElementCaseToolBarInstance()); List options = new ArrayList(); options.addAll(defaultOptions); return options.toArray(new WidgetOption[options.size()]); diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java deleted file mode 100644 index eea19ced7e..0000000000 --- a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarEditor.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.fr.design.mainframe.widget.editors; - -import com.fr.design.mainframe.widget.accessibles.AccessibleECToolBarEditor; -import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; - -/** - * Created by harry on 2017-2-23. - */ -public class ECToolBarEditor extends AccessiblePropertyEditor { - public ECToolBarEditor() { - super(new AccessibleECToolBarEditor()); - } -} diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java new file mode 100644 index 0000000000..de252c984b --- /dev/null +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarEditor.java @@ -0,0 +1,13 @@ +package com.fr.design.mainframe.widget.editors; + +import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEditor; +import com.fr.design.mainframe.widget.accessibles.AccessiblePropertyEditor; + +/** + * Created by harry on 2017-2-23. + */ +public class ElementCaseToolBarEditor extends AccessiblePropertyEditor { + public ElementCaseToolBarEditor() { + super(new AccessibleElementCaseToolBarEditor()); + } +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java similarity index 80% rename from designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java rename to designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java index ea2bbe7a4b..9e6a904451 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/editors/ECToolBarPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java @@ -8,12 +8,12 @@ import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.FSettingToolBar; -import com.fr.design.mainframe.FToolBarButton; -import com.fr.design.mainframe.FToolBarPane; +import com.fr.design.mainframe.FormSettingToolBar; +import com.fr.design.mainframe.FormToolBarButton; +import com.fr.design.mainframe.FormToolBarPane; import com.fr.form.ui.Widget; -import com.fr.form.web.FLocation; -import com.fr.form.web.FToolBarManager; +import com.fr.form.web.FormToolBarManager; +import com.fr.form.web.Location; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; @@ -34,19 +34,19 @@ import java.util.List; /** * Created by harry on 2017-2-23. */ -public class ECToolBarPane extends BasicBeanPane { +public class ElementCaseToolBarPane extends BasicBeanPane { private static final int COLUMN = 2; private int row = 6; private DefaultTableModel toolbarButtonTableModel; private JTable layoutTable; private UICheckBox isUseToolBarCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Use_ToolBar") + ":"); // 是否使用工具栏 - private FToolBarPane northToolBar; - private FToolBarPane southToolBar; - private FToolBarManager defaultToolBar; + private FormToolBarPane northToolBar; + private FormToolBarPane southToolBar; + private FormToolBarManager defaultToolBar; - public ECToolBarPane() { + public ElementCaseToolBarPane() { toolbarButtonTableModel = new TableModel(row ,COLUMN); this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel north = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -61,11 +61,11 @@ public class ECToolBarPane extends BasicBeanPane { if (defaultToolBar == null) { return; } - FToolBarManager toolBarManager = defaultToolBar; - toolBarManager.setToolBarLocation(FLocation.createTopEmbedLocation()); - FToolBarManager[] tbm = new FToolBarManager[] { toolBarManager }; + FormToolBarManager toolBarManager = defaultToolBar; + toolBarManager.setToolBarLocation(Location.createTopEmbedLocation()); + FormToolBarManager[] tbm = new FormToolBarManager[] { toolBarManager }; populateBean(tbm); - ECToolBarPane.this.repaint(); + ElementCaseToolBarPane.this.repaint(); } }); @@ -75,7 +75,7 @@ public class ECToolBarPane extends BasicBeanPane { north.add(aa, BorderLayout.CENTER); this.add(north, BorderLayout.NORTH); - northToolBar = new FToolBarPane(); + northToolBar = new FormToolBarPane(); northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setBackground(Color.lightGray); @@ -92,7 +92,7 @@ public class ECToolBarPane extends BasicBeanPane { if (isSelectedtable()) { WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); Widget widget = no.createWidget(); - FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget); tb.setNameOption(no); northToolBar.add(tb); northToolBar.validate(); @@ -117,7 +117,7 @@ public class ECToolBarPane extends BasicBeanPane { if (isSelectedtable()) { WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); Widget widget = no.createWidget(); - FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget); tb.setNameOption(no); southToolBar.add(tb); southToolBar.validate(); @@ -139,18 +139,18 @@ public class ECToolBarPane extends BasicBeanPane { small.add(layoutTable, BorderLayout.CENTER); center.add(small, BorderLayout.CENTER); center.add(downButton, BorderLayout.SOUTH); - southToolBar = new FToolBarPane(); + southToolBar = new FormToolBarPane(); southToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); southToolBar.setBackground(Color.lightGray); JPanel movePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - FSettingToolBar top = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar); + FormSettingToolBar top = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Top"), northToolBar); northContentPane.add(top, BorderLayout.EAST); northContentPane.add(northToolBar, BorderLayout.CENTER); northContentPane.setBackground(Color.lightGray); JPanel southContentPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - FSettingToolBar bottom = new FSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar); + FormSettingToolBar bottom = new FormSettingToolBar(Inter.getLocText("FR-Designer_ToolBar_Bottom"), southToolBar); southContentPane.add(bottom, BorderLayout.EAST); southContentPane.add(southToolBar, BorderLayout.CENTER); southContentPane.setBackground(Color.lightGray); @@ -180,7 +180,7 @@ public class ECToolBarPane extends BasicBeanPane { if (e.getClickCount() > 1 && !SwingUtilities.isRightMouseButton(e)) { WidgetOption no = (WidgetOption)layoutTable.getValueAt(layoutTable.getSelectedRow(), layoutTable.getSelectedColumn()); Widget widget = no.createWidget(); - FToolBarButton tb = new FToolBarButton(no.optionIcon(), widget); + FormToolBarButton tb = new FormToolBarButton(no.optionIcon(), widget); tb.setNameOption(no); northToolBar.add(tb); northToolBar.validate(); @@ -207,7 +207,7 @@ public class ECToolBarPane extends BasicBeanPane { return this.isUseToolBarCheckBox.isSelected(); } - public void setDefaultToolBar(FToolBarManager defaultToolBar, WidgetOption[] buttonArray) { + public void setDefaultToolBar(FormToolBarManager defaultToolBar, WidgetOption[] buttonArray) { this.defaultToolBar = defaultToolBar; if (buttonArray != null) { for (int i = 0; i < buttonArray.length; i++) { @@ -249,20 +249,20 @@ public class ECToolBarPane extends BasicBeanPane { } @Override - public void populateBean(FToolBarManager[] toolBarManager) { + public void populateBean(FormToolBarManager[] toolBarManager) { if (ArrayUtils.isEmpty(toolBarManager)) { - defaultToolBar.setToolBarLocation(FLocation.createTopEmbedLocation()); - toolBarManager = new FToolBarManager[] { defaultToolBar }; + defaultToolBar.setToolBarLocation(Location.createTopEmbedLocation()); + toolBarManager = new FormToolBarManager[] { defaultToolBar }; } if (ArrayUtils.isEmpty(toolBarManager)) { return; } for (int i = 0; i < toolBarManager.length; i++) { - FLocation location = toolBarManager[i].getToolBarLocation(); - if (location instanceof FLocation.Embed) { - if (((FLocation.Embed)location).getPosition() == Constants.TOP) { + Location location = toolBarManager[i].getToolBarLocation(); + if (location instanceof Location.Embed) { + if (((Location.Embed)location).getPosition() == Constants.TOP) { northToolBar.populateBean(toolBarManager[i].getToolBar()); - } else if (((FLocation.Embed)location).getPosition() == Constants.BOTTOM) { + } else if (((Location.Embed)location).getPosition() == Constants.BOTTOM) { southToolBar.populateBean(toolBarManager[i].getToolBar()); } } @@ -270,25 +270,25 @@ public class ECToolBarPane extends BasicBeanPane { } @Override - public FToolBarManager[] updateBean() { + public FormToolBarManager[] updateBean() { if(!isUseToolbar()){ - return new FToolBarManager[0]; + return new FormToolBarManager[0]; } - List toolBarManagerList = new ArrayList(); + List toolBarManagerList = new ArrayList(); if (!northToolBar.isEmpty()) { - FToolBarManager north = new FToolBarManager(); + FormToolBarManager north = new FormToolBarManager(); north.setToolBar(northToolBar.updateBean()); - north.setToolBarLocation(FLocation.createTopEmbedLocation()); + north.setToolBarLocation(Location.createTopEmbedLocation()); toolBarManagerList.add(north); } if (!southToolBar.isEmpty()) { - FToolBarManager south = new FToolBarManager(); + FormToolBarManager south = new FormToolBarManager(); south.setToolBar(southToolBar.updateBean()); - south.setToolBarLocation(FLocation.createBottomEmbedLocation()); + south.setToolBarLocation(Location.createBottomEmbedLocation()); toolBarManagerList.add(south); } - return toolBarManagerList.toArray(new FToolBarManager[toolBarManagerList.size()]); + return toolBarManagerList.toArray(new FormToolBarManager[toolBarManagerList.size()]); } private class TableModel extends DefaultTableModel { diff --git a/designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java b/designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java similarity index 79% rename from designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java rename to designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java index 5faf543483..e244c2a226 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/wrappers/ECToolBarWrapper.java +++ b/designer_form/src/com/fr/design/mainframe/widget/wrappers/ElementCaseToolBarWrapper.java @@ -3,13 +3,13 @@ package com.fr.design.mainframe.widget.wrappers; import com.fr.design.Exception.ValidationException; import com.fr.design.designer.properties.Decoder; import com.fr.design.designer.properties.Encoder; -import com.fr.form.web.FToolBarManager; +import com.fr.form.web.FormToolBarManager; import com.fr.general.Inter; /** * Created by harry on 2017-3-1. */ -public class ECToolBarWrapper implements Encoder, Decoder { +public class ElementCaseToolBarWrapper implements Encoder, Decoder { @Override public Object decode(String txt) { return null; @@ -25,7 +25,7 @@ public class ECToolBarWrapper implements Encoder, Decoder { if (v == null) { return null; } - FToolBarManager[] toolBarManager = (FToolBarManager[])v; + FormToolBarManager[] toolBarManager = (FormToolBarManager[])v; if (toolBarManager.length != 0) { return Inter.getLocText("FR-Designer_Open"); } From 26c360cbea417c66d52cdf5dc644d1aca0c480bc Mon Sep 17 00:00:00 2001 From: zhouping Date: Fri, 10 Mar 2017 11:00:39 +0800 Subject: [PATCH 21/39] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=9B=BD=E9=99=85=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/locale/designer.properties | 17 ++++++++++++++++- .../fr/design/locale/designer_en_US.properties | 17 ++++++++++++++++- .../fr/design/locale/designer_ja_JP.properties | 15 +++++++++++++++ .../fr/design/locale/designer_ko_KR.properties | 15 +++++++++++++++ .../fr/design/locale/designer_zh_CN.properties | 17 ++++++++++++++++- .../fr/design/locale/designer_zh_TW.properties | 17 ++++++++++++++++- 6 files changed, 94 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index 0a66c326e8..05c7aa6a6b 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -567,4 +567,19 @@ FR-Designer_Parameter-Formula=Formula FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too low, and is not compatible with current API. Please contact the developer to update. FR-Designer_WidgetOrder=Widget Order FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. -FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. \ No newline at end of file +FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= +FR-Designer-Move_Tab_First=move to first +FR-Designer-Move_Tab_End=move to end +FR-Designer-Move_Tab_Next=move to next +FR-Designer-Move_Tab_Prev=move to previous \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index b0acea3ab4..fcece57565 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -568,4 +568,19 @@ FR-Designer_Parameter-Formula=Formula FR-Designer_Plugin_Should_Update_Please_Contact_Developer=Plugin version is too low, and is not compatible with current API. Please contact the developer to update. FR-Designer_WidgetOrder=Widget Order FR-Designer_Mobile_Form_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the form in the APP. -FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. \ No newline at end of file +FR-Designer_Mobile_Report_Analysis_Annotation=annotation\: You can use this attribute to control the analysis of the report in the APP, only to support the paging preview, fill in the preview of the property is invalid. +FR-Designer_Background_Null=No Background +FR-Designer_Background_Color=Color +FR-Designer_Background_Texture=Texture +FR-Designer_Background_Pattern=Pattern +FR-Designer_Background_Gradient_Color=Gradient Color +FR-Designer_Background_Image=Image +FR-Designer_Background_Clear=Clear +FR-Designer_Background_Image_Select=Select Picture +FR-Designer_Initial_Background_Tips=Initial background of the button +FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background +FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background +FR-Designer-Move_Tab_First=move to first +FR-Designer-Move_Tab_End=move to end +FR-Designer-Move_Tab_Next=move to next +FR-Designer-Move_Tab_Prev=move to previous \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index d86d0a164c..233078394f 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -539,3 +539,18 @@ FR-Designer_No=\u3044\u3044\u3048 FR-Designer_Pagination=\u30DA\u30FC\u30B8\u30F3\u30B0 FR-Designer_DS_TableData=\u30C7\u30FC\u30BF\u30BD\u30FC\u30B9 FR-Designer_Parameter-Formula=\u6570\u5F0F +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= +FR-Designer-Move_Tab_First= +FR-Designer-Move_Tab_End= +FR-Designer-Move_Tab_Next= +FR-Designer-Move_Tab_Prev= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index dfb5ec78ff..a54595e0c3 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -536,3 +536,18 @@ FR-Designer_No=\uC544\uB2C8\uC624 FR-Designer_Pagination=\uD398\uC774\uC9C0\uB098\uB204\uAE30 FR-Designer_DS_TableData=\uB370\uC774\uD130\uC138\uD2B8 FR-Designer_Parameter-Formula=\uC218\uC2DD +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= +FR-Designer-Move_Tab_First= +FR-Designer-Move_Tab_End= +FR-Designer-Move_Tab_Next= +FR-Designer-Move_Tab_Prev= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index bdb97b094e..53aab70e5d 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -572,4 +572,19 @@ FR-Designer_Parameter-Formula=\u516C\u5F0F FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u672C\u8FC7\u4F4E, \u5B58\u5728API\u4E0D\u517C\u5BB9, \u8BF7\u8054\u7CFB\u5F00\u53D1\u8005\u5347\u7EA7\u63D2\u4EF6 FR-Designer_WidgetOrder=\u63A7\u4EF6\u987A\u5E8F FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CA\uFF1A\u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u8868\u5355\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 -FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA\: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002 \ No newline at end of file +FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CA\: \u53EF\u4EE5\u901A\u8FC7\u8BE5\u5C5E\u6027\u63A7\u5236\u62A5\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9875\u9884\u89C8\uFF0C\u586B\u62A5\u9884\u89C8\u65F6\u5C5E\u6027\u65E0\u6548\u3002 +FR-Designer_Background_Null=\u6CA1\u6709\u80CC\u666F +FR-Designer_Background_Color=\u989C\u8272 +FR-Designer_Background_Texture=\u7EB9\u7406 +FR-Designer_Background_Pattern=\u56FE\u6848 +FR-Designer_Background_Gradient_Color=\u6E10\u53D8\u8272 +FR-Designer_Background_Image=\u56FE\u7247 +FR-Designer_Background_Clear=\u6E05\u9664 +FR-Designer_Background_Image_Select=\u9009\u62E9\u56FE\u7247 +FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F +FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer-Move_Tab_First=\u79FB\u52A8\u5230\u9996\u4F4D +FR-Designer-Move_Tab_End=\u79FB\u52A8\u5230\u672B\u5C3E +FR-Designer-Move_Tab_Next=\u5F80\u540E\u79FB\u52A8 +FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52A8 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 3acd7487c2..68622ad34a 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -560,4 +560,19 @@ FR-Designer_Parameter-Formula=\u516C\u5F0F FR-Designer_Plugin_Should_Update_Please_Contact_Developer=\u63D2\u4EF6\u7248\u672C\u904E\u4F4E, \u5B58\u5728API\u4E0D\u517C\u5BB9, \u8ACB\u806F\u7E6B\u958B\u767C\u8005\u5347\u7D1A\u63D2\u4EF6 FR-Designer_WidgetOrder=\u63A7\u4EF6\u9806\u5E8F FR-Designer_Mobile_Form_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u8868\u55AE\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\u3002 -FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 \ No newline at end of file +FR-Designer_Mobile_Report_Analysis_Annotation=\u6CE8\u91CB\uFF1A\u53EF\u4EE5\u901A\u904E\u8A72\u5C6C\u6027\u63A7\u5236\u5831\u8868\u5728APP\u4E2D\u7684\u89E3\u6790\u65B9\u5F0F\uFF0C\u53EA\u652F\u6301\u5206\u9801\u9810\u89BD\uFF0C\u586B\u5831\u9810\u89BD\u6642\u5C6C\u6027\u7121\u6548\u3002 +FR-Designer_Background_Null= +FR-Designer_Background_Color= +FR-Designer_Background_Texture= +FR-Designer_Background_Pattern= +FR-Designer_Background_Gradient_Color= +FR-Designer_Background_Image= +FR-Designer_Background_Clear= +FR-Designer_Background_Image_Select= +FR-Designer_Initial_Background_Tips= +FR-Designer_Mouse_Move_Tips= +FR-Designer_Mouse_Click_Tips= +FR-Designer-Move_Tab_First=\u79FB\u52D5\u5230\u9996\u4F4D +FR-Designer-Move_Tab_End=\u79FB\u52D5\u5230\u672B\u5C3E +FR-Designer-Move_Tab_Next=\u5F80\u5F8C\u79FB\u52D5 +FR-Designer-Move_Tab_Prev=\u5F80\u524D\u79FB\u52D5 \ No newline at end of file From aa2c2d10d0b8d2fc722ab1fe5693154cb836ce5c Mon Sep 17 00:00:00 2001 From: mengao Date: Fri, 10 Mar 2017 14:32:37 +0800 Subject: [PATCH 22/39] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index f57328e149..4a18611fa4 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -79,7 +79,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen eastPane.setLayout(new BorderLayout()); - eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 10)); + eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 15)); JPanel button = new JPanel(); button.setPreferredSize(new Dimension(45, 20)); button.setLayout(new GridLayout(1, 2, 5, 0)); From 1da998d12e69ae0d7f7ca3f9daeca5ccf88409a5 Mon Sep 17 00:00:00 2001 From: mengao Date: Fri, 10 Mar 2017 14:44:34 +0800 Subject: [PATCH 23/39] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=9B=BE=E8=A1=A8=E9=93=BE=E6=8E=A5=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E6=98=BE=E7=A4=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index 4a18611fa4..f57328e149 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -79,7 +79,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen eastPane.setLayout(new BorderLayout()); - eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 15)); + eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 10)); JPanel button = new JPanel(); button.setPreferredSize(new Dimension(45, 20)); button.setLayout(new GridLayout(1, 2, 5, 0)); From ec86d81f94da3118320bce7dc1551505016b8ed2 Mon Sep 17 00:00:00 2001 From: mengao Date: Fri, 10 Mar 2017 14:48:32 +0800 Subject: [PATCH 24/39] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index f57328e149..4a18611fa4 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -79,7 +79,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen eastPane.setLayout(new BorderLayout()); - eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 10)); + eastPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 15)); JPanel button = new JPanel(); button.setPreferredSize(new Dimension(45, 20)); button.setLayout(new GridLayout(1, 2, 5, 0)); From bcbc311cbdd313a34e57367fd4b4e97d039b4393 Mon Sep 17 00:00:00 2001 From: frharry Date: Fri, 10 Mar 2017 16:55:30 +0800 Subject: [PATCH 25/39] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/FormEditToolBar.java | 14 +++---- .../design/mainframe/FormSettingToolBar.java | 6 +-- .../com/fr/design/mainframe/FormToolBar.java | 6 +-- .../design/mainframe/FormToolBarButton.java | 37 ++++++++----------- .../mainframe/FormWebWidgetConstants.java | 18 ++++----- .../editors/ElementCaseToolBarPane.java | 6 +-- 6 files changed, 40 insertions(+), 47 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java index d0e217f277..c2c487ef54 100644 --- a/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormEditToolBar.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicPane; @@ -22,6 +21,7 @@ import com.fr.form.ui.*; import com.fr.form.ui.Button; import com.fr.form.web.button.Export; import com.fr.general.Background; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; @@ -125,12 +125,12 @@ public class FormEditToolBar extends BasicPane { this.add(splitPane); list.addListSelectionListener(listSelectionListener); JPanel backgroundPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - UIButton bgButton = new UIButton(Inter.getLocText(new String[]{"Background", "Set"})); - defaultCheckBox = new UICheckBox(Inter.getLocText(new String[]{"Default", "Background"})); + UIButton bgButton = new UIButton(Inter.getLocText("FR-Designer-Output_Background_Set")); + defaultCheckBox = new UICheckBox(Inter.getLocText("FR-Designer-Output_Default_Background")); bgButton.addActionListener(actioner); backgroundPane.add(defaultCheckBox); backgroundPane.add(bgButton); - backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText(new String[]{"Background", "Set"}))); + backgroundPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Output_Background_Set"))); this.add(backgroundPane, BorderLayout.SOUTH); } @@ -210,7 +210,7 @@ public class FormEditToolBar extends BasicPane { public MoveUpItemAction() { this.setName(Inter.getLocText("Utils-Move_Up")); this.setMnemonic('U'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/up.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/up.png")); } /** @@ -241,7 +241,7 @@ public class FormEditToolBar extends BasicPane { public MoveDownItemAction() { this.setName(Inter.getLocText("Utils-Move_Down")); this.setMnemonic('D'); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/control/down.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/design/images/control/down.png")); } /** @@ -275,7 +275,7 @@ public class FormEditToolBar extends BasicPane { public class RemoveAction extends UpdateAction { public RemoveAction() { this.setName(Inter.getLocText("FR-Designer_Delete")); - this.setSmallIcon(BaseUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); + this.setSmallIcon(IOUtils.readIcon("/com/fr/base/images/cell/control/remove.png")); } /** diff --git a/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java index 2ed8a69842..c84776789d 100644 --- a/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormSettingToolBar.java @@ -1,11 +1,11 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; import com.fr.general.Inter; import javax.swing.*; @@ -17,8 +17,8 @@ import java.awt.event.ActionListener; * Created by harry on 2017-3-2. */ public class FormSettingToolBar extends JPanel { - private Icon setIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); - private Icon delIcon = BaseUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); + private Icon setIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnsetting.png"); + private Icon delIcon = IOUtils.readIcon("com/fr/design/images/toolbarbtn/toolbarbtnclear.png"); private UIButton setButton; private UIButton delButton; private FormToolBarPane toolBarPane; diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBar.java b/designer_form/src/com/fr/design/mainframe/FormToolBar.java index 5a172e5d41..860144dc85 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBar.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBar.java @@ -56,11 +56,11 @@ public class FormToolBar { } public ToolBar getToolBar() { - Widget[] n = new Widget[this.getButtonlist().size()]; + Widget[] widgets = new Widget[this.getButtonlist().size()]; for (int j = 0; j < this.getButtonlist().size(); j++) { - n[j] = this.getButtonlist().get(j).getWidget(); + widgets[j] = this.getButtonlist().get(j).getWidget(); } - ToolBar toolBar = new ToolBar(n); + ToolBar toolBar = new ToolBar(widgets); toolBar.setBackground(this.background); toolBar.setDefault(this.isDefault); return toolBar; diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java index a26b8d18f4..0e08197d37 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java @@ -21,7 +21,7 @@ import java.awt.event.MouseListener; */ public class FormToolBarButton extends JButton implements MouseListener { private Widget widget; - private WidgetOption no; + private WidgetOption widgetOption; public FormToolBarButton(Icon icon, Widget widget) { this(null, icon, widget); @@ -29,7 +29,8 @@ public class FormToolBarButton extends JButton implements MouseListener { public FormToolBarButton(String text, Icon icon, Widget widget) { super(text, icon); - init(); + setBackground(null); + setRolloverEnabled(true); this.widget = widget; if (widget instanceof com.fr.form.ui.Button) { com.fr.form.ui.Button button = (com.fr.form.ui.Button) widget; @@ -45,12 +46,6 @@ public class FormToolBarButton extends JButton implements MouseListener { setMargin(new Insets(0, 0, 0, 0)); } - private void init() { - setBackground(null); - setRolloverEnabled(true); - } - - /** * 改变按钮的权限细粒度状态 * @@ -81,11 +76,11 @@ public class FormToolBarButton extends JButton implements MouseListener { } public WidgetOption getNameOption() { - return this.no; + return this.widgetOption; } - public void setNameOption(WidgetOption no) { - this.no = no; + public void setNameOption(WidgetOption widgetOption) { + this.widgetOption = widgetOption; } @@ -109,18 +104,16 @@ public class FormToolBarButton extends JButton implements MouseListener { return; } if (e.getClickCount() >= 2) { - if (this.getParent() instanceof FormToolBarPane) { - final FormToolBarPane tb = (FormToolBarPane) this.getParent(); - final FormEditToolBar etb = new FormEditToolBar(); - etb.populate(tb.getFToolBar(), this); - BasicDialog dialog = etb.showWindow(DesignerContext.getDesignerFrame()); - dialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - tb.setFToolBar(etb.update()); + final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); + final FormEditToolBar editToolBar = new FormEditToolBar(); + editToolBar.populate(toolBarPane.getFToolBar(), this); + BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame()); + dialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + toolBarPane.setFToolBar(editToolBar.update()); } - }); - dialog.setVisible(true); - } + }); + dialog.setVisible(true); } } diff --git a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java index a84b7523dc..4bf970234f 100644 --- a/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java +++ b/designer_form/src/com/fr/design/mainframe/FormWebWidgetConstants.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe; -import com.fr.base.BaseUtils; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOptionFactory; import com.fr.form.ui.CustomToolBarButton; @@ -8,6 +7,7 @@ import com.fr.form.web.button.ExcelO; import com.fr.form.web.button.ExcelP; import com.fr.form.web.button.Export; import com.fr.form.web.button.page.*; +import com.fr.general.IOUtils; import com.fr.general.Inter; /** @@ -24,29 +24,29 @@ public class FormWebWidgetConstants { // 当前页/总页数 public static final WidgetOption PAGENAVI = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"HJS-Current_Page", "HF-Number_of_Page"}, new String[]{"/", ""}), - BaseUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); + IOUtils.readIcon("/com/fr/web/images/pageNumber.png"), PageNavi.class); // 首页 - public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), BaseUtils.readIcon("/com/fr/web/images/first.png"), + public static final WidgetOption FIRST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-First"), IOUtils.readIcon("/com/fr/web/images/first.png"), First.class); // 末页 - public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), BaseUtils.readIcon("/com/fr/web/images/last.png"), + public static final WidgetOption LAST = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Last"), IOUtils.readIcon("/com/fr/web/images/last.png"), Last.class); // 前一页 public static final WidgetOption PREVIOUS = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Previous"), - BaseUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); + IOUtils.readIcon("/com/fr/web/images/previous.png"), Previous.class); // 后一页 - public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), BaseUtils.readIcon("/com/fr/web/images/next.png"), + public static final WidgetOption NEXT = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Engine_ReportServerP-Next"), IOUtils.readIcon("/com/fr/web/images/next.png"), Next.class); // 导出成Excel 分页导出 public static final WidgetOption EXCELP = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Page"}, new String[]{"(", ")"}), - BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); + IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelP.class); // 导出成Excel 原样导出 public static final WidgetOption EXCELO = WidgetOptionFactory.createByWidgetClass(Inter.getLocText(new String[]{"Excel", "FR-Designer_Export_Excel_Simple"}, new String[]{"(", ")"}), - BaseUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); + IOUtils.readIcon("/com/fr/web/images/excel.png"), ExcelO.class); // 导出 public static final WidgetOption EXPORT = WidgetOptionFactory - .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), BaseUtils.readIcon("/com/fr/web/images/export.png"), Export.class); + .createByWidgetClass(Inter.getLocText("FR-Engine_Export"), IOUtils.readIcon("/com/fr/web/images/export.png"), Export.class); public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory .createByWidgetClass(Inter.getLocText(new String[]{"Custom", "Form-Button"}), CustomToolBarButton.class); diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java index 9e6a904451..624dc956ab 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/editors/ElementCaseToolBarPane.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.widget.editors; -import com.fr.base.BaseUtils; import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.ibutton.UIButton; @@ -14,6 +13,7 @@ import com.fr.design.mainframe.FormToolBarPane; import com.fr.form.ui.Widget; import com.fr.form.web.FormToolBarManager; import com.fr.form.web.Location; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; @@ -79,7 +79,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane northToolBar.setPreferredSize(new Dimension(ImageObserver.WIDTH, 26)); northToolBar.setBackground(Color.lightGray); - UIButton topButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); + UIButton topButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_up.png")); topButton.setBorder(null); topButton.setOpaque(false); topButton.setContentAreaFilled(false); @@ -103,7 +103,7 @@ public class ElementCaseToolBarPane extends BasicBeanPane } }); - UIButton downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); + UIButton downButton = new UIButton(IOUtils.readIcon("com/fr/design/images/arrow/arrow_down.png")); downButton.setBorder(null); downButton.setMargin(null); downButton.setOpaque(false); From b7343f7b9927e900060ba02a0935c17970141686 Mon Sep 17 00:00:00 2001 From: frharry Date: Fri, 10 Mar 2017 17:07:40 +0800 Subject: [PATCH 26/39] =?UTF-8?q?REPORT-1344=20=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BF=BB=E9=A1=B5=E6=94=B9=E8=BF=9B=E5=B9=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B1=80=E9=83=A8=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/FormToolBarButton.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java index 0e08197d37..a9651c7fa8 100644 --- a/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java +++ b/designer_form/src/com/fr/design/mainframe/FormToolBarButton.java @@ -99,12 +99,14 @@ public class FormToolBarButton extends JButton implements MouseListener { * @param e 鼠标点击事件 */ public void mouseClicked(MouseEvent e) { + //该button只在报表块工具栏中使用, + //parent只有FormToolBarPane一种,故可以直接强转 + final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); if (BaseUtils.isAuthorityEditing()) { auhtorityMouseAction(); return; } if (e.getClickCount() >= 2) { - final FormToolBarPane toolBarPane = (FormToolBarPane) this.getParent(); final FormEditToolBar editToolBar = new FormEditToolBar(); editToolBar.populate(toolBarPane.getFToolBar(), this); BasicDialog dialog = editToolBar.showWindow(DesignerContext.getDesignerFrame()); @@ -119,11 +121,9 @@ public class FormToolBarButton extends JButton implements MouseListener { private void auhtorityMouseAction() { - if (this.getParent() instanceof FormToolBarPane && this.isEnabled()) { + if (this.isEnabled()) { this.setSelected(!this.isSelected()); - } - } /** From f3f8b4563b5e3c261e23de4af8e50b198df5b80a Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 15 Mar 2017 11:32:20 +0800 Subject: [PATCH 27/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E9=87=8D=E6=9E=84=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=B0=86process=E5=92=8Cconsuming=E5=88=86=E7=A6=BB?= =?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E4=B8=8D=E8=AE=B0=E5=BD=95=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/TemplateProcessTracker.aj | 13 +- .../designerbase/TemplateProcessTracker.aj | 9 +- .../templateinfo/TemplateInfoCollector.java | 176 +++++++++++++----- .../templateinfo/TemplateProcessTracker.aj | 71 ------- .../designerchart/TemplateProcessTracker.aj | 9 +- .../designerform/TemplateProcessTracker.aj | 13 +- 6 files changed, 159 insertions(+), 132 deletions(-) delete mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj diff --git a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj index 24dfc73518..0b3ea70835 100644 --- a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj +++ b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj @@ -33,7 +33,8 @@ public aspect TemplateProcessTracker { before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); +// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 @@ -44,7 +45,8 @@ public aspect TemplateProcessTracker { return; } - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } @@ -56,7 +58,8 @@ public aspect TemplateProcessTracker { // return; // } - String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + //String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + String log = ""; TemplateInfoCollector.appendProcess(log); } @@ -65,9 +68,9 @@ public aspect TemplateProcessTracker { SourceLocation sl = thisJoinPoint.getSourceLocation(); // String v = "test"; - String log = String.format("%s:\n%s\nset value: %s at %s\n\n", new Date(), sl, v, g.getEditingCellElement()); + //String log = String.format("%s:\n%s\nset value: %s at %s\n\n", new Date(), sl, v, g.getEditingCellElement()); + String log = ""; TemplateInfoCollector.appendProcess(log); - } diff --git a/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj index 04e3fa2e46..b07ec9951a 100644 --- a/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj +++ b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj @@ -30,7 +30,8 @@ public aspect TemplateProcessTracker { before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 @@ -41,7 +42,8 @@ public aspect TemplateProcessTracker { return; } - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } @@ -53,7 +55,8 @@ public aspect TemplateProcessTracker { // return; // } - String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + //String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + String log = ""; TemplateInfoCollector.appendProcess(log); } diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 95ced63309..7c2ef0eab3 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -1,15 +1,21 @@ package com.fr.design.mainframe.templateinfo; +import com.fr.base.FRContext; import com.fr.base.io.IOFile; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; +import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; -import com.fr.stable.ProductConstants; -import com.fr.stable.StableUtils; +import com.fr.general.http.HttpClient; +import com.fr.stable.*; +import org.json.JSONObject; import java.io.*; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; import java.util.HashMap; @@ -51,7 +57,6 @@ public class TemplateInfoCollector implements Serializable { } public static void appendProcess(String log) { -// System.out.println(log); // 获取当前编辑的模板 JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate(); // 追加过程记录 @@ -61,9 +66,10 @@ public class TemplateInfoCollector implements Serializable { /** * 加载已经存储的模板过程 */ + @SuppressWarnings("unchecked") public String loadProcess(T t) { -// return ""; - return (String)templateInfoList.get(t.getReportletsid()).get("process"); + HashMap processMap = (HashMap) templateInfoList.get(t.getReportletsid()).get("processMap"); + return (String)processMap.get("process"); } /** @@ -77,8 +83,8 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - System.out.println("写入:" + instance.templateInfoList); - os.writeObject(instance.templateInfoList); + System.out.println("写入:" + templateInfoList); + os.writeObject(templateInfoList); os.close(); } catch (Exception ex) { ex.printStackTrace(); @@ -99,53 +105,137 @@ public class TemplateInfoCollector implements Serializable { public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { HashMap templateInfo; - if (inList(t)) { // 已有记录 + long timeConsume = saveTime - openTime; // 制作模板耗时 + String reportletsid = t.getReportletsid(); + + if (inList(t)) { // 已有记录 templateInfo = templateInfoList.get(t.getReportletsid()); - } else { // 新增 + // 更新 conusmingMap + HashMap consumingMap = (HashMap) templateInfo.get("consumingMap"); + timeConsume += (long)consumingMap.get("time_consume"); // 加上之前的累计编辑时间 + consumingMap.put("time_consume", timeConsume); + } + else { // 新增 templateInfo = new HashMap<>(); + templateInfo.put("consumingMap", getNewConsumingMap(reportletsid, openTime, timeConsume)); + } + + // 直接覆盖 processMap + templateInfo.put("processMap", getProcessMap(reportletsid, jt)); + + // TODO: 更新模板是否完成的标记 + + + templateInfoList.put(reportletsid, templateInfo); + + saveInfo(); // 每次更新之后,都同步到暂存文件中 + } + + private HashMap getNewConsumingMap(String reportletsid, long openTime, long timeConsume) { + HashMap consumingMap = new HashMap<>(); + + String username = DesignerEnvManager.getEnvManager().getBBSName(); + String uuid = DesignerEnvManager.getEnvManager().getUUID(); + String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); +// String createTime = new Date(openTime).toString(); + String createTime = new SimpleDateFormat("yyyy-MM-dd hh:mm").format(Calendar.getInstance().getTime()); + String jarTime = GeneralUtils.readBuildNO(); + String version = ProductConstants.VERSION; + consumingMap.put("username", username); + consumingMap.put("uuid", uuid); + consumingMap.put("activitykey", activitykey); + consumingMap.put("reportletsid", reportletsid); + consumingMap.put("create_time", createTime); + consumingMap.put("time_consume", timeConsume); + consumingMap.put("jar_time", jarTime); + consumingMap.put("version", version); + + return consumingMap; + } + + private HashMap getProcessMap(String reportletsid, JTemplate jt) { + HashMap processMap = new HashMap<>(); - String username = DesignerEnvManager.getEnvManager().getBBSName(); - String uuid = DesignerEnvManager.getEnvManager().getUUID(); - String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); - String reportletsid = t.getReportletsid(); - String createTime = new Date(openTime).toString(); - int reportType = jt.getReportType(); - String jarTime = GeneralUtils.readBuildNO(); - String version = ProductConstants.VERSION; - templateInfo.put("username", username); - templateInfo.put("uuid", uuid); - templateInfo.put("activitykey", activitykey); - templateInfo.put("reportletsid", reportletsid); - templateInfo.put("create_time", createTime); - templateInfo.put("report_type", reportType); - templateInfo.put("jar_time", jarTime); - templateInfo.put("version", version); + processMap.put("reportletsid", reportletsid); + processMap.put("process", jt.getProcess()); + processMap.put("report_type", jt.getReportType()); + processMap.put("cell_count", jt.getCellCount()); + processMap.put("float_count", jt.getFloatCount()); + processMap.put("block_count", jt.getBlockCount()); + processMap.put("widget_count", jt.getWidgetCount()); + + return processMap; + } + + /** + * 发送本地模板信息到服务器 + */ + public void sendTemplateInfo() { + + String url1 = "http://cloud.fanruan.com/api/monitor/record_of_make_reports/single"; + ArrayList> completeTemplatesInfo = getCompleteTemplatesInfo(); + for (HashMap templateInfo : completeTemplatesInfo) { + String jsonConsumingMap = templateInfo.get("jsonConsumingMap"); + String jsonProcessMap = templateInfo.get("jsonProcessMap"); + if (sendSingleTemplateInfo(url1, jsonConsumingMap) && sendSingleTemplateInfo(url1, jsonProcessMap)) { + // TODO: 清空记录 + System.out.println("success"); + } } +// //服务器返回true, 说明已经获取成功, 清空当前记录的信息 +// if (success) { +// System.out.println("success"); +// } else { +// System.out.println("fail"); +// } + } - long timeConsume = saveTime - openTime; - // 如果已存有数据,则加上之前的累计编辑时间 - if (templateInfo.get("time_consume") != null) { - timeConsume += (long)templateInfo.get("time_consume"); + private boolean sendSingleTemplateInfo(String url, String content) { + HashMap para = new HashMap<>(); + String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); + para.put("token", CodeUtils.md5Encode(date, "", "MD5")); + para.put("content", content); +// para.put("content", "{name:3, age:3}"); +// HttpClient httpClient = new HttpClient("http://cloud.fanruan.com/api/monitor/record_of_make_reports/single", para, true); + HttpClient httpClient = new HttpClient(url, para, true); + + //httpClient.setContent(getCompleteTemplatesInfo()); + httpClient.setTimeout(5000); + httpClient.asGet(); + + if (!httpClient.isServerAlive()) { + return false; } - String process = jt.getProcess(); - int cellCount = jt.getCellCount(); - int floatCount = jt.getFloatCount(); - int blockCount = jt.getBlockCount(); - int widgetCount = jt.getWidgetCount(); - templateInfo.put("time_consume", timeConsume); - templateInfo.put("process", process); - templateInfo.put("cell_count", cellCount); - templateInfo.put("float_count", floatCount); - templateInfo.put("block_count", blockCount); - templateInfo.put("widget_count", widgetCount); - templateInfoList.put(t.getReportletsid(), templateInfo); + String res = httpClient.getResponseText(); + boolean success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); + return success; + } - saveInfo(); // 每次更新之后,都同步到暂存文件中 + // 返回已完成的模板信息 + @SuppressWarnings("unchecked") + private ArrayList> getCompleteTemplatesInfo() { + ArrayList> completeTemplatesInfo = new ArrayList<>(); + for (String key : templateInfoList.keySet()) { + HashMap templateInfo = new HashMap<>(); + HashMap consumingMap = (HashMap) templateInfoList.get(key).get("consumingMap"); + HashMap processMap = (HashMap) templateInfoList.get(key).get("processMap"); + String jsonConsumingMap = new JSONObject(consumingMap).toString(); + String jsonProcessMap = new JSONObject(processMap).toString(); + templateInfo.put("jsonConsumingMap", jsonConsumingMap); + templateInfo.put("jsonProcessMap", jsonProcessMap); + templateInfo.put("reportletsid", key); + completeTemplatesInfo.add(templateInfo); // TODO 暂未添加筛选条件 + } + return completeTemplatesInfo; } + + public static void main(String[] args) { TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); - tic.getInfoList(); +// tic.getInfoList(); + tic.sendTemplateInfo(); + } } diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj deleted file mode 100644 index d186f82981..0000000000 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessTracker.aj +++ /dev/null @@ -1,71 +0,0 @@ -//package com.fr.design.mainframe.templateinfo; -// -//import org.aspectj.lang.reflect.SourceLocation; -// -//import java.awt.event.ActionEvent; -//import java.awt.event.MouseEvent; -//import java.util.Date; -// -///** -// * 记录模板过程 -// * Created by plough on 2017/2/27. -// */ -//public aspect TemplateProcessTracker { -// //声明一个pointcut,匹配你需要的方法 -// pointcut onMouseClicked(MouseEvent e) : -// execution(* mouseClicked(MouseEvent)) && args(e); -// pointcut onMousePressed(MouseEvent e) : -// execution(* mousePressed(MouseEvent)) && args(e); -// pointcut onMouseReleased(MouseEvent e) : -// execution(* mouseReleased(MouseEvent)) && args(e); -// pointcut onActionPerformed(ActionEvent e) : -// execution(* actionPerformed(ActionEvent)) && args(e); -// pointcut onSetValueAt(Object v, int r, int c) : -// execution(* setValueAt(Object, int, int)) && args(v, r, c); -// pointcut onSetValue4EditingElement(Object v) : -// execution(* setValue4EditingElement(Object)) && args(v); -// -// //before表示之前的意思 -// //这整个表示在MouseAdapter的public void mouseXXX(MouseEvent)方法调用之前,你想要执行的代码 -// before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { -// SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 -// -// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); -// TemplateInfoCollector.appendProcess(log); -// } -// //同上 -// before(ActionEvent e) : onActionPerformed(e) { -// SourceLocation sl = thisJoinPoint.getSourceLocation(); -// // !within(LogHandlerBar) 没用, 手动过滤 -// if (e.getSource().toString().contains("javax.swing.Timer")) { -// return; -// } -// -// String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); -// TemplateInfoCollector.appendProcess(log); -// -// } -// //同上 -// before(Object v, int r, int c) : onSetValueAt(v, r, c) { -// SourceLocation sl = thisJoinPoint.getSourceLocation(); -// // !within(LogHandlerBar) 没用, 手动过滤 -//// if (e.getSource().toString().contains("javax.swing.Timer")) { -//// return; -//// } -// -// String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); -// TemplateInfoCollector.appendProcess(log); -// -// } -// //同上 -// before(Object v) : onSetValue4EditingElement(v) { -// SourceLocation sl = thisJoinPoint.getSourceLocation(); -// -//// String v = "test"; -// String log = String.format("%s:\n%s\nset value: %s\n\n", new Date(), sl, v); -// TemplateInfoCollector.appendProcess(log); -// -// } -// -// -//} diff --git a/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj b/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj index c192a190d0..51e86fd151 100644 --- a/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj +++ b/designer_chart/src/com/fr/aspectj/designerchart/TemplateProcessTracker.aj @@ -30,7 +30,8 @@ public aspect TemplateProcessTracker { before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 @@ -41,14 +42,16 @@ public aspect TemplateProcessTracker { return; } - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 before(Chart c) : onChartUpdate(c) { SourceLocation sl = thisJoinPoint.getSourceLocation(); - String log = String.format("%s:\n%s\n插入新图表:%s\n\n", new Date(), sl, c.getChartName()); + //String log = String.format("%s:\n%s\n插入新图表:%s\n\n", new Date(), sl, c.getChartName()); + String log = ""; TemplateInfoCollector.appendProcess(log); } diff --git a/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj b/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj index 885d21ecd3..0aabeb3620 100644 --- a/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj +++ b/designer_form/src/com/fr/aspectj/designerform/TemplateProcessTracker.aj @@ -28,7 +28,8 @@ public aspect TemplateProcessTracker { before(MouseEvent e) : onMouseClicked(e) || onMousePressed(e) || onMouseReleased(e) { SourceLocation sl = thisJoinPoint.getSourceLocation();//切面对应的代码位置 - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 @@ -39,19 +40,17 @@ public aspect TemplateProcessTracker { return; } - String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + //String log = String.format("%s:\n%s\n%s\n%s\n\n", new Date(), sl, e, e.getSource()); + String log = ""; TemplateInfoCollector.appendProcess(log); } //同上 before(Object v, int r, int c) : onSetValueAt(v, r, c) { SourceLocation sl = thisJoinPoint.getSourceLocation(); - // !within(LogHandlerBar) 没用, 手动过滤 -// if (e.getSource().toString().contains("javax.swing.Timer")) { -// return; -// } - String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + //String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); + String log = ""; TemplateInfoCollector.appendProcess(log); } From 66f7e6fbcbc65d058d64aef67739971eb9884aec Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 15 Mar 2017 16:21:02 +0800 Subject: [PATCH 28/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E4=B8=8A=E4=BC=A0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=89=8D=EF=BC=8C=E5=88=A4=E6=96=AD=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E6=98=AF=E5=90=A6=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/InformationCollector.java | 2 + .../templateinfo/TemplateInfoCollector.java | 90 +++++++++++++++---- 2 files changed, 73 insertions(+), 19 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/InformationCollector.java b/designer/src/com/fr/design/mainframe/InformationCollector.java index a4b3fc6ab6..f50cc5dadf 100644 --- a/designer/src/com/fr/design/mainframe/InformationCollector.java +++ b/designer/src/com/fr/design/mainframe/InformationCollector.java @@ -10,6 +10,7 @@ import com.fr.data.core.db.dml.Delete; import com.fr.data.core.db.dml.Select; import com.fr.data.core.db.dml.Table; import com.fr.design.DesignerEnvManager; +import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; @@ -315,6 +316,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { } sendFunctionsInfo(); sendUserInfo(); + TemplateInfoCollector.getInstance().sendTemplateInfo(); } }); sendThread.start(); diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 7c2ef0eab3..83c7c1d63b 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -27,19 +27,38 @@ public class TemplateInfoCollector implements Serializable { private static final String FILE_NAME = "tplInfo.ser"; private static TemplateInfoCollector instance; private HashMap> templateInfoList; + private String designerOpenDate; //设计器最近一次打开日期 @SuppressWarnings("unchecked") private TemplateInfoCollector() { - // 先尝试从文件读取 - try{ - ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); - templateInfoList = (HashMap>) is.readObject(); - } catch (FileNotFoundException ex) { - // 如果之前没有存储过,则创建新对象 - templateInfoList = new HashMap<>(); - } catch (Exception ex) { - FRLogger.getLogger().error(ex.getMessage(), ex); - } +// // 先尝试从文件读取 +// try{ +// ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); +//// templateInfoList = (HashMap>) is.readObject(); +// instance = (HashMap>) is.readObject(); +// } catch (FileNotFoundException ex) { +// // 如果之前没有存储过,则创建新对象 +// templateInfoList = new HashMap<>(); +// } catch (Exception ex) { +// FRLogger.getLogger().error(ex.getMessage(), ex); +// } + templateInfoList = new HashMap<>(); + setDesignerOpenDate(); + } + + /** + * 把设计器最近打开日期设定为当前日期 + */ + private void setDesignerOpenDate() { + designerOpenDate = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); + } + + /** + * 判断今天是否第一次打开设计器 + */ + private boolean designerOpenFirstTime() { + String today = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); + return !ComparatorUtils.equals(today, designerOpenDate); } /** @@ -50,8 +69,21 @@ public class TemplateInfoCollector implements Serializable { } public static TemplateInfoCollector getInstance() { +// if (instance == null) { +// instance = new TemplateInfoCollector(); +// } +// return instance; if (instance == null) { - instance = new TemplateInfoCollector(); + // 先尝试从文件读取 + try{ + ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); + instance = (TemplateInfoCollector) is.readObject(); + } catch (FileNotFoundException ex) { + // 如果之前没有存储过,则创建新对象 + instance = new TemplateInfoCollector(); + } catch (Exception ex) { + FRLogger.getLogger().error(ex.getMessage(), ex); + } } return instance; } @@ -83,8 +115,8 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - System.out.println("写入:" + templateInfoList); - os.writeObject(templateInfoList); + System.out.println("写入:" + instance.templateInfoList); + os.writeObject(instance); os.close(); } catch (Exception ex) { ex.printStackTrace(); @@ -98,6 +130,20 @@ public class TemplateInfoCollector implements Serializable { return templateInfoList; } + /** + * 更新 day_count:打开设计器却未编辑模板的连续日子 + */ + private void addDayCount() { + if (designerOpenFirstTime()) { + for (String key : templateInfoList.keySet()) { + HashMap templateInfo = templateInfoList.get(key); + int dayCount = (int)templateInfo.get("day_count") + 1; + templateInfo.put("day_count", dayCount); + } + setDesignerOpenDate(); + } + } + /** * 收集模板信息。如果之前没有记录,则新增;如果已有记录,则更新。 * 同时将最新数据保存到文件中。 @@ -105,7 +151,7 @@ public class TemplateInfoCollector implements Serializable { public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { HashMap templateInfo; - long timeConsume = saveTime - openTime; // 制作模板耗时 + long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s) String reportletsid = t.getReportletsid(); if (inList(t)) { // 已有记录 @@ -123,7 +169,8 @@ public class TemplateInfoCollector implements Serializable { // 直接覆盖 processMap templateInfo.put("processMap", getProcessMap(reportletsid, jt)); - // TODO: 更新模板是否完成的标记 + // 保存模板时,让 day_count 归零 + templateInfo.put("day_count", 0); templateInfoList.put(reportletsid, templateInfo); @@ -138,7 +185,7 @@ public class TemplateInfoCollector implements Serializable { String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); // String createTime = new Date(openTime).toString(); - String createTime = new SimpleDateFormat("yyyy-MM-dd hh:mm").format(Calendar.getInstance().getTime()); + String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); String jarTime = GeneralUtils.readBuildNO(); String version = ProductConstants.VERSION; consumingMap.put("username", username); @@ -171,17 +218,19 @@ public class TemplateInfoCollector implements Serializable { * 发送本地模板信息到服务器 */ public void sendTemplateInfo() { - + addDayCount(); String url1 = "http://cloud.fanruan.com/api/monitor/record_of_make_reports/single"; ArrayList> completeTemplatesInfo = getCompleteTemplatesInfo(); for (HashMap templateInfo : completeTemplatesInfo) { String jsonConsumingMap = templateInfo.get("jsonConsumingMap"); String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(url1, jsonConsumingMap) && sendSingleTemplateInfo(url1, jsonProcessMap)) { - // TODO: 清空记录 + // 清空记录 System.out.println("success"); + templateInfoList.remove(templateInfo.get("reportletsid")); } } + saveInfo(); // //服务器返回true, 说明已经获取成功, 清空当前记录的信息 // if (success) { // System.out.println("success"); @@ -217,6 +266,9 @@ public class TemplateInfoCollector implements Serializable { private ArrayList> getCompleteTemplatesInfo() { ArrayList> completeTemplatesInfo = new ArrayList<>(); for (String key : templateInfoList.keySet()) { + if ((int)templateInfoList.get(key).get("day_count") <= 15) { // 未完成模板 + continue; + } HashMap templateInfo = new HashMap<>(); HashMap consumingMap = (HashMap) templateInfoList.get(key).get("consumingMap"); HashMap processMap = (HashMap) templateInfoList.get(key).get("processMap"); @@ -234,7 +286,7 @@ public class TemplateInfoCollector implements Serializable { public static void main(String[] args) { TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); -// tic.getInfoList(); + tic.getInfoList(); tic.sendTemplateInfo(); } From 6b6c4c43e026728eb3cffb7e36ed56475b110e2f Mon Sep 17 00:00:00 2001 From: fr_shine Date: Wed, 15 Mar 2017 17:15:21 +0800 Subject: [PATCH 29/39] =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/chart/gui/ChartTypePane.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index 172d040f3f..0b5cfe6c92 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -33,7 +33,7 @@ import java.util.List; * @version 创建时间:2012-12-26 上午10:56:51 */ public class ChartTypePane extends AbstractChartAttrPane{ - private ComboBoxPane chartTypePane; + private ComboBoxPane chartTypeComBox; private ChartTypeButtonPane buttonPane; private ChartEditPane editPane; private ChartCollection editingCollection; @@ -72,13 +72,13 @@ public class ChartTypePane extends AbstractChartAttrPane{ if (editingCollection != null) { relayoutChartTypePane(editingCollection); }else { - chartTypePane = new ComboBoxPane(); + chartTypeComBox = new ComboBoxPane(); } BasicScrollPane scrollPane = new BasicScrollPane() { @Override protected JPanel createContentPane() { - return chartTypePane; + return chartTypeComBox; } @Override @@ -99,7 +99,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ }; content.add(scrollPane, BorderLayout.CENTER); - buttonPane.setEditingChartPane(chartTypePane); + buttonPane.setEditingChartPane(chartTypeComBox); return content; } @@ -286,7 +286,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void relayoutChartTypePane(ChartCollection collection){ if (needRelayout(collection)) { - chartTypePane.relayout(collection); + chartTypeComBox.relayout(collection); //设置面板切换状态 updatePaneState(collection); } @@ -314,7 +314,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ initContentPane(); buttonPane.populateBean(collection); - chartTypePane.populateBean(chart); + chartTypeComBox.populateBean(chart); this.initAllListeners(); } @@ -326,7 +326,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ editingCollection = collection; buttonPane.update(collection);// 内部操作时 已经做过处理. Chart chart = collection.getSelectedChart(); - chartTypePane.updateBean(chart); + chartTypeComBox.updateBean(chart); } /** @@ -334,7 +334,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @return 类型界面 */ public FurtherBasicBeanPane[] getPaneList(){ - return chartTypePane.getCards().toArray(new FurtherBasicBeanPane[0]); + return chartTypeComBox.getCards().toArray(new FurtherBasicBeanPane[0]); } /** @@ -342,7 +342,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @return 当前选中的图表的index */ public int getSelectedIndex(){ - return chartTypePane.getSelectedIndex(); + return chartTypeComBox.getSelectedIndex(); } /** @@ -350,7 +350,7 @@ public class ChartTypePane extends AbstractChartAttrPane{ * @return 选中的图标的序号 */ public int getSelectedChartIndex(){ - return chartTypePane.getSelectedIndex(); + return chartTypeComBox.getSelectedIndex(); } /** From 77e8710f6cea1148f564a1b6bf53a9c7b3beb282 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 16 Mar 2017 09:47:27 +0800 Subject: [PATCH 30/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateinfo/TemplateInfoCollector.java | 59 ++++--------------- 1 file changed, 13 insertions(+), 46 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 83c7c1d63b..891fc5b20c 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -1,6 +1,5 @@ package com.fr.design.mainframe.templateinfo; -import com.fr.base.FRContext; import com.fr.base.io.IOFile; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; @@ -16,7 +15,6 @@ import java.io.*; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; -import java.util.Date; import java.util.HashMap; /** @@ -31,17 +29,6 @@ public class TemplateInfoCollector implements Serializable { @SuppressWarnings("unchecked") private TemplateInfoCollector() { -// // 先尝试从文件读取 -// try{ -// ObjectInputStream is = new ObjectInputStream(new FileInputStream(getInfoFile())); -//// templateInfoList = (HashMap>) is.readObject(); -// instance = (HashMap>) is.readObject(); -// } catch (FileNotFoundException ex) { -// // 如果之前没有存储过,则创建新对象 -// templateInfoList = new HashMap<>(); -// } catch (Exception ex) { -// FRLogger.getLogger().error(ex.getMessage(), ex); -// } templateInfoList = new HashMap<>(); setDesignerOpenDate(); } @@ -69,10 +56,6 @@ public class TemplateInfoCollector implements Serializable { } public static TemplateInfoCollector getInstance() { -// if (instance == null) { -// instance = new TemplateInfoCollector(); -// } -// return instance; if (instance == null) { // 先尝试从文件读取 try{ @@ -111,7 +94,9 @@ public class TemplateInfoCollector implements Serializable { return templateInfoList.containsKey(t.getReportletsid()); } - // 将包含所有信息的对象保存到文件 + /** + * 将包含所有信息的对象保存到文件 + */ private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); @@ -123,13 +108,6 @@ public class TemplateInfoCollector implements Serializable { } } - public HashMap getInfoList() { - for (String key : templateInfoList.keySet()) { - System.out.println(templateInfoList.get(key)); - } - return templateInfoList; - } - /** * 更新 day_count:打开设计器却未编辑模板的连续日子 */ @@ -148,6 +126,7 @@ public class TemplateInfoCollector implements Serializable { * 收集模板信息。如果之前没有记录,则新增;如果已有记录,则更新。 * 同时将最新数据保存到文件中。 */ + @SuppressWarnings("unchecked") public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { HashMap templateInfo; @@ -184,7 +163,6 @@ public class TemplateInfoCollector implements Serializable { String username = DesignerEnvManager.getEnvManager().getBBSName(); String uuid = DesignerEnvManager.getEnvManager().getUUID(); String activitykey = DesignerEnvManager.getEnvManager().getActivationKey(); -// String createTime = new Date(openTime).toString(); String createTime = new SimpleDateFormat("yyyy-MM-dd HH:mm").format(Calendar.getInstance().getTime()); String jarTime = GeneralUtils.readBuildNO(); String version = ProductConstants.VERSION; @@ -219,24 +197,19 @@ public class TemplateInfoCollector implements Serializable { */ public void sendTemplateInfo() { addDayCount(); - String url1 = "http://cloud.fanruan.com/api/monitor/record_of_make_reports/single"; + String consumingUrl = "http://cloud.fanruan.com/api/monitor/record_of_reports_consuming/single"; + String processUrl = "http://cloud.fanruan.com/api/monitor/record_of_reports_process/single"; ArrayList> completeTemplatesInfo = getCompleteTemplatesInfo(); for (HashMap templateInfo : completeTemplatesInfo) { String jsonConsumingMap = templateInfo.get("jsonConsumingMap"); String jsonProcessMap = templateInfo.get("jsonProcessMap"); - if (sendSingleTemplateInfo(url1, jsonConsumingMap) && sendSingleTemplateInfo(url1, jsonProcessMap)) { + if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 System.out.println("success"); templateInfoList.remove(templateInfo.get("reportletsid")); } } saveInfo(); -// //服务器返回true, 说明已经获取成功, 清空当前记录的信息 -// if (success) { -// System.out.println("success"); -// } else { -// System.out.println("fail"); -// } } private boolean sendSingleTemplateInfo(String url, String content) { @@ -244,11 +217,7 @@ public class TemplateInfoCollector implements Serializable { String date = new SimpleDateFormat("yyyy-MM-dd").format(Calendar.getInstance().getTime()); para.put("token", CodeUtils.md5Encode(date, "", "MD5")); para.put("content", content); -// para.put("content", "{name:3, age:3}"); -// HttpClient httpClient = new HttpClient("http://cloud.fanruan.com/api/monitor/record_of_make_reports/single", para, true); HttpClient httpClient = new HttpClient(url, para, true); - - //httpClient.setContent(getCompleteTemplatesInfo()); httpClient.setTimeout(5000); httpClient.asGet(); @@ -261,7 +230,9 @@ public class TemplateInfoCollector implements Serializable { return success; } - // 返回已完成的模板信息 + /** + * 返回已完成的模板信息 + */ @SuppressWarnings("unchecked") private ArrayList> getCompleteTemplatesInfo() { ArrayList> completeTemplatesInfo = new ArrayList<>(); @@ -277,17 +248,13 @@ public class TemplateInfoCollector implements Serializable { templateInfo.put("jsonConsumingMap", jsonConsumingMap); templateInfo.put("jsonProcessMap", jsonProcessMap); templateInfo.put("reportletsid", key); - completeTemplatesInfo.add(templateInfo); // TODO 暂未添加筛选条件 + completeTemplatesInfo.add(templateInfo); } return completeTemplatesInfo; } - - public static void main(String[] args) { - TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); - tic.getInfoList(); - tic.sendTemplateInfo(); - +// TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); +// tic.sendTemplateInfo(); } } From 9a738346ed4273d31686cb2df00ef0732f93079b Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 16 Mar 2017 16:15:58 +0800 Subject: [PATCH 31/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateinfo/TemplateInfoCollector.java | 50 +++++++++++++++---- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 891fc5b20c..b9c92b1dab 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -100,7 +100,7 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - System.out.println("写入:" + instance.templateInfoList); +// System.out.println("写入:" + instance.templateInfoList); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -205,7 +205,7 @@ public class TemplateInfoCollector implements Serializable { String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 - System.out.println("success"); +// System.out.println("success"); templateInfoList.remove(templateInfo.get("reportletsid")); } } @@ -236,23 +236,53 @@ public class TemplateInfoCollector implements Serializable { @SuppressWarnings("unchecked") private ArrayList> getCompleteTemplatesInfo() { ArrayList> completeTemplatesInfo = new ArrayList<>(); + ArrayList testTemplateKeys = new ArrayList<>(); // 保存测试模板的key for (String key : templateInfoList.keySet()) { - if ((int)templateInfoList.get(key).get("day_count") <= 15) { // 未完成模板 + HashMap templateInfo = templateInfoList.get(key); + if ((int)templateInfo.get("day_count") <= 15) { // 未完成模板 continue; } - HashMap templateInfo = new HashMap<>(); - HashMap consumingMap = (HashMap) templateInfoList.get(key).get("consumingMap"); - HashMap processMap = (HashMap) templateInfoList.get(key).get("processMap"); + if (isTestTemplate(templateInfo)) { + testTemplateKeys.add(key); + continue; + } + HashMap consumingMap = (HashMap) templateInfo.get("consumingMap"); + HashMap processMap = (HashMap) templateInfo.get("processMap"); String jsonConsumingMap = new JSONObject(consumingMap).toString(); String jsonProcessMap = new JSONObject(processMap).toString(); - templateInfo.put("jsonConsumingMap", jsonConsumingMap); - templateInfo.put("jsonProcessMap", jsonProcessMap); - templateInfo.put("reportletsid", key); - completeTemplatesInfo.add(templateInfo); + HashMap jsonTemplateInfo = new HashMap<>(); + jsonTemplateInfo.put("jsonConsumingMap", jsonConsumingMap); + jsonTemplateInfo.put("jsonProcessMap", jsonProcessMap); + jsonTemplateInfo.put("reportletsid", key); + completeTemplatesInfo.add(jsonTemplateInfo); + } + // 删除测试模板 + for (String key : testTemplateKeys) { + templateInfoList.remove(key); +// System.out.println(key + " is removed..."); } return completeTemplatesInfo; } + @SuppressWarnings("unchecked") + private boolean isTestTemplate(HashMap templateInfo) { + HashMap processMap = (HashMap) templateInfo.get("processMap"); + int reportType = (int)processMap.get("report_type"); + int cellCount = (int)processMap.get("cell_count"); + int floatCount = (int)processMap.get("float_count"); + int blockCount = (int)processMap.get("block_count"); + int widgetCount = (int)processMap.get("widget_count"); + boolean isTestTemplate = false; + if (reportType == 0) { // 普通报表 + isTestTemplate = cellCount <= 5 && floatCount <= 1 && widgetCount <= 5; + } else if (reportType == 1) { // 聚合报表 + isTestTemplate = blockCount <= 1 && widgetCount <= 5; + } else { // 表单(reportType == 2) + isTestTemplate = widgetCount <= 1; + } + return isTestTemplate; + } + public static void main(String[] args) { // TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); // tic.sendTemplateInfo(); From 2d53d781b620a0e0aaf867012adb1da7da621e14 Mon Sep 17 00:00:00 2001 From: juhaoyu <2335173323@qq.com> Date: Fri, 17 Mar 2017 11:02:33 +0800 Subject: [PATCH 32/39] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=92=E4=BB=B6=E5=8D=B8=E8=BD=BD=E5=89=8D?= =?UTF-8?q?=E7=9B=91=E5=90=AC=EF=BC=8C=E6=80=A7=E8=83=BD=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=BB=A5=E6=AD=A4=E8=BF=9B=E8=A1=8C=E9=A2=9D=E5=A4=96=E7=9A=84?= =?UTF-8?q?=E5=8D=B8=E8=BD=BD=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/extra/PluginHelper.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index be0244f78d..ed0d78aa17 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -319,6 +319,8 @@ public class PluginHelper { if (plugin == null || env == null) { return ArrayUtils.EMPTY_STRING_ARRAY; } + //卸载前监听 + plugin.preUninstall(); PluginLoader.getLoader().deletePlugin(plugin); return env.deleteFileFromPluginAndLibFolder(plugin); } From b2f7c448f98034f8981d2f58afe6e770272831d5 Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 17 Mar 2017 11:38:19 +0800 Subject: [PATCH 33/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E6=8A=8A=20reportletsid=20=E6=94=B9?= =?UTF-8?q?=E6=88=90=20templateID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/TemplateProcessTracker.aj | 4 --- .../designerbase/TemplateProcessTracker.aj | 4 --- .../com/fr/design/mainframe/JTemplate.java | 6 ++-- .../templateinfo/TemplateInfoCollector.java | 28 +++++++++---------- 4 files changed, 17 insertions(+), 25 deletions(-) diff --git a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj index 0b3ea70835..032cd23424 100644 --- a/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj +++ b/designer/src/com/fr/aspectj/designer/TemplateProcessTracker.aj @@ -53,10 +53,6 @@ public aspect TemplateProcessTracker { //同上 before(Object v, int r, int c) : onSetValueAt(v, r, c) { SourceLocation sl = thisJoinPoint.getSourceLocation(); - // !within(LogHandlerBar) 没用, 手动过滤 -// if (e.getSource().toString().contains("javax.swing.Timer")) { -// return; -// } //String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); String log = ""; diff --git a/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj index b07ec9951a..61a0be5008 100644 --- a/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj +++ b/designer_base/src/com/fr/aspectj/designerbase/TemplateProcessTracker.aj @@ -50,10 +50,6 @@ public aspect TemplateProcessTracker { //同上 before(Object v, int r, int c) : onSetValueAt(v, r, c) { SourceLocation sl = thisJoinPoint.getSourceLocation(); - // !within(LogHandlerBar) 没用, 手动过滤 -// if (e.getSource().toString().contains("javax.swing.Timer")) { -// return; -// } //String log = String.format("%s:\n%s\nset value: %s at (%d, %d)\n\n", new Date(), sl, v, r, c); String log = ""; diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java index ccdfb11e1a..aec297ddf9 100644 --- a/designer_base/src/com/fr/design/mainframe/JTemplate.java +++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java @@ -109,8 +109,8 @@ public abstract class JTemplate> ex // 为收集模版信息作准备 private void initForCollect() { - if (template.getReportletsid() == null) { - template.initReportletsid(); // 为新模板设置 reportletsid 属性 + if (template.getTemplateID() == null) { + template.initTemplateID(); // 为新模板设置 templateID 属性 } if (openTime == 0) { openTime = System.currentTimeMillis(); @@ -540,7 +540,7 @@ public abstract class JTemplate> ex boolean result = this.saveFile(); if (result) { DesignerFrameFileDealerPane.getInstance().refresh(); - initForCollect(); // 如果是旧模板另存为新模板,则添加 reportletsid + initForCollect(); // 如果是旧模板另存为新模板,则添加 templateID collectInfo(); } //更换最近打开 diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index b9c92b1dab..6e73c5d0bd 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -83,7 +83,7 @@ public class TemplateInfoCollector implements Serializable { */ @SuppressWarnings("unchecked") public String loadProcess(T t) { - HashMap processMap = (HashMap) templateInfoList.get(t.getReportletsid()).get("processMap"); + HashMap processMap = (HashMap) templateInfoList.get(t.getTemplateID()).get("processMap"); return (String)processMap.get("process"); } @@ -91,7 +91,7 @@ public class TemplateInfoCollector implements Serializable { * 根据模板ID是否在收集列表中,判断是否需要收集当前模板的信息 */ public boolean inList(T t) { - return templateInfoList.containsKey(t.getReportletsid()); + return templateInfoList.containsKey(t.getTemplateID()); } /** @@ -100,7 +100,7 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); -// System.out.println("写入:" + instance.templateInfoList); + System.out.println("写入:" + instance.templateInfoList); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -131,10 +131,10 @@ public class TemplateInfoCollector implements Serializable { HashMap templateInfo; long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s) - String reportletsid = t.getReportletsid(); + String templateID = t.getTemplateID(); if (inList(t)) { // 已有记录 - templateInfo = templateInfoList.get(t.getReportletsid()); + templateInfo = templateInfoList.get(t.getTemplateID()); // 更新 conusmingMap HashMap consumingMap = (HashMap) templateInfo.get("consumingMap"); timeConsume += (long)consumingMap.get("time_consume"); // 加上之前的累计编辑时间 @@ -142,22 +142,22 @@ public class TemplateInfoCollector implements Serializable { } else { // 新增 templateInfo = new HashMap<>(); - templateInfo.put("consumingMap", getNewConsumingMap(reportletsid, openTime, timeConsume)); + templateInfo.put("consumingMap", getNewConsumingMap(templateID, openTime, timeConsume)); } // 直接覆盖 processMap - templateInfo.put("processMap", getProcessMap(reportletsid, jt)); + templateInfo.put("processMap", getProcessMap(templateID, jt)); // 保存模板时,让 day_count 归零 templateInfo.put("day_count", 0); - templateInfoList.put(reportletsid, templateInfo); + templateInfoList.put(templateID, templateInfo); saveInfo(); // 每次更新之后,都同步到暂存文件中 } - private HashMap getNewConsumingMap(String reportletsid, long openTime, long timeConsume) { + private HashMap getNewConsumingMap(String templateID, long openTime, long timeConsume) { HashMap consumingMap = new HashMap<>(); String username = DesignerEnvManager.getEnvManager().getBBSName(); @@ -169,7 +169,7 @@ public class TemplateInfoCollector implements Serializable { consumingMap.put("username", username); consumingMap.put("uuid", uuid); consumingMap.put("activitykey", activitykey); - consumingMap.put("reportletsid", reportletsid); + consumingMap.put("templateID", templateID); consumingMap.put("create_time", createTime); consumingMap.put("time_consume", timeConsume); consumingMap.put("jar_time", jarTime); @@ -178,10 +178,10 @@ public class TemplateInfoCollector implements Serializable { return consumingMap; } - private HashMap getProcessMap(String reportletsid, JTemplate jt) { + private HashMap getProcessMap(String templateID, JTemplate jt) { HashMap processMap = new HashMap<>(); - processMap.put("reportletsid", reportletsid); + processMap.put("templateID", templateID); processMap.put("process", jt.getProcess()); processMap.put("report_type", jt.getReportType()); processMap.put("cell_count", jt.getCellCount()); @@ -206,7 +206,7 @@ public class TemplateInfoCollector implements Serializable { if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 // System.out.println("success"); - templateInfoList.remove(templateInfo.get("reportletsid")); + templateInfoList.remove(templateInfo.get("templateID")); } } saveInfo(); @@ -253,7 +253,7 @@ public class TemplateInfoCollector implements Serializable { HashMap jsonTemplateInfo = new HashMap<>(); jsonTemplateInfo.put("jsonConsumingMap", jsonConsumingMap); jsonTemplateInfo.put("jsonProcessMap", jsonProcessMap); - jsonTemplateInfo.put("reportletsid", key); + jsonTemplateInfo.put("templateID", key); completeTemplatesInfo.add(jsonTemplateInfo); } // 删除测试模板 From 89432288836110ff2271c288fbece4691fcb92ee Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 17 Mar 2017 14:27:50 +0800 Subject: [PATCH 34/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E8=8B=A5=E6=9C=AA=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E6=94=B9=E8=89=AF=E8=AE=A1=E5=88=92=EF=BC=8C?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E6=94=B6=E9=9B=86=E6=9C=AC=E5=9C=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templateinfo/TemplateInfoCollector.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 6e73c5d0bd..df71bdfc87 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.templateinfo; +import com.fr.base.FRContext; import com.fr.base.io.IOFile; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.DesignerContext; @@ -71,7 +72,14 @@ public class TemplateInfoCollector implements Serializable { return instance; } + private static boolean shouldCollectInfo() { + return DesignerEnvManager.getEnvManager().isJoinProductImprove() && FRContext.isChineseEnv(); + } + public static void appendProcess(String log) { + if (!shouldCollectInfo()) { + return; + } // 获取当前编辑的模板 JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate(); // 追加过程记录 @@ -100,7 +108,7 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - System.out.println("写入:" + instance.templateInfoList); +// System.out.println("写入:" + instance.templateInfoList); os.writeObject(instance); os.close(); } catch (Exception ex) { @@ -128,6 +136,10 @@ public class TemplateInfoCollector implements Serializable { */ @SuppressWarnings("unchecked") public void collectInfo(T t, JTemplate jt, long openTime, long saveTime) { + if (!shouldCollectInfo()) { + return; + } + HashMap templateInfo; long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s) From 7049c30a4e1da5122af8ea2649ba28d5ef089af6 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 20 Mar 2017 10:18:06 +0800 Subject: [PATCH 35/39] =?UTF-8?q?REPORT-1916=20=E5=81=9A=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E7=A8=8B=E5=92=8C=E8=80=97=E6=97=B6=E6=94=B6?= =?UTF-8?q?=E9=9B=86=3D=E3=80=8B=E6=8A=8A=E7=BB=9F=E8=AE=A1=E6=A0=BC?= =?UTF-8?q?=E5=AD=90=E6=95=B0=E9=87=8F=E7=9A=84=E5=8A=9F=E8=83=BD=E5=88=86?= =?UTF-8?q?=E7=A6=BB=E4=B8=BA=E5=8D=95=E7=8B=AC=E7=9A=84=E7=B1=BB=EF=BC=9B?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JWorkBook.java | 58 ++------------ .../tabledatapane/EmbeddedTableDataPane.java | 1 - .../src/com/fr/design/extra/PluginHelper.java | 2 +- .../com/fr/design/mainframe/JTemplate.java | 13 +--- .../templateinfo/JFormProcessInfo.java | 42 +++++++++++ .../templateinfo/JWorkBookProcessInfo.java | 75 +++++++++++++++++++ .../templateinfo/TemplateInfoCollector.java | 39 ++++++---- .../templateinfo/TemplateProcessInfo.java | 26 +++++++ .../src/com/fr/design/mainframe/JForm.java | 32 ++------ 9 files changed, 182 insertions(+), 106 deletions(-) create mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java create mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java create mode 100644 designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessInfo.java diff --git a/designer/src/com/fr/design/mainframe/JWorkBook.java b/designer/src/com/fr/design/mainframe/JWorkBook.java index 4cb98680a6..fd4cd7b0da 100644 --- a/designer/src/com/fr/design/mainframe/JWorkBook.java +++ b/designer/src/com/fr/design/mainframe/JWorkBook.java @@ -27,6 +27,8 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.mainframe.cell.QuickEditorRegion; +import com.fr.design.mainframe.templateinfo.JWorkBookProcessInfo; +import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.*; import com.fr.design.module.DesignModuleFactory; @@ -130,59 +132,11 @@ public class JWorkBook extends JTemplate { return centerPane; } - // 获取模板类型 - public int getReportType() { - return template.isElementCaseBook() ? 0 : 1; - } - - // 获取模板格子数 - public int getCellCount() { - int cellCount = 0; - if (template.isElementCaseBook()) { // 如果是普通报表 - for (int i = 0; i < template.getReportCount(); i++) { - WorkSheet r = (WorkSheet) template.getReport(i); - CellCase cc = r.getBlock().getCellCase(); - for (int j = 0; j < cc.getRowCount(); j++) { - Iterator iter = cc.getRow(j); - while (iter.hasNext()) { - cellCount ++; - iter.next(); - } - } - } - } - return cellCount; - } - // 获取模板悬浮元素个数 - public int getFloatCount() { - int chartCount = 0; - if (template.isElementCaseBook()) { // 如果是普通报表 - for (int i = 0; i < template.getReportCount(); i++) { - WorkSheet r = (WorkSheet) template.getReport(i); - Iterator fiter = r.getBlock().floatIterator(); - while (fiter.hasNext()) { - chartCount ++; - fiter.next(); - } - } - } - return chartCount; - } - // 获取模板聚合块个数 - public int getBlockCount() { - int blockCount = 0; - if (!template.isElementCaseBook()) { // 如果是聚合报表 - for (int i = 0; i < template.getReportCount(); i++) { - PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); - blockCount += r.getBlockCount(); - } + public TemplateProcessInfo getProcessInfo() { + if (processInfo == null) { + processInfo = new JWorkBookProcessInfo(template); } - return blockCount; - } - // 获取模板控件数 - public int getWidgetCount() { - ParameterUI pui = template.getReportParameterAttr().getParameterUI(); - return pui == null ? 0 : (pui.getAllWidgets().length - 1); + return processInfo; } /** diff --git a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java index a4ddba1f74..3103f6850d 100644 --- a/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java +++ b/designer_base/src/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java @@ -96,7 +96,6 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane> ex protected U undoState; protected U authorityUndoState = null; protected T template; // 当前模板 + protected TemplateProcessInfo processInfo; // 模板过程的相关信息 private static short currentIndex = 0;// 此变量用于多次新建模板时,让名字不重复 private DesignModelAdapter designModel; private PreviewProvider previewType; @@ -122,16 +124,7 @@ public abstract class JTemplate> ex openTime = saveTime; // 更新 openTime,准备下一次计算 } - // 获取模板类型。0 代表普通报表,1 代表聚合报表,2 代表表单 - public abstract int getReportType(); - // 获取模板格子数 - public abstract int getCellCount(); - // 获取模板悬浮元素个数 - public abstract int getFloatCount(); - // 获取模板聚合块个数 - public abstract int getBlockCount(); - // 获取模板控件数 - public abstract int getWidgetCount(); + public abstract TemplateProcessInfo getProcessInfo(); // 追加过程记录 public void appendProcess(String s) { diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java b/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java new file mode 100644 index 0000000000..4fa5169290 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/JFormProcessInfo.java @@ -0,0 +1,42 @@ +package com.fr.design.mainframe.templateinfo; + +import com.fr.form.main.Form; +import com.fr.form.ui.container.WFitLayout; + +/** + * Created by plough on 2017/3/17. + */ +public class JFormProcessInfo extends TemplateProcessInfo
{ + public JFormProcessInfo(Form form) { + super(form); + } + + // 获取模板类型 + public int getReportType() { + return 2; + } + + // 获取模板格子数 + public int getCellCount() { + return 0; + } + // 获取模板悬浮元素个数 + public int getFloatCount() { + return 0; + } + // 获取模板聚合块个数 + public int getBlockCount() { + return 0; + } + // 获取模板控件数 + public int getWidgetCount() { + int widgetCount = 0; + for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { + WFitLayout wf = (WFitLayout) template.getContainer().getWidget(i); + widgetCount += wf.getWidgetCount(); + } + int a = 1; + int b = 2; + return widgetCount; + } +} diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java b/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java new file mode 100644 index 0000000000..44522b8566 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/JWorkBookProcessInfo.java @@ -0,0 +1,75 @@ +package com.fr.design.mainframe.templateinfo; + +import com.fr.base.io.IOFile; +import com.fr.base.parameter.ParameterUI; +import com.fr.main.impl.WorkBook; +import com.fr.report.cellcase.CellCase; +import com.fr.report.poly.PolyWorkSheet; +import com.fr.report.worksheet.WorkSheet; + +import java.util.Iterator; + +/** + * Created by plough on 2017/3/17. + */ +public class JWorkBookProcessInfo extends TemplateProcessInfo { + + public JWorkBookProcessInfo(WorkBook wb) { + super(wb); + } + + // 获取模板类型 + public int getReportType() { + return template.isElementCaseBook() ? 0 : 1; + } + + // 获取模板格子数 + public int getCellCount() { + int cellCount = 0; + if (template.isElementCaseBook()) { // 如果是普通报表 + for (int i = 0; i < template.getReportCount(); i++) { + WorkSheet r = (WorkSheet) template.getReport(i); + CellCase cc = r.getBlock().getCellCase(); + for (int j = 0; j < cc.getRowCount(); j++) { + Iterator iter = cc.getRow(j); + while (iter.hasNext()) { + cellCount ++; + iter.next(); + } + } + } + } + return cellCount; + } + // 获取模板悬浮元素个数 + public int getFloatCount() { + int chartCount = 0; + if (template.isElementCaseBook()) { // 如果是普通报表 + for (int i = 0; i < template.getReportCount(); i++) { + WorkSheet r = (WorkSheet) template.getReport(i); + Iterator fiter = r.getBlock().floatIterator(); + while (fiter.hasNext()) { + chartCount ++; + fiter.next(); + } + } + } + return chartCount; + } + // 获取模板聚合块个数 + public int getBlockCount() { + int blockCount = 0; + if (!template.isElementCaseBook()) { // 如果是聚合报表 + for (int i = 0; i < template.getReportCount(); i++) { + PolyWorkSheet r = (PolyWorkSheet) template.getReport(i); + blockCount += r.getBlockCount(); + } + } + return blockCount; + } + // 获取模板控件数 + public int getWidgetCount() { + ParameterUI pui = template.getReportParameterAttr().getParameterUI(); + return pui == null ? 0 : (pui.getAllWidgets().length - 1); + } +} diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index df71bdfc87..8b987dc058 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -8,6 +8,7 @@ import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; import com.fr.general.GeneralUtils; +import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.*; import org.json.JSONObject; @@ -27,6 +28,10 @@ public class TemplateInfoCollector implements Serializable { private static TemplateInfoCollector instance; private HashMap> templateInfoList; private String designerOpenDate; //设计器最近一次打开日期 + private static final int VALID_CELL_COUNT = 5; // 有效报表模板的格子数 + private static final int VALID_WIDGET_COUNT = 5; // 有效报表模板的控件数 + private static final int COMPLETE_DAY_COUNT = 15; // 判断模板是否完成的天数 + private static final int ONE_THOUSAND = 1000; @SuppressWarnings("unchecked") private TemplateInfoCollector() { @@ -108,11 +113,11 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); -// System.out.println("写入:" + instance.templateInfoList); + System.out.println("写入:" + instance.templateInfoList); os.writeObject(instance); os.close(); } catch (Exception ex) { - ex.printStackTrace(); + FRLogger.getLogger().error(ex.getMessage()); } } @@ -142,7 +147,7 @@ public class TemplateInfoCollector implements Serializable { HashMap templateInfo; - long timeConsume = ((saveTime - openTime) / 1000); // 制作模板耗时(单位:s) + long timeConsume = ((saveTime - openTime) / ONE_THOUSAND); // 制作模板耗时(单位:s) String templateID = t.getTemplateID(); if (inList(t)) { // 已有记录 @@ -195,11 +200,13 @@ public class TemplateInfoCollector implements Serializable { processMap.put("templateID", templateID); processMap.put("process", jt.getProcess()); - processMap.put("report_type", jt.getReportType()); - processMap.put("cell_count", jt.getCellCount()); - processMap.put("float_count", jt.getFloatCount()); - processMap.put("block_count", jt.getBlockCount()); - processMap.put("widget_count", jt.getWidgetCount()); + + TemplateProcessInfo info = jt.getProcessInfo(); + processMap.put("report_type", info.getReportType()); + processMap.put("cell_count", info.getCellCount()); + processMap.put("float_count", info.getFloatCount()); + processMap.put("block_count", info.getBlockCount()); + processMap.put("widget_count", info.getWidgetCount()); return processMap; } @@ -209,15 +216,15 @@ public class TemplateInfoCollector implements Serializable { */ public void sendTemplateInfo() { addDayCount(); - String consumingUrl = "http://cloud.fanruan.com/api/monitor/record_of_reports_consuming/single"; - String processUrl = "http://cloud.fanruan.com/api/monitor/record_of_reports_process/single"; + String consumingUrl = SiteCenter.getInstance().acquireUrlByKind("tempinfo.consuming") + "/single"; + String processUrl = SiteCenter.getInstance().acquireUrlByKind("tempinfo.process") + "/single"; ArrayList> completeTemplatesInfo = getCompleteTemplatesInfo(); for (HashMap templateInfo : completeTemplatesInfo) { String jsonConsumingMap = templateInfo.get("jsonConsumingMap"); String jsonProcessMap = templateInfo.get("jsonProcessMap"); if (sendSingleTemplateInfo(consumingUrl, jsonConsumingMap) && sendSingleTemplateInfo(processUrl, jsonProcessMap)) { // 清空记录 -// System.out.println("success"); + FRLogger.getLogger().info("successfully send " + templateInfo.get("templateID")); templateInfoList.remove(templateInfo.get("templateID")); } } @@ -251,7 +258,7 @@ public class TemplateInfoCollector implements Serializable { ArrayList testTemplateKeys = new ArrayList<>(); // 保存测试模板的key for (String key : templateInfoList.keySet()) { HashMap templateInfo = templateInfoList.get(key); - if ((int)templateInfo.get("day_count") <= 15) { // 未完成模板 + if ((int)templateInfo.get("day_count") <= COMPLETE_DAY_COUNT) { // 未完成模板 continue; } if (isTestTemplate(templateInfo)) { @@ -286,9 +293,9 @@ public class TemplateInfoCollector implements Serializable { int widgetCount = (int)processMap.get("widget_count"); boolean isTestTemplate = false; if (reportType == 0) { // 普通报表 - isTestTemplate = cellCount <= 5 && floatCount <= 1 && widgetCount <= 5; + isTestTemplate = cellCount <= VALID_CELL_COUNT && floatCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; } else if (reportType == 1) { // 聚合报表 - isTestTemplate = blockCount <= 1 && widgetCount <= 5; + isTestTemplate = blockCount <= 1 && widgetCount <= VALID_WIDGET_COUNT; } else { // 表单(reportType == 2) isTestTemplate = widgetCount <= 1; } @@ -296,7 +303,7 @@ public class TemplateInfoCollector implements Serializable { } public static void main(String[] args) { -// TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); -// tic.sendTemplateInfo(); + TemplateInfoCollector tic = TemplateInfoCollector.getInstance(); + tic.sendTemplateInfo(); } } diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessInfo.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessInfo.java new file mode 100644 index 0000000000..d92ca7028a --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateProcessInfo.java @@ -0,0 +1,26 @@ +package com.fr.design.mainframe.templateinfo; + +import com.fr.base.io.IOFile; + +/** + * Created by plough on 2017/3/17. + */ +public abstract class TemplateProcessInfo { + + protected T template; + + public TemplateProcessInfo(T template) { + this.template = template; + } + + // 获取模板类型。0 代表普通报表,1 代表聚合报表,2 代表表单 + public abstract int getReportType(); + // 获取模板格子数 + public abstract int getCellCount(); + // 获取模板悬浮元素个数 + public abstract int getFloatCount(); + // 获取模板聚合块个数 + public abstract int getBlockCount(); + // 获取模板控件数 + public abstract int getWidgetCount(); +} diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index c19f7f43b5..b20f44bca4 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -23,6 +23,8 @@ import com.fr.design.mainframe.actions.EmbeddedFormExportExportAction; import com.fr.design.mainframe.actions.TemplateParameterAction; import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECDesignerProvider; +import com.fr.design.mainframe.templateinfo.JFormProcessInfo; +import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.menu.KeySetUtils; @@ -89,33 +91,11 @@ public class JForm extends JTemplate implements BaseJForm { return DesignState.JFORM; } - // 获取模板类型 - public int getReportType() { - return 2; - } - - // 获取模板格子数 - public int getCellCount() { - return 0; - } - // 获取模板悬浮元素个数 - public int getFloatCount() { - return 0; - } - // 获取模板聚合块个数 - public int getBlockCount() { - return 0; - } - // 获取模板控件数 - public int getWidgetCount() { - int widgetCount = 0; - for (int i = 0; i < template.getContainer().getWidgetCount(); i++) { - WFitLayout wf = (WFitLayout) template.getContainer().getWidget(i); - widgetCount += wf.getWidgetCount(); + public TemplateProcessInfo getProcessInfo() { + if (processInfo == null) { + processInfo = new JFormProcessInfo(template); } - int a = 1; - int b = 2; - return widgetCount; + return processInfo; } @Override From 587f6cf099b4700d09ae00e8d7f2a5fd1367fb6a Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 20 Mar 2017 11:01:24 +0800 Subject: [PATCH 36/39] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/src/com/fr/design/extra/PluginHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/extra/PluginHelper.java b/designer_base/src/com/fr/design/extra/PluginHelper.java index f6bcccc628..ed0d78aa17 100644 --- a/designer_base/src/com/fr/design/extra/PluginHelper.java +++ b/designer_base/src/com/fr/design/extra/PluginHelper.java @@ -320,7 +320,7 @@ public class PluginHelper { return ArrayUtils.EMPTY_STRING_ARRAY; } //卸载前监听 -// plugin.preUninstall(); + plugin.preUninstall(); PluginLoader.getLoader().deletePlugin(plugin); return env.deleteFileFromPluginAndLibFolder(plugin); } From 04e2efaf47e3e3689733e46c32f0a0d6850b7889 Mon Sep 17 00:00:00 2001 From: sunmondong Date: Mon, 20 Mar 2017 12:20:17 +0800 Subject: [PATCH 37/39] =?UTF-8?q?=20=E6=9E=84=E5=BB=BA=E4=BD=BF=E7=94=A8As?= =?UTF-8?q?pectJ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer_base/build.dev.gradle | 21 ++++++- designer_base/build.dev.gradle.bak | 70 ++++++++++++++++++++++++ designer_chart/build.dev.gradle | 20 ++++++- designer_chart/build.dev.gradle.bak | 85 +++++++++++++++++++++++++++++ designer_form/build.dev.gradle | 19 ++++++- designer_form/build.dev.gradle.bak | 4 +- 6 files changed, 213 insertions(+), 6 deletions(-) create mode 100644 designer_base/build.dev.gradle.bak create mode 100644 designer_chart/build.dev.gradle.bak diff --git a/designer_base/build.dev.gradle b/designer_base/build.dev.gradle index b02f751e7c..9b2b65770e 100644 --- a/designer_base/build.dev.gradle +++ b/designer_base/build.dev.gradle @@ -1,8 +1,25 @@ - -apply plugin: 'java' tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } + +buildscript { + repositories { + maven { + url "http://www.eveoh.nl/files/maven2" + } + } + + dependencies { + classpath "nl.eveoh:gradle-aspectj:1.2" + } +} + +ext.aspectjVersion = '1.7.4' +apply plugin: 'aspectj' + +repositories { + mavenCentral() +} //指定构建的jdk版本 sourceCompatibility=1.7 //指定生成jar包版本 diff --git a/designer_base/build.dev.gradle.bak b/designer_base/build.dev.gradle.bak new file mode 100644 index 0000000000..b02f751e7c --- /dev/null +++ b/designer_base/build.dev.gradle.bak @@ -0,0 +1,70 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} +//指定构建的jdk版本 +sourceCompatibility=1.7 +//指定生成jar包版本 +version='8.0' +//生成jar包重命名 +jar{ + baseName='fr-designer-core' +} + + +def srcDir="." + +//指定源码路径 +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src"] + } + } +} +//获取什么分支名 +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) + +//声明外部依赖 +dependencies{ + +compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} +//复制非.java文件到classes文件夹下参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + from ("${srcDir}/src"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + } + into 'build/classes/main' + } + +} + + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + + + diff --git a/designer_chart/build.dev.gradle b/designer_chart/build.dev.gradle index ba6df992bd..db1478361c 100644 --- a/designer_chart/build.dev.gradle +++ b/designer_chart/build.dev.gradle @@ -1,8 +1,26 @@ -apply plugin: 'java' tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } + +buildscript { + repositories { + maven { + url "http://www.eveoh.nl/files/maven2" + } + } + + dependencies { + classpath "nl.eveoh:gradle-aspectj:1.2" + } +} + +ext.aspectjVersion = '1.7.4' +apply plugin: 'aspectj' + +repositories { + mavenCentral() +} //指定构建的jdk版本 sourceCompatibility=1.7 //指定生成jar包的版本 diff --git a/designer_chart/build.dev.gradle.bak b/designer_chart/build.dev.gradle.bak new file mode 100644 index 0000000000..7566bcc825 --- /dev/null +++ b/designer_chart/build.dev.gradle.bak @@ -0,0 +1,85 @@ + +apply plugin: 'java' +tasks.withType(JavaCompile){ + options.encoding = 'UTF-8' +} + +buildscript { + repositories { + maven { + url "http://www.eveoh.nl/files/maven2" + } + } + + dependencies { + classpath "nl.eveoh:gradle-aspectj:1.2" + } +} + +ext.aspectjVersion = '1.7.4' +apply plugin: 'aspectj' + +repositories { + mavenCentral() +} +//指定构建的jdk版本 +sourceCompatibility=1.7 +//指定生成jar包的版本 +version='8.0' + +def srcDir="." + +//对生成的jar包进行重命名 + +jar{ + baseName='fr-designer-chart' +} + +sourceSets{ + main{ + java{ + srcDirs=["${srcDir}/src"] + } + } +} +FileTree files =fileTree(dir:'./',include:'build.*.gradle') +def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\')) +buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\')) +def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1) + +//指定外部依赖 +dependencies{ +compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar') +compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar") + + testCompile 'junit:junit:4.12' +} +//将非.java 文件复制到classes文件夹下参与打包 +task copyFile(type:Copy,dependsOn:compileJava){ + copy{ + from ("${srcDir}/src"){ + exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html' + + } + into 'build/classes/main' + } + +} + +//压缩项目中的js文件 +task compressJS{ + ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){ + classpath { + fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar') + } + } + ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false",charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){ + fileset (dir:"${srcDir}/src"){ + include (name:'**/*.js') + include (name:'**/*.css') + } + + } +} +jar.dependsOn compressJS + diff --git a/designer_form/build.dev.gradle b/designer_form/build.dev.gradle index ae16b033e3..4b71fed5fa 100644 --- a/designer_form/build.dev.gradle +++ b/designer_form/build.dev.gradle @@ -1,8 +1,25 @@ -apply plugin: 'java' tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } +buildscript { + repositories { + maven { + url "http://www.eveoh.nl/files/maven2" + } + } + + dependencies { + classpath "nl.eveoh:gradle-aspectj:1.2" + } +} + +ext.aspectjVersion = '1.7.4' +apply plugin: 'aspectj' + +repositories { + mavenCentral() +} //指定构建的jdk版本 sourceCompatibility=1.7 //指定生成的jar包版本 diff --git a/designer_form/build.dev.gradle.bak b/designer_form/build.dev.gradle.bak index 2b727caac9..ae16b033e3 100644 --- a/designer_form/build.dev.gradle.bak +++ b/designer_form/build.dev.gradle.bak @@ -4,7 +4,7 @@ tasks.withType(JavaCompile){ options.encoding = 'UTF-8' } //指定构建的jdk版本 -sourceCompatibility=1.8 +sourceCompatibility=1.7 //指定生成的jar包版本 version='8.0' @@ -20,7 +20,7 @@ sourceSets{ main{ java{ srcDirs=["${srcDir}/src", -"${srcDir}/../designer/src"] + "${srcDir}/../designer/src"] } } } From 2afb21241badfe2295285ab7c59dd2a7147d8bb4 Mon Sep 17 00:00:00 2001 From: fr_shine Date: Mon, 20 Mar 2017 18:00:08 +0800 Subject: [PATCH 38/39] =?UTF-8?q?=E5=A4=A7=E6=95=B0=E6=8D=AE=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E6=8A=8Aapilevel=E7=AD=89=E7=BA=A7=E6=8F=90=E9=AB=98?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E4=BA=A7=E5=93=81=E4=B8=8D=E5=90=8C=E6=84=8F?= =?UTF-8?q?=EF=BC=8C=E5=85=88=E6=94=B9=E5=9B=9E=E6=9D=A5=EF=BC=8C=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E9=97=AE=E9=A2=98=E5=86=8D=E7=9C=8B=E7=9C=8B=E6=80=8E?= =?UTF-8?q?=E4=B9=88=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/chart/fun/IndependentChartUIProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java index 031ecd3d6e..1b90382d6a 100644 --- a/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java +++ b/designer_chart/src/com/fr/design/chart/fun/IndependentChartUIProvider.java @@ -22,7 +22,7 @@ public interface IndependentChartUIProvider extends Level { String XML_TAG = "IndependentChartUIProvider"; - int CURRENT_API_LEVEL = 4; + int CURRENT_API_LEVEL = 3; /** * 图表的类型定义界面类型,就是属性表的第一个界面 From 47fe2434180fab8f939e05a140640bd21d2da0f1 Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 23 Mar 2017 09:27:12 +0800 Subject: [PATCH 39/39] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/templateinfo/TemplateInfoCollector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java index 8b987dc058..4f7069205c 100644 --- a/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java +++ b/designer_base/src/com/fr/design/mainframe/templateinfo/TemplateInfoCollector.java @@ -113,7 +113,7 @@ public class TemplateInfoCollector implements Serializable { private void saveInfo() { try { ObjectOutputStream os = new ObjectOutputStream(new FileOutputStream(getInfoFile())); - System.out.println("写入:" + instance.templateInfoList); + FRLogger.getLogger().info("writing: " + instance.templateInfoList); os.writeObject(instance); os.close(); } catch (Exception ex) {