From 2804a4584d86190a20a442f2621859b25bc9357c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 13 Sep 2018 10:48:23 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractExtendedChartReportDataPane.java | 15 +++++++++------ .../chart/AbstractExtendedChartTableDataPane.java | 10 ++++++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index 1cfe2bf6b3..dd683b3fb7 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -7,13 +7,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; - +import java.awt.Component; +import java.awt.FlowLayout; +import java.util.Arrays; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.awt.BorderLayout; -import java.awt.Component; -import java.util.Arrays; /** * Created by shine on 2018/3/7. @@ -44,9 +43,13 @@ public abstract class AbstractExtendedChartReportDataPane Date: Thu, 13 Sep 2018 14:09:44 +0800 Subject: [PATCH 2/7] REPORT-11257 --- .../design/actions/file/SwitchExistEnv.java | 5 ++ .../java/com/fr/start/server/ServerTray.java | 81 +++++++++---------- 2 files changed, 45 insertions(+), 41 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java index d79df8d2c3..051f14bc3f 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/SwitchExistEnv.java @@ -15,6 +15,7 @@ import com.fr.design.menu.SeparatorDef; import com.fr.design.utils.DesignUtils; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; +import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; import com.fr.workspace.Workspace; @@ -110,6 +111,10 @@ public class SwitchExistEnv extends MenuDef { DesignUtils.refreshDesignerFrame(); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshToolArea(); fireDSChanged(); + if (WorkContext.getCurrent().isLocal()) { + //初始化一下serverTray + ServerTray.init(); + } } }); } catch (AuthException exception) { diff --git a/designer-base/src/main/java/com/fr/start/server/ServerTray.java b/designer-base/src/main/java/com/fr/start/server/ServerTray.java index ce2da0407d..01cfc53fc6 100644 --- a/designer-base/src/main/java/com/fr/start/server/ServerTray.java +++ b/designer-base/src/main/java/com/fr/start/server/ServerTray.java @@ -17,32 +17,32 @@ import java.awt.event.MouseEvent; * Create server tray. */ public class ServerTray { - + private static ServerTray INSTANCE; - + private MenuItem startMenu; - + private MenuItem stopMenu; - + private Image trayStartedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStarted.png"); - + private Image trayStoppedImage = BaseUtils.readImage("/com/fr/base/images/oem/trayStopped.png"); - + private ServerManageFrame serverManageFrame; - + private TrayIcon trayIcon; - - + + private ServerTray() { - + listen(); //p:首先构建右键菜单 PopupMenu popup = new PopupMenu(); MenuItem manangeMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Open_Service_Manager")); manangeMenu.addActionListener(new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -55,9 +55,9 @@ public class ServerTray { MenuItem exitMenu = new MenuItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_M_Exit")); //创建打开监听器 ActionListener startListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.start(); } catch (Exception exp) { @@ -66,9 +66,9 @@ public class ServerTray { } }; ActionListener stopListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + try { FineEmbedServer.stop(); } catch (Throwable exp) { @@ -80,13 +80,13 @@ public class ServerTray { stopMenu.addActionListener(stopListener); //创建退出菜单监听器 ActionListener exitListener = new ActionListener() { - + public void actionPerformed(ActionEvent e) { - + exit(); } }; - + exitMenu.addActionListener(exitListener); popup.add(manangeMenu); popup.addSeparator(); @@ -94,18 +94,18 @@ public class ServerTray { popup.add(stopMenu); popup.addSeparator(); popup.add(exitMenu); - + //p:开始创建托盘. trayIcon = new TrayIcon(trayStartedImage, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Server_Embedded_Server"), popup); trayIcon.setImageAutoSize(true); trayIcon.addMouseListener(new MouseAdapter() { - + public void mouseClicked(MouseEvent e) { - + if (e.getClickCount() < 2) { return; } - + ServerManageFrame serverManageFrame = ServerManageFrame.getServerManageFrame(); if (!serverManageFrame.isVisible()) { serverManageFrame.setVisible(true); @@ -113,56 +113,56 @@ public class ServerTray { serverManageFrame.toFront();//p:到第一个. } }); - + TrayIcon[] icons = SystemTray.getSystemTray().getTrayIcons(); for (TrayIcon icon : icons) { SystemTray.getSystemTray().remove(icon); } - + try { SystemTray.getSystemTray().add(trayIcon); } catch (AWTException e) { System.err.println("Can not create the System Tray:" + e); } - + checkPopupMenuItemEnabled(); } - + private void listen() { - + ListenerAdaptor listenerAdaptor = new ListenerAdaptor() { - + @Override protected void on(Event event) { - + checkPopupMenuItemEnabled(); } }; EventDispatcher.listen(EmbedServerEvent.AfterStart, listenerAdaptor); EventDispatcher.listen(EmbedServerEvent.AfterStop, listenerAdaptor); } - + private void exit() { - + FineEmbedServer.stop(); SystemTray.getSystemTray().remove(trayIcon); } - + private void checkPopupMenuItemEnabled() { - + try { if (FineEmbedServer.isRunning()) { startMenu.setEnabled(false); stopMenu.setEnabled(true); - + trayIcon.setImage(trayStartedImage); } else { startMenu.setEnabled(true); stopMenu.setEnabled(false); - + trayIcon.setImage(trayStoppedImage); } - + if (serverManageFrame != null) { serverManageFrame.checkButtonEnabled(); serverManageFrame.repaint(); @@ -171,10 +171,9 @@ public class ServerTray { FRContext.getLogger().error(exp.getMessage(), exp); } } - + public static void init() { - - INSTANCE = new ServerTray(); - + if (INSTANCE == null) + INSTANCE = new ServerTray(); } } \ No newline at end of file From e2fb52733f43cd8d38cceab1d7a15bdae0be25a8 Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 13 Sep 2018 21:08:28 +0800 Subject: [PATCH 3/7] =?UTF-8?q?CHART-2912=20&&=20CHART-2969=20=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=8E=A5=E5=8F=A3=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/AbstractTableDataContentPane.java | 14 +- .../table/SeriesNameUseFieldNamePane.java | 13 +- .../AbstractExtendedChartReportDataPane.java | 33 +- .../AbstractExtendedChartTableDataPane.java | 74 ++-- .../ExtendedCustomFieldComboBoxPane.java | 381 ++++++++++++++++++ 5 files changed, 476 insertions(+), 39 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java index 75c7f47b8f..1fff1bfe36 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java @@ -5,8 +5,8 @@ import com.fr.design.beans.BasicBeanPane; import com.fr.design.data.tabledata.wrapper.TableDataWrapper; import com.fr.design.gui.icombobox.UIComboBox; -import javax.swing.*; -import java.awt.*; +import javax.swing.JSeparator; +import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.List; @@ -46,8 +46,8 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane extends AbstractReportDataContentPane { + private TinyFormulaPane seriesPane; + private TinyFormulaPane valuePane; + public AbstractExtendedChartReportDataPane() { initComponents(); } @@ -30,11 +35,18 @@ public abstract class AbstractExtendedChartReportDataPane fieldList = new ArrayList(); + if (hasCustomFieldPane()) { + fieldList.add(new ExtendedField(seriesPane.updateBean())); + fieldList.add(new ExtendedField(valuePane.updateBean())); + } + dataConfig.setCustomFields(fieldList); chart.setFilterDefinition(dataSet); } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java index f9beeca2bd..b49d34ec86 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java @@ -11,11 +11,11 @@ import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.GeneralUtils; +import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.Dimension; import java.util.Arrays; import java.util.List; @@ -24,7 +24,7 @@ import java.util.List; */ public abstract class AbstractExtendedChartTableDataPane extends AbstractTableDataContentPane { - private CalculateComboBox function; + private ExtendedCustomFieldComboBoxPane customFieldComboBoxPane; public AbstractExtendedChartTableDataPane() { initComponents(); @@ -37,28 +37,27 @@ public abstract class AbstractExtendedChartTableDataPane { + private static final String[] HEADS = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Summary_Method")}; + + private UseFieldValuePane useFieldValuePane; + private CustomFieldNamePane customFieldNamePane; + + private List fieldList = new ArrayList(); + + @Override + protected void initLayout() { + this.setLayout(new BorderLayout(0, 6)); + JPanel northPane = new JPanel(new BorderLayout()); + northPane.add(jcb, BorderLayout.CENTER); + UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + label.setPreferredSize(new Dimension(82, 20)); + northPane.add(label, BorderLayout.WEST); + this.add(northPane, BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); + } + + @Override + protected List> initPaneList() { + useFieldValuePane = new UseFieldValuePane(); + customFieldNamePane = new CustomFieldNamePane(); + List> list = new ArrayList>(); + list.add(useFieldValuePane); + list.add(customFieldNamePane); + return list; + } + + @Override + protected String title4PopupWindow() { + return StringUtils.EMPTY; + } + + public void checkBoxUse(boolean hasUse) { + jcb.setEnabled(hasUse); + useFieldValuePane.checkBoxUse(hasUse); + } + + public void clearAllBoxList() { + useFieldValuePane.clearAllBoxList(); + fieldList.clear(); + } + + protected void refreshBoxListWithSelectTableData(List columnNameList) { + useFieldValuePane.refreshBoxListWithSelectTableData(columnNameList); + fieldList = columnNameList; + } + + @Override + public void populateBean(AbstractDataConfig ob) { + if (ob.isCustomName()) { + customFieldNamePane.populateBean(ob); + jcb.setSelectedIndex(1); + } else { + useFieldValuePane.populateBean(ob); + jcb.setSelectedIndex(0); + } + } + + @Override + public void updateBean(AbstractDataConfig ob) { + if (jcb.getSelectedIndex() == 0) { + ob.setCustomName(false); + useFieldValuePane.updateBean(ob); + } else { + ob.setCustomName(true); + customFieldNamePane.updateBean(ob); + } + } + + private class UseFieldValuePane extends FurtherBasicBeanPane { + private UIComboBox series; + private UIComboBox value; + private CalculateComboBox function; + + private UseFieldValuePane() { + initComponents(); + } + + private void initComponents() { + + series = new UIComboBox(); + value = new UIComboBox(); + function = new CalculateComboBox(); + + Component[][] components = new Component[][]{ + new Component[]{new UILabel("series", SwingConstants.LEFT), series}, + new Component[]{new UILabel("value", SwingConstants.LEFT), value}, + new Component[]{new UILabel("function", SwingConstants.LEFT), function}, + }; + + double p = TableLayout.PREFERRED; + double[] columnSize = {76, 120}; + double[] rowSize = {p, p, p}; + + JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + + this.setLayout(new BorderLayout(0, 6)); + this.add(panel, BorderLayout.CENTER); + } + + public void checkBoxUse(boolean hasUse) { + series.setEnabled(hasUse); + value.setEnabled(hasUse); + function.setEnabled(hasUse); + } + + public void clearAllBoxList() { + AbstractTableDataContentPane.clearBoxItems(series); + AbstractTableDataContentPane.clearBoxItems(value); + } + + public void refreshBoxListWithSelectTableData(List columnNameList) { + AbstractTableDataContentPane.refreshBoxItems(series, columnNameList); + AbstractTableDataContentPane.refreshBoxItems(value, columnNameList); + } + + @Override + public void populateBean(AbstractDataConfig ob) { + List list = ob.getCustomFields(); + if (list.size() == 2) { + series.setSelectedItem(list.get(0).getFieldName()); + value.setSelectedItem(list.get(1).getFieldName()); + function.populateBean((AbstractDataFunction) list.get(1).getDataFunction()); + } + } + + @Override + public void updateBean(AbstractDataConfig ob) { + List list = new ArrayList(); + + list.add(new ExtendedField(Utils.objectToString(series.getSelectedItem()))); + ExtendedField field = new ExtendedField(Utils.objectToString(value.getSelectedItem())); + field.setDataFunction(function.updateBean()); + list.add(field); + + ob.setCustomFields(list); + } + + @Override + public boolean accept(Object ob) { + return true; + } + + @Override + public void reset() { + } + + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Value"); + } + + @Override + public AbstractDataConfig updateBean() { + return null; + } + } + + private class CustomFieldNamePane extends FurtherBasicBeanPane { + + private UICorrelationPane correlationPane; + + public CustomFieldNamePane() { + initComponents(); + } + + private void initComponents() { + + correlationPane = new UICorrelationPane(HEADS) { + @Override + protected ActionListener getAddButtonListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + tablePane.addLine(new String[]{StringUtils.EMPTY, StringUtils.EMPTY, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")}); + fireTargetChanged(); + } + }; + } + + public UITableEditor createUITableEditor() { + return new Editor() { + @Override + protected UICorrelationPane getParent() { + return correlationPane; + } + }; + } + }; + + this.setLayout(new BorderLayout()); + this.add(correlationPane, BorderLayout.CENTER); + + } + + @Override + public void populateBean(AbstractDataConfig ob) { + List customFields = ob.getCustomFields(); + + List list = new ArrayList(); + for (ExtendedField field : customFields) { + String[] array = {field.getFieldName(), field.getCustomName(), SeriesNameUseFieldNamePane.getFunctionString(field.getDataFunction())}; + list.add(array); + } + correlationPane.populateBean(list); + } + + + @Override + public void updateBean(AbstractDataConfig ob) { + List list = correlationPane.updateBean(); + + List customFields = new ArrayList(); + for (Object[] line : list) { + ExtendedField field = new ExtendedField(Utils.objectToString(line[0])); + field.setCustomName(Utils.objectToString(line[1])); + if (line.length > 2) { + field.setDataFunction(SeriesNameUseFieldNamePane.getFcuntionByName(Utils.objectToString(line[2]))); + } + customFields.add(field); + } + + ob.setCustomFields(customFields); + + } + + @Override + public boolean accept(Object ob) { + return true; + } + + @Override + public void reset() { + } + + @Override + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Enable_Field_Name"); + } + + @Override + public AbstractDataConfig updateBean() { + return null; + } + } + + private abstract class Editor extends UITableEditor { + private JComponent editorComponent; + + protected abstract UICorrelationPane getParent(); + + @Override + public Object getCellEditorValue() { + if (editorComponent instanceof UIComboBox) { + return ((UIComboBox) editorComponent).getSelectedItem(); + } else if (editorComponent instanceof UITextField) { + return ((UITextField) editorComponent).getText(); + } else if (editorComponent instanceof CalculateComboBox) { + return ((CalculateComboBox) editorComponent).getSelectedItem(); + } + return super.getCellEditorValue(); + } + + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, final int row, int column) { + + switch (column) { + case 0: + editorComponent = createComboBoxEdit(row, value); + break; + case 1: + editorComponent = createTextEdit(value); + break; + default: + editorComponent = createCalculateComboBox(value); + break; + + } + return editorComponent; + } + + private void setDefaultName(int row) { + UITable table = getParent().getTable(); + Object object = table.getValueAt(row, 0); + if (object != null) { + table.setValueAt(object, row, 1); + } + } + + private UIComboBox createComboBoxEdit(final int row, Object value) { + UIComboBox uiComboBox = new UIComboBox(fieldList.toArray()); + + uiComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + getParent().stopCellEditing(); + getParent().fireTargetChanged(); + setDefaultName(row); + } + }); + + if (value != null && StringUtils.isNotEmpty(value.toString())) { + uiComboBox.getModel().setSelectedItem(value); + } else { + uiComboBox.getModel().setSelectedItem(value); + } + + return uiComboBox; + } + + private UITextField createTextEdit(Object value) { + UITextField uiTextField = new UITextField(); + if (value != null) { + uiTextField.setText(value.toString()); + } + + uiTextField.registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + getParent().fireTargetChanged(); + } + }); + + return uiTextField; + } + + private CalculateComboBox createCalculateComboBox(Object value) { + CalculateComboBox calculateComboBox = new CalculateComboBox(); + if (value != null) { + calculateComboBox.setSelectedItem(value); + } + calculateComboBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + getParent().stopCellEditing(); + getParent().fireTargetChanged(); + } + }); + return calculateComboBox; + } + } + +} From 9e0941cfea54c8b4b915cd5c482419cab63960fb Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 13 Sep 2018 21:17:41 +0800 Subject: [PATCH 4/7] update --- .../fr/extended/chart/AbstractExtendedChartTableDataPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java index b49d34ec86..19a7b8e16b 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java @@ -43,7 +43,7 @@ public abstract class AbstractExtendedChartTableDataPane Date: Thu, 13 Sep 2018 21:44:32 +0800 Subject: [PATCH 5/7] =?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 --- .../extended/chart/AbstractExtendedChartReportDataPane.java | 6 +++--- .../fr/extended/chart/ExtendedCustomFieldComboBoxPane.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java index cfc0886a46..82ebbda6e8 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartReportDataPane.java @@ -43,14 +43,14 @@ public abstract class AbstractExtendedChartReportDataPane Date: Fri, 14 Sep 2018 09:29:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?static=E6=96=B9=E6=B3=95=E6=8B=BF=E5=87=BA?= =?UTF-8?q?=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/AbstractTableDataContentPane.java | 25 ++---- .../chart/gui/data/table/DataPaneHelper.java | 84 +++++++++++++++++++ .../table/SeriesNameUseFieldNamePane.java | 34 +------- .../table/SeriesNameUseFieldValuePane.java | 39 +++------ .../ExtendedCustomFieldComboBoxPane.java | 15 ++-- .../component/ComboBoxWithButtonPane.java | 20 +---- 6 files changed, 111 insertions(+), 106 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java index 1fff1bfe36..df5d99fbdb 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java @@ -46,32 +46,17 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane list = new ArrayList(); for (int i = 0; i < chartSummaryColumnArray.length; i++) { ChartSummaryColumn column = chartSummaryColumnArray[i]; - String[] nameArray = {column.getName(), column.getCustomName(), getFunctionString(column.getFunction())}; + String[] nameArray = {column.getName(), column.getCustomName(), DataPaneHelper.getFunctionString(column.getFunction())}; list.add(nameArray); } seriesDataPane.populateBean(list); @@ -215,16 +212,6 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane list = new ArrayList(); for (ExtendedField field : customFields) { - String[] array = {field.getFieldName(), field.getCustomName(), SeriesNameUseFieldNamePane.getFunctionString(field.getDataFunction())}; + String[] array = {field.getFieldName(), field.getCustomName(), DataPaneHelper.getFunctionString(field.getDataFunction())}; list.add(array); } correlationPane.populateBean(list); @@ -255,7 +254,7 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane 2) { - field.setDataFunction(SeriesNameUseFieldNamePane.getFcuntionByName(Utils.objectToString(line[2]))); + field.setDataFunction(DataPaneHelper.getFunctionByName(Utils.objectToString(line[2]))); } customFields.add(field); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java index 75ad743def..c00109db92 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/gantt/designer/data/data/component/ComboBoxWithButtonPane.java @@ -4,6 +4,7 @@ import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -62,29 +63,14 @@ public abstract class ComboBoxWithButtonPane extends JPanel { * 刷新Box的选项. */ public void refreshBoxItems(java.util.List list) { - if(comboBoxName == null) { - return; - } - - Object ob = comboBoxName.getSelectedItem(); - comboBoxName.removeAllItems(); - - int length = list.size(); - for(int i = 0; i < length; i++) { - comboBoxName.addItem(list.get(i)); - } - - comboBoxName.getModel().setSelectedItem(ob); + DataPaneHelper.refreshBoxItems(comboBoxName, list); } /** * 清空box里所有东西 */ public void clearBoxItems(){ - if(comboBoxName == null){ - return; - } - comboBoxName.removeAllItems(); + DataPaneHelper.clearBoxItems(comboBoxName); } From 6b0d6c60ec1abcde0a6b4d890d0d6c6a4dcd6d9e Mon Sep 17 00:00:00 2001 From: plough Date: Fri, 14 Sep 2018 17:31:51 +0800 Subject: [PATCH 7/7] =?UTF-8?q?REPORT-11155=2010.0=20=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E7=82=B9=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../beans/actions/FormWidgetEditAction.java | 22 ++++++++++++++++++- .../actions/FormMobileAttrAction.java | 10 +++++++++ .../AccessibleBodyWatermarkEditor.java | 10 +++++++++ .../report/ReportMobileAttrAction.java | 9 ++++++++ .../actions/report/ReportWatermarkAction.java | 10 +++++++++ 5 files changed, 60 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java index 753dc812b4..300086040a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/actions/FormWidgetEditAction.java @@ -3,9 +3,14 @@ package com.fr.design.designer.beans.actions; import com.fr.design.actions.TemplateComponentAction; import com.fr.design.designer.beans.actions.behavior.UpdateBehavior; import com.fr.design.mainframe.FormDesigner; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; +import javax.swing.JButton; import java.awt.event.ActionEvent; +@EnableMetrics public abstract class FormWidgetEditAction extends TemplateComponentAction { private UpdateBehavior updateBehavior = new UpdateBehavior() { @@ -27,9 +32,24 @@ public abstract class FormWidgetEditAction extends TemplateComponentAction { public FormMobileAttrAction(JForm jf) { @@ -64,6 +68,7 @@ public class FormMobileAttrAction extends JTemplateAction { // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 jf.getTarget().addAttrMark(new MobileOnlyTemplateAttrMark()); } + recordFunction(); // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); @@ -74,6 +79,11 @@ public class FormMobileAttrAction extends JTemplateAction { dialog.setVisible(true); } + @Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED) + private void recordFunction() { + // do nothing + } + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java index c5acb61148..a0567bad1d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/accessibles/AccessibleBodyWatermarkEditor.java @@ -7,6 +7,9 @@ import com.fr.design.mainframe.widget.editors.ITextComponent; import com.fr.design.mainframe.widget.renderer.WatermarkRenderer; import com.fr.design.mainframe.widget.wrappers.WatermarkWrapper; import com.fr.design.report.WatermarkPane; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; +import com.fr.record.analyzer.EnableMetrics; import javax.swing.*; import java.awt.*; @@ -15,6 +18,7 @@ import java.awt.*; * Created by plough on 2018/5/15. */ +@EnableMetrics public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor { private WatermarkPane watermarkPane; @@ -40,9 +44,15 @@ public class AccessibleBodyWatermarkEditor extends UneditableAccessibleEditor { public void doOk() { setValue(watermarkPane.update()); fireStateChanged(); + recordFunction(); } }); watermarkPane.populate((WatermarkAttr) getValue()); dlg.setVisible(true); } + + @Focus(id = "com.fr.watermark", text = "Fine-Design_Form_WaterMark", source = Original.EMBED) + private void recordFunction() { + // do nothing + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java index 40d4e68a41..a31108f2c4 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportMobileAttrAction.java @@ -11,7 +11,9 @@ import com.fr.design.report.mobile.ReportMobileAttrPane; import com.fr.file.FILE; import com.fr.general.IOUtils; +import com.fr.intelli.record.Focus; import com.fr.main.TemplateWorkBook; +import com.fr.record.analyzer.EnableMetrics; import com.fr.report.mobile.ElementCaseMobileAttr; import javax.swing.*; @@ -22,6 +24,7 @@ import java.awt.event.ActionEvent; * * Created by Administrator on 2016/5/12/0012. */ +@EnableMetrics public class ReportMobileAttrAction extends JWorkBookAction{ public ReportMobileAttrAction(JWorkBook jwb) { @@ -64,6 +67,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{ // 放到后面。如果提前 return 了,则仍然处于未设置状态,不要添加 wbTpl.addAttrMark(new MobileOnlyTemplateAttrMark()); } + recordFunction(); // 设置移动端属性并刷新界面 wbTpl.setReportMobileAttr(elementCaseMobileAttr); // 会同时修改页面设置,放到最后 jwb.fireTargetModified(); @@ -72,6 +76,11 @@ public class ReportMobileAttrAction extends JWorkBookAction{ dialog.setVisible(true); } + @Focus(id = "com.fr.mobile.mobile_template_cpt", text = "Fine-Design_Function_Mobile_Template_Cpt") + private void recordFunction() { + // do nothing + } + private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() { @Override public char getMnemonic() { return 'P'; } diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java index db1d10f9d1..a07df219f9 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWatermarkAction.java @@ -8,7 +8,10 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JWorkBook; import com.fr.design.menu.KeySetUtils; import com.fr.design.report.WatermarkPane; +import com.fr.intelli.record.Focus; +import com.fr.intelli.record.Original; import com.fr.main.impl.WorkBook; +import com.fr.record.analyzer.EnableMetrics; import com.fr.report.core.ReportUtils; import java.awt.event.ActionEvent; @@ -16,6 +19,7 @@ import java.awt.event.ActionEvent; /** * Created by plough on 2018/5/15. */ +@EnableMetrics public class ReportWatermarkAction extends JWorkBookAction { public ReportWatermarkAction(JWorkBook jwb) { super(jwb); @@ -42,7 +46,13 @@ public class ReportWatermarkAction extends JWorkBookAction { public void doOk() { wbTpl.addAttrMark(watermarkPane.update()); jwb.fireTargetModified(); + recordFunction(); } }).setVisible(true); } + + @Focus(id = "com.fr.watermark", text = "Fine-Design_Form_WaterMark", source = Original.EMBED) + private void recordFunction() { + // do nothing + } }