From a2523a0af25598135a3e7b616c58c89e69a50fe6 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Mon, 22 Oct 2018 17:10:27 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20findbug?= =?UTF-8?q?s=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/onlineupdate/domain/UpdateConstants.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java b/designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java index 853b8576e..293c5d1f0 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/domain/UpdateConstants.java @@ -4,11 +4,11 @@ package com.fr.design.onlineupdate.domain; * Created by XINZAI on 2018/8/21. */ -import com.fr.third.org.apache.commons.collections4.collection.UnmodifiableCollection; -import com.fr.third.org.apache.commons.collections4.list.UnmodifiableList; import java.awt.Color; import java.util.Arrays; +import java.util.Collections; +import java.util.List; /** * 更新升级的常量 @@ -32,7 +32,7 @@ public interface UpdateConstants { int BYTE = 153600; - UnmodifiableList JARS_FOR_SERVER_X = new UnmodifiableList(Arrays.asList(new String[]{ + List JARS_FOR_SERVER_X = Collections.unmodifiableList(Arrays.asList(new String[]{ "fine-activator-10.0.jar", "fine-core-10.0.jar", "fine-report-engine-10.0.jar", @@ -47,13 +47,13 @@ public interface UpdateConstants { "fine-accumulator-10.0.jar" })); - UnmodifiableList JARS_FOR_DESIGNER_X = new UnmodifiableList(Arrays.asList(new String[]{ + List JARS_FOR_DESIGNER_X = Collections.unmodifiableList(Arrays.asList(new String[]{ "fine-report-designer-10.0.jar", "aspectjrt.jar" })); - UnmodifiableList LOG_TYPE = new UnmodifiableList(Arrays.asList(new String[]{ + List LOG_TYPE = Collections.unmodifiableList(Arrays.asList(new String[]{ "REPORT", "MOBILE", "CHART", "PFC", "BI" })); From c27ba8498f985d63c1cf43d001b90b105d076360 Mon Sep 17 00:00:00 2001 From: qinghuiliu Date: Sun, 28 Oct 2018 19:36:27 +0800 Subject: [PATCH 02/15] =?UTF-8?q?CHART-2665=20&=20CHART-2886=20=E5=A0=86?= =?UTF-8?q?=E7=A7=AF=E5=92=8C=E5=9D=90=E6=A0=87=E8=BD=B4update=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=80=E4=B8=AA=E6=96=B0=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?conditionattr=20CHART-1882=E7=9B=B4=E6=8E=A5=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=8D=B3=E5=8F=AF=20=E4=B8=8D=E7=94=A8=E8=AE=B0?= =?UTF-8?q?=E4=BD=8Fconditionattr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nChartCustomStackAndAxisConditionPane.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index efa071305..712d5bdd2 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -99,10 +99,12 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane(seriesStackAndAxis.getXAxisNamesArray()); - YAxis = new UIButtonGroup(seriesStackAndAxis.getYAxisNameArray()); + AttrSeriesStackAndAxis seriesStackAndAxis = conditionAttr.getExisted(AttrSeriesStackAndAxis.class); + + if (XAxis == null || YAxis == null) { + XAxis = new UIButtonGroup(seriesStackAndAxis.getXAxisNamesArray()); + YAxis = new UIButtonGroup(seriesStackAndAxis.getYAxisNameArray()); + } doLayoutPane(); XAxis.setSelectedIndex(seriesStackAndAxis.getXAxisIndex()); @@ -129,11 +131,16 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane Date: Sun, 28 Oct 2018 19:48:06 +0800 Subject: [PATCH 03/15] =?UTF-8?q?CHART-2665=20&=20CHART-2886=20=E5=A0=86?= =?UTF-8?q?=E7=A7=AF=E5=92=8C=E5=9D=90=E6=A0=87=E8=BD=B4update=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E4=B8=80=E4=B8=AA=E6=96=B0=E5=88=9B=E5=BB=BA=E7=9A=84?= =?UTF-8?q?conditionattr=20CHART-1882=E7=9B=B4=E6=8E=A5=E6=94=B9=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E5=8D=B3=E5=8F=AF=20=E4=B8=8D=E7=94=A8=E8=AE=B0?= =?UTF-8?q?=E4=BD=8Fconditionattr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/column/VanChartCustomStackAndAxisConditionPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java index 712d5bdd2..ceb9bf480 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/column/VanChartCustomStackAndAxisConditionPane.java @@ -34,8 +34,6 @@ public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane isStacked; protected UIButtonGroup isPercentStacked; - private ConditionAttr conditionAttr; - private LiteConditionPane liteConditionPane; public VanChartCustomStackAndAxisConditionPane() { From 59b4b4073e7eeb397a02a43a6730fcc398eef54c Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Mon, 29 Oct 2018 17:58:23 +0800 Subject: [PATCH 04/15] =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93?= =?UTF-8?q?=E5=BC=80=E8=B6=85=E9=93=BE=E6=94=AF=E6=8C=81=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/AbstractHyperNorthPane.java | 28 +- .../hyperlink/ReporletHyperNorthPane.java | 184 ------- .../hyperlink/ReportletHyperNorthPane.java | 510 ++++++++++++++++++ .../hyperlink/ReportletHyperlinkPane.java | 47 +- 4 files changed, 563 insertions(+), 206 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java create mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index cd78c1755..22c12e296 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -6,11 +6,14 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; - import com.fr.js.Hyperlink; -import javax.swing.*; -import java.awt.*; +import javax.swing.DefaultListCellRenderer; +import javax.swing.JList; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -21,11 +24,18 @@ public abstract class AbstractHyperNorthPane extends BasicB public static final int DEFAULT_H_VALUE = 400; public static final int DEFAULT_V_VALUE = 600; - private JPanel headerPane; - private UIComboBox targetFrameComboBox; - - private UINumberField heightTextFiled; - private UINumberField widthTextFiled; + /** + * 链接打开方式对话框 + */ + UIComboBox targetFrameComboBox; + /** + * 对话框高度输入框 + */ + UINumberField heightTextFiled; + /** + * 对话框宽度输入框 + */ + UINumberField widthTextFiled; public AbstractHyperNorthPane() { @@ -35,7 +45,7 @@ public abstract class AbstractHyperNorthPane extends BasicB protected void initComponents() { this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - headerPane = this.setHeaderPanel(); + JPanel headerPane = this.setHeaderPanel(); this.add(headerPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); targetFrameComboBox = new UIComboBox(getTargetFrames()); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java deleted file mode 100644 index d35c70a82..000000000 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.fr.design.hyperlink; - -import com.fr.design.actions.UpdateAction; -import com.fr.design.dialog.BasicDialog; -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.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.itree.filetree.ReportletPane; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; - -import com.fr.js.ReportletHyperlink; -import com.fr.stable.StringUtils; - -import javax.swing.*; -import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; - -/** - * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. - * - * @author kunsnat - */ -public class ReporletHyperNorthPane extends AbstractHyperNorthPane { - private UITextField itemNameTextField; - private boolean needRenamePane = false; - private UITextField reportPathTextField; - private UICheckBox showParameterInterface; - private UIButton browserButton; - - // richer:参数传递方式 - private UIComboBox postComboBox; - - public ReporletHyperNorthPane(boolean needRenamePane) { - this.needRenamePane = needRenamePane; - this.inits(); - } - - public ReporletHyperNorthPane() { - this.inits(); - } - - /** - * 初始化组件 - */ - public void inits() { - super.initComponents(); - } - - @Override - protected JPanel setHeaderPanel() { - JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; - double[] columnSize = {p, TableLayout.FILL}; - // Reportlet. - JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - - reportPathTextField = new UITextField(20); - reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); - - browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); - browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); - reportletNamePane.add(browserButton, BorderLayout.EAST); - browserButton.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent evt) { - final ReportletPane reportletPane = new ReportletPane(); - reportletPane.setSelectedReportletPath(reportPathTextField.getText()); - BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReporletHyperNorthPane.this)); - - reportletDialog.addDialogActionListener(new DialogActionAdapter() { - public void doOk() { - reportPathTextField.setText(reportletPane.getSelectedReportletPath()); - } - }); - reportletDialog.setVisible(true); - } - }); - - Component[][] components; - if (!this.needRenamePane) { - components = new Component[][]{ - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, - }; - } else { - itemNameTextField = new UITextField(); - components = new Component[][]{ - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}, - {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, - }; - } - JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - headerPane.add(northPane, BorderLayout.NORTH); - return headerPane; - } - - @Override - protected String title4PopupWindow() { - return "reportlet"; - } - - @Override - protected void populateSubHyperlinkBean(ReportletHyperlink link) { - if (itemNameTextField != null) { - this.itemNameTextField.setText(link.getItemName()); - } - this.reportPathTextField.setText(link.getReportletPath()); - this.showParameterInterface.setSelected(link.isShowParameterInterface()); - this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); - } - - @Override - protected ReportletHyperlink updateSubHyperlinkBean() { - ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); - updateSubHyperlinkBean(reportletHyperlink); - - return reportletHyperlink; - } - - @Override - protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { - if (itemNameTextField != null) { - reportletHyperlink.setItemName(this.itemNameTextField.getText()); - } - reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); - reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); - reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1 ? true : false); - } - - public String getReportletName() { - return StringUtils.isBlank(this.reportPathTextField.getText()) ? StringUtils.EMPTY : this.reportPathTextField.getText().substring(1); - } - - /** - * 获取按钮焦点 - */ - public void requestButtonFocus() { - this.browserButton.requestFocus(); - JPopupMenu popup = new JPopupMenu(); - FakeTipAction tip = new FakeTipAction(); - tip.setEnabled(false); - popup.add(tip); - GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); - } - - private class FakeTipAction extends UpdateAction { - public FakeTipAction() { - this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Select")); - } - - public void actionPerformed(ActionEvent e) { - //do nothing - } - } - - @Override - protected JPanel setFootPanel() { - double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; - double[] columnSize = {p, TableLayout.FILL}; - showParameterInterface = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); - JPanel showParameterPanel = new JPanel(); - showParameterPanel.add(new UILabel()); - showParameterPanel.add(showParameterInterface); - - postComboBox = new UIComboBox(new String[]{"GET", "POST"}); - JPanel postPanel = new JPanel(); - postPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type"))); - postPanel.add(postComboBox); - Component[][] components = {{postPanel}, - {showParameterPanel}, - {new UILabel(" ")} - }; - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - } - -} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java new file mode 100644 index 000000000..bd1b3a4d7 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -0,0 +1,510 @@ +package com.fr.design.hyperlink; + +import com.fr.base.BaseFormula; +import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.BasicDialog; +import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.event.UIObserverListener; +import com.fr.design.formula.FormulaFactory; +import com.fr.design.formula.UIFormula; +import com.fr.design.formula.VariableResolver; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIRadioButton; +import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UINumberField; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itree.filetree.ReportletPane; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.IOUtils; +import com.fr.js.ReportletHyperlink; +import com.fr.js.ReportletHyperlinkDialogAttr; +import com.fr.stable.FormulaProvider; +import com.fr.stable.StringUtils; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +/** + * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. + * + * @author kunsnat + */ +public class ReportletHyperNorthPane extends AbstractHyperNorthPane { + /** + * item name text filed + */ + private UITextField itemNameTextField; + /** + * 是否展示item name + */ + private boolean needRenamePane = false; + /** + * 参数路径输入框 + */ + private UITextField reportPathTextField; + /** + * 是否展示参数面板勾选框 + */ + private UICheckBox showParameterInterface; + /** + * 选择文件按钮 + */ + private UIButton browserButton; + + /** + * 参数传递方式下拉选择框 + */ + private UIComboBox postComboBox; + /** + * 对话框标题输入框 + */ + private JFormulaField titleFiled; + + + /** + * 对话框居中按钮 + */ + private UIRadioButton center; + /** + * 对话框位置自定义按钮 + */ + private UIRadioButton custom; + /** + * 距左 + */ + private UINumberField leftLocation; + /** + * 距上 + */ + private UINumberField topLocation; + + + public ReportletHyperNorthPane(boolean needRenamePane) { + this.needRenamePane = needRenamePane; + } + + public ReportletHyperNorthPane() { + } + + /** + * 初始化面板 + */ + @Override + protected void initComponents() { + this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); + this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + final List dialogComponents = new ArrayList<>(); + final List othersComponents = new ArrayList<>(); + + initRenamePanel(dialogComponents, othersComponents); + initHeaderPanel(dialogComponents, othersComponents); + initTargetComboBoxPanel(dialogComponents, othersComponents); + + initTitlePanel(dialogComponents); + initDialogSizePanel(dialogComponents); + initDialogLocationPanel(dialogComponents); + + initFooterPanel(dialogComponents, othersComponents); + + initPlaceHolder(othersComponents); + + bindListener(dialogComponents, othersComponents); + + // 创建内容面板 + JPanel content = TableLayoutHelper.createTableLayoutPane(dialogComponents.toArray(new Component[dialogComponents.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); + this.add(content, BorderLayout.CENTER); + } + + + /** + * 生成最上方的配置面板 + * + * @return JPanel + */ + @Override + protected JPanel setHeaderPanel() { + + JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + // 路径输入框 + reportPathTextField = new UITextField(20); + reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); + + // 选择路径按钮 + browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select")); + browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); + reportletNamePane.add(browserButton, BorderLayout.EAST); + browserButton.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + final ReportletPane reportletPane = new ReportletPane(); + reportletPane.setSelectedReportletPath(reportPathTextField.getText()); + BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this)); + + reportletDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + reportPathTextField.setText(reportletPane.getSelectedReportletPath()); + } + }); + reportletDialog.setVisible(true); + } + }); + return reportletNamePane; + } + + @Override + protected String title4PopupWindow() { + return "reportlet"; + } + + @Override + protected void populateSubHyperlinkBean(ReportletHyperlink link) { + if (itemNameTextField != null) { + this.itemNameTextField.setText(link.getItemName()); + } + this.reportPathTextField.setText(link.getReportletPath()); + this.showParameterInterface.setSelected(link.isShowParameterInterface()); + this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); + + ReportletHyperlinkDialogAttr attr = link.getAttr(); + titleFiled.setFormulaText(StringUtils.EMPTY); + leftLocation.setText(StringUtils.EMPTY); + topLocation.setText(StringUtils.EMPTY); + center.setSelected(true); + if (attr != null) { + FormulaProvider title = attr.getTitleFormula(); + String titleContent = title == null ? StringUtils.EMPTY : title.getPureContent(); + titleFiled.setFormulaText(titleContent); + boolean isCenter = attr.isCenter(); + if (!isCenter) { + int left = attr.getLeft(), top = attr.getTop(); + leftLocation.setText(Integer.toString(left)); + topLocation.setText(Integer.toString(top)); + } + center.setSelected(isCenter); + custom.setSelected(!isCenter); + } + } + + @Override + protected ReportletHyperlink updateSubHyperlinkBean() { + ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); + updateSubHyperlinkBean(reportletHyperlink); + return reportletHyperlink; + } + + @Override + protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { + if (itemNameTextField != null) { + reportletHyperlink.setItemName(this.itemNameTextField.getText()); + } + reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); + reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); + reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1); + + ReportletHyperlinkDialogAttr attr = new ReportletHyperlinkDialogAttr(); + attr.setTitleFormula(BaseFormula.createFormulaBuilder().build(titleFiled.getFormulaText())); + attr.setCenter(center.isSelected()); + if (!attr.isCenter()) { + attr.setLeft((int) leftLocation.getValue()); + attr.setTop((int) topLocation.getValue()); + } + reportletHyperlink.setAttr(attr); + + } + + public String getReportletName() { + String text = this.reportPathTextField.getText(); + return StringUtils.isBlank(text) ? StringUtils.EMPTY : text.substring(1); + } + + /** + * 获取按钮焦点 + */ + public void requestButtonFocus() { + this.browserButton.requestFocus(); + JPopupMenu popup = new JPopupMenu(); + FakeTipAction tip = new FakeTipAction(); + tip.setEnabled(false); + popup.add(tip); + GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); + } + + private class FakeTipAction extends UpdateAction { + public FakeTipAction() { + this.setName(Toolkit.i18nText("Fine-Design_Basic_Template_Select")); + } + + @Override + public void actionPerformed(ActionEvent e) { + // do nothing + } + } + + /** + * 底部面板,参数传递方式 + * + * @return JPanel + */ + @Override + protected JPanel setFootPanel() { + JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + + // 参数传递方式下拉框 + postComboBox = new UIComboBox(new String[]{"GET", "POST"}); + postComboBox.setPreferredSize(new Dimension(60, 20)); + postComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + content.add(postComboBox); + + + showParameterInterface = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); + + showParameterInterface.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); + content.add(showParameterInterface); + return content; + } + + private void bindListener(final List dialogComponents, final List othersComponents) { + targetFrameComboBox.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + boolean show = DIALOG == targetFrameComboBox.getSelectedIndex(); + JPanel content; + List cs; + if (show) { + cs = dialogComponents; + } else { + cs = othersComponents; + } + ReportletHyperNorthPane.this.removeAll(); + content = TableLayoutHelper.createTableLayoutPane(cs.toArray(new Component[cs.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); + ReportletHyperNorthPane.this.add(content, BorderLayout.CENTER); + ReportletHyperNorthPane.this.revalidate(); + ReportletHyperNorthPane.this.repaint(); + } + }); + } + + private void initPlaceHolder(List othersComponents) { + JPanel empty1 = new JPanel(); + empty1.setPreferredSize(new Dimension(20, 20)); + JPanel empty2 = new JPanel(); + empty2.setPreferredSize(new Dimension(20, 20)); + JPanel empty3 = new JPanel(); + empty3.setPreferredSize(new Dimension(20, 23)); + + othersComponents.add(new Component[]{empty1, new JPanel()}); + othersComponents.add(new Component[]{empty2, new JPanel()}); + othersComponents.add(new Component[]{empty3, new JPanel()}); + } + + private void initRenamePanel(List dialogComponents, List othersComponents) { + // 是否有重命名属性 + if (this.needRenamePane) { + itemNameTextField = new UITextField(); + Component[] renameComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}; + dialogComponents.add(renameComponents); + othersComponents.add(renameComponents); + } + } + + private void initHeaderPanel(List dialogComponents, List othersComponents) { + //最上方位置的面板 + JPanel headerPane = this.setHeaderPanel(); + Component[] headerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), headerPane}; + dialogComponents.add(headerComponents); + othersComponents.add(headerComponents); + } + + private void initTargetComboBoxPanel(List dialogComponents, List othersComponents) { + // 链接打开于 + targetFrameComboBox = new UIComboBox(getTargetFrames()); + targetFrameComboBox.setEditable(true); + targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); + JPanel targetFramePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + targetFramePanel.add(targetFrameComboBox); + Component[] targetComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Link_Opened_In") + ":"), targetFramePanel}; + dialogComponents.add(targetComponents); + othersComponents.add(targetComponents); + } + + private void initTitlePanel(List dialogComponents) { + // 对话框标题 + titleFiled = new JFormulaField(15); + final JPanel titlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + titlePanel.add(titleFiled); + Component[] titleComponents = new Component[]{new UILabel(Toolkit.i18nText("对话框标题") + ":"), titlePanel}; + dialogComponents.add(titleComponents); + } + + private void initDialogSizePanel(List dialogComponents) {// 对话框大小 + final JPanel sizeJPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Height") + ":"); + heightLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); + sizeJPanel.add(heightLabel); + heightTextFiled = new UINumberField(); + heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); + heightTextFiled.setPreferredSize(new Dimension(40, 20)); + sizeJPanel.add(heightTextFiled); + UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":"); + widthLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + sizeJPanel.add(widthLabel); + widthTextFiled = new UINumberField(); + widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); + widthTextFiled.setPreferredSize(new Dimension(40, 20)); + sizeJPanel.add(widthTextFiled); + sizeJPanel.setVisible(true); + dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("对话框大小") + ":"), sizeJPanel}); + } + + private void initDialogLocationPanel(List dialogComponents) { + // 显示位置 + final JPanel locationPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); + // 居中 + center = new UIRadioButton(Toolkit.i18nText("居中")); + // 自定义 + custom = new UIRadioButton(Toolkit.i18nText("自定义")); + + custom.setBorder(BorderFactory.createEmptyBorder(4, 20, 4, 5)); + ButtonGroup group = new ButtonGroup(); + group.setSelected(center.getModel(), true); + group.add(center); + group.add(custom); + locationPanel.add(center); + locationPanel.add(custom); + + // 位置 距左 + final UILabel leftLabel = new UILabel(Toolkit.i18nText("距左")); + leftLabel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 10)); + leftLocation = new UINumberField(); + leftLocation.setPreferredSize(new Dimension(40, 20)); + // 位置 距上 + final UILabel topLabel = new UILabel(Toolkit.i18nText("距上")); + topLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); + topLocation = new UINumberField(); + topLocation.setPreferredSize(new Dimension(40, 20)); + + locationPanel.add(leftLabel); + locationPanel.add(leftLocation); + locationPanel.add(topLabel); + locationPanel.add(topLocation); + leftLabel.setVisible(false); + leftLocation.setVisible(false); + topLabel.setVisible(false); + topLocation.setVisible(false); + ChangeListener actionListener = new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + boolean visible = custom.isSelected(); + leftLabel.setVisible(visible); + leftLocation.setVisible(visible); + topLabel.setVisible(visible); + topLocation.setVisible(visible); + } + }; + // 默认居中 + center.setSelected(true); + center.addChangeListener(actionListener); + custom.addChangeListener(actionListener); + + dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("显示位置") + ":"), locationPanel}); + } + + private void initFooterPanel(List dialogComponents, List othersComponents) { + // 最下方的配置面板 + // 参数传递方式 + Component[] footerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type") + ":"), this.setFootPanel()}; + dialogComponents.add(footerComponents); + othersComponents.add(footerComponents); + } + + /** + * 公式输入框 + */ + public class JFormulaField extends JPanel { + private UITextField formulaTextField; + + public JFormulaField(int columns) { + + formulaTextField = new UITextField(columns); + JPanel textFieldPane = new JPanel(new BorderLayout()); + textFieldPane.add(formulaTextField, BorderLayout.CENTER); + textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); + UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); + formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); + formulaButton.setPreferredSize(new Dimension(24, formulaTextField.getPreferredSize().height)); + formulaButton.addActionListener(formulaButtonActionListener); + + JPanel pane = new JPanel(new BorderLayout()); + pane.add(textFieldPane, BorderLayout.CENTER); + pane.add(formulaButton, BorderLayout.EAST); + this.setLayout(new BorderLayout()); + this.add(pane, BorderLayout.NORTH); + } + + public void setFormulaText(String formulaContent) { + this.formulaTextField.setText(formulaContent); + } + + public String getFormulaText() { + + String text = formulaTextField.getText(); + if (text == null) { + text = StringUtils.EMPTY; + } + return text; + } + + /** + * 添加事件监听器 + * + * @param listener 公式文本输入框改动事件监听器 + */ + public void addListener(UIObserverListener listener) { + this.formulaTextField.registerChangeListener(listener); + } + + /** + * 取消事件监听器 + */ + public void removeListener() { + this.formulaTextField.registerChangeListener(null); + } + + private ActionListener formulaButtonActionListener = new ActionListener() { + @Override + public void actionPerformed(ActionEvent evt) { + BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); + valueFormula.setContent(getFormulaText()); + final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); + formulaPane.populate(valueFormula, VariableResolver.DEFAULT); + formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this), new DialogActionAdapter() { + @Override + public void doOk() { + BaseFormula valueFormula = formulaPane.update(); + setFormulaText(valueFormula.getContent()); + } + }).setVisible(true); + } + }; + } +} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java index e50360c19..532fe467c 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -6,23 +6,30 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterReader; import com.fr.design.utils.gui.GUICoreUtils; - import com.fr.js.ReportletHyperlink; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.JOptionPane; +import java.awt.BorderLayout; +import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.List; public class ReportletHyperlinkPane extends AbstractHyperLinkPane { - private ReporletHyperNorthPane northPane; + /** + * 超链配置面板 + */ + private ReportletHyperNorthPane northPane; + /** + * 是否继承参数勾选框 + */ private UICheckBox extendParametersCheckBox; public ReportletHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { @@ -38,22 +45,29 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane Date: Tue, 30 Oct 2018 00:35:37 +0800 Subject: [PATCH 05/15] =?UTF-8?q?REPORT-11520=20=E8=B6=85=E7=BA=A7?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93=E5=BC=80?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/hyperlink/ReportletHyperNorthPane.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index bd1b3a4d7..7f36d5a2c 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -352,7 +352,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents) { // 显示位置 final JPanel locationPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); // 居中 - center = new UIRadioButton(Toolkit.i18nText("居中")); + center = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Center")); // 自定义 - custom = new UIRadioButton(Toolkit.i18nText("自定义")); + custom = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Custom")); custom.setBorder(BorderFactory.createEmptyBorder(4, 20, 4, 5)); ButtonGroup group = new ButtonGroup(); @@ -393,12 +393,12 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, List othersComponents) { From 5918d7186aaeb1f5c3786646ae921116c08a2a7b Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 30 Oct 2018 09:33:46 +0800 Subject: [PATCH 06/15] ff --- .../fr/design/hyperlink/AbstractHyperNorthPane.java | 6 +++--- .../fr/design/hyperlink/ReportletHyperNorthPane.java | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index 22c12e296..42f13ceed 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -27,15 +27,15 @@ public abstract class AbstractHyperNorthPane extends BasicB /** * 链接打开方式对话框 */ - UIComboBox targetFrameComboBox; + private UIComboBox targetFrameComboBox; /** * 对话框高度输入框 */ - UINumberField heightTextFiled; + private UINumberField heightTextFiled; /** * 对话框宽度输入框 */ - UINumberField widthTextFiled; + private UINumberField widthTextFiled; public AbstractHyperNorthPane() { diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java index 7f36d5a2c..57fcfe25d 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java @@ -284,6 +284,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, final List othersComponents) { + final UIComboBox targetFrameComboBox = this.getTargetFrameComboBox(); targetFrameComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -337,7 +338,8 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane dialogComponents, List othersComponents) { // 链接打开于 - targetFrameComboBox = new UIComboBox(getTargetFrames()); + UIComboBox targetFrameComboBox = new UIComboBox(getTargetFrames()); + this.setTargetFrameComboBox(targetFrameComboBox); targetFrameComboBox.setEditable(true); targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); JPanel targetFramePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); @@ -361,17 +363,19 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane Date: Tue, 30 Oct 2018 16:16:46 +0800 Subject: [PATCH 07/15] REPORT-11831 --- .../onlineupdate/ui/dialog/UpdateMainDialog.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java index e4f44086a..fb5db0cd4 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java @@ -23,11 +23,7 @@ import com.fr.design.onlineupdate.ui.widget.UpdateInfoTableCellRender; import com.fr.design.onlineupdate.ui.widget.UpdateInfoTableModel; import com.fr.design.onlineupdate.ui.widget.UpdateInfoTextAreaCellRender; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.ComparatorUtils; -import com.fr.general.DateUtils; -import com.fr.general.GeneralUtils; -import com.fr.general.IOUtils; -import com.fr.general.SiteCenter; +import com.fr.general.*; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; @@ -341,8 +337,14 @@ public class UpdateMainDialog extends UIDialog { initUpdateActionPane(); add(jarVersionInfoPane, BorderLayout.NORTH); - add(jarUpdateInfoPane, BorderLayout.CENTER); - add(updateActionPane, BorderLayout.SOUTH); + + //海外版本不显示更新信息 + if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)){ + add(jarUpdateInfoPane, BorderLayout.CENTER); + add(updateActionPane, BorderLayout.SOUTH); + }else { + add(updateActionPane, BorderLayout.CENTER); + } addActionListenerForUpdateBtn(); From 8a00f5f32100d313722e257add29cbd686104811 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 30 Oct 2018 16:38:13 +0800 Subject: [PATCH 08/15] =?UTF-8?q?CHART-3275=20=E5=AE=89=E8=A3=85=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=20=E5=9B=BE=E8=A1=A8=E7=B1=BB=E5=9E=8B=E4=B8=8D?= =?UTF-8?q?=E9=87=8D=E5=90=AF=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 26 +++++++++++++++++++ .../design/mainframe/FormParaWidgetPane.java | 7 +++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index a01fc0ce5..154f4c097 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -37,7 +37,9 @@ import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.design.module.DesignModuleFactory; import com.fr.form.ui.ChartEditor; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; @@ -57,8 +59,13 @@ import com.fr.plugin.chart.scatter.VanChartScatterPlot; import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.treemap.VanChartTreeMapPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; +import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginSingleInjection; +import com.fr.plugin.injectable.SpecialLevel; +import com.fr.plugin.manage.PluginFilter; +import com.fr.plugin.observer.PluginEvent; +import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.solution.closeable.CloseableContainedMap; import com.fr.stable.ArrayUtils; import com.fr.stable.AssistUtils; @@ -119,6 +126,25 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr readDefault(); readVanChart(); PluginModule.registerAgent(PluginModule.ExtraChartDesign, classManager); + + GeneralContext.listenPluginRunningChanged(new PluginEventListener() { + + @Override + public void on(PluginEvent event) { + + synchronized (ChartTypeInterfaceManager.class) { + //因为是CloseableContainedMap,所以不能在mount那边处理。 + DesignModuleFactory.registerExtraWidgetOptions(ChartTypeInterfaceManager.initWidgetOption()); + } + } + }, new PluginFilter() { + + @Override + public boolean accept(PluginContext context) { + + return context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName()); + } + }); } public static WidgetOption[] initWidgetOption() { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index b78ecbf74..2fb695012 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -22,9 +22,9 @@ import com.fr.form.ui.WidgetConfig; import com.fr.form.ui.WidgetInfoConfig; import com.fr.general.ComparatorUtils; import com.fr.general.GeneralContext; - import com.fr.plugin.context.PluginContext; import com.fr.plugin.injectable.PluginModule; +import com.fr.plugin.injectable.SpecialLevel; import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEventListener; @@ -47,6 +47,8 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; +import static com.fr.plugin.injectable.SpecialLevel.IndependentChartUIProvider; + /** * @author null */ @@ -98,7 +100,8 @@ public class FormParaWidgetPane extends JPanel { @Override public boolean accept(PluginContext context) { - return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG); + return context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG) + || context.contain(PluginModule.ExtraChartDesign, SpecialLevel.IndependentChartUIProvider.getTagName()); } }); } From ef1340db0e992817d33c35afe812089e561a41ce Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 30 Oct 2018 16:40:10 +0800 Subject: [PATCH 09/15] update --- .../main/java/com/fr/design/mainframe/FormParaWidgetPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java index 2fb695012..1958056b3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormParaWidgetPane.java @@ -47,8 +47,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; -import static com.fr.plugin.injectable.SpecialLevel.IndependentChartUIProvider; - /** * @author null */ From 5b6d88e90c215d09e4e7d68125e2ef5424056af2 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 31 Oct 2018 20:10:36 +0800 Subject: [PATCH 10/15] REPORT-11831 --- .../onlineupdate/ui/dialog/UpdateMainDialog.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java index fb5db0cd4..551d5d3db 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java @@ -337,14 +337,8 @@ public class UpdateMainDialog extends UIDialog { initUpdateActionPane(); add(jarVersionInfoPane, BorderLayout.NORTH); - - //海外版本不显示更新信息 - if (GeneralContext.getLocale().equals(Locale.CHINA) || GeneralContext.getLocale().equals(Locale.TAIWAN)){ - add(jarUpdateInfoPane, BorderLayout.CENTER); - add(updateActionPane, BorderLayout.SOUTH); - }else { - add(updateActionPane, BorderLayout.CENTER); - } + add(jarUpdateInfoPane, BorderLayout.CENTER); + add(updateActionPane, BorderLayout.SOUTH); addActionListenerForUpdateBtn(); From 2c4cc795e392c5c9adb2ea41443df6be441edf6c Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Wed, 31 Oct 2018 20:45:55 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E6=89=93=E5=BC=80=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=9B=9E=E9=80=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hyperlink/AbstractHyperNorthPane.java | 22 +- .../hyperlink/ReporletHyperNorthPane.java | 184 +++++++ .../hyperlink/ReportletHyperNorthPane.java | 514 ------------------ .../hyperlink/ReportletHyperlinkPane.java | 47 +- 4 files changed, 203 insertions(+), 564 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java delete mode 100644 designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java index 42f13ceed..cd78c1755 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperNorthPane.java @@ -6,14 +6,11 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; + import com.fr.js.Hyperlink; -import javax.swing.DefaultListCellRenderer; -import javax.swing.JList; -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -24,17 +21,10 @@ public abstract class AbstractHyperNorthPane extends BasicB public static final int DEFAULT_H_VALUE = 400; public static final int DEFAULT_V_VALUE = 600; - /** - * 链接打开方式对话框 - */ + private JPanel headerPane; private UIComboBox targetFrameComboBox; - /** - * 对话框高度输入框 - */ + private UINumberField heightTextFiled; - /** - * 对话框宽度输入框 - */ private UINumberField widthTextFiled; @@ -45,7 +35,7 @@ public abstract class AbstractHyperNorthPane extends BasicB protected void initComponents() { this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); - JPanel headerPane = this.setHeaderPanel(); + headerPane = this.setHeaderPanel(); this.add(headerPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.CENTER); targetFrameComboBox = new UIComboBox(getTargetFrames()); diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java new file mode 100644 index 000000000..d35c70a82 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReporletHyperNorthPane.java @@ -0,0 +1,184 @@ +package com.fr.design.hyperlink; + +import com.fr.design.actions.UpdateAction; +import com.fr.design.dialog.BasicDialog; +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.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.gui.itree.filetree.ReportletPane; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.utils.gui.GUICoreUtils; + +import com.fr.js.ReportletHyperlink; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. + * + * @author kunsnat + */ +public class ReporletHyperNorthPane extends AbstractHyperNorthPane { + private UITextField itemNameTextField; + private boolean needRenamePane = false; + private UITextField reportPathTextField; + private UICheckBox showParameterInterface; + private UIButton browserButton; + + // richer:参数传递方式 + private UIComboBox postComboBox; + + public ReporletHyperNorthPane(boolean needRenamePane) { + this.needRenamePane = needRenamePane; + this.inits(); + } + + public ReporletHyperNorthPane() { + this.inits(); + } + + /** + * 初始化组件 + */ + public void inits() { + super.initComponents(); + } + + @Override + protected JPanel setHeaderPanel() { + JPanel headerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, TableLayout.FILL}; + // Reportlet. + JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); + + reportPathTextField = new UITextField(20); + reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); + + browserButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Select")); + browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); + reportletNamePane.add(browserButton, BorderLayout.EAST); + browserButton.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent evt) { + final ReportletPane reportletPane = new ReportletPane(); + reportletPane.setSelectedReportletPath(reportPathTextField.getText()); + BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReporletHyperNorthPane.this)); + + reportletDialog.addDialogActionListener(new DialogActionAdapter() { + public void doOk() { + reportPathTextField.setText(reportletPane.getSelectedReportletPath()); + } + }); + reportletDialog.setVisible(true); + } + }); + + Component[][] components; + if (!this.needRenamePane) { + components = new Component[][]{ + {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, + }; + } else { + itemNameTextField = new UITextField(); + components = new Component[][]{ + {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}, + {new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), reportletNamePane}, + }; + } + JPanel northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + headerPane.add(northPane, BorderLayout.NORTH); + return headerPane; + } + + @Override + protected String title4PopupWindow() { + return "reportlet"; + } + + @Override + protected void populateSubHyperlinkBean(ReportletHyperlink link) { + if (itemNameTextField != null) { + this.itemNameTextField.setText(link.getItemName()); + } + this.reportPathTextField.setText(link.getReportletPath()); + this.showParameterInterface.setSelected(link.isShowParameterInterface()); + this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); + } + + @Override + protected ReportletHyperlink updateSubHyperlinkBean() { + ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); + updateSubHyperlinkBean(reportletHyperlink); + + return reportletHyperlink; + } + + @Override + protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { + if (itemNameTextField != null) { + reportletHyperlink.setItemName(this.itemNameTextField.getText()); + } + reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); + reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); + reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1 ? true : false); + } + + public String getReportletName() { + return StringUtils.isBlank(this.reportPathTextField.getText()) ? StringUtils.EMPTY : this.reportPathTextField.getText().substring(1); + } + + /** + * 获取按钮焦点 + */ + public void requestButtonFocus() { + this.browserButton.requestFocus(); + JPopupMenu popup = new JPopupMenu(); + FakeTipAction tip = new FakeTipAction(); + tip.setEnabled(false); + popup.add(tip); + GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); + } + + private class FakeTipAction extends UpdateAction { + public FakeTipAction() { + this.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Select")); + } + + public void actionPerformed(ActionEvent e) { + //do nothing + } + } + + @Override + protected JPanel setFootPanel() { + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, TableLayout.FILL}; + showParameterInterface = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); + JPanel showParameterPanel = new JPanel(); + showParameterPanel.add(new UILabel()); + showParameterPanel.add(showParameterInterface); + + postComboBox = new UIComboBox(new String[]{"GET", "POST"}); + JPanel postPanel = new JPanel(); + postPanel.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type"))); + postPanel.add(postComboBox); + Component[][] components = {{postPanel}, + {showParameterPanel}, + {new UILabel(" ")} + }; + + return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + } + +} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java deleted file mode 100644 index 57fcfe25d..000000000 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperNorthPane.java +++ /dev/null @@ -1,514 +0,0 @@ -package com.fr.design.hyperlink; - -import com.fr.base.BaseFormula; -import com.fr.design.actions.UpdateAction; -import com.fr.design.dialog.BasicDialog; -import com.fr.design.dialog.DialogActionAdapter; -import com.fr.design.event.UIObserverListener; -import com.fr.design.formula.FormulaFactory; -import com.fr.design.formula.UIFormula; -import com.fr.design.formula.VariableResolver; -import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ibutton.UIRadioButton; -import com.fr.design.gui.icheckbox.UICheckBox; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UINumberField; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.itree.filetree.ReportletPane; -import com.fr.design.i18n.Toolkit; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.IOUtils; -import com.fr.js.ReportletHyperlink; -import com.fr.js.ReportletHyperlinkDialogAttr; -import com.fr.stable.FormulaProvider; -import com.fr.stable.StringUtils; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.SwingUtilities; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.FlowLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; - -/** - * 热点链接部分 上方 定义特征 样式 报表 等属性的界面. - * - * @author kunsnat - */ -public class ReportletHyperNorthPane extends AbstractHyperNorthPane { - /** - * item name text filed - */ - private UITextField itemNameTextField; - /** - * 是否展示item name - */ - private boolean needRenamePane = false; - /** - * 参数路径输入框 - */ - private UITextField reportPathTextField; - /** - * 是否展示参数面板勾选框 - */ - private UICheckBox showParameterInterface; - /** - * 选择文件按钮 - */ - private UIButton browserButton; - - /** - * 参数传递方式下拉选择框 - */ - private UIComboBox postComboBox; - /** - * 对话框标题输入框 - */ - private JFormulaField titleFiled; - - - /** - * 对话框居中按钮 - */ - private UIRadioButton center; - /** - * 对话框位置自定义按钮 - */ - private UIRadioButton custom; - /** - * 距左 - */ - private UINumberField leftLocation; - /** - * 距上 - */ - private UINumberField topLocation; - - - public ReportletHyperNorthPane(boolean needRenamePane) { - this.needRenamePane = needRenamePane; - } - - public ReportletHyperNorthPane() { - } - - /** - * 初始化面板 - */ - @Override - protected void initComponents() { - this.setLayout(FRGUIPaneFactory.createM_BorderLayout()); - this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - - final List dialogComponents = new ArrayList<>(); - final List othersComponents = new ArrayList<>(); - - initRenamePanel(dialogComponents, othersComponents); - initHeaderPanel(dialogComponents, othersComponents); - initTargetComboBoxPanel(dialogComponents, othersComponents); - - initTitlePanel(dialogComponents); - initDialogSizePanel(dialogComponents); - initDialogLocationPanel(dialogComponents); - - initFooterPanel(dialogComponents, othersComponents); - - initPlaceHolder(othersComponents); - - bindListener(dialogComponents, othersComponents); - - // 创建内容面板 - JPanel content = TableLayoutHelper.createTableLayoutPane(dialogComponents.toArray(new Component[dialogComponents.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); - this.add(content, BorderLayout.CENTER); - } - - - /** - * 生成最上方的配置面板 - * - * @return JPanel - */ - @Override - protected JPanel setHeaderPanel() { - - JPanel reportletNamePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); - // 路径输入框 - reportPathTextField = new UITextField(20); - reportletNamePane.add(reportPathTextField, BorderLayout.CENTER); - - // 选择路径按钮 - browserButton = new UIButton(Toolkit.i18nText("Fine-Design_Basic_Select")); - browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, 20)); - reportletNamePane.add(browserButton, BorderLayout.EAST); - browserButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent evt) { - final ReportletPane reportletPane = new ReportletPane(); - reportletPane.setSelectedReportletPath(reportPathTextField.getText()); - BasicDialog reportletDialog = reportletPane.showWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this)); - - reportletDialog.addDialogActionListener(new DialogActionAdapter() { - @Override - public void doOk() { - reportPathTextField.setText(reportletPane.getSelectedReportletPath()); - } - }); - reportletDialog.setVisible(true); - } - }); - return reportletNamePane; - } - - @Override - protected String title4PopupWindow() { - return "reportlet"; - } - - @Override - protected void populateSubHyperlinkBean(ReportletHyperlink link) { - if (itemNameTextField != null) { - this.itemNameTextField.setText(link.getItemName()); - } - this.reportPathTextField.setText(link.getReportletPath()); - this.showParameterInterface.setSelected(link.isShowParameterInterface()); - this.postComboBox.setSelectedIndex(link.isByPost() ? 1 : 0); - - ReportletHyperlinkDialogAttr attr = link.getAttr(); - titleFiled.setFormulaText(StringUtils.EMPTY); - leftLocation.setText(StringUtils.EMPTY); - topLocation.setText(StringUtils.EMPTY); - center.setSelected(true); - if (attr != null) { - FormulaProvider title = attr.getTitleFormula(); - String titleContent = title == null ? StringUtils.EMPTY : title.getPureContent(); - titleFiled.setFormulaText(titleContent); - boolean isCenter = attr.isCenter(); - if (!isCenter) { - int left = attr.getLeft(), top = attr.getTop(); - leftLocation.setText(Integer.toString(left)); - topLocation.setText(Integer.toString(top)); - } - center.setSelected(isCenter); - custom.setSelected(!isCenter); - } - } - - @Override - protected ReportletHyperlink updateSubHyperlinkBean() { - ReportletHyperlink reportletHyperlink = new ReportletHyperlink(); - updateSubHyperlinkBean(reportletHyperlink); - return reportletHyperlink; - } - - @Override - protected void updateSubHyperlinkBean(ReportletHyperlink reportletHyperlink) { - if (itemNameTextField != null) { - reportletHyperlink.setItemName(this.itemNameTextField.getText()); - } - reportletHyperlink.setReportletPath(this.reportPathTextField.getText()); - reportletHyperlink.setShowParameterInterface(this.showParameterInterface.isSelected()); - reportletHyperlink.setByPost(postComboBox.getSelectedIndex() == 1); - - ReportletHyperlinkDialogAttr attr = new ReportletHyperlinkDialogAttr(); - attr.setTitleFormula(BaseFormula.createFormulaBuilder().build(titleFiled.getFormulaText())); - attr.setCenter(center.isSelected()); - if (!attr.isCenter()) { - attr.setLeft((int) leftLocation.getValue()); - attr.setTop((int) topLocation.getValue()); - } - reportletHyperlink.setAttr(attr); - - } - - public String getReportletName() { - String text = this.reportPathTextField.getText(); - return StringUtils.isBlank(text) ? StringUtils.EMPTY : text.substring(1); - } - - /** - * 获取按钮焦点 - */ - public void requestButtonFocus() { - this.browserButton.requestFocus(); - JPopupMenu popup = new JPopupMenu(); - FakeTipAction tip = new FakeTipAction(); - tip.setEnabled(false); - popup.add(tip); - GUICoreUtils.showPopupCloseMenu(popup, this.browserButton); - } - - private class FakeTipAction extends UpdateAction { - public FakeTipAction() { - this.setName(Toolkit.i18nText("Fine-Design_Basic_Template_Select")); - } - - @Override - public void actionPerformed(ActionEvent e) { - // do nothing - } - } - - /** - * 底部面板,参数传递方式 - * - * @return JPanel - */ - @Override - protected JPanel setFootPanel() { - JPanel content = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - - // 参数传递方式下拉框 - postComboBox = new UIComboBox(new String[]{"GET", "POST"}); - postComboBox.setPreferredSize(new Dimension(60, 20)); - postComboBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - content.add(postComboBox); - - - showParameterInterface = new UICheckBox(Toolkit.i18nText("Fine-Design_Basic_Parameter_UI_Display")); - - showParameterInterface.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); - content.add(showParameterInterface); - return content; - } - - private void bindListener(final List dialogComponents, final List othersComponents) { - final UIComboBox targetFrameComboBox = this.getTargetFrameComboBox(); - targetFrameComboBox.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - boolean show = DIALOG == targetFrameComboBox.getSelectedIndex(); - JPanel content; - List cs; - if (show) { - cs = dialogComponents; - } else { - cs = othersComponents; - } - ReportletHyperNorthPane.this.removeAll(); - content = TableLayoutHelper.createTableLayoutPane(cs.toArray(new Component[cs.size()][]), TableLayoutHelper.FILL_LASTCOL_AND_ROW); - ReportletHyperNorthPane.this.add(content, BorderLayout.CENTER); - ReportletHyperNorthPane.this.revalidate(); - ReportletHyperNorthPane.this.repaint(); - } - }); - } - - private void initPlaceHolder(List othersComponents) { - JPanel empty1 = new JPanel(); - empty1.setPreferredSize(new Dimension(20, 20)); - JPanel empty2 = new JPanel(); - empty2.setPreferredSize(new Dimension(20, 20)); - JPanel empty3 = new JPanel(); - empty3.setPreferredSize(new Dimension(20, 23)); - - othersComponents.add(new Component[]{empty1, new JPanel()}); - othersComponents.add(new Component[]{empty2, new JPanel()}); - othersComponents.add(new Component[]{empty3, new JPanel()}); - } - - private void initRenamePanel(List dialogComponents, List othersComponents) { - // 是否有重命名属性 - if (this.needRenamePane) { - itemNameTextField = new UITextField(); - Component[] renameComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Name") + ":"), itemNameTextField}; - dialogComponents.add(renameComponents); - othersComponents.add(renameComponents); - } - } - - private void initHeaderPanel(List dialogComponents, List othersComponents) { - //最上方位置的面板 - JPanel headerPane = this.setHeaderPanel(); - Component[] headerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet") + ":"), headerPane}; - dialogComponents.add(headerComponents); - othersComponents.add(headerComponents); - } - - private void initTargetComboBoxPanel(List dialogComponents, List othersComponents) { - // 链接打开于 - UIComboBox targetFrameComboBox = new UIComboBox(getTargetFrames()); - this.setTargetFrameComboBox(targetFrameComboBox); - targetFrameComboBox.setEditable(true); - targetFrameComboBox.setPreferredSize(new Dimension(100, 20)); - JPanel targetFramePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - targetFramePanel.add(targetFrameComboBox); - Component[] targetComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Link_Opened_In") + ":"), targetFramePanel}; - dialogComponents.add(targetComponents); - othersComponents.add(targetComponents); - } - - private void initTitlePanel(List dialogComponents) { - // 对话框标题 - titleFiled = new JFormulaField(15); - final JPanel titlePanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - titlePanel.add(titleFiled); - Component[] titleComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Title") + ":"), titlePanel}; - dialogComponents.add(titleComponents); - } - - private void initDialogSizePanel(List dialogComponents) {// 对话框大小 - final JPanel sizeJPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - UILabel heightLabel = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Height") + ":"); - heightLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10)); - sizeJPanel.add(heightLabel); - UINumberField heightTextFiled = new UINumberField(); - heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); - heightTextFiled.setPreferredSize(new Dimension(40, 20)); - sizeJPanel.add(heightTextFiled); - this.setHeightTextFiled(heightTextFiled); - UILabel widthLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Designer_Width") + ":"); - widthLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); - sizeJPanel.add(widthLabel); - UINumberField widthTextFiled = new UINumberField(); - widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); - widthTextFiled.setPreferredSize(new Dimension(40, 20)); - sizeJPanel.add(widthTextFiled); - this.setWidthTextFiled(widthTextFiled); - sizeJPanel.setVisible(true); - dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Size") + ":"), sizeJPanel}); - } - - private void initDialogLocationPanel(List dialogComponents) { - // 显示位置 - final JPanel locationPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0)); - // 居中 - center = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Center")); - // 自定义 - custom = new UIRadioButton(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Custom")); - - custom.setBorder(BorderFactory.createEmptyBorder(4, 20, 4, 5)); - ButtonGroup group = new ButtonGroup(); - group.setSelected(center.getModel(), true); - group.add(center); - group.add(custom); - locationPanel.add(center); - locationPanel.add(custom); - - // 位置 距左 - final UILabel leftLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Left")); - leftLabel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 10)); - leftLocation = new UINumberField(); - leftLocation.setPreferredSize(new Dimension(40, 20)); - // 位置 距上 - final UILabel topLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Position_Top")); - topLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); - topLocation = new UINumberField(); - topLocation.setPreferredSize(new Dimension(40, 20)); - - locationPanel.add(leftLabel); - locationPanel.add(leftLocation); - locationPanel.add(topLabel); - locationPanel.add(topLocation); - leftLabel.setVisible(false); - leftLocation.setVisible(false); - topLabel.setVisible(false); - topLocation.setVisible(false); - ChangeListener actionListener = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - boolean visible = custom.isSelected(); - leftLabel.setVisible(visible); - leftLocation.setVisible(visible); - topLabel.setVisible(visible); - topLocation.setVisible(visible); - } - }; - // 默认居中 - center.setSelected(true); - center.addChangeListener(actionListener); - custom.addChangeListener(actionListener); - - dialogComponents.add(new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Dialog_Show_Position") + ":"), locationPanel}); - } - - private void initFooterPanel(List dialogComponents, List othersComponents) { - // 最下方的配置面板 - // 参数传递方式 - Component[] footerComponents = new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Basic_Reportlet_Parameter_Type") + ":"), this.setFootPanel()}; - dialogComponents.add(footerComponents); - othersComponents.add(footerComponents); - } - - /** - * 公式输入框 - */ - public class JFormulaField extends JPanel { - private UITextField formulaTextField; - - public JFormulaField(int columns) { - - formulaTextField = new UITextField(columns); - JPanel textFieldPane = new JPanel(new BorderLayout()); - textFieldPane.add(formulaTextField, BorderLayout.CENTER); - textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); - UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); - formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); - formulaButton.setPreferredSize(new Dimension(24, formulaTextField.getPreferredSize().height)); - formulaButton.addActionListener(formulaButtonActionListener); - - JPanel pane = new JPanel(new BorderLayout()); - pane.add(textFieldPane, BorderLayout.CENTER); - pane.add(formulaButton, BorderLayout.EAST); - this.setLayout(new BorderLayout()); - this.add(pane, BorderLayout.NORTH); - } - - public void setFormulaText(String formulaContent) { - this.formulaTextField.setText(formulaContent); - } - - public String getFormulaText() { - - String text = formulaTextField.getText(); - if (text == null) { - text = StringUtils.EMPTY; - } - return text; - } - - /** - * 添加事件监听器 - * - * @param listener 公式文本输入框改动事件监听器 - */ - public void addListener(UIObserverListener listener) { - this.formulaTextField.registerChangeListener(listener); - } - - /** - * 取消事件监听器 - */ - public void removeListener() { - this.formulaTextField.registerChangeListener(null); - } - - private ActionListener formulaButtonActionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent evt) { - BaseFormula valueFormula = BaseFormula.createFormulaBuilder().build(); - valueFormula.setContent(getFormulaText()); - final UIFormula formulaPane = FormulaFactory.createFormulaPaneWhenReserveFormula(); - formulaPane.populate(valueFormula, VariableResolver.DEFAULT); - formulaPane.showLargeWindow(SwingUtilities.getWindowAncestor(ReportletHyperNorthPane.this), new DialogActionAdapter() { - @Override - public void doOk() { - BaseFormula valueFormula = formulaPane.update(); - setFormulaText(valueFormula.getContent()); - } - }).setVisible(true); - } - }; - } -} diff --git a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java index 532fe467c..e50360c19 100644 --- a/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java +++ b/designer-base/src/main/java/com/fr/design/hyperlink/ReportletHyperlinkPane.java @@ -6,30 +6,23 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.UITableEditAction; -import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterReader; import com.fr.design.utils.gui.GUICoreUtils; + import com.fr.js.ReportletHyperlink; import com.fr.stable.ParameterProvider; import com.fr.stable.StringUtils; -import javax.swing.JOptionPane; -import java.awt.BorderLayout; -import java.awt.FlowLayout; +import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.util.HashMap; import java.util.List; public class ReportletHyperlinkPane extends AbstractHyperLinkPane { - /** - * 超链配置面板 - */ - private ReportletHyperNorthPane northPane; - /** - * 是否继承参数勾选框 - */ + private ReporletHyperNorthPane northPane; private UICheckBox extendParametersCheckBox; public ReportletHyperlinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { @@ -45,29 +38,22 @@ public class ReportletHyperlinkPane extends AbstractHyperLinkPane Date: Mon, 5 Nov 2018 14:01:31 +0800 Subject: [PATCH 12/15] =?UTF-8?q?REPORT-12324=20=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8=E3=80=8B=E6=9C=8D=E5=8A=A1=E5=99=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E4=B8=AD=E6=96=B0=E5=A2=9E=E6=95=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E9=A2=84=E8=A7=88=E5=90=8E=E6=97=A5=E5=BF=97=E4=B8=AD?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/datapane/TreeTableDataDictPane.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java index 81c791282..f1f1c6c75 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TreeTableDataDictPane.java @@ -16,12 +16,15 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIRadioButton; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; - -import com.fr.script.Calculator; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; @@ -155,7 +158,6 @@ public class TreeTableDataDictPane extends BasicPane implements Previewable { } } rtd.setTableDataSource(DesignTableDataManager.getEditingTableDataSource()); - rtd.createDataModel(Calculator.createCalculator()); PreviewTablePane.previewTableData(rtd); } }); From 12b13eba2194e03f5704a50ffcbcfa84739ddd68 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 7 Nov 2018 12:52:34 +0800 Subject: [PATCH 13/15] update --- .../fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java index 551d5d3db..ef9727186 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/UpdateMainDialog.java @@ -23,7 +23,12 @@ import com.fr.design.onlineupdate.ui.widget.UpdateInfoTableCellRender; import com.fr.design.onlineupdate.ui.widget.UpdateInfoTableModel; import com.fr.design.onlineupdate.ui.widget.UpdateInfoTextAreaCellRender; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.*; +import com.fr.general.ComparatorUtils; +import com.fr.general.DateUtils; +import com.fr.general.GeneralContext; +import com.fr.general.GeneralUtils; +import com.fr.general.IOUtils; +import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONArray; import com.fr.json.JSONObject; From 358a4bf4dfdbad50346de3ccbd017dc1dead5e66 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 7 Nov 2018 12:52:50 +0800 Subject: [PATCH 14/15] 1 --- .../fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java index 680d3190d..4cfda16ec 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java @@ -1,6 +1,6 @@ package com.fr.design.onlineupdate.ui.dialog; -import com.fr.base.FRContext; +import com.fr.base.F RContext; import com.fr.design.RestartHelper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel; From 61c76f593daafb63eb27ed4cfa404d47d82dc70c Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Wed, 7 Nov 2018 12:53:18 +0800 Subject: [PATCH 15/15] update --- .../fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java index 4cfda16ec..680d3190d 100644 --- a/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java +++ b/designer-base/src/main/java/com/fr/design/onlineupdate/ui/dialog/RestoreResultDialog.java @@ -1,6 +1,6 @@ package com.fr.design.onlineupdate.ui.dialog; -import com.fr.base.F RContext; +import com.fr.base.FRContext; import com.fr.design.RestartHelper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ilable.UILabel;