From 92324089d7b77a8bb28ca24bb7e38befbc37335d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 14 Jul 2020 14:59:46 +0800 Subject: [PATCH 01/72] =?UTF-8?q?CHART-14598=20=E9=9B=B7=E8=BE=BE=E5=9B=BE?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BA=BF=E5=AE=BD=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/background/VanChartAlertValuePane.java | 2 +- .../background/radar/VanChartRadarAlertValuePane.java | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index 85aff83629..a3600a9852 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -52,7 +52,7 @@ public class VanChartAlertValuePane extends BasicBeanPane { private UIButtonGroup alertAxis; protected TinyFormulaPane alertValue; protected LineTypeComboBox alertLineStyle;//线型 - private UISpinner lineWidthSpinner;//线宽 + protected UISpinner lineWidthSpinner;//线宽 protected ColorSelectBox alertLineColor; private UIButtonGroup alertTextPosition; diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java index 4459d96816..8d6fb2cf61 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java @@ -1,7 +1,7 @@ package com.fr.van.chart.designer.style.background.radar; import com.fr.design.gui.ilable.UILabel; - +import com.fr.design.i18n.Toolkit; import com.fr.van.chart.designer.style.background.VanChartAlertValuePane; import java.awt.Component; @@ -14,9 +14,10 @@ public class VanChartRadarAlertValuePane extends VanChartAlertValuePane { protected Component[][] getTopPaneComponents() { return new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")),alertValue}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),alertLineStyle}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),alertLineColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), alertValue}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), alertLineStyle}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), alertLineColor}, }; } From ac5c016673f719ca46011cd815a5b08c7060b115 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Jul 2020 15:39:25 +0800 Subject: [PATCH 02/72] REPORT-35381 && REPORT-35379 --- .../java/com/fr/design/actions/help/AboutDialog.java | 2 +- .../java/com/fr/design/actions/help/AboutPane.java | 12 +++++++++++- .../gui/icontainer/UIEastResizableContainer.java | 12 +++++++++++- .../fr/design/mainframe/EastRegionContainerPane.java | 10 +++++++++- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java index b4b6d53c6f..d94e8ea5c3 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutDialog.java @@ -76,7 +76,7 @@ public class AboutDialog extends JDialog implements ActionListener { this.getRootPane().setDefaultButton(okButton); - this.setSize(new Dimension(660, 600)); + this.setSize(defaultPane.getPreferredSize().width, 600); GUICoreUtils.centerWindow(this); } diff --git a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java index 3ede159504..a7aac03913 100644 --- a/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java +++ b/designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java @@ -4,6 +4,7 @@ package com.fr.design.actions.help; import com.fr.base.FRContext; +import com.fr.base.GraphHelper; import com.fr.design.DesignerEnvManager; import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.BoldFontTextLabel; @@ -36,9 +37,13 @@ public class AboutPane extends JPanel { private static final String COMPANY_TELEPHONE = CloudCenter.getInstance().acquireUrlByKind("help.compNo"); private static final String PRESIDENT_PHONE = CloudCenter.getInstance().acquireUrlByKind("help.PNo"); + private int maxWidth; + public AboutPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - + this.maxWidth = GraphHelper.getWidth(getBuildTitle() + GeneralUtils.readFullBuildNO() + + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO") + + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Copy_Build_NO_OK")); //center panel JPanel centerPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); this.add(centerPane, BorderLayout.CENTER); @@ -90,6 +95,11 @@ public class AboutPane extends JPanel { } } + @Override + public Dimension getPreferredSize() { + return new Dimension(this.maxWidth, super.getPreferredSize().height); + } + private void addPhoneAndQQPane(JPanel contentPane) { BoxCenterAligmentPane boxCenterAlignmentPane; // 英文版不显示服务电话和QQ diff --git a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java index 2a5c29d8c8..df07acf1ab 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java +++ b/designer-base/src/main/java/com/fr/design/gui/icontainer/UIEastResizableContainer.java @@ -18,6 +18,10 @@ import java.awt.event.MouseMotionListener; */ public class UIEastResizableContainer extends JPanel { private static final long serialVersionUID = 1854340560790476907L; + + public static final int MAX_CONTAINER_WIDTH = 500; + public static final int MIN_CONTAINER_WIDTH = 286; + private int containerWidth = 240; private int preferredWidth = 240; private int topToolPaneHeight = 25; @@ -262,7 +266,13 @@ public class UIEastResizableContainer extends JPanel { @Override public void mouseDragged(MouseEvent e) { - // do nothing + containerWidth = UIEastResizableContainer.this.getWidth() + (UIEastResizableContainer.this.getLocationOnScreen().x - e.getXOnScreen()); + containerWidth = Math.min(containerWidth, MAX_CONTAINER_WIDTH); + containerWidth = Math.max(containerWidth, MIN_CONTAINER_WIDTH); + refreshContainer(); + if ( DesignModeContext.isAuthorityEditing()) { + DesignerContext.getDesignerFrame().doResize(); + } } }); addMouseListener(new MouseAdapter() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 394dfca1e2..b2ea7be11f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.base.FRContext; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignerEnvManager; import com.fr.design.ExtraDesignClassManager; @@ -66,7 +67,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private JPanel leftPane; private JPanel rightPane; private FixedPopupPane currentPopupPane; - private static final int CONTAINER_WIDTH = 286; + private static final int CONTAINER_WIDTH = containerWidth(); private static final int TAB_WIDTH = 38; private static final int TAB_BUTTON_WIDTH = 32; private static final int TAB_BUTTON_HEIGHT = 28; @@ -107,6 +108,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板) + private static int containerWidth() { + if (FRContext.isChineseEnv()) { + return UIEastResizableContainer.MIN_CONTAINER_WIDTH; + } + return UIEastResizableContainer.MAX_CONTAINER_WIDTH; + } + /** * 得到实例 * From 1f25a4de4fe8d5d6f54bb3e9d27c40739bbe22e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 14 Jul 2020 17:37:39 +0800 Subject: [PATCH 03/72] =?UTF-8?q?CHART-14624=20=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E9=9D=A2=E7=A7=AF=E5=9B=BE=E7=B3=BB=E5=88=97=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E4=B8=8D=E9=80=8F=E6=98=8E=E7=9A=84enable=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E7=9A=84check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../item/VanChartAreaFillColorConditionPane.java | 11 ++++++----- .../series/VanChartAbstractPlotSeriesPane.java | 15 +++++++-------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartAreaFillColorConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartAreaFillColorConditionPane.java index c8be9aa7a9..aeb72f07d8 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartAreaFillColorConditionPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/other/condition/item/VanChartAreaFillColorConditionPane.java @@ -1,11 +1,11 @@ package com.fr.van.chart.designer.other.condition.item; -import com.fr.chart.base.ChartConstants; import com.fr.chart.base.DataSeriesCondition; import com.fr.chart.chartattr.Plot; import com.fr.design.condition.ConditionAttributesPane; - +import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground; +import com.fr.plugin.chart.type.GradientType; import com.fr.van.chart.designer.component.VanChartAreaSeriesFillColorPane; import javax.swing.JPanel; @@ -13,7 +13,7 @@ import javax.swing.JPanel; /** * 面积图,填充色 */ -public class VanChartAreaFillColorConditionPane extends AbstractNormalMultiLineConditionPane { +public class VanChartAreaFillColorConditionPane extends AbstractNormalMultiLineConditionPane { private Plot plot; private static final long serialVersionUID = -4148284851967140012L; private VanChartAreaSeriesFillColorPane fillColorBackground; @@ -40,6 +40,7 @@ public class VanChartAreaFillColorConditionPane extends AbstractNormalMultiLine /** * 条件属性item的名称 + * * @return item的名称 */ public String nameForPopupMenuItem() { @@ -54,13 +55,13 @@ public class VanChartAreaFillColorConditionPane extends AbstractNormalMultiLine public void setDefault() { //下面这句话是给各组件一个默认值 fillColorBackground.populate(new AttrAreaSeriesFillColorBackground()); - fillColorBackground.checkoutAlpha(!(plot != null && plot.getPlotStyle() == ChartConstants.STYLE_SHADE)); + fillColorBackground.checkoutAlpha(plot != null && ((VanChartPlot) plot).getGradientStyle().getGradientType() == GradientType.NONE); } public void populate(DataSeriesCondition condition) { if (condition instanceof AttrAreaSeriesFillColorBackground) { fillColorBackground.populate((AttrAreaSeriesFillColorBackground) condition); - fillColorBackground.checkoutAlpha(!(plot != null && plot.getPlotStyle() == ChartConstants.STYLE_SHADE)); + fillColorBackground.checkoutAlpha(plot != null && ((VanChartPlot) plot).getGradientStyle().getGradientType() == GradientType.NONE); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java index 4c914b0cd2..e8f9def4b3 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/series/VanChartAbstractPlotSeriesPane.java @@ -5,7 +5,6 @@ import com.fr.base.chart.chartdata.model.LargeDataModel; import com.fr.base.chart.chartdata.model.NormalDataModel; import com.fr.chart.base.AttrAlpha; import com.fr.chart.base.AttrBorder; -import com.fr.chart.base.ChartConstants; import com.fr.chart.base.GradientStyle; import com.fr.chart.chartattr.Plot; import com.fr.chart.chartglyph.ConditionAttr; @@ -90,7 +89,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP } JPanel panel = new JPanel(new BorderLayout()); JPanel colorPane = getColorPane(); - if(colorPane != null) { + if (colorPane != null) { panel.add(colorPane, BorderLayout.NORTH); } panel.add(getContentInPlotType(), BorderLayout.CENTER); @@ -279,7 +278,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP checkoutMapType(plot); - if(vanChartFillStylePane != null) { //配色 + if (vanChartFillStylePane != null) { //配色 vanChartFillStylePane.populateBean(plot.getPlotFillStyle()); } @@ -310,7 +309,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP populateCondition(plot.getConditionCollection().getDefaultAttr()); - checkAreaSeriesFillColorPane(plot.getPlotStyle()); + checkAreaSeriesFillColorPane(((VanChartPlot) plot).getGradientStyle()); checkCompsEnabledWithLarge(plot); } @@ -340,7 +339,7 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP //更新之前先更新界面的map类型属性 checkoutMapType(plot); - if(vanChartFillStylePane != null) {//配色 + if (vanChartFillStylePane != null) {//配色 plot.setPlotFillStyle(vanChartFillStylePane.updateBean()); } @@ -369,16 +368,16 @@ public abstract class VanChartAbstractPlotSeriesPane extends AbstractPlotSeriesP updateCondition(plot.getConditionCollection().getDefaultAttr()); - checkAreaSeriesFillColorPane(plot.getPlotStyle()); + checkAreaSeriesFillColorPane(((VanChartPlot) plot).getGradientStyle()); } protected void checkoutMapType(Plot plot) { } - protected void checkAreaSeriesFillColorPane(int plotStyle) { + protected void checkAreaSeriesFillColorPane(GradientStyle gradientStyle) { if (areaSeriesFillColorPane != null) { - areaSeriesFillColorPane.checkoutAlpha(plotStyle == ChartConstants.STYLE_NONE); + areaSeriesFillColorPane.checkoutAlpha(gradientStyle.getGradientType() == GradientType.NONE); } } From 64dcfc7bde6b376bd8876d77a5c369404af6745b Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 14 Jul 2020 18:51:45 +0800 Subject: [PATCH 04/72] REPORT-34780 && CHART-14441 --- .../com/fr/design/data/datapane/TableDataPaneListPane.java | 5 ++++- .../java/com/fr/design/designer/creator/XCreatorUtils.java | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java index 1dd1f00aa0..8c09eb3035 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataPaneListPane.java @@ -60,7 +60,10 @@ public class TableDataPaneListPane extends JListControlPane implements TableData if (StringUtils.isEmpty(tempName)) { isNamePermitted = false; nameableList.stopEditing(); - FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips")); + FineJOptionPane.showMessageDialog(SwingUtilities.getWindowAncestor(TableDataPaneListPane.this), + Toolkit.i18nText("Fine-Design_Basic_Table_Data_Empty_Name_Tips"), + Toolkit.i18nText("Fine-Design_Report_Alert"), + JOptionPane.WARNING_MESSAGE); setIllegalIndex(editingIndex); return; } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 36d2d44a57..42069e4d8a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -11,6 +11,7 @@ import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWCardTagLayout; import com.fr.design.designer.creator.cardlayout.XWCardTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; +import com.fr.design.fun.ChartWidgetOptionProvider; import com.fr.design.fun.FormWidgetOptionProvider; import com.fr.design.fun.ParameterWidgetOptionProvider; import com.fr.design.module.DesignModuleFactory; @@ -102,7 +103,8 @@ public class XCreatorUtils { public boolean accept(PluginContext context) { return context.contain(PluginModule.ExtraDesign, ParameterWidgetOptionProvider.XML_TAG) - || context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG); + || context.contain(PluginModule.ExtraDesign, FormWidgetOptionProvider.XML_TAG) + || context.contain(PluginModule.ExtraDesign, ChartWidgetOptionProvider.XML_TAG); } }); } From 6a8905f46746bfe3b0999516dedba23876468c7d Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 15 Jul 2020 00:10:28 +0800 Subject: [PATCH 05/72] =?UTF-8?q?REPORT-34994=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E8=A1=A8=E6=A0=BC=E6=8A=98=E5=8F=A0=E6=A0=91=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3(=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=8E=A5=E5=8F=A3)-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cell/AbstractCellElementPropertyPane.java | 23 +++++++++++++ .../cell/CellElementPropertyComponent.java | 34 +++++++++++++++++++ .../fr/design/fun/CellAttributeProvider.java | 2 ++ .../design/fun/CellPropertyPaneProvider.java | 18 ++++++++++ .../AbstractCellPropertyPaneProvider.java | 15 ++++++++ .../mainframe/EastRegionContainerPane.java | 6 ++-- .../mainframe/ElementCasePaneDelegate.java | 32 ++++++++++++++++- 7 files changed, 127 insertions(+), 3 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java create mode 100644 designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java create mode 100644 designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java diff --git a/designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java b/designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java new file mode 100644 index 0000000000..3e4e001a8f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/cell/AbstractCellElementPropertyPane.java @@ -0,0 +1,23 @@ +package com.fr.design.cell; + +import com.fr.design.designer.TargetComponent; +import com.fr.design.dialog.BasicPane; + +import javax.swing.JPanel; + +/** + * @author zack + * @version 10.0 + * Created by zack on 2020/7/14 + */ +public abstract class AbstractCellElementPropertyPane extends BasicPane implements CellElementPropertyComponent { + @Override + public JPanel toPanel() { + return this; + } + + @Override + public boolean accept(TargetComponent tc) { + return true; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java b/designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java new file mode 100644 index 0000000000..b3e6f41674 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/cell/CellElementPropertyComponent.java @@ -0,0 +1,34 @@ +package com.fr.design.cell; + +import com.fr.design.designer.TargetComponent; + +import javax.swing.JPanel; + +/** + * 单元格属性配置面板接口 + * @author zack + * @version 10.0 + * Created by zack on 2020/7/14 + */ +public interface CellElementPropertyComponent { + + /** + * 判断当前编辑的对象是否显示当前实现 + * @param tc + * @return + */ + boolean accept(TargetComponent tc); + + /** + * 加载数据 + * @param tc + */ + void populate(TargetComponent tc); + + /** + * 返回当前属性面板,默认返回this + * @return + */ + JPanel toPanel(); + +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java b/designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java index 227333cd08..82f7a81445 100644 --- a/designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/CellAttributeProvider.java @@ -4,8 +4,10 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.stable.fun.mark.Immutable; /** + * 单元格属性面板扩展接口,接口基本逻辑不通且不符合接口设计规范,单元格属性扩展可以使用CellPropertyPaneProvider * Created by zhouping on 2015/11/11. */ +@Deprecated public interface CellAttributeProvider extends Immutable{ String MARK_STRING = "CellAttributeProvider"; diff --git a/designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java new file mode 100644 index 0000000000..0100f4b2cf --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/CellPropertyPaneProvider.java @@ -0,0 +1,18 @@ +package com.fr.design.fun; + +import com.fr.design.cell.CellElementPropertyComponent; + +/** + * 单元格设置(属性)扩展接口 + * @author zack + * @version 10.0 + * Created by zack on 2020/7/14 + */ +public interface CellPropertyPaneProvider extends PropertyItemPaneProvider { + + /** + * 构造单元格属性面板,面板实现需要使用单例模式实现 + * @return 面板类 + */ + CellElementPropertyComponent getSingletonCelPropertyPane(); +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java new file mode 100644 index 0000000000..ba1c71d5f3 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractCellPropertyPaneProvider.java @@ -0,0 +1,15 @@ +package com.fr.design.fun.impl; + +import com.fr.design.fun.CellPropertyPaneProvider; +import com.fr.stable.fun.mark.API; + +/** + * Created by zhouping on 2015/11/11. + */ +@API(level = CellPropertyPaneProvider.CURRENT_LEVEL) +public abstract class AbstractCellPropertyPaneProvider extends AbstractPropertyItemPaneProvider implements CellPropertyPaneProvider { + + public int currentAPILevel() { + return CellPropertyPaneProvider.CURRENT_LEVEL; + } +} \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java index 394dfca1e2..b2328f295a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java @@ -219,8 +219,10 @@ public class EastRegionContainerPane extends UIEastResizableContainer { itemBean.getEnableModes()); UIButton button = propertyItem.getButton(); List buttonListeners = itemBean.getButtonListeners(); - for (ActionListener buttonListener : buttonListeners) { - button.addActionListener(buttonListener); + if (buttonListeners != null) { + for (ActionListener buttonListener : buttonListeners) { + button.addActionListener(buttonListener); + } } propertyItemMap.put(key, propertyItem); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 22ab323443..3f46dded84 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; +import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.cell.CellAttributeAction; import com.fr.design.actions.cell.CellExpandAttrAction; @@ -18,7 +19,10 @@ import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.cell.CellElementPropertyComponent; +import com.fr.design.fun.CellPropertyPaneProvider; import com.fr.design.fun.MenuHandler; +import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.menu.KeySetUtils; @@ -28,15 +32,17 @@ import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; - +import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.page.ReportSettingsProvider; +import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.util.Set; /** @@ -82,6 +88,9 @@ public class ElementCasePaneDelegate extends ElementCasePane { } CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); + //加载插件中的单元格属性 + populateExtraCellProperties(); + QuickEditorRegion.getInstance().populate(getCurrentEditor()); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); // 模板初始化完成后,才能初始化超级链接面板 @@ -218,4 +227,25 @@ public class ElementCasePaneDelegate extends ElementCasePane { return this.getTarget().getReportSettings(); } + private void populateExtraCellProperties() { + Selection selection = getSelection(); + if (selection instanceof CellSelection) { + //单元格属性,限定下是选中单个单元格 + TemplateElementCase elementCase = getEditingElementCase(); + if (elementCase != null) { + Set itemPaneProviders = ExtraDesignClassManager.getInstance().getArray(PropertyItemPaneProvider.XML_TAG); + if (itemPaneProviders != null) { + for (PropertyItemPaneProvider itemPaneProvider : itemPaneProviders) { + if(itemPaneProvider instanceof CellPropertyPaneProvider){ + CellPropertyPaneProvider cellPropertyPaneProvider = (CellPropertyPaneProvider) itemPaneProvider; + CellElementPropertyComponent cellElementPropertyPane = cellPropertyPaneProvider.getSingletonCelPropertyPane(); + if (cellElementPropertyPane != null && cellElementPropertyPane.accept(ElementCasePaneDelegate.this)) { + cellElementPropertyPane.populate(ElementCasePaneDelegate.this); + } + } + } + } + } + } + } } From 44d31554d8e9e0a2b67002e33cbf842fd77b7376 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Jul 2020 10:18:52 +0800 Subject: [PATCH 06/72] =?UTF-8?q?REPORT-35253=20=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=88=B0=E6=9C=AC=E5=9C=B0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../env/RemoteDesignerWorkspaceInfo.java | 27 +++++++++++++++++++ .../env/RemoteDesignerWorkspaceInfoTest.java | 25 +++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java diff --git a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java index 0e3f688970..2f30f70b97 100644 --- a/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java +++ b/designer-base/src/main/java/com/fr/design/env/RemoteDesignerWorkspaceInfo.java @@ -1,16 +1,39 @@ package com.fr.design.env; +import com.fr.design.DesignerEnvManager; +import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.security.SecurityToolbox; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; +import com.fr.stable.project.ProjectConstants; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLableReader; import com.fr.workspace.WorkContext; import com.fr.workspace.connect.WorkspaceConnectionInfo; +import java.util.HashSet; +import java.util.Set; + public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { + private static final Set FILTER_SET = new HashSet<>(); + private static final String HTTPS = "https://"; + private static final String HTTP = "http://"; + private static final String DEFAULT_SERVLET_NAME = "decision"; + private static final String PATH = ProjectConstants.FORWARD_SLASH + ProjectConstants.WEBAPP_NAME + ProjectConstants.FORWARD_SLASH + DEFAULT_SERVLET_NAME; + private static final String HOST_NAME = "127.0.0.1"; + private static final String LOCAL_HOTS_NAME = "localhost"; + private static final String QUOTATION = ":"; + private static final String PORT = Integer.toString(DesignerEnvManager.getEnvManager().getEmbedServerPort()); + + static { + FILTER_SET.add(HTTP + HOST_NAME + QUOTATION + PORT + PATH); + FILTER_SET.add(HTTPS + HOST_NAME + QUOTATION + PORT + PATH); + FILTER_SET.add(HTTP + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); + FILTER_SET.add(HTTPS + LOCAL_HOTS_NAME + QUOTATION + PORT + PATH); + } + private String name; private String remindTime; @@ -109,6 +132,10 @@ public class RemoteDesignerWorkspaceInfo implements DesignerWorkspaceInfo { @Override public boolean checkValid() { boolean result = false; + if (FILTER_SET.contains(connection.getUrl())) { + FineLoggerFactory.getLogger().error("url is same with local designer"); + return result; + } try { result = WorkContext.getConnector().testConnection(connection); } catch (Exception e) { diff --git a/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java b/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java new file mode 100644 index 0000000000..54dbae3b02 --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/env/RemoteDesignerWorkspaceInfoTest.java @@ -0,0 +1,25 @@ +package com.fr.design.env; + +import com.fr.workspace.connect.WorkspaceConnectionInfo; +import junit.framework.TestCase; +import org.junit.Assert; + +/** + * @author hades + * @version 10.0 + * Created by hades on 2020/7/15 + */ +public class RemoteDesignerWorkspaceInfoTest extends TestCase { + + public void testCheckValid() { + RemoteDesignerWorkspaceInfo workspaceInfo0 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("http://localhost:8075/webroot/decision", "admin", "123", "", "", true)); + RemoteDesignerWorkspaceInfo workspaceInfo1 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("http://127.0.0.1:8075/webroot/decision", "admin", "123", "", "", true)); + RemoteDesignerWorkspaceInfo workspaceInfo2 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("https://127.0.0.1:8075/webroot/decision", "admin", "123", "", "", true)); + RemoteDesignerWorkspaceInfo workspaceInfo3 = RemoteDesignerWorkspaceInfo.create(new WorkspaceConnectionInfo("https://localhost:8075/webroot/decision", "admin", "123", "", "", true)); + Assert.assertFalse(workspaceInfo0.checkValid()); + Assert.assertFalse(workspaceInfo1.checkValid()); + Assert.assertFalse(workspaceInfo2.checkValid()); + Assert.assertFalse(workspaceInfo3.checkValid()); + } + +} From b5764821255d3da3880e359fb6c798a07486604c Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 15 Jul 2020 10:42:02 +0800 Subject: [PATCH 07/72] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=AE=BF=E9=97=AE=E4=BF=AE=E9=A5=B0=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../background/VanChartAlertValuePane.java | 24 +++++++++++++++---- .../radar/VanChartRadarAlertValuePane.java | 8 +++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java index a3600a9852..b239583418 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/VanChartAlertValuePane.java @@ -50,10 +50,10 @@ public class VanChartAlertValuePane extends BasicBeanPane { private static final double LINE_WIDTH_DEFAULT_VALUE = 1; private UIButtonGroup alertAxis; - protected TinyFormulaPane alertValue; - protected LineTypeComboBox alertLineStyle;//线型 - protected UISpinner lineWidthSpinner;//线宽 - protected ColorSelectBox alertLineColor; + private TinyFormulaPane alertValue; + private LineTypeComboBox alertLineStyle;//线型 + private UISpinner lineWidthSpinner;//线宽 + private ColorSelectBox alertLineColor; private UIButtonGroup alertTextPosition; private TinyFormulaPane alertText; @@ -67,6 +67,22 @@ public class VanChartAlertValuePane extends BasicBeanPane { initComponents(); } + public TinyFormulaPane getAlertValue() { + return alertValue; + } + + public LineTypeComboBox getAlertLineStyle() { + return alertLineStyle; + } + + public UISpinner getLineWidthSpinner() { + return lineWidthSpinner; + } + + public ColorSelectBox getAlertLineColor() { + return alertLineColor; + } + private void initComponents() { alertValue = new TinyFormulaPane(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java index 8d6fb2cf61..80e836834d 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/background/radar/VanChartRadarAlertValuePane.java @@ -14,10 +14,10 @@ public class VanChartRadarAlertValuePane extends VanChartAlertValuePane { protected Component[][] getTopPaneComponents() { return new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), alertValue}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), alertLineStyle}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), lineWidthSpinner}, - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), alertLineColor}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Use_Value")), getAlertValue()}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Style")), getAlertLineStyle()}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Line_Width")), getLineWidthSpinner()}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Color")), getAlertLineColor()}, }; } From 3e369642bcf1879c74a08f23abfe881d875bb00e Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Jul 2020 12:42:11 +0800 Subject: [PATCH 08/72] REPORT-35379 && REPORT-35205 --- designer-base/src/main/java/com/fr/file/FILEChooserPane.java | 4 +++- .../src/main/java/com/fr/quickeditor/CellQuickEditor.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 96e722d116..b896542e64 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -12,6 +12,7 @@ import com.fr.design.dialog.UIDialog; import com.fr.design.env.DesignerWorkspaceInfo; import com.fr.design.env.DesignerWorkspaceType; import com.fr.design.file.HistoryTemplateListPane; +import com.fr.design.file.NodeAuthProcessor; import com.fr.design.fun.ReportSupportedFileUIProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButtonUI; @@ -916,7 +917,8 @@ public class FILEChooserPane extends BasicPane { try { access = FRContext.getOrganizationOperator().canAccess(selectedFile.getPath()); if (selectedFile.isEnvFile() && selectedFile instanceof FileNodeFILE) { - access = access && ((FileNodeFILE) selectedFile).hasFullAuth(); + FileNodeFILE fileNodeFILE = ((FileNodeFILE) selectedFile); + access = access && fileNodeFILE.hasFullAuth() && NodeAuthProcessor.getInstance().checkFileNodeAuth(new FileNode(fileNodeFILE.getPath(),fileNodeFILE.isDirectory())); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); diff --git a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java index 088026ba70..019b4cdeea 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java @@ -1,5 +1,6 @@ package com.fr.quickeditor; +import com.fr.base.GraphHelper; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; import com.fr.design.file.HistoryTemplateListPane; @@ -49,7 +50,6 @@ public abstract class CellQuickEditor extends QuickEditor { protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20); protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; - private static final int INSERT_CONTENT_LABEL_WIDTH = 60; /** * 滚动条相关配置 @@ -208,7 +208,7 @@ public abstract class CellQuickEditor extends QuickEditor { private JPanel initTopContent() { double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {INSERT_CONTENT_LABEL_WIDTH, f}; + double[] columnSize = {GraphHelper.getWidth(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")), f}; double[] rowSize = {p, p}; UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); From 2a262c3227a4a9e5753dc4b40ae46f8a98857367 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Jul 2020 12:51:25 +0800 Subject: [PATCH 09/72] REPORT-35205 fix --- designer-base/src/main/java/com/fr/file/FILEChooserPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index b896542e64..43c3f43ad8 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -918,7 +918,7 @@ public class FILEChooserPane extends BasicPane { access = FRContext.getOrganizationOperator().canAccess(selectedFile.getPath()); if (selectedFile.isEnvFile() && selectedFile instanceof FileNodeFILE) { FileNodeFILE fileNodeFILE = ((FileNodeFILE) selectedFile); - access = access && fileNodeFILE.hasFullAuth() && NodeAuthProcessor.getInstance().checkFileNodeAuth(new FileNode(fileNodeFILE.getPath(),fileNodeFILE.isDirectory())); + access = access && fileNodeFILE.hasFullAuth() && NodeAuthProcessor.getInstance().checkFileNodeAuth(new FileNode(fileNodeFILE.getPath(), fileNodeFILE.isDirectory())); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); From 1910d60fc951dd0b1a69c84d04f4f084812c0b44 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 15 Jul 2020 13:54:27 +0800 Subject: [PATCH 10/72] =?UTF-8?q?REPORT-34994=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E8=A1=A8=E6=A0=BC=E6=8A=98=E5=8F=A0=E6=A0=91=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3(=E5=8D=95=E5=85=83=E6=A0=BC=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=8E=A5=E5=8F=A3)-=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86=20=20,=E8=A1=A8=E5=8D=95=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E4=B9=9F=E9=9C=80=E8=A6=81=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/CellElementPropertyPane.java | 30 +++++++++++++++++++ .../mainframe/ElementCasePaneDelegate.java | 30 ------------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java index 7324300eba..1716fb4765 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java @@ -4,9 +4,13 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.ExtraDesignClassManager; +import com.fr.design.cell.CellElementPropertyComponent; import com.fr.design.fun.BackgroundQuickUIProvider; import com.fr.design.fun.CellAttributeProvider; +import com.fr.design.fun.CellPropertyPaneProvider; import com.fr.design.fun.PresentKindProvider; +import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.UITitlePanel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itabpane.TitleChangeListener; @@ -31,6 +35,7 @@ import javax.swing.JPanel; import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Dimension; +import java.util.Set; /** @@ -156,6 +161,7 @@ public class CellElementPropertyPane extends DockingView { return; } ePane.getSelection().populatePropertyPane(ePane); + populateExtraCellProperties(ePane); } @Override @@ -188,5 +194,29 @@ public class CellElementPropertyPane extends DockingView { EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ATTR); EastRegionContainerPane.getInstance().setWindow2PreferWidth(); } + private void populateExtraCellProperties(ElementCasePane ePane) { + if (ePane == null) { + return; + } + Selection selection = ePane.getSelection(); + if (selection instanceof CellSelection) { + //单元格属性,限定下是选中单个单元格 + TemplateElementCase elementCase = ePane.getEditingElementCase(); + if (elementCase != null) { + Set itemPaneProviders = ExtraDesignClassManager.getInstance().getArray(PropertyItemPaneProvider.XML_TAG); + if (itemPaneProviders != null) { + for (PropertyItemPaneProvider itemPaneProvider : itemPaneProviders) { + if(itemPaneProvider instanceof CellPropertyPaneProvider){ + CellPropertyPaneProvider cellPropertyPaneProvider = (CellPropertyPaneProvider) itemPaneProvider; + CellElementPropertyComponent cellElementPropertyPane = cellPropertyPaneProvider.getSingletonCelPropertyPane(); + if (cellElementPropertyPane != null && cellElementPropertyPane.accept(ePane)) { + cellElementPropertyPane.populate(ePane); + } + } + } + } + } + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java index 3f46dded84..83a1c08501 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -2,7 +2,6 @@ package com.fr.design.mainframe; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; -import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.cell.CellAttributeAction; import com.fr.design.actions.cell.CellExpandAttrAction; @@ -19,10 +18,7 @@ import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.cell.CellElementPropertyComponent; -import com.fr.design.fun.CellPropertyPaneProvider; import com.fr.design.fun.MenuHandler; -import com.fr.design.fun.PropertyItemPaneProvider; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.menu.KeySetUtils; @@ -32,17 +28,14 @@ import com.fr.design.present.ConditionAttributesGroupPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; -import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.page.ReportSettingsProvider; -import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.worksheet.WorkSheet; import com.fr.stable.ArrayUtils; import javax.swing.JPanel; import java.awt.BorderLayout; -import java.util.Set; /** @@ -88,8 +81,6 @@ public class ElementCasePaneDelegate extends ElementCasePane { } CellWidgetPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this); - //加载插件中的单元格属性 - populateExtraCellProperties(); QuickEditorRegion.getInstance().populate(getCurrentEditor()); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); @@ -227,25 +218,4 @@ public class ElementCasePaneDelegate extends ElementCasePane { return this.getTarget().getReportSettings(); } - private void populateExtraCellProperties() { - Selection selection = getSelection(); - if (selection instanceof CellSelection) { - //单元格属性,限定下是选中单个单元格 - TemplateElementCase elementCase = getEditingElementCase(); - if (elementCase != null) { - Set itemPaneProviders = ExtraDesignClassManager.getInstance().getArray(PropertyItemPaneProvider.XML_TAG); - if (itemPaneProviders != null) { - for (PropertyItemPaneProvider itemPaneProvider : itemPaneProviders) { - if(itemPaneProvider instanceof CellPropertyPaneProvider){ - CellPropertyPaneProvider cellPropertyPaneProvider = (CellPropertyPaneProvider) itemPaneProvider; - CellElementPropertyComponent cellElementPropertyPane = cellPropertyPaneProvider.getSingletonCelPropertyPane(); - if (cellElementPropertyPane != null && cellElementPropertyPane.accept(ElementCasePaneDelegate.this)) { - cellElementPropertyPane.populate(ElementCasePaneDelegate.this); - } - } - } - } - } - } - } } From 89f5de1f09853c9adfe6bb30a57e166f25757a05 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 15 Jul 2020 15:35:09 +0800 Subject: [PATCH 11/72] =?UTF-8?q?REPORT-35387=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=B7=B2=E6=9C=89=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=B7=BB=E5=8A=A0=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/parameter/FormParaDesigner.java | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index c72aa45128..ea222f98c4 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -83,6 +83,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP private static final int SUBMIT_BUTTON_H_LOCATION = 270; private static final int PARA_IMAGE_SHIFT_X = -4; private static final int FORM_AREA_PADDING_LEFT = 13; + private int addableRegionY; private static Image paraImage = BaseUtils.readImage("/com/fr/design/images/form/parameter.png"); @@ -412,10 +413,31 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP if (layoutContainer == null) { layoutContainer = new XWParameterLayout(); } + refreshAddableRegion(layoutContainer); layoutContainer.setSize(LARGE_PREFERRED_SIZE); setRootComponent(layoutContainer); } + /** + * @Description: 为了不覆盖以前的组件,所以要计算可以添加组件的区域 + * @param layoutContainer + * @return: + * @Author: Henry.Wang + * @date: 2020/7/15 15:12 + */ + public void refreshAddableRegion(XLayoutContainer layoutContainer) { + addableRegionY = 0; + for (int i = 0; i < layoutContainer.getComponentCount(); i++) { + Rectangle rectangle = layoutContainer.getComponent(i).getBounds(); + System.out.println("rectangle:" + rectangle); + if (addableRegionY < rectangle.y + rectangle.height) { + addableRegionY = rectangle.y + rectangle.height; + } + } + int vGap = V_COMPONENT_GAP - (int) XCreator.SMALL_PREFERRED_SIZE.getHeight(); + addableRegionY = Math.max(0, addableRegionY - FIRST_V_LOCATION + (int) (XCreator.SMALL_PREFERRED_SIZE.getHeight() / 2) + vGap); + } + /** * 是否是报表的参数面板 * @@ -584,13 +606,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP label.setWidgetValue(new WidgetValue(name + ":")); XCreator xCreator = XCreatorUtils.createXCreator(label); if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + + FIRST_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { return false; } EditorHolder editor = new EditorHolder(parameter); xCreator = XCreatorUtils.createXCreator(editor); if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + + SECOND_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { return false; } return true; @@ -647,7 +669,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP XCreator xCreator = XCreatorUtils.createXCreator(label); if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + FIRST_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + + FIRST_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { break; } // 每行显示5组 @@ -655,7 +677,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP editor.setWidgetName(parameterArray[i].getName()); xCreator = XCreatorUtils.createXCreator(editor); if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + SECOND_H_LOCATION, FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + + SECOND_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { break; } currentIndex++; From 2a26171429a66a8804f24f7cb17a2b721a810726 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 15 Jul 2020 15:38:28 +0800 Subject: [PATCH 12/72] =?UTF-8?q?REPORT-35387=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=B7=B2=E6=9C=89=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=B7=BB=E5=8A=A0=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=8F=A0=20=E5=88=A0=E9=99=A4=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/form/parameter/FormParaDesigner.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index ea222f98c4..a15a1cd4e1 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -429,7 +429,6 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP addableRegionY = 0; for (int i = 0; i < layoutContainer.getComponentCount(); i++) { Rectangle rectangle = layoutContainer.getComponent(i).getBounds(); - System.out.println("rectangle:" + rectangle); if (addableRegionY < rectangle.y + rectangle.height) { addableRegionY = rectangle.y + rectangle.height; } From e842f26de29af1658c636126c7fd371eda5e5c0b Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 15 Jul 2020 16:20:04 +0800 Subject: [PATCH 13/72] =?UTF-8?q?REPORT-35387=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=B7=B2=E6=9C=89=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E7=82=B9=E5=87=BB=E5=8F=B3=E4=BE=A7?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=B7=BB=E5=8A=A0=EF=BC=8C=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E9=87=8D=E5=8F=A0=20=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/parameter/FormParaDesigner.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java index a15a1cd4e1..a91342d4af 100644 --- a/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java +++ b/designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java @@ -419,8 +419,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP } /** - * @Description: 为了不覆盖以前的组件,所以要计算可以添加组件的区域 * @param layoutContainer + * @Description: 为了不覆盖以前的组件,所以要计算可以添加组件的区域 * @return: * @Author: Henry.Wang * @date: 2020/7/15 15:12 @@ -604,14 +604,15 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP label.setWidgetName("Label" + name); label.setWidgetValue(new WidgetValue(name + ":")); XCreator xCreator = XCreatorUtils.createXCreator(label); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + FIRST_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + int x = H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + FIRST_H_LOCATION; + int y = addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE); + if (!(this.autoAddComponent(xCreator, x, y))) { return false; } EditorHolder editor = new EditorHolder(parameter); xCreator = XCreatorUtils.createXCreator(editor); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + SECOND_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + x = H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + SECOND_H_LOCATION; + if (!(this.autoAddComponent(xCreator, x, y))) { return false; } return true; @@ -667,16 +668,17 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP label.setWidgetValue(new WidgetValue(parameterArray[i].getName() + ":")); XCreator xCreator = XCreatorUtils.createXCreator(label); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + FIRST_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + int x = H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + FIRST_H_LOCATION; + int y = addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE); + if (!(this.autoAddComponent(xCreator, x, y))) { break; } // 每行显示5组 EditorHolder editor = new EditorHolder(parameterArray[i]); editor.setWidgetName(parameterArray[i].getName()); xCreator = XCreatorUtils.createXCreator(editor); - if (!(this.autoAddComponent(xCreator, H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) - + SECOND_H_LOCATION, addableRegionY + FIRST_V_LOCATION + V_COMPONENT_GAP * (currentIndex / NUM_IN_A_LINE)))) { + x = H_COMPONENT_GAP * (currentIndex % NUM_IN_A_LINE) + SECOND_H_LOCATION; + if (!(this.autoAddComponent(xCreator, x, y))) { break; } currentIndex++; From 2dc9d95653a042033a30329409dbdb6e314543fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Thu, 16 Jul 2020 17:12:05 +0800 Subject: [PATCH 14/72] =?UTF-8?q?CHART-12123=20=E5=9B=BE=E8=A1=A8=E9=A2=84?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=85=8D=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combobox/ColorSchemeComboBox.java | 13 +- .../design/module/ChartPreStyleListPane.java | 142 ++++++++++++++++ .../module/ChartPreStyleManagerPane.java | 153 +++++++++++------- .../fr/design/module/ChartPreStylePane.java | 2 +- 4 files changed, 249 insertions(+), 61 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index e7a7ab929b..e09362cb64 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -52,7 +52,7 @@ public class ColorSchemeComboBox extends UIComboBox { this.setRenderer(new ColorSchemeCellRenderer()); } - private Map getColorSchemesFromConfig() { + protected Map getColorSchemesFromConfig() { Map colorSchemes = new LinkedHashMap<>(); ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); @@ -92,7 +92,14 @@ public class ColorSchemeComboBox extends UIComboBox { } public void refresh() { - this.colorSchemes = getColorSchemesFromConfig(); + refresh(null); + } + + public void refresh(Map colorSchemes) { + if (colorSchemes == null) { + colorSchemes = getColorSchemesFromConfig(); + } + this.colorSchemes = colorSchemes; this.setModel(new DefaultComboBoxModel(colorSchemes.keySet().toArray())); } @@ -149,7 +156,7 @@ public class ColorSchemeComboBox extends UIComboBox { return colorSchemes.keySet(); } - public class ColorInfo { + public static class ColorInfo { private List colors; diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java new file mode 100644 index 0000000000..f2f5c3cf6f --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleListPane.java @@ -0,0 +1,142 @@ +package com.fr.design.module; + +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; +import com.fr.base.Utils; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.gui.controlpane.JListControlPane; +import com.fr.design.gui.controlpane.NameObjectCreator; +import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.gui.controlpane.ShortCut4JControlPane; +import com.fr.design.gui.ilist.ModNameActionListener; +import com.fr.design.menu.ShortCut; +import com.fr.general.NameObject; +import com.fr.stable.Nameable; + +import javax.swing.event.ListSelectionEvent; +import javax.swing.event.ListSelectionListener; +import java.util.ArrayList; +import java.util.Iterator; + +/** + * @author Bjorn + * @version 10.0 + * Created by Bjorn on 2020-07-08 + */ +public class ChartPreStyleListPane extends JListControlPane { + + ChartPreStyleManagerPane chartPreStyleManagerPane; + + public ChartPreStyleListPane(ChartPreStyleManagerPane chartPreStyleManagerPane) { + super(); + this.chartPreStyleManagerPane = chartPreStyleManagerPane; + initListener(); + } + + /** + * 创建有名字的creator + * + * @return 有名字的creator数组 + */ + @Override + public NameableCreator[] createNameableCreators() { + return new NameableCreator[]{ + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle_Duplicate"), + ChartColorMatching.class, ChartPreStylePane.class) + }; + } + + @Override + protected String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle"); + } + + @Override + public BasicBeanPane createPaneByCreators(NameableCreator creator) { + return new ChartPreStylePane() { + @Override + protected void refreshWhenStyleChange(ChartColorMatching preStyle) { + super.refreshWhenStyleChange(preStyle); + chartPreStyleManagerPane.refreshDefaultColorBox(); + } + }; + } + + + protected ShortCut4JControlPane[] createShortcuts() { + return new ShortCut4JControlPane[]{ + shortCutFactory.addItemShortCut(), + createRemoveItemShortCut(), + shortCutFactory.copyItemShortCut(), + shortCutFactory.moveUpItemShortCut(), + shortCutFactory.moveDownItemShortCut(), + shortCutFactory.sortItemShortCut() + }; + } + + private ShortCut4JControlPane createRemoveItemShortCut() { + ShortCut4JControlPane shortCut4JControlPane = shortCutFactory.removeItemShortCut(); + //替换删除按钮的check事件。 + ShortCut shortCut = shortCut4JControlPane.getShortCut(); + shortCut4JControlPane = new MoreThanOneShortCut(shortCut); + return shortCut4JControlPane; + } + + public void initListener() { + nameableList.addListSelectionListener(new ListSelectionListener() { + @Override + public void valueChanged(ListSelectionEvent e) { + chartPreStyleManagerPane.refreshDefaultColorBox(); + } + }); + nameableList.addModNameActionListener(new ModNameActionListener() { + @Override + public void nameModed(int index, String oldName, String newName) { + chartPreStyleManagerPane.refreshDefaultColorBox(oldName, newName); + } + }); + } + + public void populateBean() { + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror(); + ArrayList list = new ArrayList(); + + Iterator keys = config.names(); + while (keys.hasNext()) { + Object key = keys.next(); + ChartColorMatching value = (ChartColorMatching) config.getPreStyle(key); + + list.add(new NameObject(Utils.objectToString(key), value)); + } + + Nameable[] values = (Nameable[]) list.toArray(new Nameable[list.size()]); + populate(values); + + if (config.containsName(config.getCurrentStyle())) { + this.setSelectedName(config.getCurrentStyle()); + } + } + + public void updateBean() { + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + + Nameable[] values = update(); + config.clearAllPreStyle(); + + for (Nameable value : values) { + config.putPreStyle(value.getName(), ((NameObject) value).getObject()); + } + } + + private class MoreThanOneShortCut extends ShortCut4JControlPane { + public MoreThanOneShortCut(ShortCut shortCut) { + this.shortCut = shortCut; + } + + + @Override + public void checkEnable() { + this.shortCut.setEnabled(nameableList.getModel().getSize() > 1); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java index abae5118b3..a0615817b2 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java @@ -2,72 +2,111 @@ package com.fr.design.module; import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; -import com.fr.base.Utils; -import com.fr.design.gui.controlpane.JListControlPane; -import com.fr.design.gui.controlpane.NameObjectCreator; -import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.design.chartx.component.combobox.ColorSchemeComboBox; +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; -import java.util.ArrayList; +import javax.swing.JPanel; import java.util.Iterator; - +import java.util.LinkedHashMap; +import java.util.Map; +import java.awt.BorderLayout; /** * 图表预定义管理 界面, 在工具栏-服务器管理中. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-8-21 下午02:33:48 */ -public class ChartPreStyleManagerPane extends JListControlPane { - - @Override - /** - * 创建有名字的creator - * @return 有名字的creator数组 - */ - public NameableCreator[] createNameableCreators() { - return new NameableCreator[]{ - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle_Duplicate"), - ChartColorMatching.class, ChartPreStylePane.class) - }; - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_PreStyle"); - } - - public void populateBean() { - ChartPreStyleConfig config = ChartPreStyleConfig.getInstance().mirror(); - ArrayList list = new ArrayList(); - - Iterator keys = config.names(); - while(keys.hasNext()) { - Object key = keys.next(); - ChartColorMatching value = (ChartColorMatching) config.getPreStyle(key); - - list.add(new NameObject(Utils.objectToString(key), value)); - } - - Nameable[] values = (Nameable[])list.toArray(new Nameable[list.size()]); - populate(values); - - if(config.containsName(config.getCurrentStyle())) { - this.setSelectedName(config.getCurrentStyle()); - } - } - - public void updateBean() { - ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); - - config.setCurrentStyle(getSelectedName()); - - Nameable[] values = update(); - config.clearAllPreStyle(); - - for (Nameable value : values) { - config.putPreStyle(value.getName(), ((NameObject) value).getObject()); - } - } +public class ChartPreStyleManagerPane extends BasicPane { + + private ColorSchemeComboBox defaultColorBox; + + private ChartPreStyleListPane chartPreStyleListPane; + + public ChartPreStyleManagerPane() { + initComponent(); + } + + private void initComponent() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel colorBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + + chartPreStyleListPane = new ChartPreStyleListPane(this); + + initDefaultColorBox(); + colorBoxPane.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Match_Default_Color_Scheme") + ":")); + colorBoxPane.add(defaultColorBox); + + this.add(colorBoxPane, BorderLayout.NORTH); + this.add(chartPreStyleListPane, BorderLayout.CENTER); + } + + private void initDefaultColorBox() { + Map colorSchemes = new LinkedHashMap<>(); + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + Iterator names = config.names(); + while (names.hasNext()) { + Object key = names.next(); + ColorSchemeComboBox.ColorInfo colorInfo = new ColorSchemeComboBox.ColorInfo(); + ChartColorMatching colorMatching = (ChartColorMatching) config.getPreStyle(key); + colorInfo.setGradient(colorMatching.getGradient()); + colorInfo.setColors(colorMatching.getColorList()); + colorSchemes.put(colorMatching.getId(), colorInfo); + } + defaultColorBox = new ColorSchemeComboBox(colorSchemes); + } + + private void refreshColorSchemes() { + Nameable[] nameables = chartPreStyleListPane.update(); + Map colorSchemes = new LinkedHashMap<>(); + for (Nameable value : nameables) { + String name = value.getName(); + ChartColorMatching colorMatching = (ChartColorMatching) ((NameObject) value).getObject(); + ColorSchemeComboBox.ColorInfo colorInfo = new ColorSchemeComboBox.ColorInfo(); + colorInfo.setGradient(colorMatching.getGradient()); + colorInfo.setColors(colorMatching.getColorList()); + colorSchemes.put(name, colorInfo); + } + defaultColorBox.refresh(colorSchemes); + } + + public void refreshDefaultColorBox() { + Object selectedItem = defaultColorBox.getSelectedItem(); + refreshColorSchemes(); + defaultColorBox.setSelectedItem(selectedItem); + } + + public void refreshDefaultColorBox(String oldName, String newName) { + Object selectedItem = defaultColorBox.getSelectedItem(); + if (ComparatorUtils.equals(selectedItem, oldName)) { + selectedItem = newName; + } + refreshColorSchemes(); + defaultColorBox.setSelectedItem(selectedItem); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_ServerM_Predefined_Styles"); + } + + public void populateBean() { + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + String currentStyle = config.getCurrentStyle(); + defaultColorBox.setSelectedItem(currentStyle); + chartPreStyleListPane.populateBean(); + } + public void updateBean() { + ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + config.setCurrentStyle(GeneralUtils.objectToString(defaultColorBox.getSelectedItem())); + chartPreStyleListPane.updateBean(); + } } diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java index 5bd4c38978..9cce2be7c3 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStylePane.java @@ -80,7 +80,7 @@ public class ChartPreStylePane extends BasicBeanPane { } } - private void refreshWhenStyleChange(ChartColorMatching preStyle) { + protected void refreshWhenStyleChange(ChartColorMatching preStyle) { if(chartComponent != null) { demoPlot.setPlotFillStyle(ChartUtils.chartColorMatching2AttrFillStyle(preStyle)); chartComponent.reset(); From 1a7bf4bfe0e50341a6451afee254b166ad31d790 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 17 Jul 2020 11:02:23 +0800 Subject: [PATCH 15/72] REPORT-35108 && REPORT-34895 --- .../fr/design/actions/file/OpenRecentReportMenuDef.java | 9 ++++++++- .../write/submit/SmartInsertDBManipulationPane.java | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java b/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java index 2bb026159f..7533cb133a 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/OpenRecentReportMenuDef.java @@ -1,6 +1,7 @@ package com.fr.design.actions.file; import java.awt.event.ActionEvent; +import java.io.File; import java.util.List; import com.fr.base.BaseUtils; @@ -11,6 +12,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.MenuDef; import com.fr.file.FILEFactory; +import com.fr.file.FileFILE; /** * Open Resent MenuDef. @@ -68,7 +70,12 @@ public class OpenRecentReportMenuDef extends MenuDef { * @param e 事件 */ public void actionPerformed(ActionEvent e) { - DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath())); + File file = new File(this.getPath()); + if (file.exists()) { + DesignerContext.getDesignerFrame().openTemplate(new FileFILE(file)); + } else { + DesignerContext.getDesignerFrame().openTemplate(FILEFactory.createFILE(this.getPath())); + } } public String getPath() { diff --git a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index 37d6a639f3..a430faeec1 100644 --- a/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/main/java/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -238,6 +238,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { dlg.setModal(false); dlg.setVisible(true); + dlg.setAlwaysOnTop(true); } private void showDialogAfterAddCellAction() { From 3a6efa8b3b901f0c489f9fa561f6942a51c11352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 17 Jul 2020 13:48:46 +0800 Subject: [PATCH 16/72] =?UTF-8?q?CHART-14664=20=E5=AE=BD=E5=BA=A6=E5=AE=9A?= =?UTF-8?q?=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/module/ChartPreStyleManagerPane.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java index a0615817b2..44b504ef3f 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreStyleManagerPane.java @@ -11,12 +11,14 @@ import com.fr.general.ComparatorUtils; import com.fr.general.GeneralUtils; import com.fr.general.NameObject; import com.fr.stable.Nameable; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.awt.BorderLayout; +import java.awt.Dimension; /** * 图表预定义管理 界面, 在工具栏-服务器管理中. @@ -61,6 +63,7 @@ public class ChartPreStyleManagerPane extends BasicPane { colorSchemes.put(colorMatching.getId(), colorInfo); } defaultColorBox = new ColorSchemeComboBox(colorSchemes); + defaultColorBox.setPreferredSize(new Dimension(TableLayout4VanChartHelper.EDIT_AREA_WIDTH, 20)); } private void refreshColorSchemes() { From d12fcf3d0721377483c2faaa4ec70dee1be951b8 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 17 Jul 2020 14:55:00 +0800 Subject: [PATCH 17/72] =?UTF-8?q?REPORT-35455=20=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=B6=E6=95=B0=E6=8D=AE=E9=9B=86=E5=BA=94?= =?UTF-8?q?=E4=B8=80=E5=B9=B6=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 11 +++- .../fr/design/data/BasicTableDataUtils.java | 17 ++++++ .../data/datapane/TableDataTreePane.java | 53 +++++++++++-------- .../design/data/BasicTableDataUtilsTest.java | 27 +++++++++- .../designer/beans/models/SelectionModel.java | 4 +- .../fr/design/designer/creator/XCreator.java | 16 +++--- .../mainframe/FormCreatorDropTarget.java | 2 +- 7 files changed, 94 insertions(+), 36 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index e8bc8e39ab..5ba801ca89 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -446,7 +446,16 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp * @param srcName 数据集来源(比如报表块,就是报表块的名称) * @param tableDataSource 数据集 */ + public Map addTableData(String srcName, TableDataSource tableDataSource, boolean isCover) { + return new HashMap<>(0); + } + public Map addTableData(String srcName, TableDataSource tableDataSource) { - return new HashMap<>(0); + return addTableData(srcName, tableDataSource, false); + } + + public void removeTableData(String sourceName) { + } + } diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java index 27724450bb..57c7e23a13 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java @@ -1,5 +1,6 @@ package com.fr.design.data; +import com.fr.data.TableDataSource; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; @@ -10,6 +11,7 @@ import com.fr.stable.StringUtils; * Created by hades on 2020/4/27 */ public abstract class BasicTableDataUtils { + private static final String SEPARATOR = "-"; private static final int LEN = 2; @@ -33,4 +35,19 @@ public abstract class BasicTableDataUtils { } return false; } + + public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) { + if (isCover) { + return srcName + SEPARATOR + tdName; + } + if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称 + tdName = srcName + SEPARATOR + tdName; + } + int i = 0; + while (tds.getTableData(tdName) != null) { + i++;//如果拼上名字后依然已经存在就加编号 + tdName += i; + } + return tdName; + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 531e128484..a2cc5b7d28 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -9,6 +9,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.data.BasicTableDataTreePane; +import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; @@ -59,7 +60,7 @@ import java.util.Map; public class TableDataTreePane extends BasicTableDataTreePane { private static TableDataTreePane singleton = new TableDataTreePane(); - + public static final int PLUGIN_LISTENER_PRIORITY = 1; public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter tc) { @@ -96,10 +97,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); createAddMenuDef(); - + // 创建插件监听 createPluginListener(); - + editAction = new EditAction(); removeAction = new RemoveAction(); previewTableDataAction = new PreviewTableDataAction(dataTree); @@ -139,27 +140,27 @@ public class TableDataTreePane extends BasicTableDataTreePane { new TableDataTreeDragSource(dataTree, DnDConstants.ACTION_COPY); checkButtonEnabled(); } - + private void createPluginListener() { - + //菜单栏监听 GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { - + @Override public void on(PluginEvent event) { - + addMenuDef.clearShortCuts(); createAddMenuDef(); } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); - + //监听数据集插件 GeneralContext.listenPluginRunningChanged(new PluginEventListener() { @Override @@ -188,8 +189,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { } }); } - - + + protected void checkButtonEnabled() { super.checkButtonEnabled(editAction, previewTableDataAction, removeAction, op, dataTree); } @@ -339,10 +340,11 @@ public class TableDataTreePane extends BasicTableDataTreePane { /** * 合并数据集 - * @param srcName 数据集来源(比如报表块,就是报表块的名称) + * + * @param srcName 数据集来源(比如报表块,就是报表块的名称) * @param tableDataSource 数据集 */ - public Map addTableData(String srcName, TableDataSource tableDataSource) { + public Map addTableData(String srcName, TableDataSource tableDataSource, boolean isCover) { Map tdNameMap = new HashMap<>(); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); @@ -352,14 +354,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { String tdName = (String) tdIterator.next(); String oldName = tdName; TableData td = tableDataSource.getTableData(tdName); - if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称 - tdName = srcName + tdName; - } - int i = 0; - while (tds.getTableData(tdName) != null) { - i++;//如果拼上名字后依然已经存在就加编号 - tdName += i; - } + boolean isDsNameRepeaded = isDsNameRepeaded(tdName); + tdName = BasicTableDataUtils.getTableDataName(isCover, tds, tdName, srcName, isDsNameRepeaded); tds.putTableData(tdName, td); if (!ComparatorUtils.equals(oldName, tdName)) { tdNameMap.put(oldName, tdName); @@ -367,8 +363,19 @@ public class TableDataTreePane extends BasicTableDataTreePane { } tc.parameterChanged(); dataTree.refresh(); - return Collections.unmodifiableMap(tdNameMap); + return Collections.unmodifiableMap(tdNameMap); } + + @Override + public void removeTableData(String sourceName) { + TableDataSource tds = tc.getBook(); + tds.removeTableData(sourceName); + dataTree.refresh(); + } + + + + public void addDataPane(final AbstractTableDataPane uPanel, String paneName) { final NamePane nPanel = uPanel.asNamePane(); nPanel.setObjectName(paneName); diff --git a/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java index acd47a3c11..7391924ac2 100644 --- a/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java @@ -1,6 +1,9 @@ package com.fr.design.data; +import com.fr.base.TableData; +import com.fr.data.TableDataSource; import junit.framework.TestCase; +import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; @@ -41,4 +44,26 @@ public class BasicTableDataUtilsTest extends TestCase { Assert.assertFalse(result12); } -} \ No newline at end of file + + @Test + public void testGetTableDataName() { + TableDataSource source = EasyMock.mock(TableDataSource.class); + TableData tableData = EasyMock.mock(TableData.class); + EasyMock.expect(source.getTableData("ds1")).andReturn(tableData).anyTimes(); + EasyMock.expect(source.getTableData("test-ds1")).andReturn(tableData).anyTimes(); + EasyMock.expect(source.getTableData("test-ds11")).andReturn(null).anyTimes(); + EasyMock.replay(source, tableData); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false)); + Assert.assertEquals("test-ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false)); + + source = EasyMock.mock(TableDataSource.class); + EasyMock.expect(source.getTableData("ds1")).andReturn(null).anyTimes(); + EasyMock.expect(source.getTableData("test-ds1")).andReturn(null).anyTimes(); + EasyMock.replay(source); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false)); + Assert.assertEquals("ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false)); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true)); + + } + +} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 1209310f66..a930deb231 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -306,12 +306,12 @@ public class SelectionModel { // 清除被选中的组件 selection.reset(); } + designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); + setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); - setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); // 触发事件 - designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.repaint(); } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index f4554069e3..dcb6938836 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -298,7 +298,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo @Override public JComponent createToolPane(BaseJForm jform, FormDesigner formEditor) { if (!DesignerMode.isAuthorityEditing()) { - if (isDedicateContainer()) { + if (isDedicateContainer() && this.getComponentCount() > 0) { // 图表块和报表块由于控件树处不显示,但对应的属性表要显示,此处处理下 XCreator child = ((XLayoutContainer) this).getXCreator(0); return child.createToolPane(jform, formEditor); @@ -408,7 +408,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public Component getParentShow(){ return this.getParent(); } - + /** * 重置组件的名称 * @@ -418,18 +418,18 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void resetCreatorName(String name) { toData().setWidgetName(name); } - + /** * 遍历所有命名相关的组件到集合中 * * @param xCreators 集合 */ public void traversalNameRelatedXCreators(Set xCreators) { - + xCreators.add(this); int componentCount = getComponentCount(); for (int i = 0; i < componentCount; i++) { - + Component component = getComponent(i); if (component instanceof XCreator) { XCreator xCreator = (XCreator) component; @@ -439,7 +439,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } } - + /** * 重置组件的可见性 * @@ -448,7 +448,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void resetVisible(boolean visible) { toData().setVisible(visible); } - + /** * 返回编辑的子组件,scale为其内部组件 * @return 组件 @@ -804,4 +804,4 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return false; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 06cb19d0ae..e13748719b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -105,7 +105,7 @@ public class FormCreatorDropTarget extends DropTarget { SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); SharableWidgetProvider bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); if (sharableEditor != null && bindInfo != null) { - Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource()); + Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true); //合并数据集之后,可能会有数据集名称变化,做一下联动 //共享的组件拿的时候都是克隆的,这边改拖拽中克隆的对象而非新克隆对象,上面这个新克隆的对象只是为了拿数据集 for (Map.Entry entry : tdNameMap.entrySet()) { From b5ecddf42bff1849d7c5f363569bae5253328cb8 Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Fri, 17 Jul 2020 18:25:17 +0800 Subject: [PATCH 18/72] =?UTF-8?q?REPORT-34954=20=E5=9C=A8=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E8=AE=BE=E7=BD=AE=E4=B8=AD=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=95=B0=E6=8D=AE=E6=97=B6=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=B8=8A=E4=B8=8B=E6=A0=87=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/cell/editor/RichTextToolBar.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index b3a78d34d9..a8f4b2ac1a 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -258,6 +258,7 @@ public class RichTextToolBar extends BasicPane{ boolean isSub = RichTextToolBar.this.subPane.isSelected(); MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSub && RichTextToolBar.this.superPane.isSelected()) { + RichTextToolBar.this.superPane.setSelected(false); StyleConstants.setSuperscript(attr, false); } // 调用setCharacterAttributes函数设置文本区选择文本的字体 @@ -273,6 +274,7 @@ public class RichTextToolBar extends BasicPane{ // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSuper && RichTextToolBar.this.subPane.isSelected()) { + RichTextToolBar.this.subPane.setSelected(false); StyleConstants.setSubscript(attr, false); } StyleConstants.setSuperscript(attr, !isSuper); From 002b56f0ccea2923e917ffbebf35945867530dd0 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 18 Jul 2020 13:35:18 +0800 Subject: [PATCH 19/72] =?UTF-8?q?CHART-11549=20=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=AE=B1=E5=9E=8B=E5=9B=BE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 3 + .../box/BoxIndependentVanChartInterface.java | 85 ++++++++++++++++++ .../chart/box/VanChartBoxConditionPane.java | 53 +++++++++++ .../fr/van/chart/box/VanChartBoxPlotPane.java | 45 ++++++++++ .../van/chart/box/VanChartBoxSeriesPane.java | 12 +++ .../com/fr/design/images/form/toolbar/box.png | Bin 0 -> 1960 bytes .../com/fr/van/chart/box.images/box.png | Bin 0 -> 918 bytes 7 files changed, 198 insertions(+) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java create mode 100755 designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png create mode 100755 designer-chart/src/main/resources/com/fr/van/chart/box.images/box.png 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 8480d24647..b50c740a32 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -49,6 +49,7 @@ import com.fr.locale.InterProviderFactory; import com.fr.log.FineLoggerFactory; import com.fr.plugin.chart.PiePlot4VanChart; import com.fr.plugin.chart.area.VanChartAreaPlot; +import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot; @@ -79,6 +80,7 @@ import com.fr.stable.StringUtils; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.van.chart.area.AreaIndependentVanChartInterface; import com.fr.van.chart.bar.BarIndependentVanChartInterface; +import com.fr.van.chart.box.BoxIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.van.chart.column.VanColumnChartTypeUI; import com.fr.van.chart.custom.CustomIndependentVanChartInterface; @@ -202,6 +204,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBoxPlot.VAN_CHART_BOX_PLOT_ID, new BoxIndependentVanChartInterface()); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java new file mode 100644 index 0000000000..655ce7cae7 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -0,0 +1,85 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.Plot; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.condition.ConditionAttributesPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; +import com.fr.van.chart.bar.VanChartBarStylePane; +import com.fr.van.chart.designer.other.VanChartInteractivePane; +import com.fr.van.chart.designer.other.VanChartOtherPane; +import com.fr.van.chart.designer.other.zoom.ZoomPane; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI; + +import java.awt.Component; + +public class BoxIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { + + public String getName() { + return Toolkit.i18nText("Fine-Design_Chart_New_Box"); + } + + public String[] getSubName() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_New_Box") + }; + } + + public String[] getDemoImagePath() { + return new String[]{ + "com/fr/plugin/chart/demo/image/box.png" + }; + } + + public String getIconPath() { + return "com/fr/design/images/form/toolbar/box.png"; + } + + public AbstractChartTypePane getPlotTypePane() { + return new VanChartBoxPlotPane(); + } + + public ConditionAttributesPane getPlotConditionPane(Plot plot) { + return new VanChartBoxConditionPane(plot); + } + + public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { + return new VanChartBoxSeriesPane(parent, plot); + } + + public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) { + VanChartStylePane stylePane = new VanChartBarStylePane(listener); + VanChartOtherPane otherPane = new VanChartOtherPane() { + + protected BasicBeanPane createInteractivePane() { + return new VanChartInteractivePane() { + + protected Component[][] createToolBarComponents() { + return new Component[][]{ + new Component[]{null, exportImages}, + new Component[]{null, fullScreenDisplay} + }; + } + + protected double[] getToolBarRowSize() { + double p = TableLayout.PREFERRED; + return new double[]{p, p}; + } + + protected ZoomPane createZoomPane() { + return new ZoomPane(); + } + }; + } + }; + + return new AbstractChartAttrPane[]{stylePane, otherPane}; + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java new file mode 100644 index 0000000000..c0412a9f38 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxConditionPane.java @@ -0,0 +1,53 @@ +package com.fr.van.chart.box; + +import com.fr.chart.base.AttrAlpha; +import com.fr.chart.base.AttrBackground; +import com.fr.chart.base.AttrBorder; +import com.fr.chart.chartattr.Plot; +import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; +import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; +import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.plugin.chart.type.ConditionKeyType; +import com.fr.van.chart.column.VanChartColumnLabelBorderPane; +import com.fr.van.chart.designer.other.condition.item.VanChartColumnSeriesColorConditionPane; + +import java.awt.Dimension; + +public class VanChartBoxConditionPane extends DataSeriesConditionPane { + + public VanChartBoxConditionPane(Plot plot) { + super(plot); + } + + protected void initComponents() { + super.initComponents(); + + liteConditionPane.setPreferredSize(new Dimension(300, 400)); + } + + protected void addBasicAction() { + classPaneMap.put(AttrBackground.class, new VanChartColumnSeriesColorConditionPane(this)); + classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this)); + classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this)); + } + + protected void addStyleAction() { + } + + protected ChartConditionPane createListConditionPane() { + + return new ChartConditionPane() { + + @Override + protected ConditionKeyType[] conditionKeyTypes() { + return ConditionKeyType.BOX_CONDITION_KEY_TYPES; + } + }; + } + + + public Class class4Correspond() { + return VanChartBoxPlot.class; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java new file mode 100644 index 0000000000..2679f7eba4 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotPane.java @@ -0,0 +1,45 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Chart; +import com.fr.chart.chartattr.Plot; +import com.fr.log.FineLoggerFactory; +import com.fr.plugin.chart.box.BoxIndependentVanChart; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.van.chart.designer.type.AbstractVanChartTypePane; + +public class VanChartBoxPlotPane extends AbstractVanChartTypePane { + + protected String[] getTypeIconPath() { + return new String[]{"/com/fr/van/chart/box.images/box.png" + }; + } + + protected Plot getSelectedClonedPlot() { + VanChartBoxPlot newPlot = null; + + Chart[] boxChartGroup = BoxIndependentVanChart.BoxVanChartTypes; + + for (int i = 0, len = boxChartGroup.length; i < len; i++) { + if (typeDemo.get(i).isPressing) { + newPlot = boxChartGroup[i].getPlot(); + } + } + + Plot cloned = null; + + try { + if (newPlot != null) { + cloned = (Plot) newPlot.clone(); + } + } catch (CloneNotSupportedException e) { + FineLoggerFactory.getLogger().error("Error In ColumnChart"); + } + + return cloned; + } + + public Chart getDefaultChart() { + return BoxIndependentVanChart.BoxVanChartTypes[0]; + } + +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java new file mode 100644 index 0000000000..867f7ec9e3 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java @@ -0,0 +1,12 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Plot; +import com.fr.design.mainframe.chart.gui.ChartStylePane; +import com.fr.van.chart.column.VanChartColumnSeriesPane; + +public class VanChartBoxSeriesPane extends VanChartColumnSeriesPane { + + public VanChartBoxSeriesPane(ChartStylePane parent, Plot plot) { + super(parent, plot); + } +} diff --git a/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png b/designer-chart/src/main/resources/com/fr/design/images/form/toolbar/box.png new file mode 100755 index 0000000000000000000000000000000000000000..ba9101b2d801aab5146e48b9eb9934e2ef639e4f GIT binary patch literal 1960 zcmV;Z2UqxsP)Epm6rN}A=BK2Ms*)c-6J z5(f_4fNoWUxD=3}Qm&Pd;1Ehk+Nf|q2tivVg+^&OMCuiZo;dJR3Hr0W@*|F@i7L?+ zwSg+7Rns=vwLLsNyby#<8_~<)sEl1_vX#_+1~NIv6nI02mwNX5Fi8y0YX3r z0njnZvQ6>C%_4W*3o3mCuzE@Zou^fFNhd`J?D^tmp?G{siDc7ZTc!h`_M=6B2#pp` z^dwbSWS&HH40IA1h&eOKzk3 zFMn7lyUzGnVR*M7b`l8?pi8a*ltva2p^eO*Aa){D07@f^h|or6PY^p1DgdRCMMP*L zvnPn12o-?R$RZ-Nk=YZ(9(rOST)q(gDGhXO6tqjCm=Fj}Xz7EF62`J*M#s+=y4)Qv z9o$GWIufD=uMTc{FbjJn)l0>YKYOzKv&&0`YI~sxRdcJZ_1?sx37K};ahkBMQ>Mc? ztKPAK>I z6JXn;qTuJdEvlK90r0(GvB%^Z>8bg0$5H>leK#0UV6OU|p!{LV#tFrP)#aRD(dh&p z(f5{J{dL@A%7#X{nWB?1B9sWt7y=pVj``ovlmNQx_*8X-DGJBoZdJUJ4uHM4G|=(A z$UaFK5n4kV0Pbwq$_917pT5TTGmlN_*hXzbzoAhhYSXCV66&1@#OhLuEhzKk=z%XN51G$E6hl@L%qLop*;Ue^idR&pk* z!WO{VTif24JvVrh|37wV8i4w0Y>d%*S%MGNH>2X9!?f%oCwRXvPr8 zSa;|QB|Kutgqnm z6?_f5`j#3(b9r~B;#zMCjfK3Nzp$YQMji2&+E_EVJ_ zLThjOsGf;307$+%0;wT%^-yEiXq*0veWKF}UKZQH=8leS)HXzD4N5gIeVNxLUPlSVw|_K47!0Z!UI-L@ozc;DpVqT{(2g3aL{-d1;e zFCD7RQ7_cltY>WJ@acv95CtMM1XvHFI?{ctg!YTm(huWo1>4YszC3=b-MQ;L8}#Xc zyBRYi?ZxB&z7UjKmQ_CA|M)LK8I|KjAT*(D#@UYVw>=sR3+FQZL+{>lIsVbQ{|Nu< zL0u}xi$G{X&kl6@DXtge4U4?%B0!^DUF1?~M}(%77~QalP+jCwY8U%3I;H)VhE*J$ zeu|YVZw3``%}*DO;`d<+Z7e9a!9H_tpkpE^GhGfnC^8*z?Cm>l3$v_k!FFnQ{XgKJ u9W0Rp=b=~S1^rT)5Fi8y0Yadm5%?cvyPu5)S0SAM0000sRV z6$OT2r1iltXGEujd2k?1KZ?%}V@EgNPaGq_POT}XK`)l9IB?!2X9IyY@AanEY%E(l zRM~8FeX^&x<*m!Qt);bR_R!SF3T87}U75{Bjp{U=LsnOIJ%4MELw6}Gu-Rw<0ME=F znSN7!GPDNm@C60{`R6C%T-XOWcj$iM1bJSP@me9?6&)w@VzgtWTAvi01|6L8B3E)$ zWB?3@*v%Y+ebu&%`6lFDDtb@YxtIY|FN)q3Uhc1EDGjKr83A*VsbLd41Q8Aath%6Z z3N@W8A0ze?Q8%CHCqT;c(-7m2YYba5FaZ}?RsKNBkY?*6JWVtIvhal5>{!=4kMf7a zosBdPBkWuzJ09B>5^T4q>9Wk-ttXd#j4aboiQ5>xghVMkB+E|SEevY%BqJmU;|#DS z#1pd{w`Hc#dG>s)!^{>2tf&AhZ2PEBHwhj{mdnfHovW$1L}aEg$FevU7a0x3Ydmzy z{Ew;D8Pg==%I}OR!AInC){p<~b<+j)oqO%Yl9hO zrW9!WVI4ulbauQuv_P|Mr76pw>^fu>)H~TqTLtx8-^?Pn(r=}e4tn5-R$9X2QjpFs z-U22bes0GfI6%@XX+6nB{xDxz29!!6-ygM6E_=1>YlIOiD746@@026bMz6$9aTVt! z<-+kB=6UG1+SNiyaS%zb6iSG&8Vc?JU}V`2*f&i2iu_5=xnUN_fCDL>ms;uFb!Zu+ s`82}A@E9O(mG(X(jW5fsbd>z+Pl(bHYsk2^^#A|>07*qoM6N<$f=2|7_y7O^ literal 0 HcmV?d00001 From 027ae5872a184de7df1c0d3da5954e02cbf6946e Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sat, 18 Jul 2020 16:54:11 +0800 Subject: [PATCH 20/72] =?UTF-8?q?=E6=95=B4=E7=90=86=E7=AE=B1=E5=9E=8B?= =?UTF-8?q?=E5=9B=BE=E6=95=B0=E6=8D=AE=E7=82=B9=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/BoxIndependentVanChartInterface.java | 3 +- .../chart/box/VanChartBoxPlotTooltipPane.java | 20 +++++++++++++ .../van/chart/box/VanChartBoxStylePane.java | 21 ++++++++++++++ .../box/VanChartBoxTooltipContentPane.java | 28 +++++++++++++++++++ .../van/chart/box/VanChartBoxTooltipPane.java | 17 +++++++++++ 5 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java index 655ce7cae7..40c969876e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -10,7 +10,6 @@ import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.van.chart.bar.VanChartBarStylePane; import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.zoom.ZoomPane; @@ -54,7 +53,7 @@ public class BoxIndependentVanChartInterface extends AbstractMultiCategoryVanCha } public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener) { - VanChartStylePane stylePane = new VanChartBarStylePane(listener); + VanChartStylePane stylePane = new VanChartBoxStylePane(listener); VanChartOtherPane otherPane = new VanChartOtherPane() { protected BasicBeanPane createInteractivePane() { diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java new file mode 100644 index 0000000000..e976d05e6c --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; + +public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane { + + public VanChartBoxPlotTooltipPane(Plot plot, VanChartStylePane parent) { + super(plot, parent); + } + + protected void initTooltipContentPane(Plot plot) { + tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this); + } + + protected boolean hasTooltipSeriesType() { + return false; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java new file mode 100644 index 0000000000..b9e60c68e7 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java @@ -0,0 +1,21 @@ +package com.fr.van.chart.box; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.van.chart.bar.VanChartBarStylePane; + +import java.util.List; + +public class VanChartBoxStylePane extends VanChartBarStylePane { + + public VanChartBoxStylePane(AttributeChangeListener listener) { + super(listener); + } + + protected void createVanChartLabelPane(List paneList) { + } + + protected void addVanChartTooltipPane(List paneList) { + paneList.add(new VanChartBoxTooltipPane(VanChartBoxStylePane.this)); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java new file mode 100644 index 0000000000..9fc9988f0a --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -0,0 +1,28 @@ +package com.fr.van.chart.box; + +import com.fr.van.chart.designer.component.VanChartTooltipContentPane; +import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.style.VanChartStylePane; + +import javax.swing.JPanel; +import java.awt.Component; + +public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { + + public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { + super(parent, showOnPane); + } + + protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { + categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); + seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); + } + + protected Component[][] getPaneComponents() { + return new Component[][]{ + new Component[]{categoryNameFormatPane, null}, + new Component[]{seriesNameFormatPane, null} + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java new file mode 100644 index 0000000000..5d485c31d2 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipPane.java @@ -0,0 +1,17 @@ +package com.fr.van.chart.box; + +import com.fr.chart.chartattr.Plot; +import com.fr.van.chart.designer.style.VanChartStylePane; +import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; +import com.fr.van.chart.designer.style.tooltip.VanChartTooltipPane; + +public class VanChartBoxTooltipPane extends VanChartTooltipPane { + + public VanChartBoxTooltipPane(VanChartStylePane parent) { + super(parent); + } + + protected VanChartPlotTooltipPane getTooltipPane(Plot plot) { + return new VanChartBoxPlotTooltipPane(plot, parent); + } +} From d1dc8bae18f0bfde696a2cbaff87991d83810988 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Sun, 19 Jul 2020 15:58:44 +0800 Subject: [PATCH 21/72] =?UTF-8?q?=E5=A1=AB=E5=85=85=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=95=B0=E6=8D=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../box/BoxIndependentVanChartInterface.java | 17 +- .../data/BoxPlotReportDataContentPane.java | 11 ++ .../BoxPlotReportResultDataSeriesPane.java | 4 + .../box/data/BoxPlotTableDataContentPane.java | 141 +++++++++++++++ .../BoxPlotTableDetailedDataSeriesPane.java | 20 +++ .../BoxPlotTableResultDataSeriesPane.java | 163 ++++++++++++++++++ 6 files changed, 354 insertions(+), 2 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java index 40c969876e..0313838921 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -8,17 +8,22 @@ import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.van.chart.box.data.BoxPlotReportDataContentPane; +import com.fr.van.chart.box.data.BoxPlotTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.zoom.ZoomPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.vanchart.AbstractMultiCategoryVanChartUI; +import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; import java.awt.Component; -public class BoxIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI { +public class BoxIndependentVanChartInterface extends AbstractIndependentVanChartUI { public String getName() { return Toolkit.i18nText("Fine-Design_Chart_New_Box"); @@ -40,6 +45,14 @@ public class BoxIndependentVanChartInterface extends AbstractMultiCategoryVanCha return "com/fr/design/images/form/toolbar/box.png"; } + public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { + return new BoxPlotTableDataContentPane(parent); + } + + public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { + return new BoxPlotReportDataContentPane(parent); + } + public AbstractChartTypePane getPlotTypePane() { return new VanChartBoxPlotPane(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java new file mode 100644 index 0000000000..cce6bf9649 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportDataContentPane.java @@ -0,0 +1,11 @@ +package com.fr.van.chart.box.data; + +import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotReportDataContentPane; + +public class BoxPlotReportDataContentPane extends CategoryPlotReportDataContentPane { + + public BoxPlotReportDataContentPane(ChartDataPane parent) { + super(parent); + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java new file mode 100644 index 0000000000..629c67a5f5 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotReportResultDataSeriesPane.java @@ -0,0 +1,4 @@ +package com.fr.van.chart.box.data; + +public class BoxPlotReportResultDataSeriesPane { +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java new file mode 100644 index 0000000000..58cdc89394 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java @@ -0,0 +1,141 @@ +package com.fr.van.chart.box.data; + +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.List; + +public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { + + private UIButtonGroup dataType; + private JPanel detailedDataPane; + private JPanel resultDataPane; + + public BoxPlotTableDataContentPane(ChartDataPane parent) { + + this.setLayout(new BorderLayout()); + + this.add(createDataTypePane(), BorderLayout.NORTH); + this.add(createDetailDataPane(parent), BorderLayout.CENTER); + this.add(createResultDataPane(parent), BorderLayout.SOUTH); + + initDataTypeListener(); + } + + private JPanel createDataTypePane() { + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Type")); + + String[] names = new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Detailed_Data"), + Toolkit.i18nText("Fine-Design_Chart_Result_Data") + }; + + dataType = new UIButtonGroup(names); + + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + + double[] column = {p, f}; + double[] row = {p, p}; + + Component[][] components = new Component[][]{ + new Component[]{null, null}, + new Component[]{label, dataType}, + new Component[]{null, null} + }; + + return TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, column); + } + + private JPanel createDetailDataPane(ChartDataPane parent) { + detailedDataPane = new BoxPlotTableDetailedDataSeriesPane(parent); + + return detailedDataPane; + } + + private JPanel createResultDataPane(ChartDataPane parent) { + resultDataPane = new BoxPlotTableResultDataSeriesPane(parent); + + return resultDataPane; + } + + + private void initDataTypeListener() { + dataType.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + checkDataPaneVisible(); + } + }); + } + + private void checkDataPaneVisible() { + if (detailedDataPane != null) { + detailedDataPane.setVisible(dataType.getSelectedIndex() == 0); + } + if (resultDataPane != null) { + resultDataPane.setVisible(dataType.getSelectedIndex() == 1); + } + } + + public void checkBoxUse(boolean hasUse) { + if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { + ((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).checkBoxUse(hasUse); + } + if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { + ((BoxPlotTableResultDataSeriesPane) resultDataPane).checkBoxUse(hasUse); + } + } + + protected void refreshBoxListWithSelectTableData(List list) { + if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { + ((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).refreshBoxListWithSelectTableData(list); + } + if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { + ((BoxPlotTableResultDataSeriesPane) resultDataPane).refreshBoxListWithSelectTableData(list); + } + } + + public void clearAllBoxList() { + if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { + ((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).clearAllBoxList(); + } + if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { + ((BoxPlotTableResultDataSeriesPane) resultDataPane).clearAllBoxList(); + } + } + + public void updateBean(ChartCollection collection) { + if (dataType.getSelectedIndex() == 0 && detailedDataPane != null) { + ((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).updateBean(collection); + } + if (dataType.getSelectedIndex() == 1 && resultDataPane != null) { + ((BoxPlotTableResultDataSeriesPane) resultDataPane).updateBean(collection); + } + } + + public void populateBean(ChartCollection collection) { + if (detailedDataPane != null) { + ((BoxPlotTableDetailedDataSeriesPane) detailedDataPane).populateBean(collection); + } + if (resultDataPane != null) { + ((BoxPlotTableResultDataSeriesPane) resultDataPane).populateBean(collection); + } + + dataType.setSelectedIndex(isDetailedDataType(collection) ? 0 : 1); + } + + private boolean isDetailedDataType(ChartCollection collection) { + return true; + } +} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java new file mode 100644 index 0000000000..ed858f0bf0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java @@ -0,0 +1,20 @@ +package com.fr.van.chart.box.data; + +import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane; + +import java.util.List; + +public class BoxPlotTableDetailedDataSeriesPane extends CategoryPlotTableDataContentPane { + + public BoxPlotTableDetailedDataSeriesPane(ChartDataPane parent) { + super(parent); + } + + public void refreshBoxListWithSelectTableData(List list) { + refreshBoxItems(categoryCombox, list); + categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); + + seriesTypeComboxPane.refreshBoxListWithSelectTableData(list); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java new file mode 100644 index 0000000000..25c80d1a80 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java @@ -0,0 +1,163 @@ +package com.fr.van.chart.box.data; + +import com.fr.base.chart.chartdata.TopDefinitionProvider; +import com.fr.chart.base.ChartConstants; +import com.fr.chart.chartattr.BubblePlot; +import com.fr.chart.chartattr.ChartCollection; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.mainframe.chart.gui.ChartDataPane; +import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; +import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.plugin.chart.box.data.VanBoxTableDefinition; +import com.fr.stable.ArrayUtils; +import com.fr.stable.StringUtils; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.util.List; + +public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPane { + + private UIComboBox seriesName; + private UIComboBox max; + private UIComboBox median; + private UIComboBox min; + + private ChartDataFilterPane dataScreeningPane; + + public BoxPlotTableResultDataSeriesPane(ChartDataPane parent) { + + initComboxSize(); + + this.setLayout(new BorderLayout()); + + this.add(createCenterPane(), BorderLayout.CENTER); + this.add(createSouthPane(parent), BorderLayout.SOUTH); + + seriesName.addItemListener(tooltipListener); + max.addItemListener(tooltipListener); + median.addItemListener(tooltipListener); + min.addItemListener(tooltipListener); + } + + private void initComboxSize() { + Dimension preferredSize = new Dimension(100, 20); + + seriesName = new UIComboBox(); + max = new UIComboBox(); + median = new UIComboBox(); + min = new UIComboBox(); + + seriesName.setPreferredSize(preferredSize); + max.setPreferredSize(preferredSize); + median.setPreferredSize(preferredSize); + min.setPreferredSize(preferredSize); + } + + private JPanel createCenterPane() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double[] column = {f, COMPONENT_WIDTH}; + double[] row = {p, p, p, p}; + + Component[][] components_north = new Component[][]{ + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name")), seriesName}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), max}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Median")), median}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Data_Max")), min}, + }; + + JPanel center = TableLayout4VanChartHelper.createGapTableLayoutPane(components_north, row, column); + center.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); + + return center; + } + + private JPanel createSouthPane(ChartDataPane parent) { + dataScreeningPane = new ChartDataFilterPane(new VanChartBoxPlot(), parent); + + JPanel south = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), dataScreeningPane); + south.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + + return south; + } + + public void checkBoxUse(boolean hasUse) { + } + + protected void refreshBoxListWithSelectTableData(List list) { + refreshBoxItems(seriesName, list); + refreshBoxItems(max, list); + refreshBoxItems(median, list); + refreshBoxItems(min, list); + } + + public void clearAllBoxList() { + clearBoxItems(seriesName); + clearBoxItems(max); + clearBoxItems(median); + clearBoxItems(min); + } + + public void populateBean(ChartCollection collection) { + super.populateBean(collection); + + TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); + + if (!(top instanceof VanBoxTableDefinition)) { + return; + } + + VanBoxTableDefinition definition = (VanBoxTableDefinition) top; + + combineCustomEditValue(seriesName, definition.getSeriesName()); + combineCustomEditValue(max, definition.getMax()); + combineCustomEditValue(median, definition.getMedian()); + combineCustomEditValue(median, definition.getMin()); + + dataScreeningPane.populateBean(collection); + } + + @Override + public void updateBean(ChartCollection collection) { + VanBoxTableDefinition definition = new VanBoxTableDefinition(); + + collection.getSelectedChart().setFilterDefinition(definition); + + Object resultName = seriesName.getSelectedItem(); + Object resultMax = max.getSelectedItem(); + Object resultMedian = median.getSelectedItem(); + Object resultMin = min.getSelectedItem(); + + if (resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) { + definition.setSeriesName(StringUtils.EMPTY); + } else { + definition.setSeriesName(resultName.toString()); + } + + if (resultMax != null) { + definition.setMax(resultMax.toString()); + } + if (resultMedian != null) { + definition.setMedian(resultMedian.toString()); + } + if (resultMin != null) { + definition.setMin(resultMin.toString()); + } + + dataScreeningPane.updateBean(collection); + } + + public void redoLayoutPane() { + dataScreeningPane.relayoutPane(this.isNeedSummaryCaculateMethod()); + } +} \ No newline at end of file From 83f01ae956a08f58c8de8e58a4bd6fd2aa1dcd1f Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 20 Jul 2020 10:30:45 +0800 Subject: [PATCH 22/72] =?UTF-8?q?REPORT-35699=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9=E5=AF=B9=E6=8A=A5=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E4=BA=A7=E7=94=9F=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/utils/gui/GUICoreUtils.java | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 586047f5ae..3723c775f5 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -387,31 +387,35 @@ public final class GUICoreUtils { * @param y y坐标 */ public static void showPopupMenu(JPopupMenu popup, Component parentComponent, int x, int y) { - if (popup == null) {// check null. - return; - } - - Point point = new Point(x, y); - SwingUtilities.convertPointToScreen(point, parentComponent); - - Dimension size = popup.getPreferredSize(); - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); - - int showOnScreenX = Math.min(screen.width, parentComponent.getLocationOnScreen().x + parentComponent.getWidth()); - - // peter:调整X的高度. - if (point.x + size.width > showOnScreenX && size.width < showOnScreenX) { - x += (showOnScreenX - point.x - size.width); - } - - // peter:调整y高度. - if (point.y + size.height > screen.height && size.height < screen.height) { - y -= size.height; - } - - popup.show(parentComponent, x, y); - } + if (popup == null) {// check null. + return; + } + + Point point = new Point(x, y); + SwingUtilities.convertPointToScreen(point, parentComponent); + + Dimension size = popup.getPreferredSize(); + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); + //父元素右边界的坐标 + int parentComponentRightBorderPosition = parentComponent.getLocationOnScreen().x + parentComponent.getWidth(); + //设计器右边界的坐标 + Rectangle rectangle = DesignerContext.getDesignerFrame().getBounds(); + int designerRightBorderPosition = rectangle.x + rectangle.width; + rectangle = SwingUtilities.getWindowAncestor(parentComponent).getBounds(); + designerRightBorderPosition = Math.max(designerRightBorderPosition, rectangle.x + rectangle.width); + // peter:调整X的高度. + if (point.x + size.width > designerRightBorderPosition && size.width < designerRightBorderPosition) { + x += (parentComponentRightBorderPosition - point.x - size.width); + } + + // peter:调整y高度. + if (point.y + size.height > screen.height && size.height < screen.height) { + y -= size.height; + } + + popup.show(parentComponent, x, y); + } /** * Set enabled.
From fe878c0ffa375a812629dd6970dfd4e5d2bb3c92 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 20 Jul 2020 10:38:27 +0800 Subject: [PATCH 23/72] =?UTF-8?q?REPORT-35699=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9=E5=AF=B9=E6=8A=A5=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E4=BA=A7=E7=94=9F=E5=BD=B1=E5=93=8D=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/utils/gui/GUICoreUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 3723c775f5..9f5c7fbaa9 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -27,6 +27,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorFactory; import com.fr.design.style.color.ColorSelectBox; From 42e9b6320e14e824f34017a5175f1fc9c28f5b72 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 20 Jul 2020 10:30:45 +0800 Subject: [PATCH 24/72] =?UTF-8?q?REPORT-35699=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9=E5=AF=B9=E6=8A=A5=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E4=BA=A7=E7=94=9F=E5=BD=B1=E5=93=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/utils/gui/GUICoreUtils.java | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 586047f5ae..3723c775f5 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -387,31 +387,35 @@ public final class GUICoreUtils { * @param y y坐标 */ public static void showPopupMenu(JPopupMenu popup, Component parentComponent, int x, int y) { - if (popup == null) {// check null. - return; - } - - Point point = new Point(x, y); - SwingUtilities.convertPointToScreen(point, parentComponent); - - Dimension size = popup.getPreferredSize(); - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); - - int showOnScreenX = Math.min(screen.width, parentComponent.getLocationOnScreen().x + parentComponent.getWidth()); - - // peter:调整X的高度. - if (point.x + size.width > showOnScreenX && size.width < showOnScreenX) { - x += (showOnScreenX - point.x - size.width); - } - - // peter:调整y高度. - if (point.y + size.height > screen.height && size.height < screen.height) { - y -= size.height; - } - - popup.show(parentComponent, x, y); - } + if (popup == null) {// check null. + return; + } + + Point point = new Point(x, y); + SwingUtilities.convertPointToScreen(point, parentComponent); + + Dimension size = popup.getPreferredSize(); + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); + //父元素右边界的坐标 + int parentComponentRightBorderPosition = parentComponent.getLocationOnScreen().x + parentComponent.getWidth(); + //设计器右边界的坐标 + Rectangle rectangle = DesignerContext.getDesignerFrame().getBounds(); + int designerRightBorderPosition = rectangle.x + rectangle.width; + rectangle = SwingUtilities.getWindowAncestor(parentComponent).getBounds(); + designerRightBorderPosition = Math.max(designerRightBorderPosition, rectangle.x + rectangle.width); + // peter:调整X的高度. + if (point.x + size.width > designerRightBorderPosition && size.width < designerRightBorderPosition) { + x += (parentComponentRightBorderPosition - point.x - size.width); + } + + // peter:调整y高度. + if (point.y + size.height > screen.height && size.height < screen.height) { + y -= size.height; + } + + popup.show(parentComponent, x, y); + } /** * Set enabled.
From 57c22fe43b56ae478d357c29417b79b51303b0f8 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 20 Jul 2020 10:38:27 +0800 Subject: [PATCH 25/72] =?UTF-8?q?REPORT-35699=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9=E5=AF=B9=E6=8A=A5=E8=A1=A8=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E4=BA=A7=E7=94=9F=E5=BD=B1=E5=93=8D=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/utils/gui/GUICoreUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 3723c775f5..9f5c7fbaa9 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -27,6 +27,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorFactory; import com.fr.design.style.color.ColorSelectBox; From 90c2aaeee80819e2652ff0a9d8a4cb802edf4ea9 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 20 Jul 2020 18:47:07 +0800 Subject: [PATCH 26/72] =?UTF-8?q?REPORT-35455=20=20=E8=B5=B6=E8=BF=99?= =?UTF-8?q?=E4=B8=80=E6=B3=A2=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/data/BasicTableDataTreePane.java | 11 +++- .../fr/design/data/BasicTableDataUtils.java | 17 ++++++ .../data/datapane/TableDataTreePane.java | 53 +++++++++++-------- .../design/data/BasicTableDataUtilsTest.java | 27 +++++++++- .../fr/design/designer/creator/XCreator.java | 16 +++--- .../mainframe/FormCreatorDropTarget.java | 2 +- 6 files changed, 92 insertions(+), 34 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java index e8bc8e39ab..5ba801ca89 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataTreePane.java @@ -446,7 +446,16 @@ public abstract class BasicTableDataTreePane extends DockingView implements Resp * @param srcName 数据集来源(比如报表块,就是报表块的名称) * @param tableDataSource 数据集 */ + public Map addTableData(String srcName, TableDataSource tableDataSource, boolean isCover) { + return new HashMap<>(0); + } + public Map addTableData(String srcName, TableDataSource tableDataSource) { - return new HashMap<>(0); + return addTableData(srcName, tableDataSource, false); + } + + public void removeTableData(String sourceName) { + } + } diff --git a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java index 27724450bb..57c7e23a13 100644 --- a/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java +++ b/designer-base/src/main/java/com/fr/design/data/BasicTableDataUtils.java @@ -1,5 +1,6 @@ package com.fr.design.data; +import com.fr.data.TableDataSource; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; @@ -10,6 +11,7 @@ import com.fr.stable.StringUtils; * Created by hades on 2020/4/27 */ public abstract class BasicTableDataUtils { + private static final String SEPARATOR = "-"; private static final int LEN = 2; @@ -33,4 +35,19 @@ public abstract class BasicTableDataUtils { } return false; } + + public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) { + if (isCover) { + return srcName + SEPARATOR + tdName; + } + if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称 + tdName = srcName + SEPARATOR + tdName; + } + int i = 0; + while (tds.getTableData(tdName) != null) { + i++;//如果拼上名字后依然已经存在就加编号 + tdName += i; + } + return tdName; + } } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java index 531e128484..a2cc5b7d28 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/TableDataTreePane.java @@ -9,6 +9,7 @@ import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.UpdateAction; import com.fr.design.constants.UIConstants; import com.fr.design.data.BasicTableDataTreePane; +import com.fr.design.data.BasicTableDataUtils; import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.tabledata.StoreProcedureWorkerListener; import com.fr.design.data.tabledata.tabledatapane.AbstractTableDataPane; @@ -59,7 +60,7 @@ import java.util.Map; public class TableDataTreePane extends BasicTableDataTreePane { private static TableDataTreePane singleton = new TableDataTreePane(); - + public static final int PLUGIN_LISTENER_PRIORITY = 1; public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter tc) { @@ -96,10 +97,10 @@ public class TableDataTreePane extends BasicTableDataTreePane { addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH); createAddMenuDef(); - + // 创建插件监听 createPluginListener(); - + editAction = new EditAction(); removeAction = new RemoveAction(); previewTableDataAction = new PreviewTableDataAction(dataTree); @@ -139,27 +140,27 @@ public class TableDataTreePane extends BasicTableDataTreePane { new TableDataTreeDragSource(dataTree, DnDConstants.ACTION_COPY); checkButtonEnabled(); } - + private void createPluginListener() { - + //菜单栏监听 GeneralContext.listenPluginRunningChanged(new PluginEventListener(PLUGIN_LISTENER_PRIORITY) { - + @Override public void on(PluginEvent event) { - + addMenuDef.clearShortCuts(); createAddMenuDef(); } }, new PluginFilter() { - + @Override public boolean accept(PluginContext context) { - + return context.contain(PluginModule.ExtraDesign); } }); - + //监听数据集插件 GeneralContext.listenPluginRunningChanged(new PluginEventListener() { @Override @@ -188,8 +189,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { } }); } - - + + protected void checkButtonEnabled() { super.checkButtonEnabled(editAction, previewTableDataAction, removeAction, op, dataTree); } @@ -339,10 +340,11 @@ public class TableDataTreePane extends BasicTableDataTreePane { /** * 合并数据集 - * @param srcName 数据集来源(比如报表块,就是报表块的名称) + * + * @param srcName 数据集来源(比如报表块,就是报表块的名称) * @param tableDataSource 数据集 */ - public Map addTableData(String srcName, TableDataSource tableDataSource) { + public Map addTableData(String srcName, TableDataSource tableDataSource, boolean isCover) { Map tdNameMap = new HashMap<>(); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); @@ -352,14 +354,8 @@ public class TableDataTreePane extends BasicTableDataTreePane { String tdName = (String) tdIterator.next(); String oldName = tdName; TableData td = tableDataSource.getTableData(tdName); - if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称 - tdName = srcName + tdName; - } - int i = 0; - while (tds.getTableData(tdName) != null) { - i++;//如果拼上名字后依然已经存在就加编号 - tdName += i; - } + boolean isDsNameRepeaded = isDsNameRepeaded(tdName); + tdName = BasicTableDataUtils.getTableDataName(isCover, tds, tdName, srcName, isDsNameRepeaded); tds.putTableData(tdName, td); if (!ComparatorUtils.equals(oldName, tdName)) { tdNameMap.put(oldName, tdName); @@ -367,8 +363,19 @@ public class TableDataTreePane extends BasicTableDataTreePane { } tc.parameterChanged(); dataTree.refresh(); - return Collections.unmodifiableMap(tdNameMap); + return Collections.unmodifiableMap(tdNameMap); } + + @Override + public void removeTableData(String sourceName) { + TableDataSource tds = tc.getBook(); + tds.removeTableData(sourceName); + dataTree.refresh(); + } + + + + public void addDataPane(final AbstractTableDataPane uPanel, String paneName) { final NamePane nPanel = uPanel.asNamePane(); nPanel.setObjectName(paneName); diff --git a/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java index acd47a3c11..7391924ac2 100644 --- a/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java +++ b/designer-base/src/test/java/com/fr/design/data/BasicTableDataUtilsTest.java @@ -1,6 +1,9 @@ package com.fr.design.data; +import com.fr.base.TableData; +import com.fr.data.TableDataSource; import junit.framework.TestCase; +import org.easymock.EasyMock; import org.junit.Assert; import org.junit.Test; @@ -41,4 +44,26 @@ public class BasicTableDataUtilsTest extends TestCase { Assert.assertFalse(result12); } -} \ No newline at end of file + + @Test + public void testGetTableDataName() { + TableDataSource source = EasyMock.mock(TableDataSource.class); + TableData tableData = EasyMock.mock(TableData.class); + EasyMock.expect(source.getTableData("ds1")).andReturn(tableData).anyTimes(); + EasyMock.expect(source.getTableData("test-ds1")).andReturn(tableData).anyTimes(); + EasyMock.expect(source.getTableData("test-ds11")).andReturn(null).anyTimes(); + EasyMock.replay(source, tableData); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false)); + Assert.assertEquals("test-ds11", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false)); + + source = EasyMock.mock(TableDataSource.class); + EasyMock.expect(source.getTableData("ds1")).andReturn(null).anyTimes(); + EasyMock.expect(source.getTableData("test-ds1")).andReturn(null).anyTimes(); + EasyMock.replay(source); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(true, source, "ds1", "test", false)); + Assert.assertEquals("ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", false)); + Assert.assertEquals("test-ds1", BasicTableDataUtils.getTableDataName(false, source, "ds1", "test", true)); + + } + +} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index f4554069e3..dcb6938836 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -298,7 +298,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo @Override public JComponent createToolPane(BaseJForm jform, FormDesigner formEditor) { if (!DesignerMode.isAuthorityEditing()) { - if (isDedicateContainer()) { + if (isDedicateContainer() && this.getComponentCount() > 0) { // 图表块和报表块由于控件树处不显示,但对应的属性表要显示,此处处理下 XCreator child = ((XLayoutContainer) this).getXCreator(0); return child.createToolPane(jform, formEditor); @@ -408,7 +408,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public Component getParentShow(){ return this.getParent(); } - + /** * 重置组件的名称 * @@ -418,18 +418,18 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void resetCreatorName(String name) { toData().setWidgetName(name); } - + /** * 遍历所有命名相关的组件到集合中 * * @param xCreators 集合 */ public void traversalNameRelatedXCreators(Set xCreators) { - + xCreators.add(this); int componentCount = getComponentCount(); for (int i = 0; i < componentCount; i++) { - + Component component = getComponent(i); if (component instanceof XCreator) { XCreator xCreator = (XCreator) component; @@ -439,7 +439,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } } - + /** * 重置组件的可见性 * @@ -448,7 +448,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo public void resetVisible(boolean visible) { toData().setVisible(visible); } - + /** * 返回编辑的子组件,scale为其内部组件 * @return 组件 @@ -804,4 +804,4 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo return false; } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java index 06cb19d0ae..e13748719b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormCreatorDropTarget.java @@ -105,7 +105,7 @@ public class FormCreatorDropTarget extends DropTarget { SharableEditorProvider sharableEditor = ShareLoader.getLoader().getSharedElCaseEditorById(shareId); SharableWidgetProvider bindInfo = ShareLoader.getLoader().getElCaseBindInfoById(shareId); if (sharableEditor != null && bindInfo != null) { - Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource()); + Map tdNameMap = TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).addTableData(bindInfo.getName(), sharableEditor.getTableDataSource(), true); //合并数据集之后,可能会有数据集名称变化,做一下联动 //共享的组件拿的时候都是克隆的,这边改拖拽中克隆的对象而非新克隆对象,上面这个新克隆的对象只是为了拿数据集 for (Map.Entry entry : tdNameMap.entrySet()) { From 0debb703223cacd46f5894e3583d8c39de77b087 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 20 Jul 2020 18:50:16 +0800 Subject: [PATCH 27/72] =?UTF-8?q?=E6=97=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index 1209310f66..a930deb231 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -306,12 +306,12 @@ public class SelectionModel { // 清除被选中的组件 selection.reset(); } + designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); + setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); - setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); // 触发事件 - designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); designer.repaint(); } } From fbd5c6668283ae022168059c8d46a261aa08d501 Mon Sep 17 00:00:00 2001 From: pengda Date: Mon, 20 Jul 2020 19:20:34 +0800 Subject: [PATCH 28/72] =?UTF-8?q?REPORT-34907=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8-=E7=BA=B8=E5=BC=A0=E8=83=8C=E6=99=AF-=E6=B8=90?= =?UTF-8?q?=E5=8F=98=E8=89=B2=EF=BC=8C=E5=8F=B3=E8=BE=B9=E7=9A=84=E6=B8=B8?= =?UTF-8?q?=E6=A0=87=E4=B8=8D=E8=83=BD=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/style/background/gradient/GradientBar.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java index efeffa4e49..46d1b9165b 100644 --- a/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java +++ b/designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBar.java @@ -11,6 +11,7 @@ import com.fr.design.style.color.ColorSelectDialog; import com.fr.design.style.color.ColorSelectable; import com.fr.stable.AssistUtils; +import com.fr.stable.os.OperatingSystem; import javax.swing.JComponent; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -124,14 +125,20 @@ public class GradientBar extends JComponent implements UIObserver, ColorSelectab protected void addMouseDragListener() { this.addMouseMotionListener(new MouseAdapter() { public void mouseDragged(MouseEvent e) { - + int oldIndex = index; for (int i = 0; i < list.size(); i++) { if (list.get(i).contains(e.getX(), e.getY())) { index = i; break; } } - + if(OperatingSystem.isLinux() && AssistUtils.equals(oldIndex,index)){ + if(Math.abs(p1.getX() - e.getX()) > Math.abs(p2.getX() - e.getX())){ + index = 1; + }else{ + index = 0; + } + } boolean x = e.getX() <= max && e.getX() >= min; if (x && e.getY() < MAX_VERTICAL) { list.get(index).setX(e.getX()); From deee0ab65fe104e3cce7be960279441c44641377 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Jul 2020 10:50:04 +0800 Subject: [PATCH 29/72] REPORT-34996 && REPORT-34636 --- .../java/com/fr/design/actions/UpdateAction.java | 8 +++++++- .../com/fr/design/os/impl/UpdateDialogAction.java | 12 +++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java index b0803635c9..4fd7e6c42b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/UpdateAction.java @@ -17,6 +17,7 @@ import com.fr.design.mainframe.toolbar.UpdateActionManager; import com.fr.design.menu.ShortCut; import com.fr.design.selection.SelectionListener; import com.fr.general.ComparatorUtils; +import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; import com.fr.stable.pinyin.PinyinFormat; import com.fr.stable.pinyin.PinyinHelper; @@ -562,7 +563,12 @@ public abstract class UpdateAction extends ShortCut implements Action { for (int i = 0; i < component.getTabCount(); i++) { String title = component.getTitleAt(i); handleSearchText(separator, text, pinyin, shortPinyin, title); - Component tabComponent = component.getComponentAt(i); + Component tabComponent = null; + try { + tabComponent = component.getComponentAt(i); + } catch (Exception ignore) { + FineLoggerFactory.getLogger().info("AlphaFine index tabPane end"); + } if (tabComponent instanceof JPanel) { getComponentTexts((JPanel) tabComponent, separator, text, pinyin, shortPinyin); } else if (tabComponent instanceof JTabbedPane) { diff --git a/designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java b/designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java index 64f8f21120..f71493cd6b 100644 --- a/designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java +++ b/designer-base/src/main/java/com/fr/design/os/impl/UpdateDialogAction.java @@ -2,8 +2,6 @@ package com.fr.design.os.impl; import com.fr.design.mainframe.DesignerContext; import com.fr.design.update.ui.dialog.UpdateMainDialog; -import com.fr.design.utils.DesignUtils; -import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.support.OSBasedAction; /** @@ -12,14 +10,10 @@ import com.fr.stable.os.support.OSBasedAction; * @date 2019/10/9 */ public class UpdateDialogAction implements OSBasedAction { - private static String UPDATE_ROUTE = "#management/backup"; + @Override public void execute(Object... objects) { - if(!OperatingSystem.isLinux()) { - UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); - dialog.showDialog(); - }else{ - DesignUtils.visitEnvServerByParameters( UPDATE_ROUTE,null,null); - } + UpdateMainDialog dialog = new UpdateMainDialog(DesignerContext.getDesignerFrame()); + dialog.showDialog(); } } From 39fd9ae7e71b41facc712c8e06c4feb39efd4946 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 21 Jul 2020 11:57:38 +0800 Subject: [PATCH 30/72] =?UTF-8?q?REPORT-35692=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE-=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=94=B9=E4=B8=BAINCH=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/report/UnitFieldPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index 6da8957b26..c6a86de53d 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -52,9 +52,9 @@ public class UnitFieldPane extends JPanel { this.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Unit_MM")); } - //ajust the heigt of unitLabel. - Dimension unitDimension = new Dimension(this.getPreferredSize().width, - preferredHeight); + //自适应label宽度 + int width = this.getFontMetrics(this.getFont()).stringWidth(this.getText()); + Dimension unitDimension = new Dimension(width, preferredHeight); this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension); this.setSize(unitDimension); @@ -62,7 +62,8 @@ public class UnitFieldPane extends JPanel { } } - public UnitFieldPane(int unitType) { + public + UnitFieldPane(int unitType) { this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.unitType = unitType; From b30e6623d6de54430fd8a21c029299c330fad6d5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 21 Jul 2020 11:59:56 +0800 Subject: [PATCH 31/72] =?UTF-8?q?REPORT-35692=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE-=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=94=B9=E4=B8=BAINCH=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E8=B0=83=E6=95=B4=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/UnitFieldPane.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index c6a86de53d..9ad44562f3 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -62,8 +62,7 @@ public class UnitFieldPane extends JPanel { } } - public - UnitFieldPane(int unitType) { + public UnitFieldPane(int unitType) { this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.unitType = unitType; From 304a522cfb4f379d2a522a52e9c539a69c9bca19 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 21 Jul 2020 12:24:45 +0800 Subject: [PATCH 32/72] =?UTF-8?q?REPORT-35692=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE-=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=94=B9=E4=B8=BAINCH=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E6=92=A4=E9=94=80=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/utils/gui/GUICoreUtils.java | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java index 9f5c7fbaa9..586047f5ae 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/GUICoreUtils.java @@ -27,7 +27,6 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.DesignerContext; import com.fr.design.style.color.ColorCell; import com.fr.design.style.color.ColorFactory; import com.fr.design.style.color.ColorSelectBox; @@ -388,35 +387,31 @@ public final class GUICoreUtils { * @param y y坐标 */ public static void showPopupMenu(JPopupMenu popup, Component parentComponent, int x, int y) { - if (popup == null) {// check null. - return; - } - - Point point = new Point(x, y); - SwingUtilities.convertPointToScreen(point, parentComponent); - - Dimension size = popup.getPreferredSize(); - Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); - //父元素右边界的坐标 - int parentComponentRightBorderPosition = parentComponent.getLocationOnScreen().x + parentComponent.getWidth(); - //设计器右边界的坐标 - Rectangle rectangle = DesignerContext.getDesignerFrame().getBounds(); - int designerRightBorderPosition = rectangle.x + rectangle.width; - rectangle = SwingUtilities.getWindowAncestor(parentComponent).getBounds(); - designerRightBorderPosition = Math.max(designerRightBorderPosition, rectangle.x + rectangle.width); - // peter:调整X的高度. - if (point.x + size.width > designerRightBorderPosition && size.width < designerRightBorderPosition) { - x += (parentComponentRightBorderPosition - point.x - size.width); - } - - // peter:调整y高度. - if (point.y + size.height > screen.height && size.height < screen.height) { - y -= size.height; - } - - popup.show(parentComponent, x, y); - } + if (popup == null) {// check null. + return; + } + + Point point = new Point(x, y); + SwingUtilities.convertPointToScreen(point, parentComponent); + + Dimension size = popup.getPreferredSize(); + Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); + screen.setSize(screen.getSize().width, screen.height - HEIGHT_GAP); + + int showOnScreenX = Math.min(screen.width, parentComponent.getLocationOnScreen().x + parentComponent.getWidth()); + + // peter:调整X的高度. + if (point.x + size.width > showOnScreenX && size.width < showOnScreenX) { + x += (showOnScreenX - point.x - size.width); + } + + // peter:调整y高度. + if (point.y + size.height > screen.height && size.height < screen.height) { + y -= size.height; + } + + popup.show(parentComponent, x, y); + } /** * Set enabled.
From 23a94b9371a68a360c33d87d0a683c8f6dbfb4c5 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Jul 2020 12:43:27 +0800 Subject: [PATCH 33/72] =?UTF-8?q?REPORT-34878=20&&=20REPORT-34936=20=20lin?= =?UTF-8?q?ux=E4=B8=8B=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E8=B6=85=E9=93=BE=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/controlpane/UIControlPane.java | 4 ++ .../gui/controlpane/UIListControlPane.java | 4 ++ .../design/os/impl/PopupDialogSaveAction.java | 39 +++++++++++++++++++ .../java/com/fr/grid/GridMouseAdapter.java | 7 +++- 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java index 747dbe32f0..04427b3378 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java @@ -9,12 +9,14 @@ import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.menu.ShortCut; +import com.fr.design.os.impl.PopupDialogSaveAction; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.invoke.Reflect; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; import com.fr.stable.os.OperatingSystem; +import com.fr.stable.os.support.OSSupportCenter; import javax.swing.BorderFactory; import javax.swing.JComponent; @@ -273,6 +275,8 @@ abstract class UIControlPane extends JControlPane { } saveSettings(); setVisible(false); + PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); + saveAction.unregister(); } private void initListener() { diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 0dec124219..786eb2d305 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -7,9 +7,11 @@ import com.fr.design.gui.ilist.JNameEdList; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.gui.ilist.UINameEdList; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.os.impl.PopupDialogSaveAction; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; +import com.fr.stable.os.support.OSSupportCenter; import javax.swing.DefaultListModel; import javax.swing.JList; @@ -216,6 +218,8 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon ((PopupEditDialog)popupEditDialog).setTitle(getSelectedName()); } popupEditDialog.setVisible(true); + PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); + osBasedAction.execute(this, popupEditDialog); } } diff --git a/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java b/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java new file mode 100644 index 0000000000..019ee3d97e --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/os/impl/PopupDialogSaveAction.java @@ -0,0 +1,39 @@ +package com.fr.design.os.impl; + +import com.fr.design.gui.controlpane.UIListControlPane; +import com.fr.stable.os.OperatingSystem; +import com.fr.stable.os.support.OSBasedAction; + +import java.awt.*; + +/** + * linux下超链弹窗等保存问题 + * + * @author hades + * @version 10.0 + * Created by hades on 2020/7/21 + */ +public class PopupDialogSaveAction implements OSBasedAction { + + private UIListControlPane currentControlPane; + private Window popupDialog; + + @Override + public void execute(Object... objects) { + boolean canSave = OperatingSystem.isLinux() && popupDialog != null && popupDialog.isVisible() && currentControlPane != null; + if (canSave) { + currentControlPane.saveSettings(); + } + } + + public void register(UIListControlPane currentControlPane, Window popupDialog) { + this.currentControlPane = currentControlPane; + this.popupDialog = popupDialog; + } + + public void unregister() { + this.currentControlPane = null; + this.popupDialog = null; + } + +} diff --git a/designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java b/designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java index ae230a5319..86ed09161b 100644 --- a/designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java +++ b/designer-realize/src/main/java/com/fr/grid/GridMouseAdapter.java @@ -10,7 +10,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.JSliderPane; -import com.fr.design.present.CellWriteAttrPane; +import com.fr.design.os.impl.PopupDialogSaveAction; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; @@ -26,6 +26,7 @@ import com.fr.report.elementcase.TemplateElementCase; import com.fr.stable.ArrayUtils; import com.fr.stable.ColumnRow; import com.fr.stable.StringUtils; +import com.fr.stable.os.support.OSSupportCenter; import com.fr.stable.unit.FU; import javax.swing.*; @@ -93,7 +94,9 @@ public class GridMouseAdapter implements MouseListener, MouseWheelListener, Mous if (!grid.hasFocus() && grid.isRequestFocusEnabled()) { grid.requestFocus(); } - + // linux下 点击单元格时 失焦之前立即触发保存 + PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); + saveAction.execute(); if (SwingUtilities.isRightMouseButton(evt)) { doWithRightButtonPressed(); } else { From 8eda3e745d6421b3101164517b30ba2309ebd914 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 21 Jul 2020 14:49:52 +0800 Subject: [PATCH 34/72] =?UTF-8?q?REPORT-35692=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E9=A1=B5=E9=9D=A2=E8=AE=BE=E7=BD=AE-=E5=8D=95?= =?UTF-8?q?=E4=BD=8D=E6=94=B9=E4=B8=BAINCH=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E6=96=B9=E6=B3=95=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/report/UnitFieldPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java index 9ad44562f3..6af6852d47 100644 --- a/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/UnitFieldPane.java @@ -8,6 +8,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.stable.Constants; +import com.fr.stable.GraphDrawHelper; import com.fr.stable.OperatingSystem; import com.fr.stable.unit.CM; import com.fr.stable.unit.INCH; @@ -53,7 +54,7 @@ public class UnitFieldPane extends JPanel { } //自适应label宽度 - int width = this.getFontMetrics(this.getFont()).stringWidth(this.getText()); + int width = GraphDrawHelper.getWidth(this.getText(), this.getFont()); Dimension unitDimension = new Dimension(width, preferredHeight); this.setMinimumSize(unitDimension); this.setMinimumSize(unitDimension); From 326eb6bb1eefb6716c8ff6eb4145c06c8f02f1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 21 Jul 2020 17:35:58 +0800 Subject: [PATCH 35/72] =?UTF-8?q?CHART-14689=20=20=E9=A2=84=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=85=8D=E8=89=B2=E6=8C=89=E9=92=AE=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/module/ChartPreFillStylePane.java | 56 ++++++++----------- 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 34f917f153..5bcdaca537 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -2,14 +2,16 @@ package com.fr.design.module; import com.fr.base.ChartColorMatching; import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.style.ChartColorAdjustPane; import com.fr.design.style.background.gradient.FixedGradientBar; +import javax.swing.BorderFactory; import javax.swing.JPanel; import java.util.ArrayList; import java.util.Collections; @@ -19,7 +21,6 @@ import java.awt.CardLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; -import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -35,8 +36,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { private JPanel changeColorSetPane; private CardLayout cardLayout; - private UIButton accButton; - private UIButton gradientButton; + private UIButtonGroup groupButton; private ChartColorAdjustPane colorAdjustPane; private FixedGradientBar colorGradient; @@ -52,22 +52,20 @@ public class ChartPreFillStylePane extends BasicBeanPane { JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); - JPanel buttonPane = new JPanel(); - buttonPane.setLayout(new FlowLayout(FlowLayout.LEFT)); - buttonPane.add(accButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Color"))); - buttonPane.add(gradientButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Gradient_Color"))); - customPane.add(buttonPane, BorderLayout.NORTH); + groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); + groupButton.setPreferredSize(new Dimension(155, 20)); + groupButton.setSelectedIndex(0); + customPane.add(groupButton, BorderLayout.NORTH); changeColorSetPane = new JPanel(cardLayout = new CardLayout()); - changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 130), "gradient"); + changeColorSetPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0)); + changeColorSetPane.add(colorGradient = new FixedGradientBar(4, 150), "gradient"); changeColorSetPane.add(colorAdjustPane = new ChartColorAdjustPane(), "acc"); cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER); - accButton.setSelected(true); - - customPane.setPreferredSize(new Dimension(200, 200)); - colorGradient.setPreferredSize(new Dimension(120, 30)); + customPane.setPreferredSize(new Dimension(155, 200)); + colorGradient.setPreferredSize(new Dimension(155, 30)); colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); colorGradient.getSelectColorPointBtnP2().setColorInner(FixedGradientBar.NEW_CHARACTER); @@ -84,24 +82,20 @@ public class ChartPreFillStylePane extends BasicBeanPane { } private void initListener() { - - accButton.addActionListener(new ActionListener() { + groupButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - accButton.setSelected(true); - gradientButton.setSelected(false); - cardLayout.show(changeColorSetPane, "acc"); + checkCardPane(); } }); + } - gradientButton.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - gradientButton.setSelected(true); - accButton.setSelected(false); - cardLayout.show(changeColorSetPane, "gradient"); - } - }); + private void checkCardPane() { + if (groupButton.getSelectedIndex() == 0) { + cardLayout.show(changeColorSetPane, "acc"); + } else { + cardLayout.show(changeColorSetPane, "gradient"); + } } @Override @@ -117,8 +111,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { boolean isGradient = condition.getGradient(); List colorList = condition.getColorList(); if (isGradient) { - gradientButton.setSelected(true); - accButton.setSelected(false); + groupButton.setSelectedIndex(1); cardLayout.show(changeColorSetPane, "gradient"); if (colorList.size() == 2) { @@ -127,8 +120,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { colorGradient.repaint(); } } else { - accButton.setSelected(true); - gradientButton.setSelected(false); + groupButton.setSelectedIndex(0); cardLayout.show(changeColorSetPane, "acc"); if (colorList.isEmpty()) { @@ -148,7 +140,7 @@ public class ChartPreFillStylePane extends BasicBeanPane { List colorList = new ArrayList(); - if (gradientButton.isSelected()) { + if (groupButton.getSelectedIndex() == 1) { chartColorMatching.setGradient(true); Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); From 75d9b30d8c71e0b548731cfcff4b6109a49a81e6 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 21 Jul 2020 18:54:33 +0800 Subject: [PATCH 36/72] =?UTF-8?q?REPORT-34878=20&&=20REPORT-34936=20linux?= =?UTF-8?q?=E4=B8=8B=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=92=8C=E8=B6=85?= =?UTF-8?q?=E9=93=BE=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/controlpane/UIListControlPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java index 786eb2d305..100daf511b 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListControlPane.java @@ -219,7 +219,7 @@ public abstract class UIListControlPane extends UIControlPane implements ListCon } popupEditDialog.setVisible(true); PopupDialogSaveAction osBasedAction = OSSupportCenter.getAction(PopupDialogSaveAction.class); - osBasedAction.execute(this, popupEditDialog); + osBasedAction.register(this, popupEditDialog); } } From 2525b1f62d6087805a91861fabdab0670047d30a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 21 Jul 2020 20:06:43 +0800 Subject: [PATCH 37/72] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/ChartDataFilterPane.java | 53 +++-- .../table/SeriesNameUseFieldNamePane.java | 32 ++- .../table/SeriesNameUseFieldValuePane.java | 34 ++- .../box/BoxIndependentVanChartInterface.java | 2 +- .../box/data/BoxPlotDataContentPaneHelp.java | 123 +++++++++++ .../box/data/BoxPlotTableDataContentPane.java | 196 +++++++++++++----- .../BoxPlotTableDetailedDataSeriesPane.java | 20 -- .../BoxPlotTableResultDataSeriesPane.java | 72 +++---- .../data/BoxPlotTableSeriesTypeUsePane.java | 143 +++++++++++++ 9 files changed, 534 insertions(+), 141 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotDataContentPaneHelp.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDetailedDataSeriesPane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java index 9db2fe7b21..fcd101fb15 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/ChartDataFilterPane.java @@ -7,13 +7,13 @@ import com.fr.chart.chartattr.Plot; import com.fr.chart.chartdata.TopDefinition; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.icheckbox.UICheckBox; +import com.fr.design.i18n.Toolkit; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.style.AbstractChartTabPane; import com.fr.design.mainframe.chart.gui.style.ThirdTabPane; - import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -50,6 +50,11 @@ public class ChartDataFilterPane extends ThirdTabPane { this.isNeedPresent = true; } + public ChartDataFilterPane(Plot plot, ChartDataPane parent, boolean isNeedPresent) { + super(plot, parent); + this.isNeedPresent = isNeedPresent; + } + protected void initTabPane() { super.initTabPane(); tabPane.setPreferredSize(new Dimension(221, 25)); @@ -109,7 +114,7 @@ public class ChartDataFilterPane extends ThirdTabPane { * @return 返回标题. */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"); + return Toolkit.i18nText("Fine-Design_Chart_Data_Filter"); } /** @@ -144,12 +149,17 @@ public class ChartDataFilterPane extends ThirdTabPane { } public void populateBean(ChartCollection collection, boolean isNeedPresent) { - relayoutPane(isNeedPresent); + TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition(); + populateDefinition(topDefinition, isNeedPresent); + } + + public void populateDefinition(TopDefinitionProvider topDefinition, boolean isNeedSummary) { + relayoutPane(isNeedSummary); if (categoryPane != null) { - categoryPane.populateBean(collection.getSelectedChart().getFilterDefinition()); + categoryPane.populateBean(topDefinition); } if (seriesPane != null) { - seriesPane.populateBean(collection.getSelectedChart().getFilterDefinition()); + seriesPane.populateBean(topDefinition); } checkBoxUse(); } @@ -165,11 +175,16 @@ public class ChartDataFilterPane extends ThirdTabPane { * 保存界面数据筛选. */ public void updateBean(ChartCollection collection) { + TopDefinitionProvider topDefinition = collection.getSelectedChart().getFilterDefinition(); + updateDefinition(topDefinition); + } + + public void updateDefinition(TopDefinitionProvider topDefinition) { if (categoryPane != null) { - categoryPane.updateBean(collection.getSelectedChart().getFilterDefinition()); + categoryPane.updateBean(topDefinition); } if (seriesPane != null) { - seriesPane.updateBean(collection.getSelectedChart().getFilterDefinition()); + seriesPane.updateBean(topDefinition); } } @@ -222,13 +237,13 @@ public class ChartDataFilterPane extends ThirdTabPane { } protected JPanel initOtherPane() { - onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); + onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); JPanel panel1 = new JPanel(new BorderLayout()); JPanel panel2 = new JPanel(new BorderLayout()); panel1.add(onlyPreData, BorderLayout.NORTH); preDataNum = new UITextField(); - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num")); - combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num")); + combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther.setSelected(true); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -244,7 +259,7 @@ public class ChartDataFilterPane extends ThirdTabPane { //默认不显示 preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); - notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); + notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Cate")); panel2.add(notShowNull, BorderLayout.NORTH); onlyPreData.addChangeListener(new ChangeListener() { @@ -258,7 +273,7 @@ public class ChartDataFilterPane extends ThirdTabPane { fire(); } }; - presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); + presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); panel2.add(presentPane, BorderLayout.SOUTH); double[] column = {f}; @@ -281,7 +296,7 @@ public class ChartDataFilterPane extends ThirdTabPane { * 界面标题 "分类" */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category"); + return Toolkit.i18nText("Fine-Design_Chart_Style_Category"); } /** @@ -397,13 +412,13 @@ public class ChartDataFilterPane extends ThirdTabPane { protected JPanel initOtherPane() { - onlyPreData = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); + onlyPreData = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Only_Use_Before_Records")); JPanel panel1 = new JPanel(new BorderLayout()); JPanel panel2 = new JPanel(new BorderLayout()); panel1.add(onlyPreData, BorderLayout.NORTH); preDataNum = new UITextField(); - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Records_Num")); - combineOther = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Records_Num")); + combineOther = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_CombineOther")); combineOther.setSelected(true); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; @@ -419,7 +434,7 @@ public class ChartDataFilterPane extends ThirdTabPane { //默认不显示 preDataNumPane.setVisible(false); panel1.add(preDataNumPane, BorderLayout.CENTER); - notShowNull = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series")); + notShowNull = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Data_Not_Show_Series")); panel2.add(notShowNull, BorderLayout.NORTH); onlyPreData.addChangeListener(new ChangeListener() { @@ -433,7 +448,7 @@ public class ChartDataFilterPane extends ThirdTabPane { fire(); } }; - presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); + presentPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Toolkit.i18nText("Fine-Design_Chart_Style_Present") ,present); panel2.add(presentPane, BorderLayout.SOUTH); double[] column = {f}; @@ -457,7 +472,7 @@ public class ChartDataFilterPane extends ThirdTabPane { * 界面标题 */ public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series"); + return Toolkit.i18nText("Fine-Design_Chart_Series"); } /** diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index 0c643cf8c1..c6f4ac2041 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.itable.UITable; import com.fr.design.gui.itable.UITableEditor; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; @@ -40,8 +41,15 @@ import java.util.List; * @version 创建时间:2012-12-26 下午04:39:46 */ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane { - 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 static final String[] HEADS_NO_SUMMARY = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Field_Name"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")}; + private static final String[] HEADS = { + Toolkit.i18nText("Fine-Design_Chart_Field_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name"), + Toolkit.i18nText("Fine-Design_Chart_Summary_Method")}; + + private static final String[] HEADS_NO_SUMMARY = { + Toolkit.i18nText("Fine-Design_Chart_Field_Name"), + Toolkit.i18nText("Fine-Design_Chart_Series_Name")}; + private UICorrelationPane seriesDataPane; private List field = new ArrayList(); private JPanel centerPane; @@ -62,7 +70,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane { + + private static boolean NEED_SUMMERY = false; + + private SeriesNameUseFieldValuePane nameFieldValuePane; + private SeriesNameUseFieldNamePane nameFieldNamePane; + + public BoxPlotTableSeriesTypeUsePane() { + cards = initPaneList(); + initComponents(); + } + + protected void initLayout() { + this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); + + cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); + + this.add(createNorthPane(), BorderLayout.NORTH); + this.add(cardPane, BorderLayout.CENTER); + } + + protected UIComboBox createComboBox() { + UIComboBox uiComboBox = new UIComboBox(); + UIComponentUtils.setPreferedWidth(uiComboBox, 100); + return uiComboBox; + } + + private JPanel createNorthPane() { + JPanel north = new JPanel(new BorderLayout(4, 0)); + + UILabel label = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); + north.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label, null})); + north.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15)); + + return north; + } + + public void checkBoxUse(boolean hasUse) { + jcb.setEnabled(hasUse); + nameFieldValuePane.checkUse(hasUse); + } + + public void refreshBoxListWithSelectTableData(List list) { + nameFieldValuePane.refreshBoxListWithSelectTableData(list); + nameFieldNamePane.refreshBoxListWithSelectTableData(list); + } + + public void clearAllBoxList() { + nameFieldValuePane.clearAllBoxList(); + nameFieldNamePane.clearAllBoxList(); + } + + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"); + } + + protected List> initPaneList() { + nameFieldValuePane = new SeriesNameUseFieldValuePane(); + nameFieldNamePane = new SeriesNameUseFieldNamePane(); + + nameFieldValuePane.relayoutPane(NEED_SUMMERY); + nameFieldNamePane.relayoutPane(NEED_SUMMERY); + + List> paneList = new ArrayList>(); + + paneList.add(nameFieldValuePane); + paneList.add(nameFieldNamePane); + + return paneList; + } + + public void relayoutPane() { + if (jcb.getSelectedIndex() == 0) { + nameFieldValuePane.relayoutPane(NEED_SUMMERY); + } else { + nameFieldNamePane.relayoutPane(NEED_SUMMERY); + } + } + + protected void comboBoxItemStateChanged() { + if (jcb.getSelectedIndex() == 0) { + nameFieldValuePane.relayoutPane(NEED_SUMMERY); + } else { + nameFieldNamePane.relayoutPane(NEED_SUMMERY); + } + } + + public void populateBean(ChartCollection collection) { + NormalTableDataDefinition definition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection); + + if (definition instanceof OneValueCDDefinition) { + this.setSelectedIndex(0); + nameFieldValuePane.populateDefinition(definition, NEED_SUMMERY); + } else if (definition instanceof MoreNameCDDefinition) { + this.setSelectedIndex(1); + nameFieldNamePane.populateDefinition(definition, NEED_SUMMERY); + } + } + + public void updateBean(ChartCollection ob) { + VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(ob); + + NormalTableDataDefinition definition; + + if (this.getSelectedIndex() == 0) { + definition = nameFieldValuePane.updateDefinition(); + } else { + definition = nameFieldNamePane.updateDefinition(table.getDetailedDefinition()); + } + + table.setDetailedDefinition(definition); + } + +} From fde23b8576a7e053a34ad40f82e9be01dd3c422d Mon Sep 17 00:00:00 2001 From: "Hugh.C" Date: Wed, 22 Jul 2020 09:16:58 +0800 Subject: [PATCH 38/72] =?UTF-8?q?REPORT-34954=20=E5=9C=A8=E5=AF=8C?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E8=AE=BE=E7=BD=AE=E4=B8=AD=EF=BC=8C=E6=9C=AA?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=95=B0=E6=8D=AE=E6=97=B6=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E7=82=B9=E5=87=BB=E4=B8=8A=E4=B8=8B=E6=A0=87=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E5=90=8C=E6=97=B6=E8=AE=BE=E7=BD=AE(?= =?UTF-8?q?=E6=8F=90=E9=94=99=E4=BA=86=EF=BC=8C=E4=B9=8B=E5=89=8D=E6=8F=90?= =?UTF-8?q?=E5=88=B0=E4=BA=86release)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/cell/editor/RichTextToolBar.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java index b3a78d34d9..a8f4b2ac1a 100644 --- a/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java +++ b/designer-realize/src/main/java/com/fr/design/cell/editor/RichTextToolBar.java @@ -258,6 +258,7 @@ public class RichTextToolBar extends BasicPane{ boolean isSub = RichTextToolBar.this.subPane.isSelected(); MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSub && RichTextToolBar.this.superPane.isSelected()) { + RichTextToolBar.this.superPane.setSelected(false); StyleConstants.setSuperscript(attr, false); } // 调用setCharacterAttributes函数设置文本区选择文本的字体 @@ -273,6 +274,7 @@ public class RichTextToolBar extends BasicPane{ // 调用setCharacterAttributes函数设置文本区选择文本的字体 MutableAttributeSet attr = new SimpleAttributeSet(); if (!isSuper && RichTextToolBar.this.subPane.isSelected()) { + RichTextToolBar.this.subPane.setSelected(false); StyleConstants.setSubscript(attr, false); } StyleConstants.setSuperscript(attr, !isSuper); From 76042b86331212db997c9a98e4d5f8815489cecb Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 22 Jul 2020 11:47:00 +0800 Subject: [PATCH 39/72] =?UTF-8?q?REPORT-35688=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E9=A2=84=E5=AE=9A=E4=B9=89=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/server/StyleListAction.java | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java b/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java index ff16a33633..97b4963240 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/server/StyleListAction.java @@ -17,6 +17,7 @@ import com.fr.transaction.WorkerCallBack; import com.fr.transaction.WorkerFacade; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; @@ -24,6 +25,8 @@ import java.awt.event.ActionEvent; * StyleList Action */ public class StyleListAction extends UpdateAction { + public static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(710, 600); + public StyleListAction() { this.setMenuKeySet(PREDEFINED_STYLES); this.setName(getMenuKeySet().getMenuKeySetName() + "..."); @@ -37,23 +40,23 @@ public class StyleListAction extends UpdateAction { * * @param evt 事件 */ - public void actionPerformed(ActionEvent evt) { - DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); - final StyleManagerPane styleListPane = new StyleManagerPane(); - final BasicDialog styleListDialog = styleListPane.showWindow(designerFrame); - styleListDialog.addDialogActionListener(new DialogActionAdapter() { - @Override - public void doOk() { - if (!styleListPane.isNamePermitted()) { - styleListDialog.setDoOKSucceed(false); + public void actionPerformed(ActionEvent evt) { + DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); + final StyleManagerPane styleListPane = new StyleManagerPane(); + final BasicDialog styleListDialog = styleListPane.showWindowWithCustomSize(designerFrame, null, WINDOW_CUSTOM_SIZE); + styleListDialog.addDialogActionListener(new DialogActionAdapter() { + @Override + public void doOk() { + if (!styleListPane.isNamePermitted()) { + styleListDialog.setDoOKSucceed(false); } - Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { - @Override - public void run() { - styleListPane.update(ServerPreferenceConfig.getInstance()); - } - }.addCallBack(new CallBackAdaptor(){ - @Override + Configurations.modify(new WorkerFacade(ServerPreferenceConfig.class) { + @Override + public void run() { + styleListPane.update(ServerPreferenceConfig.getInstance()); + } + }.addCallBack(new CallBackAdaptor() { + @Override public void afterCommit() { DesignerContext.getDesignerBean("predefinedStyle").refreshBeanElement(); } From e6c10db5cf73d83c9dca9181c5cb8a48ed939002 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 22 Jul 2020 11:47:52 +0800 Subject: [PATCH 40/72] =?UTF-8?q?CHART-14689=20=E5=88=87=E6=8D=A2=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=8D=A2=E8=A1=8C=E4=B8=8D=E9=99=90=E5=88=B6=E9=AB=98?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/module/ChartPreFillStylePane.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java index 5bcdaca537..09ba3d3ce6 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartPreFillStylePane.java @@ -53,7 +53,6 @@ public class ChartPreFillStylePane extends BasicBeanPane { JPanel customPane = new JPanel(FRGUIPaneFactory.createBorderLayout()); groupButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Custom_Color"), Toolkit.i18nText("Fine-Design_Chart_Gradient_Color")}); - groupButton.setPreferredSize(new Dimension(155, 20)); groupButton.setSelectedIndex(0); customPane.add(groupButton, BorderLayout.NORTH); @@ -64,11 +63,11 @@ public class ChartPreFillStylePane extends BasicBeanPane { cardLayout.show(changeColorSetPane, "acc"); customPane.add(changeColorSetPane, BorderLayout.CENTER); - customPane.setPreferredSize(new Dimension(155, 200)); + customPane.setPreferredSize(new Dimension(155, 300)); colorGradient.setPreferredSize(new Dimension(155, 30)); colorGradient.getSelectColorPointBtnP1().setColorInner(Color.WHITE); colorGradient.getSelectColorPointBtnP2().setColorInner(FixedGradientBar.NEW_CHARACTER); - + double p = TableLayout.PREFERRED; double[] columnSize = {p, p}; double[] rowSize = {p, p, p}; From 37553746869ab93deddf4ce91a5a4bb713e4bc6b Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 22 Jul 2020 14:08:45 +0800 Subject: [PATCH 41/72] =?UTF-8?q?=E5=AE=8C=E5=96=84=E9=9D=A2=E6=9D=BF?= =?UTF-8?q?=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CategoryPlotTableDataContentPane.java | 53 +++----- .../chart/gui/data/table/DataPaneHelper.java | 25 ++++ .../table/SeriesNameUseFieldValuePane.java | 20 +-- .../box/data/BoxPlotDataContentPaneHelp.java | 123 ------------------ .../box/data/BoxPlotTableDataContentPane.java | 118 +++++++---------- .../BoxPlotTableResultDataSeriesPane.java | 42 ++++-- .../data/BoxPlotTableSeriesTypeUsePane.java | 96 +++++++++++++- .../MultiPiePlotTableDataContentPane.java | 38 ++---- 8 files changed, 222 insertions(+), 293 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotDataContentPaneHelp.java diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java index 8c988ce294..7d12e3e52d 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; +import com.fr.design.i18n.Toolkit; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -28,24 +29,24 @@ import java.util.List; */ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPane{ private static final long serialVersionUID = 7284078589672079657L; - + protected UIComboBox categoryCombox; protected SeriesTypeUseComboxPane seriesTypeComboxPane; - + public CategoryPlotTableDataContentPane() { - + } - + public CategoryPlotTableDataContentPane(ChartDataPane parent) { - + categoryCombox = new UIComboBox(); JPanel categoryPane = new JPanel(new BorderLayout(4,0)); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); - UILabel label1 = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ; + UILabel label1 = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Style_Category")) ; label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); categoryCombox.setPreferredSize(new Dimension(100,20)); - categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); + categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); categoryPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{categoryCombox,null,null,label1,null})); categoryPane.setPreferredSize(new Dimension(246,30)); categoryPane.setBorder(BorderFactory.createEmptyBorder(0,24,10,15)); @@ -56,7 +57,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa this.add(getJSeparator()); seriesTypeComboxPane = new SeriesTypeUseComboxPane(parent, new Bar2DPlot()); this.add(seriesTypeComboxPane, BorderLayout.SOUTH); - + categoryCombox.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { checkSeriseUse(categoryCombox.getSelectedItem() != null); @@ -64,7 +65,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa } }); } - + protected void makeToolTipUse(UIComboBox comBox) { if(comBox.getSelectedItem() != null) { comBox.setToolTipText(comBox.getSelectedItem().toString()); @@ -72,7 +73,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa comBox.setToolTipText(null); } } - + /** * 检查 某些Box是否可用 * @param hasUse 是否使用. @@ -81,16 +82,16 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa categoryCombox.setEnabled(hasUse); checkSeriseUse(hasUse); } - + protected void checkSeriseUse(boolean hasUse) { if(seriesTypeComboxPane != null) { seriesTypeComboxPane.checkUseBox(hasUse && categoryCombox.getSelectedItem() != null); } } - + protected void refreshBoxListWithSelectTableData(List list) { refreshBoxItems(categoryCombox, list); - categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); + categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); seriesTypeComboxPane.refreshBoxListWithSelectTableData(list); } @@ -100,10 +101,10 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa */ public void clearAllBoxList(){ clearBoxItems(categoryCombox); - categoryCombox.addItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); + categoryCombox.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); seriesTypeComboxPane.clearAllBoxList(); } - + /** * 保存界面内容到ChartCollection */ @@ -129,15 +130,15 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa public void populateBean(ChartCollection collection) { super.populateBean(collection); TopDefinition top = (TopDefinition)collection.getSelectedChart().getFilterDefinition(); - + if(!(top instanceof NormalTableDataDefinition)) { return; } NormalTableDataDefinition data = (NormalTableDataDefinition)top; - if(data == null || ComparatorUtils.equals(data.getCategoryName(), StringUtils.EMPTY)) { - categoryCombox.setSelectedItem(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_None")); - } else if(data!= null && !this.boxItemsContainsObject(categoryCombox,data.getCategoryName())){ + if(ComparatorUtils.equals(data.getCategoryName(), StringUtils.EMPTY)) { + categoryCombox.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); + } else if(!DataPaneHelper.boxItemsContainsObject(categoryCombox,data.getCategoryName())){ categoryCombox.setSelectedItem(null); }else { combineCustomEditValue(categoryCombox, data.getCategoryName()); @@ -146,20 +147,6 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa seriesTypeComboxPane.populateBean(collection,this.isNeedSummaryCaculateMethod()); } - private boolean boxItemsContainsObject(UIComboBox box,Object item){ - if(box == null){ - return false; - } - - ComboBoxModel dataModel = box.getModel(); - for (int i = 0; i < dataModel.getSize(); i++) { - if(ComparatorUtils.equals(dataModel.getElementAt(i),item)){ - return true; - } - } - return false; - } - /** * 重新布局整个面板 */ diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java index 69cf88286f..7f5373c665 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java @@ -7,6 +7,7 @@ import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; +import javax.swing.ComboBoxModel; import java.util.List; /** @@ -24,6 +25,30 @@ public class DataPaneHelper { box.refreshBoxItems(list); } + public static boolean boxItemsContainsObject(UIComboBox box, Object item) { + if (box == null) { + return false; + } + + ComboBoxModel dataModel = box.getModel(); + + for (int i = 0; i < dataModel.getSize(); i++) { + if (ComparatorUtils.equals(dataModel.getElementAt(i), item)) { + return true; + } + } + + return false; + } + + public static void combineCustomEditValue(UIComboBox comBox, String value) { + if(comBox != null) { + comBox.setEditable(true); + comBox.setSelectedItem(value); + comBox.setEditable(false); + } + } + /** * 清空box里所有东西 * diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index bef72ca3dc..aab267c545 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -14,10 +14,8 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.ComparatorUtils; import javax.swing.BorderFactory; -import javax.swing.ComboBoxModel; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; @@ -171,20 +169,6 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane Date: Wed, 22 Jul 2020 14:19:17 +0800 Subject: [PATCH 42/72] =?UTF-8?q?REPORT-35690=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=A1=AB=E6=8A=A5=E5=BF=AB=E6=8D=B7=E9=94=AE?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2=E5=B1=95=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/report/ReportWriteAttrAction.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWriteAttrAction.java b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWriteAttrAction.java index 92451deb26..e4a8ca7857 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/report/ReportWriteAttrAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/report/ReportWriteAttrAction.java @@ -3,6 +3,7 @@ package com.fr.design.actions.report; import com.fr.design.actions.ReportComponentAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; +import com.fr.design.dialog.DialogActionListener; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.WorkSheetDesigner; @@ -11,10 +12,15 @@ import com.fr.design.webattr.ReportWriteAttrPane; import com.fr.general.IOUtils; import com.fr.report.worksheet.WorkSheet; +import java.awt.Dimension; + + /** * ReportWriteAttrAction */ public class ReportWriteAttrAction extends ReportComponentAction { + public static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600); + public ReportWriteAttrAction(WorkSheetDesigner t) { super(t); this.setMenuKeySet(KeySetUtils.REPORT_WRITE); @@ -49,7 +55,7 @@ public class ReportWriteAttrAction extends ReportComponentAction Date: Wed, 22 Jul 2020 23:33:04 +0800 Subject: [PATCH 43/72] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/box/BoxIndependentVanChartInterface.java | 2 +- .../{ => table}/BoxPlotTableDataContentPane.java | 2 +- .../BoxPlotTableResultDataSeriesPane.java | 2 +- .../BoxPlotTableSeriesNameUseFieldNamePane.java | 12 ++++++++++++ .../BoxPlotTableSeriesNameUseFieldValuePane.java | 12 ++++++++++++ .../{ => table}/BoxPlotTableSeriesTypeUsePane.java | 12 +++++------- 6 files changed, 32 insertions(+), 10 deletions(-) rename designer-chart/src/main/java/com/fr/van/chart/box/data/{ => table}/BoxPlotTableDataContentPane.java (99%) rename designer-chart/src/main/java/com/fr/van/chart/box/data/{ => table}/BoxPlotTableResultDataSeriesPane.java (99%) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java rename designer-chart/src/main/java/com/fr/van/chart/box/data/{ => table}/BoxPlotTableSeriesTypeUsePane.java (94%) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java index 099a8484df..cb08abcbd1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/BoxIndependentVanChartInterface.java @@ -14,7 +14,7 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.van.chart.box.data.BoxPlotReportDataContentPane; -import com.fr.van.chart.box.data.BoxPlotTableDataContentPane; +import com.fr.van.chart.box.data.table.BoxPlotTableDataContentPane; import com.fr.van.chart.designer.other.VanChartInteractivePane; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.other.zoom.ZoomPane; diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java similarity index 99% rename from designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java rename to designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index 679ad29222..6ea7e126e4 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -1,4 +1,4 @@ -package com.fr.van.chart.box.data; +package com.fr.van.chart.box.data.table; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.Plot; diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java similarity index 99% rename from designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java rename to designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java index 77ce69689a..04dd3cda96 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableResultDataSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java @@ -1,4 +1,4 @@ -package com.fr.van.chart.box.data; +package com.fr.van.chart.box.data.table; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.ChartCollection; diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java new file mode 100644 index 0000000000..8fc7d7e684 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldNamePane.java @@ -0,0 +1,12 @@ +package com.fr.van.chart.box.data.table; + +import com.fr.chart.chartdata.MoreNameCDDefinition; +import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane; +import com.fr.plugin.chart.box.data.VanBoxMoreNameCDDefinition; + +public class BoxPlotTableSeriesNameUseFieldNamePane extends SeriesNameUseFieldNamePane { + + protected MoreNameCDDefinition createMoreNameCDDefinition() { + return new VanBoxMoreNameCDDefinition(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java new file mode 100644 index 0000000000..93319f5c3e --- /dev/null +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesNameUseFieldValuePane.java @@ -0,0 +1,12 @@ +package com.fr.van.chart.box.data.table; + +import com.fr.chart.chartdata.OneValueCDDefinition; +import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane; +import com.fr.plugin.chart.box.data.VanBoxOneValueCDDefinition; + +public class BoxPlotTableSeriesNameUseFieldValuePane extends SeriesNameUseFieldValuePane { + + protected OneValueCDDefinition createOneValueCDDefinition() { + return new VanBoxOneValueCDDefinition(); + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java similarity index 94% rename from designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java rename to designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java index 211e4d93c8..1fd9186b18 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/BoxPlotTableSeriesTypeUsePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java @@ -1,4 +1,4 @@ -package com.fr.van.chart.box.data; +package com.fr.van.chart.box.data.table; import com.fr.chart.base.ChartConstants; import com.fr.chart.chartattr.ChartCollection; @@ -14,8 +14,6 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.general.ComparatorUtils; @@ -40,8 +38,8 @@ public class BoxPlotTableSeriesTypeUsePane extends UIComboBoxPane> initPaneList() { - nameFieldValuePane = new SeriesNameUseFieldValuePane(); - nameFieldNamePane = new SeriesNameUseFieldNamePane(); + nameFieldValuePane = new BoxPlotTableSeriesNameUseFieldValuePane(); + nameFieldNamePane = new BoxPlotTableSeriesNameUseFieldNamePane(); nameFieldValuePane.relayoutPane(NEED_SUMMERY); nameFieldNamePane.relayoutPane(NEED_SUMMERY); From 6f210916d7f33f4d41ce3efa817d994699f9ad7c Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Thu, 23 Jul 2020 10:48:31 +0800 Subject: [PATCH 44/72] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=80=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index ff52dac142..449ffc0744 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -760,6 +760,7 @@ public class JWorkBook extends JTemplate { if (centerPane.isUpEditMode()) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } } else { From 5b4868a601d318f1d29d2177dda311e71ee2dec9 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 23 Jul 2020 18:04:45 +0800 Subject: [PATCH 45/72] =?UTF-8?q?=E7=B3=BB=E5=88=97=E5=92=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=82=B9=E6=8F=90=E7=A4=BA=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/box/VanChartBoxPlotTooltipPane.java | 6 + .../van/chart/box/VanChartBoxSeriesPane.java | 94 ++++++++++++- .../van/chart/box/VanChartBoxStylePane.java | 4 +- .../box/VanChartBoxTooltipContentPane.java | 123 +++++++++++++++++- 4 files changed, 222 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java index e976d05e6c..4ad21d0d86 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxPlotTooltipPane.java @@ -1,6 +1,8 @@ package com.fr.van.chart.box; import com.fr.chart.chartattr.Plot; +import com.fr.plugin.chart.base.AttrTooltip; +import com.fr.plugin.chart.box.attr.AttrBoxTooltip; import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.tooltip.VanChartPlotTooltipPane; @@ -14,6 +16,10 @@ public class VanChartBoxPlotTooltipPane extends VanChartPlotTooltipPane { tooltipContentPane = new VanChartBoxTooltipContentPane(parent, VanChartBoxPlotTooltipPane.this); } + protected AttrTooltip getAttrTooltip() { + return new AttrBoxTooltip(); + } + protected boolean hasTooltipSeriesType() { return false; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java index 867f7ec9e3..e64a134d51 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java @@ -1,12 +1,102 @@ package com.fr.van.chart.box; import com.fr.chart.chartattr.Plot; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.van.chart.column.VanChartColumnSeriesPane; +import com.fr.plugin.chart.box.VanChartBoxPlot; +import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.designer.component.VanChartBeautyPane; +import com.fr.van.chart.designer.component.VanChartMarkerPane; +import com.fr.van.chart.designer.component.border.VanChartBorderPane; +import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; -public class VanChartBoxSeriesPane extends VanChartColumnSeriesPane { +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; + +public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { + + private VanChartMarkerPane normalValuePane; + private VanChartMarkerPane outlierValuePane; public VanChartBoxSeriesPane(ChartStylePane parent, Plot plot) { super(parent, plot); } + + protected JPanel getContentInPlotType() { + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + + double[] columnSize = {f}; + double[] rowSize = {p, p, p}; + + Component[][] components = new Component[][]{ + new Component[]{createBorderPane()}, + new Component[]{createNormalValuePane()}, + new Component[]{createOutlierValuePane()} + }; + + contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + + return contentPane; + } + + protected VanChartBorderPane createDiffBorderPane() { + return new VanChartBorderPane(); + } + + private JPanel createNormalValuePane() { + normalValuePane = new VanChartMarkerPane(); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); + } + + private JPanel createOutlierValuePane() { + outlierValuePane = new VanChartMarkerPane(); + + return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); + } + + private void checkMarkerPane(boolean isDetailed) { + normalValuePane.setVisible(isDetailed); + outlierValuePane.setVisible(isDetailed); + } + + protected void setColorPaneContent(JPanel panel) { + panel.add(createAlphaPane(), BorderLayout.SOUTH); + } + + protected VanChartBeautyPane createStylePane() { + return null; + } + + public void populateBean(Plot plot) { + if (plot == null) { + return; + } + + super.populateBean(plot); + + if (plot instanceof VanChartBoxPlot) { + normalValuePane.populate(((VanChartBoxPlot) plot).getNormalValue()); + outlierValuePane.populate(((VanChartBoxPlot) plot).getOutlierValue()); + + checkMarkerPane(((VanChartBoxPlot) plot).isDetailed()); + } + } + + public void updateBean(Plot plot) { + if (plot == null) { + return; + } + + if (plot instanceof VanChartBoxPlot) { + ((VanChartBoxPlot) plot).setNormalValue(normalValuePane.update()); + ((VanChartBoxPlot) plot).setOutlierValue(outlierValuePane.update()); + } + + super.updateBean(plot); + } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java index b9e60c68e7..53cf8083fe 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxStylePane.java @@ -2,11 +2,11 @@ package com.fr.van.chart.box; import com.fr.design.dialog.BasicPane; import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.van.chart.bar.VanChartBarStylePane; +import com.fr.van.chart.designer.style.VanChartStylePane; import java.util.List; -public class VanChartBoxStylePane extends VanChartBarStylePane { +public class VanChartBoxStylePane extends VanChartStylePane { public VanChartBoxStylePane(AttributeChangeListener listener) { super(listener); diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java index 9fc9988f0a..870250d65c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxTooltipContentPane.java @@ -1,8 +1,12 @@ package com.fr.van.chart.box; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.base.AttrTooltipContent; +import com.fr.plugin.chart.box.attr.AttrBoxTooltipContent; import com.fr.van.chart.designer.component.VanChartTooltipContentPane; import com.fr.van.chart.designer.component.format.CategoryNameFormatPaneWithCheckBox; import com.fr.van.chart.designer.component.format.SeriesNameFormatPaneWithCheckBox; +import com.fr.van.chart.designer.component.format.VanChartFormatPaneWithCheckBox; import com.fr.van.chart.designer.style.VanChartStylePane; import javax.swing.JPanel; @@ -10,6 +14,14 @@ import java.awt.Component; public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { + private VanChartFormatPaneWithCheckBox number; + private VanChartFormatPaneWithCheckBox max; + private VanChartFormatPaneWithCheckBox q3; + private VanChartFormatPaneWithCheckBox median; + private VanChartFormatPaneWithCheckBox q1; + private VanChartFormatPaneWithCheckBox min; + private VanChartFormatPaneWithCheckBox outlier; + public VanChartBoxTooltipContentPane(VanChartStylePane parent, JPanel showOnPane) { super(parent, showOnPane); } @@ -17,12 +29,121 @@ public class VanChartBoxTooltipContentPane extends VanChartTooltipContentPane { protected void initFormatPane(VanChartStylePane parent, JPanel showOnPane) { categoryNameFormatPane = new CategoryNameFormatPaneWithCheckBox(parent, showOnPane); seriesNameFormatPane = new SeriesNameFormatPaneWithCheckBox(parent, showOnPane); + + number = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Number"); + } + }; + max = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Max_Value"); + } + }; + q3 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Q3"); + } + }; + median = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Median"); + } + }; + q1 = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Data_Q1"); + } + }; + min = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Design_Chart_Min_Value"); + } + }; + outlier = new VanChartFormatPaneWithCheckBox(parent, showOnPane) { + protected String getCheckBoxText() { + return Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"); + } + }; + } + + protected double[] getRowSize(double p) { + return new double[]{p, p, p, p, p, p, p, p, p}; } protected Component[][] getPaneComponents() { return new Component[][]{ new Component[]{categoryNameFormatPane, null}, - new Component[]{seriesNameFormatPane, null} + new Component[]{seriesNameFormatPane, null}, + new Component[]{number, null}, + new Component[]{max, null}, + new Component[]{q3, null}, + new Component[]{median, null}, + new Component[]{q1, null}, + new Component[]{min, null}, + new Component[]{outlier, null} }; } + + public boolean isDirty() { + return categoryNameFormatPane.isDirty() + || seriesNameFormatPane.isDirty() + || number.isDirty() + || max.isDirty() + || q3.isDirty() + || median.isDirty() + || q1.isDirty() + || min.isDirty() + || outlier.isDirty(); + } + + public void setDirty(boolean isDirty) { + categoryNameFormatPane.setDirty(isDirty); + seriesNameFormatPane.setDirty(isDirty); + number.setDirty(isDirty); + max.setDirty(isDirty); + q3.setDirty(isDirty); + median.setDirty(isDirty); + q1.setDirty(isDirty); + min.setDirty(isDirty); + outlier.setDirty(isDirty); + } + + protected AttrTooltipContent createAttrTooltip() { + return new AttrBoxTooltipContent(); + } + + protected void populateFormatPane(AttrTooltipContent attrTooltipContent) { + categoryNameFormatPane.populate(attrTooltipContent.getCategoryFormat()); + seriesNameFormatPane.populate(attrTooltipContent.getSeriesFormat()); + + if (attrTooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; + + number.populate(boxTooltipContent.getNumber()); + max.populate(boxTooltipContent.getMax()); + q3.populate(boxTooltipContent.getQ3()); + median.populate(boxTooltipContent.getMedian()); + q1.populate(boxTooltipContent.getQ1()); + min.populate(boxTooltipContent.getMin()); + outlier.populate(boxTooltipContent.getOutlier()); + } + } + + protected void updateFormatPane(AttrTooltipContent attrTooltipContent) { + categoryNameFormatPane.update(attrTooltipContent.getCategoryFormat()); + seriesNameFormatPane.update(attrTooltipContent.getSeriesFormat()); + + if (attrTooltipContent instanceof AttrBoxTooltipContent) { + AttrBoxTooltipContent boxTooltipContent = (AttrBoxTooltipContent) attrTooltipContent; + + number.update(boxTooltipContent.getNumber()); + max.update(boxTooltipContent.getMax()); + q3.update(boxTooltipContent.getQ3()); + median.update(boxTooltipContent.getMedian()); + q1.update(boxTooltipContent.getQ1()); + min.update(boxTooltipContent.getMin()); + outlier.update(boxTooltipContent.getOutlier()); + } + } } From 7db61352ff4bbb50fe3b1b55acb8d685febe52a8 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 23 Jul 2020 18:54:52 +0800 Subject: [PATCH 46/72] =?UTF-8?q?=E7=BB=93=E6=9E=9C=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81=E6=95=B0=E6=8D=AE=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../table/BoxPlotTableDataContentPane.java | 31 ++++------ .../BoxPlotTableResultDataSeriesPane.java | 5 +- .../table/BoxPlotTableSeriesTypeUsePane.java | 5 +- .../data/table/BoxTableDefinitionHelper.java | 59 +++++++++++++++++++ 4 files changed, 76 insertions(+), 24 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxTableDefinitionHelper.java diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index 6ea7e126e4..c17b39bf00 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -12,8 +12,6 @@ import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.plugin.chart.box.data.VanBoxTableDefinition; -import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper; -import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition; import javax.swing.BorderFactory; import javax.swing.JPanel; @@ -31,6 +29,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { private BoxPlotTableSeriesTypeUsePane seriesTypeComboxPane; private BoxPlotTableResultDataSeriesPane resultDataSeriesPane; + private JPanel filterPane; private ChartDataFilterPane dataScreeningPane; private ChartDataPane parent; @@ -88,10 +87,10 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { dataScreeningPane = new ChartDataFilterPane(initplot, parent, false); dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 10, 15)); - JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + filterPane = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); + filterPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); - return panel; + return filterPane; } private void initDataTypeListener() { @@ -109,6 +108,10 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { if (resultDataSeriesPane != null) { resultDataSeriesPane.setVisible(dataType.getSelectedIndex() == 1); } + + if (filterPane != null) { + filterPane.setVisible(dataType.getSelectedIndex() == 0); + } } public void checkBoxUse(boolean hasUse) { @@ -144,7 +147,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { public void updateBean(ChartCollection collection) { checkChartCollection(collection); - VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(collection); + VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); if (table != null) { table.setDetailed(dataType.getSelectedIndex() == 0); @@ -164,7 +167,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { checkChartCollection(collection); if (dataType != null) { - dataType.setSelectedIndex(VanBoxTableDefinitionHelper.isDetailedTableDataType(collection) ? 0 : 1); + dataType.setSelectedIndex(BoxTableDefinitionHelper.isDetailedTableDataType(collection) ? 0 : 1); } if (seriesTypeComboxPane != null) { seriesTypeComboxPane.populateBean(collection); @@ -180,7 +183,7 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { } private void checkChartCollection(ChartCollection collection) { - VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(collection); + VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); if (table == null) { collection.getSelectedChart().setFilterDefinition(new VanBoxTableDefinition()); @@ -188,26 +191,18 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { } private void populateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) { - NormalTableDataDefinition detailedDefinition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection); - VanBoxTableResultDefinition resultDefinition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection); + NormalTableDataDefinition detailedDefinition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection); if (detailedDefinition != null) { dataScreeningPane.populateDefinition(detailedDefinition, false); - } else if (resultDefinition != null) { - dataScreeningPane.populateDefinition(resultDefinition, false); } } private void updateDataScreeningPane(ChartDataFilterPane dataScreeningPane, ChartCollection collection) { - NormalTableDataDefinition detailedDefinition = VanBoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection); - VanBoxTableResultDefinition resultDefinition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection); + NormalTableDataDefinition detailedDefinition = BoxTableDefinitionHelper.getBoxTableDetailedDefinition(collection); if (detailedDefinition != null) { dataScreeningPane.updateDefinition(detailedDefinition); } - - if (resultDefinition != null) { - dataScreeningPane.updateDefinition(resultDefinition); - } } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java index 04dd3cda96..ff5391d111 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableResultDataSeriesPane.java @@ -8,7 +8,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.plugin.chart.box.data.VanBoxTableDefinition; -import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper; import com.fr.plugin.chart.box.data.VanBoxTableResultDefinition; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -120,7 +119,7 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa public void populateBean(ChartCollection collection) { super.populateBean(collection); - VanBoxTableResultDefinition definition = VanBoxTableDefinitionHelper.getBoxTableResultDefinition(collection); + VanBoxTableResultDefinition definition = BoxTableDefinitionHelper.getBoxTableResultDefinition(collection); if (definition == null) { return; @@ -136,7 +135,7 @@ public class BoxPlotTableResultDataSeriesPane extends AbstractTableDataContentPa } public void updateBean(ChartCollection collection) { - VanBoxTableDefinition table = VanBoxTableDefinitionHelper.getBoxTableDefinition(collection); + VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); VanBoxTableResultDefinition definition = new VanBoxTableResultDefinition(); diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java index 1fd9186b18..ea85335773 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableSeriesTypeUsePane.java @@ -18,7 +18,6 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.general.ComparatorUtils; import com.fr.plugin.chart.box.data.VanBoxTableDefinition; -import com.fr.plugin.chart.box.data.VanBoxTableDefinitionHelper; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -168,7 +167,7 @@ public class BoxPlotTableSeriesTypeUsePane extends UIComboBoxPane Date: Fri, 24 Jul 2020 09:50:28 +0800 Subject: [PATCH 47/72] =?UTF-8?q?REPORT-35906=20=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E7=BC=96=E8=BE=91=E7=9A=84=E7=95=8C=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E5=9C=A8=E6=B7=BB=E5=8A=A0=E8=A1=8C=E6=95=B0=E6=88=96=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A1=8C=E6=95=B0=E5=90=8E=EF=BC=8C=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=B8=AD=E4=BC=9A=E5=81=9A=E4=B8=80=E9=83=A8=E5=88=86=E9=87=8D?= =?UTF-8?q?=E5=A4=8D=E6=B7=BB=E5=8A=A0=EF=BC=8C=E6=A0=B9=E6=8D=AE=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E9=A1=BA=E5=BA=8F=E7=89=B9=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E5=88=A0=E5=8E=BB=E5=A4=9A=E4=BD=99=E7=9A=84Component=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../tabledata/tabledatapane/MaxMemRowCountPanel.java | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index 3118ed8a99..84c06b0b5e 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - implementation 'com.fr.third:jxbrowser-swing:6.23' + //implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 00bbcc995b..fbab521b06 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -1,6 +1,6 @@ package com.fr.design.data.tabledata.tabledatapane; -import java.awt.Dimension; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.i18n.Toolkit; public class MaxMemRowCountPanel extends UIToolbar { @@ -88,7 +89,11 @@ public class MaxMemRowCountPanel extends UIToolbar { switchCache.setSelectedIndex(MAX_IN_MEMORY); this.add(new UILabel(" ")); this.add(numberSpinner); - this.add(new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"))); + this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); + if (this.getComponentCount() > 4) { + this.remove(1); + this.remove(1); + } this.validate(); this.repaint(); } From dbcdf851828b67dfa580affe0622372db11539e0 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Fri, 24 Jul 2020 14:44:26 +0800 Subject: [PATCH 48/72] =?UTF-8?q?=E7=B3=BB=E5=88=97=E6=A0=87=E8=AE=B0?= =?UTF-8?q?=E7=82=B9=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/van/chart/box/VanChartBoxSeriesPane.java | 13 +++++++++---- .../box/data/table/BoxPlotTableDataContentPane.java | 6 +++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java index e64a134d51..617d3e5e73 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/VanChartBoxSeriesPane.java @@ -18,6 +18,9 @@ import java.awt.Component; public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { + private JPanel normalMarker; + private JPanel outlierMarker; + private VanChartMarkerPane normalValuePane; private VanChartMarkerPane outlierValuePane; @@ -49,19 +52,21 @@ public class VanChartBoxSeriesPane extends VanChartAbstractPlotSeriesPane { private JPanel createNormalValuePane() { normalValuePane = new VanChartMarkerPane(); + normalMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Normal_Value"), normalValuePane); + return normalMarker; } private JPanel createOutlierValuePane() { outlierValuePane = new VanChartMarkerPane(); + outlierMarker = TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); - return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Engine_Chart_Outlier_Value"), outlierValuePane); + return outlierMarker; } private void checkMarkerPane(boolean isDetailed) { - normalValuePane.setVisible(isDetailed); - outlierValuePane.setVisible(isDetailed); + normalMarker.setVisible(isDetailed); + outlierMarker.setVisible(isDetailed); } protected void setColorPaneContent(JPanel panel) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java index c17b39bf00..bb17a6f2cd 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/box/data/table/BoxPlotTableDataContentPane.java @@ -11,6 +11,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.plugin.chart.box.VanChartBoxPlot; import com.fr.plugin.chart.box.data.VanBoxTableDefinition; import javax.swing.BorderFactory; @@ -150,7 +151,10 @@ public class BoxPlotTableDataContentPane extends AbstractTableDataContentPane { VanBoxTableDefinition table = BoxTableDefinitionHelper.getBoxTableDefinition(collection); if (table != null) { - table.setDetailed(dataType.getSelectedIndex() == 0); + boolean isDetailed = dataType.getSelectedIndex() == 0; + + table.setDetailed(isDetailed); + ((VanChartBoxPlot) initplot).setDetailed(isDetailed); } if (seriesTypeComboxPane != null) { seriesTypeComboxPane.updateBean(collection); From 604f611bda68d8b8df593079a89fc42bdcf907d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Fri, 24 Jul 2020 14:46:26 +0800 Subject: [PATCH 49/72] =?UTF-8?q?CHART-14801=20=E9=9D=A2=E6=9D=BF=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CategoryPlotMoreCateReportDataContentPane.java | 9 ++++----- .../report/CategoryPlotReportDataContentPane.java | 11 +++++------ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java index fd8e08d87f..d4e1f64e77 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java @@ -13,21 +13,20 @@ import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; - import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.BorderFactory; import javax.swing.BoxLayout; import javax.swing.JPanel; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Color; 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; /** @@ -72,14 +71,14 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor catePane.add(boxPane, BorderLayout.SOUTH); - catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,6)); + catePane.setBorder(BorderFactory.createEmptyBorder(0,24,10,20)); this.add(catePane, "0,0,2,0"); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); panel.setBorder(getSidesBorder()); filterPane.setBorder(getFilterPaneBorder()); - this.add(panel, "0,6,2,4"); + this.add(panel, "0,6,1,4"); addButton.addActionListener(new ActionListener() { @Override diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java index 298ee49370..68e5881c00 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotReportDataContentPane.java @@ -10,7 +10,6 @@ import com.fr.design.formula.TinyFormulaPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane; - import com.fr.stable.StringUtils; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -18,9 +17,9 @@ import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; +import java.util.List; import java.awt.BorderLayout; import java.awt.Dimension; -import java.util.List; public class CategoryPlotReportDataContentPane extends AbstractReportDataContentPane { protected static final int PRE_WIDTH = 210; @@ -35,14 +34,14 @@ public class CategoryPlotReportDataContentPane extends AbstractReportDataContent public CategoryPlotReportDataContentPane(ChartDataPane parent) { initEveryPane(); categoryName = initCategoryBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Name")); - categoryName.setPreferredSize(new Dimension(246,30)); - categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,7)); - this.add(categoryName, "0,0,2,0"); + categoryName.setPreferredSize(new Dimension(236,30)); + categoryName.setBorder(BorderFactory.createEmptyBorder(0,24,0,20)); + this.add(categoryName, "0,0,1,0"); filterPane = new ChartDataFilterPane(new Bar2DPlot(), parent); JPanel panel = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"),filterPane); panel.setBorder(getSidesBorder()); filterPane.setBorder(getFilterPaneBorder()); - this.add(panel, "0,6,2,4"); } + this.add(panel, "0,6,1,4"); } protected TinyFormulaPane initCategoryBox(final String leftLabel) { TinyFormulaPane categoryName = new TinyFormulaPane() { From 0a80bfb61fbeb03598bb998fab667c630b57b546 Mon Sep 17 00:00:00 2001 From: Yvan Date: Fri, 24 Jul 2020 17:00:28 +0800 Subject: [PATCH 50/72] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../tabledata/tabledatapane/MaxMemRowCountPanel.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 84c06b0b5e..3118ed8a99 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - //implementation 'com.fr.third:jxbrowser-swing:6.23' + implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index fbab521b06..3f5902d8a4 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -1,6 +1,7 @@ package com.fr.design.data.tabledata.tabledatapane; -import java.awt.*; + +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -87,13 +88,12 @@ public class MaxMemRowCountPanel extends UIToolbar { this.removeAll(); this.add(switchCache); switchCache.setSelectedIndex(MAX_IN_MEMORY); + if (this.getComponentCount() == 4) { + return; + } this.add(new UILabel(" ")); this.add(numberSpinner); this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); - if (this.getComponentCount() > 4) { - this.remove(1); - this.remove(1); - } this.validate(); this.repaint(); } From 80554b04ffb68cc30392a0ba19dfa870e961b704 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 10:43:05 +0800 Subject: [PATCH 51/72] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index 3f5902d8a4..bb8f3128ba 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -21,7 +21,7 @@ public class MaxMemRowCountPanel extends UIToolbar { private static final String[] CACHE_LIST = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Save_All_Records_In_Memory"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Max_Mem_Row_Count") }; private static final int MAX_WIDTH = getMaxComBoBoxWidth() > 200 ? 350 : 250; - + private static final int MAX_COMPONENT_COUNT_OF_MAX_MEMORY = 4; private static int getMaxComBoBoxWidth() { int maxWidth = GraphHelper.getWidth(CACHE_LIST[0]); for (int i = 1; i < CACHE_LIST.length; i++) { @@ -88,7 +88,8 @@ public class MaxMemRowCountPanel extends UIToolbar { this.removeAll(); this.add(switchCache); switchCache.setSelectedIndex(MAX_IN_MEMORY); - if (this.getComponentCount() == 4) { + if (this.getComponentCount() == MAX_COMPONENT_COUNT_OF_MAX_MEMORY) { + //此处因为switchCache的setSelectedIndex可能会造成双层调用,然后因为重复添加组件产生bug,故而定义这个工具栏的正常最大组件数,做个判断 return; } this.add(new UILabel(" ")); From 46b4d5e81d6d325cbb3f377803df473e757bef4b Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 11:16:35 +0800 Subject: [PATCH 52/72] =?UTF-8?q?Merge=20branch=20'release/10.0'=20of=20ht?= =?UTF-8?q?tps://code.fineres.com/scm/~yvan/design=20into=20release/10.0?= =?UTF-8?q?=20#=20=E8=AF=B7=E8=BE=93=E5=85=A5=E4=B8=80=E4=B8=AA=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BB=A5=E8=A7=A3=E9=87=8A=E6=AD=A4?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E7=9A=84=E5=BF=85=E8=A6=81=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E5=B0=A4=E5=85=B6=E6=98=AF=E5=B0=86=E4=B8=80=E4=B8=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=90=8E=E7=9A=84=E4=B8=8A=E6=B8=B8=E5=88=86=E6=94=AF?= =?UTF-8?q?=20#=20=E5=90=88=E5=B9=B6=E5=88=B0=E4=B8=BB=E9=A2=98=E5=88=86?= =?UTF-8?q?=E6=94=AF=E3=80=82=20#=20#=20=E4=BB=A5=20'#'=20=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E7=9A=84=E8=A1=8C=E5=B0=86=E8=A2=AB=E5=BF=BD=E7=95=A5?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E7=A9=BA=E7=9A=84=E6=8F=90=E4=BA=A4=E8=AF=B4?= =?UTF-8?q?=E6=98=8E=E5=B0=86=E7=BB=88=E6=AD=A2=E6=8F=90=E4=BA=A4=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/tabledata/tabledatapane/MaxMemRowCountPanel.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java index bb8f3128ba..d43e6bdee4 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/MaxMemRowCountPanel.java @@ -13,6 +13,7 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.i18n.Toolkit; +import com.fr.stable.StringUtils; public class MaxMemRowCountPanel extends UIToolbar { @@ -92,9 +93,9 @@ public class MaxMemRowCountPanel extends UIToolbar { //此处因为switchCache的setSelectedIndex可能会造成双层调用,然后因为重复添加组件产生bug,故而定义这个工具栏的正常最大组件数,做个判断 return; } - this.add(new UILabel(" ")); + this.add(new UILabel(StringUtils.BLANK)); this.add(numberSpinner); - this.add(new UILabel(" " + Toolkit.i18nText("Fine-Design_Basic_Row"))); + this.add(new UILabel(StringUtils.BLANK + Toolkit.i18nText("Fine-Design_Basic_Row"))); this.validate(); this.repaint(); } From 46b31cea09de2cc64fa80034fae38bf9f3b205b7 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 27 Jul 2020 14:38:42 +0800 Subject: [PATCH 53/72] CHART-14813 dierta time --- .../main/java/com/fr/extended/chart/ExtendedOtherPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java index 6fba552b76..74bc01282b 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java @@ -109,7 +109,7 @@ public class ExtendedOtherPane extends AbstractChartAtt } }); - autoRefreshTime = new UISpinner(0, Integer.MAX_VALUE, 1, 0); + autoRefreshTime = createIntervalTime(); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {p, f, 20}; @@ -129,6 +129,10 @@ public class ExtendedOtherPane extends AbstractChartAtt return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Refresh"), gapPane); } + protected UISpinner createIntervalTime() { + return new UISpinner(1, Integer.MAX_VALUE, 5, 60); + } + private JPanel createHyperlinkPane() { hyperLinkPane = new ExtendedChartHyperLinkPane(); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_M_Insert_Hyperlink"), hyperLinkPane); From 0b4d28c4c22971e956e37de33f86a680c1316bf2 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 14:49:36 +0800 Subject: [PATCH 54/72] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E6=92=A4=E9=94=80=E4=BC=9A=E5=87=BA=E7=8E=B0=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84=E6=A1=86=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index 449ffc0744..b68833f83f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -783,6 +783,7 @@ public class JWorkBook extends JTemplate { private void applyAll(WorkBookUndoState u) { if (hasParameterPane()) { parameterPane.populate(u.getApplyTarget()); + setAutoHeightForCenterPane(); DesignModuleFactory.getFormHierarchyPane().refreshRoot(); } //报表主体 From c3ce3949aaf88a55e6ca12b77970919ca4aefe96 Mon Sep 17 00:00:00 2001 From: Yvan Date: Mon, 27 Jul 2020 15:01:23 +0800 Subject: [PATCH 55/72] =?UTF-8?q?1.=E5=8E=9F=E6=9C=AC=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97=E9=87=8C=EF=BC=8CWARN=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AF=B9=E5=BA=94=E4=B8=A5=E9=87=8D=EF=BC=8CERROR?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E5=AF=B9=E5=BA=94=E8=AD=A6=E5=91=8A=202.?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=EF=BC=8CERROR=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E4=B8=A5=E9=87=8D=EF=BC=8CWARN=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E5=AF=B9=E5=BA=94=E8=AD=A6=E5=91=8A=EF=BC=8C=E5=B9=B6?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E7=9A=84=E4=BF=AE=E6=94=B9=E5=85=B6=E9=85=8D?= =?UTF-8?q?=E8=89=B2=E5=92=8C=E8=AE=A1=E6=95=B0=203.=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E5=B8=B8=E9=87=8F=EF=BC=8C=E4=BD=BF=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=9B=B4=E7=AC=A6=E5=90=88=E5=B8=86=E8=BD=AF=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../loghandler/DesignerLogHandler.java | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java index b935eb11ea..1d67c47df1 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/loghandler/DesignerLogHandler.java @@ -8,6 +8,7 @@ import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.general.log.Log4jConfig; import com.fr.log.FineLoggerFactory; +import com.fr.stable.StringUtils; import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.spi.LoggingEvent; import com.fr.third.apache.log4j.spi.ThrowableInformation; @@ -53,12 +54,14 @@ public class DesignerLogHandler { private static final int SERVER_GAP_Y = -20; - private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; + private static final String ERROR_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; - private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Seriously") + ":"; + private static final String WARN_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Alert") + ":"; private static final String NORMAL_MARK = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Normal") + ":"; + private static final String ACTION_MAP_KEY = "clear"; + public static DesignerLogHandler getInstance() { return HOLDER.singleton; @@ -223,14 +226,14 @@ public class DesignerLogHandler { InputMap inputMap = resultPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, DEFAULT_MODIFIER), DefaultEditorKit.copyAction); inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_A, DEFAULT_MODIFIER), DefaultEditorKit.selectAllAction); - inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), "clear"); + inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_L, DEFAULT_MODIFIER), ACTION_MAP_KEY); ActionMap actionMap = resultPane.getActionMap(); - actionMap.put("clear", new AbstractAction() { + actionMap.put(ACTION_MAP_KEY, new AbstractAction() { @Override public void actionPerformed(ActionEvent evt) { - resultPane.setText(""); + resultPane.setText(StringUtils.EMPTY); caption.clearMessage(); } }); @@ -293,10 +296,10 @@ public class DesignerLogHandler { SimpleAttributeSet attrSet = new SimpleAttributeSet(); if (style == DesignerLogger.ERROR_INT) { - StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); + StyleConstants.setForeground(attrSet, Color.RED); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.WARN_INT) { - StyleConstants.setForeground(attrSet, Color.red); + StyleConstants.setForeground(attrSet, new Color(247, 148, 29)); StyleConstants.setBold(attrSet, true); } else if (style == DesignerLogger.INFO_INT) { StyleConstants.setForeground(attrSet, Color.black); @@ -330,9 +333,9 @@ public class DesignerLogHandler { LogMessageBar.getInstance().setMessage(message); if (level == DesignerLogger.INFO_INT && showInfo.isSelected()) { caption.infoAdd(); - } else if (level == DesignerLogger.ERROR_INT && showError.isSelected()) { + } else if (level == DesignerLogger.WARN_INT && showError.isSelected()) { caption.errorAdd(); - } else if (level == DesignerLogger.WARN_INT && showServer.isSelected()) { + } else if (level == DesignerLogger.ERROR_INT && showServer.isSelected()) { caption.serverAdd(); } } @@ -343,7 +346,7 @@ public class DesignerLogHandler { this.copy.setEnabled(true); this.clear.setEnabled(true); - if (ComparatorUtils.equals(this.jTextArea.getText(), "")) { + if (ComparatorUtils.equals(this.jTextArea.getText(), StringUtils.EMPTY)) { this.selectAll.setEnabled(false); this.clear.setEnabled(false); } @@ -367,7 +370,7 @@ public class DesignerLogHandler { } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.copy.getText())) { LogHandlerArea.this.jTextArea.copy(); } else if (ComparatorUtils.equals(evt.getActionCommand(), LogHandlerArea.this.clear.getText())) { - LogHandlerArea.this.jTextArea.setText(""); + LogHandlerArea.this.jTextArea.setText(StringUtils.EMPTY); caption.clearMessage(); } } From 975f4c6a3addac55a34eae4359e805c91930994e Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 19:53:57 +0800 Subject: [PATCH 56/72] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 +++++ .../fr/start/server/FineEmbedServerMonitor.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f73..6d10b48e56 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,9 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + this.text.setFont(font); + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 0783721832..6bab19fded 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,7 +7,11 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import javax.swing.plaf.ColorUIResource; +import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -86,8 +90,14 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + //如果为韩文则改变字体 + if (GeneralContext.getLocale().equals(Locale.KOREA)) { + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); + } else { + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); + } } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 4644b3d208f2b2739943a12327b042617f7e1867 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Mon, 27 Jul 2020 19:57:42 +0800 Subject: [PATCH 57/72] =?UTF-8?q?REPORT-35568=20=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=EF=BC=8C=E6=B7=BB=E5=8A=A0=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=EF=BC=8C=E6=92=A4=E9=94=80=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E5=87=BA=E7=8E=B0=E4=B8=80=E4=B8=AA=E8=93=9D=E8=89=B2=E7=9A=84?= =?UTF-8?q?=E6=A1=86=E7=BA=BF=20=20=E6=92=A4=E5=9B=9E=E5=8F=A6=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E4=BB=BB=E5=8A=A1=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 ----- .../fr/start/server/FineEmbedServerMonitor.java | 14 ++------------ 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 6d10b48e56..e416083f73 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,9 +96,4 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } - - public void updateLoadingText(String text, FRFont font) { - this.text.setFont(font); - this.text.setText(text); - } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 6bab19fded..0783721832 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,11 +7,7 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; -import com.fr.general.FRFont; -import com.fr.general.GeneralContext; -import javax.swing.plaf.ColorUIResource; -import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -90,14 +86,8 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); - //如果为韩文则改变字体 - if (GeneralContext.getLocale().equals(Locale.KOREA)) { - FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); - } else { - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); - } + DesignerContext.getDesignerFrame().getProgressDialog() + .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 4ef4c4879589597d802cff088662de3376bf20ed Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Tue, 28 Jul 2020 10:04:32 +0800 Subject: [PATCH 58/72] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/iprogressbar/ProgressDialog.java | 5 +++++ .../fr/start/server/FineEmbedServerMonitor.java | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index e416083f73..6d10b48e56 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -96,4 +96,9 @@ public class ProgressDialog extends UIDialog { public void updateLoadingText(String text) { this.text.setText(text); } + + public void updateLoadingText(String text, FRFont font) { + this.text.setFont(font); + this.text.setText(text); + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 0783721832..6bab19fded 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -7,7 +7,11 @@ import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; +import com.fr.general.FRFont; +import com.fr.general.GeneralContext; +import javax.swing.plaf.ColorUIResource; +import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -86,8 +90,14 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - DesignerContext.getDesignerFrame().getProgressDialog() - .updateLoadingText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server")); + String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + //如果为韩文则改变字体 + if (GeneralContext.getLocale().equals(Locale.KOREA)) { + FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); + } else { + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); + } } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 60e2a8b2bf8b94fa1e61db4a37a7e926c4d73dba Mon Sep 17 00:00:00 2001 From: Yvan Date: Tue, 28 Jul 2020 11:42:35 +0800 Subject: [PATCH 59/72] =?UTF-8?q?REPORT-31992=20=E6=97=A5=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=201.=E9=80=9A=E8=BF=87=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEborder=E6=95=B0=E6=8D=AE=EF=BC=8C=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E9=97=B4=E8=B7=9D=EF=BC=8C=E4=BD=BF=E5=BE=97?= =?UTF-8?q?=E8=A2=AB=E6=8C=A4=E5=87=BA=E7=95=8C=E9=9D=A2=E7=9A=84=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E6=A1=86=E6=AD=A3=E5=B8=B8=E6=98=BE=E7=A4=BA=202.?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BA=86=E6=AF=8F=E7=A7=8D=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E4=B8=8B=E7=9A=84bug=E6=89=80=E5=9C=A8=E7=9A=84=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=EF=BC=8C=E5=8F=91=E7=8E=B0=E6=94=B9=E5=8A=A8=E5=B9=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=BC=95=E8=B5=B7=E5=85=B6=E5=AE=83=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/hyperlink/ReportletHyperNorthPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 43710cd0f2..8355d4f97f 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 @@ -395,7 +395,7 @@ public class ReportletHyperNorthPane extends AbstractHyperNorthPane Date: Tue, 28 Jul 2020 11:50:15 +0800 Subject: [PATCH 60/72] =?UTF-8?q?REPORT-31758=20=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E8=AE=BE=E8=AE=A1=E9=9D=A2=E6=9D=BF=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=BF=9B=E8=A1=8C=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JFormSliderPane.java | 332 +++++------------- .../layout/FRBorderLayoutAdapter.java | 15 +- .../fr/design/designer/creator/XButton.java | 23 +- .../fr/design/designer/creator/XCreator.java | 9 + .../fr/design/designer/creator/XLabel.java | 6 +- .../designer/creator/XWAbsoluteLayout.java | 16 + .../designer/creator/XWBorderLayout.java | 56 ++- .../design/designer/creator/XWFitLayout.java | 86 +++-- .../creator/cardlayout/XCardSwitchButton.java | 6 +- .../creator/cardlayout/XWCardTagLayout.java | 2 - .../creator/cardlayout/XWTabFitLayout.java | 83 ++--- .../com/fr/design/mainframe/FormArea.java | 155 ++++---- .../com/fr/design/mainframe/FormDesigner.java | 6 +- .../fr/design/mainframe/FormSelection.java | 9 +- .../component/WidgetAbsoluteBoundPane.java | 14 +- .../designer/component/WidgetBoundPane.java | 29 +- .../component/WidgetCardTagBoundPane.java | 24 +- 17 files changed, 394 insertions(+), 477 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index 1552d1b658..c47267897f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -1,45 +1,27 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; -import com.fr.design.constants.LayoutConstants; import com.fr.design.gui.ibutton.UIButton; -import com.fr.design.gui.ibutton.UIRadioButton; -import com.fr.design.gui.ibutton.UISliderButton; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.islider.UISlider; -import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.utils.gui.GUICoreUtils; - - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.JFormattedTextField; import javax.swing.JFrame; import javax.swing.JPanel; -import javax.swing.JPopupMenu; -import javax.swing.JRadioButton; -import javax.swing.JSeparator; -import javax.swing.JSpinner; -import javax.swing.SpinnerNumberModel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import javax.swing.text.DefaultFormatterFactory; -import javax.swing.text.NumberFormatter; +import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.PlainDocument; import java.awt.BorderLayout; import java.awt.Color; -import java.awt.Component; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.FlowLayout; -import java.awt.Font; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; import java.awt.event.MouseEvent; import java.math.BigDecimal; @@ -51,72 +33,37 @@ public class JFormSliderPane extends JPanel { private static final double ONEPOINTEIGHT = 1.8; private static final int SIX = 6; private static final int TEN = 10; - private static final int ONE_EIGHT = 18; - private static final int FONT_SIZE = 12; - private static final int SPINNER_WIDTH = 45; - private static final int SPINNER_HEIGHT = 20; private static final int HALF_HUNDRED = 50; private static final int HUNDRED = 100; private static final int TWO_HUNDRED = 200; - private static final int THREE_HUNDRED = 300; private static final int FOUR_HUNDRED = 400; - private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 172; - private static final int SLIDER_WIDTH = 220; - private static final int SLIDER_HEIGHT = 20; private static final int SHOWVALBUTTON_WIDTH = 40; private static final int SHOWVALBUTTON_HEIGHTH = 20; - private static final int SLIDER_GAP = 5; + private static final String SUFFIX = "%"; + private static final String REGEX = "[\\d%]*"; private static final int TOOLTIP_Y = 30; private static final Color BACK_COLOR = new Color(245, 245, 247); public int showValue = 100; - public double resolutionTimes = 1.0; - private UITextField showVal; - private JSpinner showValSpinner; + private UITextField showValField; private UISlider slider; private int times; private int sliderValue; private UIButton downButton; private UIButton upButton; - private UISliderButton showValButton; - private UIRadioButton twoHundredButton; - private UIRadioButton oneHundredButton; - private UIRadioButton sevenFiveButton; - private UIRadioButton fiveTenButton; - private UIRadioButton twoFiveButton; - private UIRadioButton selfAdaptButton; - private UIRadioButton customButton; //拖动条处理和button、直接输入不一样 private boolean isButtonOrIsTxt = true; - //是否选中指定的几个缩放等级,避免触发不必要的事件 - private boolean selectSpecified = false; - private FormPopupPane dialog; - private int upButtonX; - private JPanel dialogContentPanel; public JFormSliderPane() { this.setLayout(new BorderLayout()); initSlider(); - initShowValSpinner(); - //MoMeak:控制只能输入10-400 - JSpinner.NumberEditor editor = new JSpinner.NumberEditor(showValSpinner, "0"); - showValSpinner.setEditor(editor); - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.setEditable(true); - DefaultFormatterFactory factory = (DefaultFormatterFactory) textField.getFormatterFactory(); - NumberFormatter formatter = (NumberFormatter) factory.getDefaultFormatter(); - formatter.setAllowsInvalid(false); - initDownUpButton(); - initShowValButton(); - initUIRadioButton(); - initPane(); + initShowValField(); JPanel panel = new JPanel(new FlowLayout(FlowLayout.CENTER, 0, 0)); panel.add(downButton); panel.add(slider); panel.add(upButton); - panel.add(showValButton); + panel.add(showValField); panel.setBackground(BACK_COLOR); this.add(panel, BorderLayout.NORTH); } @@ -131,6 +78,7 @@ public class JFormSliderPane extends JPanel { return new Point(event.getX(), event.getY() - TOOLTIP_Y); } }; + slider.setValue(HALF_HUNDRED); slider.setUI(new JSliderPaneUI(slider)); slider.addChangeListener(listener); slider.setPreferredSize(new Dimension(220, 20)); @@ -139,16 +87,6 @@ public class JFormSliderPane extends JPanel { slider.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Slider")); } - private void initShowValSpinner() { - showValSpinner = new UIBasicSpinner(new SpinnerNumberModel(HUNDRED, 0, FOUR_HUNDRED, 1)) { - public Point getToolTipLocation(MouseEvent event) { - return new Point(event.getX(), event.getY() - TOOLTIP_Y); - } - }; - showValSpinner.setEnabled(true); - showValSpinner.addChangeListener(showValSpinnerChangeListener); - showValSpinner.setPreferredSize(new Dimension(SPINNER_WIDTH, SPINNER_HEIGHT)); - } private void initDownUpButton() { downButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/data/source/normalDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png"), BaseUtils.readIcon("com/fr/design/images/data/source/hoverDown20.png")) { @@ -173,128 +111,73 @@ public class JFormSliderPane extends JPanel { upButton.addActionListener(buttonActionListener); } - private void initShowValButton() { - showValButton = new UISliderButton(showValSpinner.getValue() + "%"); - showValButton.setBackground(BACK_COLOR); - showValButton.setBorderPainted(false); - showValButton.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); - showValButton.addActionListener(showValButtonActionListener); - showValButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Grade")); - } + private void initShowValField() { + showValField = new UITextField(showValue + SUFFIX); + showValField.setBorderPainted(false); + showValField.setPreferredSize(new Dimension(SHOWVALBUTTON_WIDTH, SHOWVALBUTTON_HEIGHTH)); + showValField.addKeyListener(new KeyListener() { + @Override + public void keyTyped(KeyEvent e) { + + } + + @Override + public void keyPressed(KeyEvent e) { + + } - private void initUIRadioButton() { - twoHundredButton = new UIRadioButton("200%"); - oneHundredButton = new UIRadioButton("100%"); - sevenFiveButton = new UIRadioButton("75%"); - fiveTenButton = new UIRadioButton("50%"); - twoFiveButton = new UIRadioButton("25%"); - selfAdaptButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Self_Adapt_Button")); - selfAdaptButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - customButton = new UIRadioButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_Custom_Button")); - customButton.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - twoHundredButton.addItemListener(radioButtonItemListener); - oneHundredButton.addItemListener(radioButtonItemListener); - sevenFiveButton.addItemListener(radioButtonItemListener); - fiveTenButton.addItemListener(radioButtonItemListener); - twoFiveButton.addItemListener(radioButtonItemListener); - customButton.addItemListener(new ItemListener() { @Override - public void itemStateChanged(ItemEvent e) { - JRadioButton temp = (JRadioButton) e.getSource(); - if (temp.isSelected()) { - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.requestFocus(); - textField.selectAll(); + public void keyReleased(KeyEvent evt) { + int code = evt.getKeyCode(); + + if (code == KeyEvent.VK_ENTER) { + showValue = parseInputValue(); + showValField.setText(showValue + SUFFIX); + showValFieldChange(); + } + } + }); + showValField.setDocument(new PlainDocument() { + @Override + public void insertString(int offset, String s, AttributeSet a) throws BadLocationException { + if (!s.matches(REGEX)) { + return; } + super.insertString(offset, s, a); } }); - ButtonGroup bg = new ButtonGroup();// 初始化按钮组 - bg.add(twoHundredButton);// 加入按钮组 - bg.add(oneHundredButton); - bg.add(sevenFiveButton); - bg.add(fiveTenButton); - bg.add(twoFiveButton); - bg.add(selfAdaptButton); - bg.add(customButton); - customButton.setSelected(true); } - private void initPane() { - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p, p, p, p, p, p, p, p}; - UILabel upLabel = new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Scale_EnlargeOrReduce")); - upLabel.setOpaque(false); - JPanel septPane = new JPanel(new BorderLayout()); - JSeparator sept = new JSeparator(); - sept.setBackground(new Color(232, 232, 233)); - septPane.add(sept, BorderLayout.NORTH); - septPane.setBorder(BorderFactory.createEmptyBorder(2, 5, 1, 10)); - septPane.setBackground(BACK_COLOR); - twoHundredButton.setBackground(BACK_COLOR); - oneHundredButton.setBackground(BACK_COLOR); - sevenFiveButton.setBackground(BACK_COLOR); - fiveTenButton.setBackground(BACK_COLOR); - twoFiveButton.setBackground(BACK_COLOR); -// selfAdaptButton.setBackground(BACK_COLOR); - customButton.setBackground(BACK_COLOR); - Component[][] components = new Component[][]{ - new Component[]{upLabel, null}, - new Component[]{septPane, null}, - new Component[]{twoHundredButton, null}, - new Component[]{oneHundredButton, null}, - new Component[]{sevenFiveButton, null}, - new Component[]{fiveTenButton, null}, - new Component[]{twoFiveButton, null}, - new Component[]{customButton, createSpinnerPanel()} - }; - dialogContentPanel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, LayoutConstants.VGAP_MEDIUM, 0); - dialogContentPanel.setBackground(BACK_COLOR); - dialogContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); + private void showValFieldChange() { + isButtonOrIsTxt = true; + if (showValue > FOUR_HUNDRED) { + showValue = FOUR_HUNDRED; + } + if (showValue < TEN) { + showValue = TEN; + } + refreshShowValueFieldText(); + refreshSlider(); } - private JPanel createSpinnerPanel() { - JPanel spinnerPanel = new JPanel(new FlowLayout()); - spinnerPanel.add(showValSpinner); - UILabel percent = new UILabel("%"); - percent.setFont(new Font("SimSun", Font.PLAIN, FONT_SIZE)); - spinnerPanel.add(percent); - spinnerPanel.setBackground(BACK_COLOR); - return spinnerPanel; + private void refreshShowValueFieldText(){ + showValField.setText(showValue + SUFFIX); } - private ActionListener showValButtonActionListener = new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - popupDialog(); + private int parseInputValue(){ + String text = showValField.getText(); + if (text.endsWith(SUFFIX)){ + text = text.substring(0, text.length() -1); } - }; - - private ChangeListener showValSpinnerChangeListener = new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - int val = (int) ((UIBasicSpinner) e.getSource()).getValue(); - isButtonOrIsTxt = true; - resolutionTimes = divide(showValue, 100, 2); - if (val > FOUR_HUNDRED) { - showValSpinner.setValue(FOUR_HUNDRED); - val = FOUR_HUNDRED; - } - if (val < TEN) { - showValSpinner.setValue(TEN); - val = TEN; - } - refreshSlider(val); - refreshBottun(val); - JFormattedTextField textField = ((JSpinner.NumberEditor) showValSpinner.getEditor()).getTextField(); - textField.setCaretPosition(showValSpinner.getValue().toString().length()); - if (!selectSpecified) { - customButton.setSelected(true); - } + try{ + return Integer.parseInt(text); + }catch (NumberFormatException e){ + return HUNDRED; } - }; + + } + //定义一个监听器,用于监听所有滑动条 @@ -302,13 +185,12 @@ public class JFormSliderPane extends JPanel { public void stateChanged(ChangeEvent event) { //取出滑动条的值,并在文本中显示出来 if (!isButtonOrIsTxt) { - customButton.setSelected(true); EventQueue.invokeLater(new Runnable() { public void run() { sliderValue = slider.getValue(); getTimes(sliderValue); showValue = times; - showValSpinner.setValue(times); + refreshShowValueFieldText(); } }); } else { @@ -317,20 +199,8 @@ public class JFormSliderPane extends JPanel { } }; - private ItemListener radioButtonItemListener = new ItemListener() { - @Override - public void itemStateChanged(ItemEvent e) { - JRadioButton temp = (JRadioButton) e.getSource(); - if (temp.isSelected()) { - selectSpecified = true; - showValSpinner.setValue(Integer.valueOf(temp.getText().substring(0, temp.getText().indexOf("%")))); - selectSpecified = false; - } - } - }; - private void refreshSlider(int val) { - showValue = val; + private void refreshSlider() { if (showValue > HUNDRED) { slider.setValue((int) (showValue + TWO_HUNDRED) / SIX); } else if (showValue < HUNDRED) { @@ -341,18 +211,6 @@ public class JFormSliderPane extends JPanel { } - private void refreshBottun(int val) { - showValButton.setText(val + "%"); - } - - public double getResolutionTimes() { - return this.resolutionTimes; - } - - public int getshowValue() { - return this.showValue; - } - public static double divide(double v1, double v2, int scale) { BigDecimal b1 = new BigDecimal(Double.toString(v1)); BigDecimal b2 = new BigDecimal(Double.toString(v2)); @@ -362,30 +220,28 @@ public class JFormSliderPane extends JPanel { private ActionListener buttonActionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - showValue = (int) showValSpinner.getValue(); isButtonOrIsTxt = true; if ("less".equals(e.getActionCommand())) { int newDownVal = showValue - TEN; if (newDownVal >= TEN) { showValue = newDownVal; - showValSpinner.setValue(newDownVal); } else { - showValue = newDownVal; - showValSpinner.setValue(TEN); + showValue = TEN; } + refreshShowValueFieldText(); + refreshSlider(); } if ("more".equals(e.getActionCommand())) { int newUpVal = showValue + TEN; if (newUpVal <= FOUR_HUNDRED) { showValue = newUpVal; - showValSpinner.setValue(newUpVal); } else { - showValue = newUpVal; - showValSpinner.setValue(FOUR_HUNDRED); + showValue = TEN; } + refreshShowValueFieldText(); + refreshSlider(); } isButtonOrIsTxt = true; - customButton.setSelected(true); } }; @@ -396,37 +252,26 @@ public class JFormSliderPane extends JPanel { } else if (value < HALF_HUNDRED) { times = (int) Math.round(ONEPOINTEIGHT * value + TEN); } else { - times = (int) (SIX * value - TWO_HUNDRED); + times = SIX * value - TWO_HUNDRED; } } - public JSpinner getShowVal() { - return this.showValSpinner; + public int getShowValue() { + return this.showValue; } - public UIRadioButton getSelfAdaptButton() { - return this.selfAdaptButton; + public void setShowValue(int value) { + showValue = value; + showValFieldChange(); } - private void popupDialog() { - Point btnCoords = upButton.getLocationOnScreen(); - if (dialog == null) { - dialog = new FormPopupPane(upButton, dialogContentPanel); - if (upButtonX == 0) { - upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } - } else { - if (upButtonX == 0) { - upButtonX = btnCoords.x; - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } else { - GUICoreUtils.showPopupMenu(dialog, upButton, -DIALOG_WIDTH + upButton.getWidth() + SHOWVALBUTTON_WIDTH, -DIALOG_HEIGHT); - } - } + + public void addValueChangeListener(ChangeListener changeListener){ + this.slider.addChangeListener(changeListener); } + public static void main(String[] args) { JFrame jf = new JFrame("test"); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); @@ -440,16 +285,3 @@ public class JFormSliderPane extends JPanel { } } - -class FormPopupPane extends JPopupMenu { - private static final int DIALOG_WIDTH = 157; - private static final int DIALOG_HEIGHT = 172; - - FormPopupPane(UIButton b, JPanel dialogContentPanel) { - this.add(dialogContentPanel, BorderLayout.CENTER); - this.setPreferredSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT)); - this.setBackground(new Color(245, 245, 247)); - } - - -} diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java index d010bad9a3..d1a5951ccb 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRBorderLayoutAdapter.java @@ -35,18 +35,19 @@ public class FRBorderLayoutAdapter extends AbstractLayoutAdapter { * @param creator 组件 */ public void fix(XCreator creator) { - FRBorderLayout layout = (FRBorderLayout)container.getFRLayout(); + FRBorderLayout layout = (FRBorderLayout) container.getFRLayout(); Object constraints = layout.getConstraints(creator); + double scale = container.getScale(); if (ComparatorUtils.equals(constraints, BorderLayout.NORTH)) { - ((XWBorderLayout)container).toData().setNorthSize(creator.getHeight()); + ((XWBorderLayout) container).toData().setNorthSize((int) (creator.getHeight() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.SOUTH)) { - ((XWBorderLayout)container).toData().setSouthSize(creator.getHeight()); + ((XWBorderLayout) container).toData().setSouthSize((int) (creator.getHeight() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.EAST)) { - ((XWBorderLayout)container).toData().setEastSize(creator.getWidth()); + ((XWBorderLayout) container).toData().setEastSize((int) (creator.getWidth() / scale)); } else if (ComparatorUtils.equals(constraints, BorderLayout.WEST)) { - ((XWBorderLayout)container).toData().setWestSize(creator.getWidth()); + ((XWBorderLayout) container).toData().setWestSize((int) (creator.getWidth() / scale)); } else { - return; + return; } container.recalculateChildrenPreferredSize(); } @@ -185,4 +186,4 @@ public class FRBorderLayoutAdapter extends AbstractLayoutAdapter { return new FRBorderLayoutConstraints(container, creator); } -} \ No newline at end of file +} diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java index 44996df8cd..9dc7b7de9d 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XButton.java @@ -147,7 +147,7 @@ public class XButton extends XWidgetCreator { public void propertyChange() { FreeButton button = (FreeButton) data; if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } @@ -230,7 +230,7 @@ public class XButton extends XWidgetCreator { if (!button.isCustomStyle()) { l.setBorder(BorderFactory.createLineBorder(new Color(148, 148, 148))); bg = DEFAULTBG; - contentLabel.setFont(DEFAULTFT); + setContentLabelFont(DEFAULTFT); contentLabel.setForeground(DEFAULTFOREGROUNDCOLOR); editor.setLayout(new BorderLayout()); editor.add(l, BorderLayout.CENTER); @@ -239,7 +239,7 @@ public class XButton extends XWidgetCreator { editor.setLayout(new BorderLayout()); editor.add(l,BorderLayout.CENTER); if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } @@ -302,11 +302,26 @@ public class XButton extends XWidgetCreator { setButtonText(button.getText()); checkButonType(); if (button.getFont() != null) { - contentLabel.setFont(button.getFont().applyResolutionNP( + setContentLabelFont(button.getFont().applyResolutionNP( FontTransformUtil.getDesignerFontResolution())); contentLabel.setForeground(button.getFont().getForeground()); } } + private void setContentLabelFont(Font font) { + float size = (float) (font.getSize() * getScale()); + contentLabel.setFont(font.deriveFont(size)); + } + + public void setScale(double scale){ + super.setScale(scale); + FreeButton button = (FreeButton) data; + if (button.getFont() != null) { + setContentLabelFont(button.getFont().applyResolutionNP( + FontTransformUtil.getDesignerFontResolution())); + }else { + setContentLabelFont(DEFAULTFT); + } + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index dcb6938836..0df6abaf16 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -49,6 +49,7 @@ import java.util.Set; * */ public abstract class XCreator extends JPanel implements XComponent, XCreatorTools { + private double scale = 1.0; protected static final Border DEFALUTBORDER = BorderFactory.createLineBorder(new Color(210, 210, 210), 1); public static final Dimension SMALL_PREFERRED_SIZE = new Dimension(80, 21); @@ -102,6 +103,14 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } } + public double getScale() { + return scale; + } + + public void setScale(double scale) { + this.scale = scale; + } + /** * 初始化组件大小 */ diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java index df2252c7af..705ecae5c0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLabel.java @@ -17,6 +17,7 @@ import com.fr.design.mainframe.widget.renderer.LabelHorizontalAlignmentRenderer; import com.fr.form.ui.Label; import com.fr.form.ui.container.WParameterLayout; +import com.fr.general.FRFont; import com.fr.stable.ArrayUtils; import com.fr.stable.Constants; import com.fr.stable.core.PropertyChangeAdapter; @@ -94,8 +95,11 @@ public class XLabel extends XWidgetCreator { } if (label.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = label.getFont(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), label.getWidgetValue() - .toString(), Style.getInstance(label.getFont()).deriveHorizontalAlignment(label.getTextalign()) + .toString(), Style.getInstance(font.applySize(fontsize)) + .deriveHorizontalAlignment(label.getTextalign()) .deriveVerticalAlignment(label.isVerticalCenter() ? SwingConstants.CENTER : SwingConstants.TOP) .deriveTextStyle(label.isWrap() ? Style.TEXTSTYLE_WRAPTEXT : Style.TEXTSTYLE_SINGLELINE), FontTransformUtil.getDesignerFontResolution()); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java index 7c852f2820..faf544f3b1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWAbsoluteLayout.java @@ -30,6 +30,8 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.container.WParameterLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.FRScreen; import com.fr.general.IOUtils; @@ -397,6 +399,7 @@ public class XWAbsoluteLayout extends XLayoutContainer { return; } XWidgetCreator creator = (XWidgetCreator) e.getChild(); + creator.setScale(this.getScale()); WAbsoluteLayout wabs = this.toData(); if (!creator.acceptType(XWFitLayout.class)) { creator.setDirections(Direction.ALL); @@ -602,4 +605,17 @@ public class XWAbsoluteLayout extends XLayoutContainer { return super.getWidgetPropertyUIProviders(); } } + + public void adjustCompSize(double percent) { + double p = percent + 1; + WAbsoluteLayout absoluteLayout = this.toData(); + for (int i = 0; i < this.getComponentCount(); i++) { + XCreator component = (XCreator) this.getComponent(i); + CRBoundsWidget boundsWidget = absoluteLayout.getBoundsWidget(component.toData()); + Rectangle rec = new Rectangle(boundsWidget.getBounds()); + component.adjustCompSize(percent); + component.setBounds((int) (rec.x * p), (int) (rec.y * p), (int) (rec.width * p), (int) (rec.height * p)); + } + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java index 6d2003e21c..c65421696e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWBorderLayout.java @@ -126,14 +126,14 @@ public class XWBorderLayout extends XLayoutContainer { WBorderLayout wlayout = this.toData(); Object constraints = wlayout.getConstraints(wgt); Dimension d = new Dimension(); - if (ComparatorUtils.equals(WBorderLayout.NORTH,constraints)) { - d.height = wlayout.getNorthSize(); - } else if (ComparatorUtils.equals(WBorderLayout.SOUTH,constraints)) { - d.height = wlayout.getSouthSize(); - } else if (ComparatorUtils.equals(WBorderLayout.EAST,constraints)) { - d.width = wlayout.getEastSize(); - } else if (ComparatorUtils.equals(WBorderLayout.WEST,constraints)) { - d.width = wlayout.getWestSize(); + if (ComparatorUtils.equals(WBorderLayout.NORTH, constraints)) { + d.height = (int) (wlayout.getNorthSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.SOUTH, constraints)) { + d.height = (int) (wlayout.getSouthSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.EAST, constraints)) { + d.width = (int) (wlayout.getEastSize() * getScale()); + } else if (ComparatorUtils.equals(WBorderLayout.WEST, constraints)) { + d.width = (int) (wlayout.getWestSize() * getScale()); } return d; } @@ -203,8 +203,40 @@ public class XWBorderLayout extends XLayoutContainer { } } - @Override - public LayoutAdapter getLayoutAdapter() { - return new FRBorderLayoutAdapter(this); - } + @Override + public LayoutAdapter getLayoutAdapter() { + return new FRBorderLayoutAdapter(this); + } + + + /** + * 自适应布局的缩放 + * + * @param percent 百分比 + */ + public void adjustCompSize(double percent) { + for (int i = 0; i < this.getComponentCount(); i++) { + XCreator creator = this.getXCreator(i); + WBorderLayout wlayout = this.toData(); + Object constraints = wlayout.getConstraints(creator.toData()); + if (ComparatorUtils.equals(BorderLayout.NORTH, constraints)) { + int northSize = (int) (this.toData().getNorthSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(dim.width, northSize)); + } else if (ComparatorUtils.equals(BorderLayout.SOUTH, constraints)) { + int southSize = (int) (this.toData().getSouthSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(dim.width, southSize)); + } else if (ComparatorUtils.equals(BorderLayout.EAST, constraints)) { + int eastSize = (int) (this.toData().getEastSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(eastSize, dim.height)); + } else if (ComparatorUtils.equals(BorderLayout.WEST, constraints)) { + int westSize = (int) (this.toData().getWestSize() * this.getScale()); + Dimension dim = creator.getSize(); + creator.setPreferredSize(new Dimension(westSize, dim.height)); + } + } + } } + diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 352899bcbb..2376ecc94a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -18,6 +18,7 @@ import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.stable.ArrayUtils; @@ -129,6 +130,7 @@ public class XWFitLayout extends XLayoutContainer { } } + /** * 直接拖动滑条改变整体像素大小时,不用考虑控件的最小高度宽度,内部组件全部一起缩小放大 * 只是界面显示大小改变,不改变对应的BoundsWidget大小 @@ -137,32 +139,28 @@ public class XWFitLayout extends XLayoutContainer { public void adjustCreatorsWhileSlide(double percent) { int count = this.getComponentCount(); if (count == 0) { - Dimension size = new Dimension(this.getSize()); - size.width += size.width*percent; - size.height += size.height*percent; + Dimension size = new Dimension(this.toData().getContentWidth(), this.toData().getContentHeight()); + size.width += size.width * percent; + size.height += size.height * percent; this.setSize(size); return; } - // 初始化时还未加间隔 - if (hasCalGap) { - moveContainerMargin(); - moveCompInterval(backupGap); - LayoutUtils.layoutContainer(this); - } int containerW = 0; int containerH = 0; - int[] hors = getHors(false); - int[] veris = getVeris(false); - PaddingMargin margin = toData().getMargin(); - for (int i=0; i posX = new ArrayList(); + // 保存实际大小时,组件大小已经去除内边距,此处也判断下 + posX.add(0); + int width = this.toData().getContainerWidth(); + posX.add(width); + for (int i = 0, len = this.toData().getWidgetCount(); i < len; i++) { + CRBoundsWidget widget = (CRBoundsWidget) this.toData().getWidget(i); + Rectangle rec = widget.getBounds(); + if (!posX.contains(rec.x)) { + posX.add(rec.x); + } + } + Collections.sort(posX); + return ArrayUtils.toPrimitive(posX.toArray(new Integer[]{posX.size()})); + } + + + public int[] getDataVeris() { + List posY = new ArrayList(); + // 保存实际大小时,组件大小已经去除内边距,此处也判断下 + posY.add(0); + int height = this.toData().getContainerHeight(); + posY.add(height); + for (int i = 0, len = this.toData().getWidgetCount(); i < len; i++) { + CRBoundsWidget boundsWidget = (CRBoundsWidget) this.toData().getWidget(i); + Rectangle rec = boundsWidget.getBounds(); + if (!posY.contains(rec.y)) { + posY.add(rec.y); + } + } + Collections.sort(posY); + return ArrayUtils.toPrimitive(posY.toArray(new Integer[]{posY.size()})); + } + /** * 获取内部组件纵坐标值 * @param isActualSize 实际大小 @@ -290,6 +321,7 @@ public class XWFitLayout extends XLayoutContainer { return ArrayUtils.toPrimitive(posY.toArray(new Integer[]{posY.size()})); } + /** * 是否能缩小 * @param percent 百分比 @@ -860,12 +892,14 @@ public class XWFitLayout extends XLayoutContainer { } super.add(comp, constraints); XCreator creator = (XCreator) comp; + creator.setScale(this.getScale()); dealDirections(creator, false); } private void add(Component comp, Object constraints, boolean isInit) { super.add(comp, constraints); XCreator creator = (XCreator) comp; + creator.setScale(this.getScale()); dealDirections(creator, isInit); } @@ -1331,4 +1365,14 @@ public class XWFitLayout extends XLayoutContainer { } } } + + /** + * 自适应布局的缩放 + * + * @param percent 百分比 + */ + @Override + public void adjustCompSize(double percent) { + this.adjustCreatorsWhileSlide(percent); + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java index f0e23b977f..92d91dd732 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XCardSwitchButton.java @@ -237,6 +237,7 @@ public class XCardSwitchButton extends XButton { layout.setIndex(--tabFitIndex); } } + tagLayout.setTabsAndAdjust(); } @@ -337,7 +338,8 @@ public class XCardSwitchButton extends XButton { String titleText = button.getText(); this.setButtonText(titleText); FRFont font = widgetTitle.getFrFont(); - FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(),font.getSize() + FONT_SIZE_ADJUST); + int fontsize = font.getSize() + FONT_SIZE_ADJUST; + FRFont newFont = FRFont.getInstance(font.getName(),font.getStyle(), (float) (fontsize * getScale())); UILabel label = this.getContentLabel(); label.setFont(newFont); label.setForeground(font.getForeground()); @@ -459,7 +461,7 @@ public class XCardSwitchButton extends XButton { TitlePacker title = getWidgetTitle(); FRFont font = title.getFrFont(); int fontSize = font.getSize() + FONT_SIZE_ADJUST; - FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), fontSize); + FRFont newFont = FRFont.getInstance(font.getName(), font.getStyle(), (float) (fontSize * getScale())); FontMetrics fm = GraphHelper.getFontMetrics(newFont); for (int i = 0; i < titleText.length(); i++) { titleStringBuf.append(titleText.charAt(i)); diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java index dc8bb90801..0f141e7634 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardTagLayout.java @@ -290,7 +290,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { @Override public void doLayout() { - setTabsAndAdjust(); //设置布局 super.doLayout(); } @@ -382,7 +381,6 @@ public class XWCardTagLayout extends XWHorizontalBoxLayout { } else { adjustTabsV(parent, tabLength, cardWidth, cardHeight); } - fixTitleLayout(parent); } public void adjustTabsH(XLayoutContainer parent, int tabLength, Map width, Map height) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java index 508f3f7dfa..e87e30b5f1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWTabFitLayout.java @@ -8,15 +8,11 @@ import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; -import com.fr.design.designer.properties.mobile.MobileBooKMarkUsePropertyUI; -import com.fr.design.designer.properties.mobile.MobileBookMarkPropertyUI; -import com.fr.design.form.util.FormDesignerUtils; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormHierarchyTreePane; -import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.editors.ButtonTypeEditor; import com.fr.design.mainframe.widget.editors.ImgBackgroundEditor; import com.fr.design.utils.gui.LayoutUtils; @@ -44,7 +40,7 @@ import java.beans.IntrospectionException; * @date 2014-6-23 */ public class XWTabFitLayout extends XWFitLayout { - + private static final int MIN_SIZE = 0; private static final int WIDTH_SIDE_OFFSET = 57; @@ -101,7 +97,7 @@ public class XWTabFitLayout extends XWFitLayout { public XWTabFitLayout(){ this(new WTabFitLayout(), new Dimension()); } - + public XWTabFitLayout(WTabFitLayout widget, Dimension initSize) { super(widget, initSize); } @@ -252,13 +248,13 @@ public class XWTabFitLayout extends XWFitLayout { public LayoutAdapter getLayoutAdapter() { return new FRTabFitLayoutAdapter(this); } - + /** * tab布局里删除XWTabFitLayout对应的tab按钮 - * + * * @param creator 当前组件 * @param designer 表单设计器 - * + * */ @Override public void deleteRelatedComponent(XCreator creator, FormDesigner designer){ @@ -288,15 +284,15 @@ public class XWTabFitLayout extends XWFitLayout { deleteTabLayout(mainLayout,designer); return; } - + //刷新tab按钮和tabFitLayout的index refreshIndex(tag,cardLayout,index); - + LayoutUtils.layoutRootContainer(designer.getRootComponent()); } - - + + private void deleteTabLayout(XLayoutContainer mainLayout, FormDesigner designer){ SelectionModel selectionModel = designer.getSelectionModel(); if(mainLayout != null){ @@ -323,7 +319,7 @@ public class XWTabFitLayout extends XWFitLayout { } } } - + /** * tab布局里切换到相应的tab按钮 * @param comp 当前组件 @@ -344,44 +340,37 @@ public class XWTabFitLayout extends XWFitLayout { button.setShowButton(button.getIndex()==index); } } - - + + /** * 寻找最近的为自适应布局的父容器 - * + * * @return 布局容器 - * + * * * @date 2014-12-30-下午3:15:28 - * + * */ @Override public XLayoutContainer findNearestFit(){ XLayoutContainer parent = this.getBackupParent(); return parent == null ? null : parent.findNearestFit(); - } - - /** - * 非顶层自适应布局的缩放 - * @param percent 百分比 - */ - @Override - public void adjustCompSize(double percent) { - this.adjustCreatorsWhileSlide(percent); - } - + } + + + /** * 该布局需要隐藏,无需对边框进行操作 * @param border 边框 - * + * */ public void setBorder(Border border) { return; } - + /** * 按照百分比缩放内部组件宽度 - * + * * @param percent 宽度变化的百分比 */ @Override @@ -397,7 +386,7 @@ public class XWTabFitLayout extends XWFitLayout { moveCompInterval(getAcualInterval()); updateCompsWidget(); } - layoutWidthResize(percent); + layoutWidthResize(percent); if (percent < 0 && this.getNeedAddWidth() > 0) { this.setSize(this.getWidth()+this.getNeedAddWidth(), this.getHeight()); modifyEdgemostCreator(true); @@ -410,8 +399,8 @@ public class XWTabFitLayout extends XWFitLayout { updateWidgetBackupBounds(); LayoutUtils.layoutContainer(this); } - - + + /** * 布局容器高度手动修改时, * 同时调整容器内的组件们,缩小时需要考虑有的组件高度不满足缩小高度 @@ -441,13 +430,13 @@ public class XWTabFitLayout extends XWFitLayout { updateWidgetBackupBounds(); LayoutUtils.layoutContainer(this); } - + @Override public XLayoutContainer getOuterLayout(){ XWCardLayout cardLayout = (XWCardLayout) this.getBackupParent(); return cardLayout.getBackupParent(); } - + // 更新内部组件的widget private void updateCompsWidget(){ for(int m=0;m SHOWVALMAX ? SHOWVALMAX : value; value = value < SHOWVALMIN ? SHOWVALMIN : value; - JForm jf = (JForm) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - jf.getFormDesign().setResolution((int) value); - jf.getFormDesign().getArea().resolution = (int) value; - reCalculateRoot(value, true); + scale((int) value); JTemplate form = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (form != null) { form.fireTargetModified(); @@ -214,6 +194,12 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } }; + private void scale(int value){ + this.designer.setResolution(value); + this.designer.getArea().resolution = value; + reCalculateRoot(value, true); + } + /** * 返回当前的屏幕分辨率对应的百分比值 * @@ -238,7 +224,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { this.screenValue = FRScreen.getDesignScreenByDimension(scrnsize).getValue(); XLayoutContainer root = FormArea.this.designer.getRootComponent(); // 7.1.1不放缩放滑块,但表单大小仍按屏幕分辨率调整 -// slidePane.populateBean(screenValue); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; if ( !AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) { @@ -246,7 +231,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } else { // 组件间隔啊 // REPORT-2585 原有的逻辑导致嵌套的tab中的间隔加不上去,会在后续拖动的过程中出问题 - reCalculateDefaultRoot(screenValue, true); + reCalculateDefaultRoot(); } } LayoutUtils.layoutContainer(root); @@ -366,16 +351,14 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * 修改大小后,再根据屏幕分辨率调整下 */ private void doReCalculateRoot(int width, int height, XWFitLayout layout) { -// double value = slidePane.updateBean(); //重置滑块的值为默认值100 - START_VALUE = DEFAULT_SLIDER; if ( AssistUtils.equals(screenValue, DEFAULT_SLIDER) ) { layout.getParent().setSize(width, height + designer.getParaHeight()); - FormArea.this.validate(); } else { layout.setBackupGap(screenValue / DEFAULT_SLIDER); - reCalculateRoot(screenValue, false); } + reCalculateRoot(slidePane.getShowValue(), true); + } /** @@ -385,71 +368,60 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * @param value */ private void reCalculateRoot(double value, boolean needCalculateParaHeight) { - if ( AssistUtils.equals(value, START_VALUE) ) { - return; - } - double percent = (value - START_VALUE) / START_VALUE; + double percent = (value - DEFAULT_SLIDER) / DEFAULT_SLIDER; + double scale = value / DEFAULT_SLIDER; XLayoutContainer root = FormArea.this.designer.getRootComponent(); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; - layout.setContainerPercent(value / DEFAULT_SLIDER); + layout.setContainerPercent(scale); + layout.adjustCompSize(percent); traverAndAdjust(layout, percent); - layout.adjustCreatorsWhileSlide(percent); - // 拖动滑块,先将内部组件百分比大小计算,再计算容器大小 - Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); + XWBorderLayout parent = (XWBorderLayout) layout.getParent(); + root.setScale(scale); + parent.setScale(scale); // 自适应布局的父层是border if (layout.getParent() != null) { - int paraHeight = designer.getParaHeight(); - if (needCalculateParaHeight && paraHeight > 0) { - designer.setParaHeight(paraHeight); - XWBorderLayout parent = (XWBorderLayout) layout.getParent(); - parent.toData().setNorthSize(paraHeight); + int paraHeight = parent.toData().getNorthSize(); + XLayoutContainer paraComponent = designer.getParaComponent(); + if (needCalculateParaHeight && paraComponent != null) { + paraComponent.setScale(scale); + this.designer.setParaHeight(paraHeight); + paraComponent.setPreferredSize(new Dimension(d.width, this.designer.getParaHeight())); + paraComponent.adjustCompSize( percent); parent.removeAll(); - parent.add(designer.getParaComponent(), WBorderLayout.NORTH); - parent.add(designer.getRootComponent(), WBorderLayout.CENTER); + parent.add(paraComponent, WBorderLayout.NORTH); + parent.add(root, WBorderLayout.CENTER); + root.setBounds(0, this.designer.getParaHeight(), d.width, d.height); } - layout.getParent().setSize(d.width, d.height + paraHeight); + layout.getParent().setSize(d.width, d.height + this.designer.getParaHeight()); + // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea FormArea.this.validate(); + LayoutUtils.layoutRootContainer(designer.getRootComponent()); } - START_VALUE = value; } } /** * 按照界面大小的百分比值调整root大小 * - * @param needCalculateParaHeight 是否需要调整参数界面高度 - * @param value */ - private void reCalculateDefaultRoot(double value, boolean needCalculateParaHeight) { + private void reCalculateDefaultRoot() { XLayoutContainer root = FormArea.this.designer.getRootComponent(); if (root.acceptType(XWFitLayout.class)) { XWFitLayout layout = (XWFitLayout) root; - layout.setContainerPercent(1.0); - traverAndAdjust(layout, 0.0); - layout.adjustCreatorsWhileSlide(0.0); - - // 拖动滑块,先将内部组件百分比大小计算,再计算容器大小 - - Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); - // 自适应布局的父层是border - if (layout.getParent() != null) { - int paraHeight = designer.getParaHeight(); - if (needCalculateParaHeight && paraHeight > 0) { - designer.setParaHeight(paraHeight); - XWBorderLayout parent = (XWBorderLayout) layout.getParent(); - parent.toData().setNorthSize(paraHeight); - parent.removeAll(); - parent.add(designer.getParaComponent(), WBorderLayout.NORTH); - parent.add(designer.getRootComponent(), WBorderLayout.CENTER); - } - layout.getParent().setSize(d.width, d.height + paraHeight); - // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea - FormArea.this.validate(); + Dimension dimension = layout.getSize(); + double widthScale = 960D / dimension.width; + double heightScale = 960D / dimension.height; + final double scaleValue = Math.min(widthScale, heightScale); + int value = (int) (scaleValue * 100); + slidePane.setShowValue(value); + if (value == 100) { + return; } + scale(value); } } @@ -459,6 +431,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { Object object = creator.getComponent(i); if (object instanceof XCreator) { XCreator temp = (XCreator) object; + temp.setScale(1 + percent); temp.adjustCompSize(percent); traverAndAdjust(temp, percent); } @@ -480,17 +453,17 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * 鼠标滚轮事件 * 由于表单设计界面要求: 容器大小大于界面时,滚动条才可以拖动,所以不支持滚动无限往下滚 */ - @Override - protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent evt) { - int id = evt.getID(); - switch (id) { - case MouseEvent.MOUSE_WHEEL: { - onMouseWheelScroll(evt); - break; - } - default: - } - } +// @Override +// protected void processMouseWheelEvent(java.awt.event.MouseWheelEvent evt) { +// int id = evt.getID(); +// switch (id) { +// case MouseEvent.MOUSE_WHEEL: { +// onMouseWheelScroll(evt); +// break; +// } +// default: +// } +// } private void onMouseWheelScroll(MouseWheelEvent evt) { int value = this.verScrollBar.getValue() + evt.getWheelRotation() * ROTATIONS; @@ -763,7 +736,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { layout.moveContainerMargin(); layout.addCompInterval(layout.getAcualInterval()); } else if (designer.getRootComponent().acceptType(XWFitLayout.class)) { - START_VALUE = DEFAULT_SLIDER; reCalculateRoot(slide, true); // slidePane.populateBean(slide); } @@ -840,7 +812,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent { DESIGNERWIDTH = DESIGNERWIDTH > maxWidth ? maxWidth : DESIGNERWIDTH; DESIGNERHEIGHT = DESIGNERHEIGHT > maxHeight ? maxHeight : DESIGNERHEIGHT; int designerLeft = left + (verScrollBar.getX() - DESIGNERWIDTH) / 2; - rec = new Rectangle(designerLeft, TOPGAP, DESIGNERWIDTH, DESIGNERHEIGHT); + int designerTop = top + (horScrollBar.getY() - DESIGNERHEIGHT) / 2; + rec = new Rectangle(designerLeft, designerTop, DESIGNERWIDTH, DESIGNERHEIGHT); } // designer是整个表单设计界面中的面板部分,目前只放自适应布局和参数界面。 designer.setBounds(rec); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index b94ad57dbb..851758803a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -493,10 +493,12 @@ public class FormDesigner extends TargetComponent
implements TreeSelection public void setParaHeight(int height) { XWBorderLayout container = (XWBorderLayout) getTopContainer(); container.toData().setNorthSize(height); - container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); - paraHeight = height; + int displayHeight = (int) (height * container.getScale()); + container.setSize(container.getWidth(), container.getHeight() + displayHeight - getParaHeight()); + paraHeight = displayHeight; } + /** * 删除参数界面 */ diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java index cbebbcba16..8f95ecaf68 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelection.java @@ -15,6 +15,8 @@ import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.Widget; +import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WParameterLayout; import com.fr.log.FineLoggerFactory; import java.awt.LayoutManager; @@ -232,12 +234,13 @@ public class FormSelection { int size = selection.size(); if (size == 1) { XCreator creator = selection.get(0); - if(creator.acceptType(XWCardTagLayout.class)){ - creator = (XCreator)selection.get(0).getParent(); + if (creator.acceptType(XWCardTagLayout.class)) { + creator = (XCreator) selection.get(0).getParent(); } creator.setBounds(rec); if (creator.acceptType(XWParameterLayout.class)) { - designer.setParaHeight((int) rec.getHeight()); + double height = rec.getHeight() / creator.getScale(); + designer.setParaHeight((int) height); designer.getArea().doLayout(); } LayoutUtils.layoutContainer(creator); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 7ddff022f9..e1f7f882ad 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -8,6 +8,7 @@ import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.widget.CRBoundsWidget; import java.awt.Rectangle; @@ -42,15 +43,13 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); formDesigner.getSelectionModel().getSelection().backupBounds(); super.update(); - Rectangle bounds = new Rectangle(creator.getBounds()); - bounds.x = (int) x.getValue(); - bounds.y = (int) y.getValue(); + Rectangle bounds = new Rectangle((int) x.getValue(), (int) y.getValue(), (int) width.getValue(), (int) height.getValue()); if (parent == null) { return; } WLayout wabs = parent.toData(); wabs.setBounds(creator.toData(), bounds); - creator.setBounds(bounds); + parent.adjustCompSize(parent.getScale() -1); LayoutUtils.layoutContainer(creator); XWAbsoluteLayout layout = (XWAbsoluteLayout) parent; layout.updateBoundsWidget(creator); @@ -59,14 +58,13 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void limitWidth(WLayout wabs, int w, Rectangle bounds, Rectangle rec){ bounds.width = w; - creator.setBounds(bounds); } @Override public void limitHeight(WLayout wabs, int h, Rectangle bounds, Rectangle rec){ bounds.height = h; - creator.setBounds(bounds); } + @Override protected String title4PopupWindow() { return "absoluteBound"; @@ -75,7 +73,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { @Override public void populate() { super.populate(); - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = boundsWidget.getBounds(); x.setValue(bounds.x); y.setValue(bounds.y); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index ab148f2ae6..6b538d14fe 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -20,9 +20,8 @@ import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; +import com.fr.form.ui.widget.CRBoundsWidget; - -import javax.swing.JOptionPane; import java.awt.Rectangle; @@ -46,8 +45,8 @@ public class WidgetBoundPane extends BasicPane { } public XLayoutContainer getParent(XCreator source) { - if(source.acceptType(XWCardTagLayout.class)){ - return (XLayoutContainer)source.getParent(); + if (source.acceptType(XWCardTagLayout.class)) { + return (XLayoutContainer) source.getParent(); } XLayoutContainer container = XCreatorUtils.getParentXLayoutContainer(source); if (source.acceptType(XWFitLayout.class) || source.acceptType(XWParameterLayout.class)) { @@ -79,18 +78,21 @@ public class WidgetBoundPane extends BasicPane { } public void populate() { - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = new Rectangle(boundsWidget.getBounds()); width.setValue(bounds.width); height.setValue(bounds.height); } public void fix() { - Rectangle bounds = new Rectangle(creator.getBounds()); + WLayout wabs = parent.toData(); + CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + Rectangle bounds = new Rectangle(boundsWidget.getBounds()); creator.setBackupBound(creator.getBounds()); int w = (int) width.getValue(); int h = (int) height.getValue(); Rectangle rec = ComponentUtils.getRelativeBounds(parent); - WLayout wabs = parent.toData(); if (bounds.width != w) { limitWidth(wabs, w, bounds, rec); } @@ -101,25 +103,27 @@ public class WidgetBoundPane extends BasicPane { public void adjustComponents(Rectangle bounds, int difference, int row) { + double scale = parent.getScale(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); Rectangle backupBounds = getBound(); FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, creator); if (layoutAdapter != null) { layoutAdapter.setEdit(true); - layoutAdapter.calculateBounds(backupBounds, bounds, creator, row, difference); + layoutAdapter.calculateBounds(backupBounds, new Rectangle((int) (bounds.x * scale), (int) (bounds.y * scale), (int) (bounds.width * scale), (int) (bounds.height * scale)), creator, row, difference); } } public void limitWidth(WLayout wabs, int w, Rectangle bounds, Rectangle rec) { int difference = 0; + double scale = parent.getScale(); int minWidth = (int) (MINWIDTH * ((WFitLayout) wabs).getResolutionScaling()); PaddingMargin margin = wabs.getMargin(); if (bounds.width != w) { - if (bounds.width == rec.width - margin.getLeft() - margin.getRight()) { + if ((int) (bounds.width * scale) == rec.width - margin.getLeft() - margin.getRight()) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); width.setValue(bounds.width); return; - } else if (w < minWidth) { + } else if (w * scale < minWidth) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Width") + Integer.toString(minWidth)); width.setValue(bounds.width); return; @@ -132,15 +136,16 @@ public class WidgetBoundPane extends BasicPane { } public void limitHeight(WLayout wabs, int h, Rectangle bounds, Rectangle rec) { + double scale = parent.getScale(); int difference = 0; PaddingMargin margin = wabs.getMargin(); int minHeight = (int) (MINHEIGHT * ((WFitLayout) wabs).getResolutionScaling()); if (bounds.height != h) { - if (bounds.height == rec.height - margin.getTop() - margin.getBottom()) { + if ((int) (bounds.height * scale) == rec.height - margin.getTop() - margin.getBottom()) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Bounds")); height.setValue(bounds.height); return; - } else if (h < minHeight) { + } else if (h * scale < minHeight) { FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Min_Height") + Integer.toString(minHeight)); height.setValue(bounds.height); return; diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java index 22d544c1a6..e89fe09354 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetCardTagBoundPane.java @@ -10,11 +10,9 @@ import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WTabDisplayPosition; +import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.ComparatorUtils; - - -import javax.swing.JOptionPane; import java.awt.Rectangle; /** @@ -39,6 +37,7 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { if (parent == null) { return; } + double scale = parent.getScale(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); Rectangle parentBounds = new Rectangle(parent.getBounds()); @@ -48,17 +47,17 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { XLayoutContainer tabLayout = creator.getTopLayout(); Rectangle rectangle = tabLayout.getBounds(); if(ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ - if(rectangle.height < size){ + if(rectangle.height < size* scale){ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } - parentBounds.height = size; + parentBounds.height = (int) (size * scale); }else{ - if(rectangle.width < size){ + if(rectangle.width < size*scale){ FineJOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Beyond_Tablayout_Bounds")); return; } - parentBounds.width = size; + parentBounds.width = (int) (size * scale); } parent.setBounds(parentBounds); @@ -76,15 +75,8 @@ public class WidgetCardTagBoundPane extends WidgetBoundPane { @Override public void populate() { - WCardTagLayout tagLayout = (WCardTagLayout)creator.toData(); - Rectangle bounds = new Rectangle(creator.getBounds()); - WTabDisplayPosition displayPosition = tagLayout.getDisplayPosition(); - if( ComparatorUtils.equals(displayPosition, WTabDisplayPosition.TOP_POSITION) || ComparatorUtils.equals(displayPosition, WTabDisplayPosition.BOTTOM_POSITION)){ - cardTagWidth.setValue(bounds.height); - }else{ - cardTagWidth.setValue(bounds.width); - } - + WCardMainBorderLayout wCardMainBorderLayout = (WCardMainBorderLayout)creator.getTopLayout().toData(); + cardTagWidth.setValue(wCardMainBorderLayout.getTitleSize()); } } From 476d3965398362b3a3b4f203a3a10466f6ccc2b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 28 Jul 2020 14:21:00 +0800 Subject: [PATCH 61/72] =?UTF-8?q?CHART-9760=20=E7=B3=BB=E5=88=97=E5=90=8D?= =?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 --- .../table/SeriesNameUseFieldValuePane.java | 5 +- .../data/table/SeriesTypeUseComboxPane.java | 125 +++++++++++++----- .../chart/gui/style/ThirdTabPane.java | 12 +- 3 files changed, 97 insertions(+), 45 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java index aab267c545..37dcdebf47 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java @@ -14,15 +14,16 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.extended.chart.UIComboBoxWithNone; import javax.swing.BorderFactory; import javax.swing.JPanel; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.List; /** * 属性表 数据集 系列名使用 系列值 界面. @@ -38,7 +39,7 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane { +public class SeriesTypeUseComboxPane extends BasicBeanPane { private SeriesNameUseFieldValuePane nameFieldValuePane; private SeriesNameUseFieldNamePane nameFieldNamePane; @@ -39,50 +40,100 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { private ChartDataPane parent; private Plot initplot; - private boolean isNeedSummary = true; + private boolean isNeedSummary; + + protected UIButtonGroup content; + protected JPanel cardPane; public SeriesTypeUseComboxPane(ChartDataPane parent, Plot initplot) { this.initplot = initplot; this.parent = parent; - cards = initPaneList(); this.isNeedSummary = true; initComponents(); } + protected void initComponents() { + nameFieldValuePane = createValuePane(); + nameFieldNamePane = createNamePane(); + + cardPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (content.getSelectedIndex() == 0) { + return nameFieldValuePane.getPreferredSize(); + } else { + return nameFieldNamePane.getPreferredSize(); + } + } + }; + cardPane.add(nameFieldValuePane, nameFieldValuePane.title4PopupWindow()); + cardPane.add(nameFieldNamePane, nameFieldNamePane.title4PopupWindow()); + + content = new UIButtonGroup<>(new String[]{nameFieldValuePane.title4PopupWindow(), nameFieldNamePane.title4PopupWindow()}); + + addItemChangeEvent(); + + initLayout(); + content.setSelectedIndex(0); + } + + private void addItemChangeEvent() { + content.addActionListener(new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + checkCardPane(); + + } + }); + } + + protected void checkCardPane() { + comboBoxItemStateChanged(); + CardLayout cl = (CardLayout) cardPane.getLayout(); + if (content.getSelectedIndex() == 0) { + cl.show(cardPane, nameFieldValuePane.title4PopupWindow()); + } else { + cl.show(cardPane, nameFieldNamePane.title4PopupWindow()); + } + } + protected void initLayout() { this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); JPanel northPane = new JPanel(new BorderLayout(4, 0)); - UILabel label1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); + UILabel label1 = new UILabel(Toolkit.i18nText("Fine-Design_Chart_Series_Name_From")); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT)); - northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); + JPanel borderLayoutPane = GUICoreUtils.createBorderLayoutPane(new Component[]{content, null, null, label1, null}); + northPane.add(borderLayoutPane); northPane.setBorder(BorderFactory.createEmptyBorder(10, 24, 0, 15)); cardPane.setBorder(BorderFactory.createEmptyBorder(0, 24, 0, 15)); this.add(northPane, BorderLayout.NORTH); this.add(cardPane, BorderLayout.CENTER); - dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); - JPanel panel = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 290, 24, dataScreeningPane); - panel.setBorder(BorderFactory.createEmptyBorder(0,5,0,5)); - dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10,5,0,5)); + dataScreeningPane = new ChartDataFilterPane(this.initplot, parent); + JPanel panel = new UIExpandablePane(Toolkit.i18nText("Fine-Design_Chart_Data_Filter"), 250, 24, dataScreeningPane); + panel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 15)); + dataScreeningPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); this.add(panel, BorderLayout.SOUTH); } - protected UIComboBox createComboBox() { - UIComboBox uiComboBox = new UIComboBox(); - UIComponentUtils.setPreferedWidth(uiComboBox, 100); - return uiComboBox; + public Dimension getPreferredSize() { + Dimension preferredSize = super.getPreferredSize(); + return new Dimension(260, (int) preferredSize.getHeight()); } + /** * 检查box 是否使用, hasUse, 表示上层已经使用, 否则, 则此界面都可使用 + * * @param hasUse 是否使用 */ public void checkUseBox(boolean hasUse) { - jcb.setEnabled(hasUse); + content.setEnabled(hasUse); nameFieldValuePane.checkUse(hasUse); dataScreeningPane.checkBoxUse(); } /** * 切换 变更数据集时, 刷新Box选中项目 + * * @param list 列表 */ public void refreshBoxListWithSelectTableData(List list) { @@ -93,28 +144,20 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { /** * 清空所有的box设置 */ - public void clearAllBoxList(){ + public void clearAllBoxList() { nameFieldValuePane.clearAllBoxList(); nameFieldNamePane.clearAllBoxList(); } /** * 界面标题 + * * @return 界面标题 */ protected String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name_From"); } - @Override - protected List> initPaneList() { - nameFieldValuePane = createValuePane(); - nameFieldNamePane = createNamePane(); - List> paneList = new ArrayList>(); - paneList.add(nameFieldValuePane); - paneList.add(nameFieldNamePane); - return paneList; - } protected SeriesNameUseFieldValuePane createValuePane() { return new SeriesNameUseFieldValuePane(); @@ -135,15 +178,17 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { nameFieldNamePane.populateBean(ob, isNeedSummary); } dataScreeningPane.populateBean(ob, isNeedSummary); + checkCardPane(); } /** * 重新布局整个面板 + * * @param isNeedSummary 是否需要汇总 */ public void relayoutPane(boolean isNeedSummary) { this.isNeedSummary = isNeedSummary; - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -152,9 +197,8 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { } - @Override protected void comboBoxItemStateChanged() { - if (jcb.getSelectedIndex() == 0) { + if (this.getSelectedIndex() == 0) { nameFieldValuePane.relayoutPane(this.isNeedSummary); } else { nameFieldNamePane.relayoutPane(this.isNeedSummary); @@ -178,4 +222,21 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane { dataScreeningPane.updateBean(ob); } + /** + * 保存数据 + * + * @return 待保存的对象 + */ + public ChartCollection updateBean() { + return null; + } + + + public int getSelectedIndex() { + return content.getSelectedIndex(); + } + + public void setSelectedIndex(int index) { + content.setSelectedIndex(index); + } } \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java index a0580ba468..a58a889164 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java @@ -10,6 +10,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import javax.swing.JPanel; import javax.swing.border.Border; +import java.util.List; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Component; @@ -20,7 +21,6 @@ import java.awt.Graphics2D; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.util.List; public abstract class ThirdTabPane extends BasicBeanPane{ @@ -74,16 +74,6 @@ public abstract class ThirdTabPane extends BasicBeanPane{ } } - @Override - public void paint(Graphics g) { - super.paint(g); - if (!paneList.isEmpty()) { - Graphics2D g2d = (Graphics2D)g; - g2d.setColor(UIConstants.LINE_COLOR); - g2d.drawLine(getWidth() - 2, tabPane.getPreferredSize().height, getWidth() - 2, getHeight() - 1); - } - } - protected void initLayout() { this.setLayout(new BorderLayout()); if (!paneList.isEmpty()) { From 5d5e0386c67bcb8d3b3dfe07bf64e619e45fd18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Tue, 28 Jul 2020 15:40:11 +0800 Subject: [PATCH 62/72] =?UTF-8?q?CHART-9760=20=E4=BF=AE=E6=94=B9=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/data/table/SeriesNameUseFieldNamePane.java | 6 +++--- .../chart/gui/data/table/SeriesNameUseFieldValuePane.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java index c6f4ac2041..3f5f70aae3 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java @@ -24,6 +24,8 @@ import javax.swing.JComponent; import javax.swing.JPanel; import javax.swing.JTable; import javax.swing.event.ChangeEvent; +import java.util.ArrayList; +import java.util.List; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Container; @@ -31,8 +33,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import java.util.ArrayList; -import java.util.List; /** * 属性表 数据集界面: 系列名 使用字段名. @@ -129,7 +129,7 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane Date: Tue, 28 Jul 2020 16:11:24 +0800 Subject: [PATCH 63/72] =?UTF-8?q?REPORT-35544=20=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96-=E5=88=87=E6=8D=A2=E5=88=B0=E9=9F=A9=E6=96=87?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E7=BD=AE=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gui/iprogressbar/ProgressDialog.java | 4 ++- .../design/locale/impl/SupportLocaleImpl.java | 13 +++++++++- .../start/server/FineEmbedServerMonitor.java | 26 ++++++++++++------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java index 6d10b48e56..29214984c3 100644 --- a/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -98,7 +98,9 @@ public class ProgressDialog extends UIDialog { } public void updateLoadingText(String text, FRFont font) { - this.text.setFont(font); + if (font != null) { + this.text.setFont(font); + } this.text.setText(text); } } diff --git a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java index 61de25937c..c6c1b1f280 100644 --- a/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java +++ b/designer-base/src/main/java/com/fr/design/locale/impl/SupportLocaleImpl.java @@ -38,7 +38,18 @@ public enum SupportLocaleImpl implements SupportLocale { set.add(Locale.TAIWAN); return set; } - } + }, + /** + * 支持韩文 + */ + SUPPORT_KOREA { + @Override + public Set support() { + Set set = new HashSet(); + set.add(Locale.KOREA); + return set; + } + } } diff --git a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java index 6bab19fded..7e95c48d27 100644 --- a/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java +++ b/designer-base/src/main/java/com/fr/start/server/FineEmbedServerMonitor.java @@ -2,16 +2,18 @@ package com.fr.start.server; import com.fr.concurrent.NamedThreadFactory; import com.fr.design.gui.iprogressbar.ProgressDialog; +import com.fr.design.i18n.Toolkit; +import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.mainframe.DesignerContext; import com.fr.event.Event; import com.fr.event.EventDispatcher; import com.fr.event.Listener; import com.fr.event.Null; import com.fr.general.FRFont; -import com.fr.general.GeneralContext; +import com.fr.general.locale.LocaleAction; +import com.fr.general.locale.LocaleCenter; import javax.swing.plaf.ColorUIResource; -import java.util.Locale; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -31,6 +33,11 @@ public class FineEmbedServerMonitor { private static final int STEP_HEARTBEAT = 40; private static volatile FineEmbedServerMonitor monitor; private static ProgressDialog progressBar = DesignerContext.getDesignerFrame().getProgressDialog(); + //由于默认值的字体不支持韩文,所以要对韩文单独生成字体 + private FRFont font = null; + private static final int FONT_RGB = 333334; + private static final int FONT_SIZE = 14; + private static final String FONT_NAME = "Dialog"; private FineEmbedServerMonitor() { } @@ -90,14 +97,15 @@ public class FineEmbedServerMonitor { } if (!DesignerContext.getDesignerFrame().getProgressDialog().isVisible()) { DesignerContext.getDesignerFrame().showProgressDialog(); - String text = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); //如果为韩文则改变字体 - if (GeneralContext.getLocale().equals(Locale.KOREA)) { - FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)).applyName("Dialog"); - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); - } else { - DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text); - } + LocaleCenter.buildAction(new LocaleAction() { + @Override + public void execute() { + font = FRFont.getInstance().applySize(FONT_SIZE).applyForeground(new ColorUIResource(FONT_RGB)).applyName(FONT_NAME); + } + }, SupportLocaleImpl.SUPPORT_KOREA); + String text = Toolkit.i18nText("Fine-Design_Basic_Loading_Embed_Server"); + DesignerContext.getDesignerFrame().getProgressDialog().updateLoadingText(text, font); } DesignerContext.getDesignerFrame().updateProgress(getProgress()); } From 07bb4980762755d68955225c93d2255fbfe4dde7 Mon Sep 17 00:00:00 2001 From: vito Date: Tue, 28 Jul 2020 17:27:31 +0800 Subject: [PATCH 64/72] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3118ed8a99..6446da4044 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,6 @@ allprojects { dependencies { implementation 'com.fr.third:jxbrowser:6.23' - implementation 'com.fr.third:jxbrowser-swing:6.23' implementation 'com.fr.third:jxbrowser-mac:6.23' implementation 'com.fr.third:jxbrowser-win64:6.23' implementation 'com.fr.third.server:servlet-api:3.0' From 0a98c77d3c54d8ec81117b477818aa455fd8d3cc Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 17:40:35 +0800 Subject: [PATCH 65/72] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 6 +++--- .../ui/designer/component/WidgetAbsoluteBoundPane.java | 3 +++ .../widget/ui/designer/component/WidgetBoundPane.java | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 2d7180bba1..39c7f1a720 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -380,9 +380,9 @@ public class FormArea extends JComponent implements ScrollRulerComponent { Dimension d = new Dimension(layout.getWidth(), layout.getHeight()); XWBorderLayout parent = (XWBorderLayout) layout.getParent(); root.setScale(scale); - parent.setScale(scale); // 自适应布局的父层是border - if (layout.getParent() != null) { + if (parent != null) { + parent.setScale(scale); int paraHeight = parent.toData().getNorthSize(); XLayoutContainer paraComponent = designer.getParaComponent(); if (needCalculateParaHeight && paraComponent != null) { @@ -395,7 +395,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { parent.add(root, WBorderLayout.CENTER); root.setBounds(0, this.designer.getParaHeight(), d.width, d.height); } - layout.getParent().setSize(d.width, d.height + this.designer.getParaHeight()); + parent.setSize(d.width, d.height + this.designer.getParaHeight()); // 调整自适应布局大小后,同步调整参数界面和border大小,此时刷新下formArea FormArea.this.validate(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index e1f7f882ad..80898f592d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -75,6 +75,9 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { super.populate(); WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = boundsWidget.getBounds(); x.setValue(bounds.x); y.setValue(bounds.y); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 6b538d14fe..d76c2f891e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -80,6 +80,9 @@ public class WidgetBoundPane extends BasicPane { public void populate() { WLayout wabs = parent.toData(); CRBoundsWidget boundsWidget = wabs.getBoundsWidget(creator.toData()); + if (boundsWidget == null){ + return; + } Rectangle bounds = new Rectangle(boundsWidget.getBounds()); width.setValue(bounds.width); height.setValue(bounds.height); From 878d65de01648d02691829854b7f921f08ea4889 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 18:43:02 +0800 Subject: [PATCH 66/72] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/JFormSliderPane.java | 39 ++++++++------ .../design/mainframe/JFormSliderPaneTest.java | 51 +++++++++++++++++++ 2 files changed, 75 insertions(+), 15 deletions(-) create mode 100644 designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java index c47267897f..0658d6040f 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JFormSliderPane.java @@ -131,7 +131,7 @@ public class JFormSliderPane extends JPanel { int code = evt.getKeyCode(); if (code == KeyEvent.VK_ENTER) { - showValue = parseInputValue(); + showValue = parseInputValue(showValField.getText()); showValField.setText(showValue + SUFFIX); showValFieldChange(); } @@ -151,22 +151,26 @@ public class JFormSliderPane extends JPanel { private void showValFieldChange() { isButtonOrIsTxt = true; - if (showValue > FOUR_HUNDRED) { - showValue = FOUR_HUNDRED; - } - if (showValue < TEN) { - showValue = TEN; - } + showValue = getPreferredValue(showValue); refreshShowValueFieldText(); refreshSlider(); } + private int getPreferredValue(int value){ + if (value > FOUR_HUNDRED) { + value = FOUR_HUNDRED; + } + if (value < TEN) { + value = TEN; + } + return value; + } + private void refreshShowValueFieldText(){ showValField.setText(showValue + SUFFIX); } - private int parseInputValue(){ - String text = showValField.getText(); + private int parseInputValue(String text){ if (text.endsWith(SUFFIX)){ text = text.substring(0, text.length() -1); } @@ -175,7 +179,6 @@ public class JFormSliderPane extends JPanel { }catch (NumberFormatException e){ return HUNDRED; } - } @@ -201,13 +204,19 @@ public class JFormSliderPane extends JPanel { private void refreshSlider() { - if (showValue > HUNDRED) { - slider.setValue((int) (showValue + TWO_HUNDRED) / SIX); - } else if (showValue < HUNDRED) { - slider.setValue((int) ((showValue - TEN) / ONEPOINTEIGHT)); + slider.setValue(calSliderValue(showValue)); + } + + private int calSliderValue(int value) { + int result; + if (value > HUNDRED) { + result = (value + TWO_HUNDRED) / SIX; + } else if (value < HUNDRED) { + result = (int) ((value - TEN) / ONEPOINTEIGHT); } else { - slider.setValue(HALF_HUNDRED); + result = HALF_HUNDRED; } + return result; } diff --git a/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java new file mode 100644 index 0000000000..59da9fc1fb --- /dev/null +++ b/designer-base/src/test/java/com/fr/design/mainframe/JFormSliderPaneTest.java @@ -0,0 +1,51 @@ +package com.fr.design.mainframe; + +import com.fr.invoke.Reflect; +import org.junit.Assert; +import org.junit.Test; + +/** + * Created by kerry on 2020-07-28 + */ +public class JFormSliderPaneTest { + + @Test + public void testParseInputValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("parseInputValue", "100%").get(); + Assert.assertEquals(100, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50%").get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50").get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("parseInputValue", "50abc").get(); + Assert.assertEquals(100, result); + } + + @Test + public void testGetPreferredValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("getPreferredValue", 100).get(); + Assert.assertEquals(100, result); + result = Reflect.on(sliderPane).call("getPreferredValue", 0).get(); + Assert.assertEquals(10, result); + result = Reflect.on(sliderPane).call("getPreferredValue", 1000).get(); + Assert.assertEquals(400, result); + } + + @Test + public void testCalSliderValue() { + JFormSliderPane sliderPane = new JFormSliderPane(); + int result = Reflect.on(sliderPane).call("calSliderValue", 10).get(); + Assert.assertEquals(0, result); + result = Reflect.on(sliderPane).call("calSliderValue", 90).get(); + Assert.assertEquals(44, result); + result = Reflect.on(sliderPane).call("calSliderValue", 100).get(); + Assert.assertEquals(50, result); + result = Reflect.on(sliderPane).call("calSliderValue", 200).get(); + Assert.assertEquals(66, result); + result = Reflect.on(sliderPane).call("calSliderValue", 400).get(); + Assert.assertEquals(100, result); + + } +} From 0b69b9b61b7c2a3c8c8799ed5586bf706fe96096 Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 28 Jul 2020 19:08:54 +0800 Subject: [PATCH 67/72] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 39c7f1a720..d92ca80a8a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -696,9 +696,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { * @return 百分比值 */ public double getSlideValue() { -// return slidePane.updateBean(); - //7.1.1不加缩放滑块 - return this.screenValue; + return slidePane.getShowValue(); } /** From ce908d9dca755361230746b9984a205b6f0b9864 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 11:26:19 +0800 Subject: [PATCH 68/72] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/FormArea.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index d92ca80a8a..88b1b8ba24 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -25,8 +25,10 @@ import com.fr.general.FRScreen; import com.fr.stable.AssistUtils; +import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.JPanel; +import javax.swing.KeyStroke; import javax.swing.border.LineBorder; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; @@ -43,12 +45,17 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; +import java.awt.event.KeyEvent; import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelListener; +import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; + public class FormArea extends JComponent implements ScrollRulerComponent { private static final double SLIDER_FLOAT = 400.0; private static final double SLIDER_MIN = 10.0; + private static final String SCALE_PLUS_COMMAND = "scale_plus"; + private static final String SCALE_MINUS_COMMAND = "scale_minus"; public static final double DEFAULT_SLIDER = 100.0; private static final int ROTATIONS = 50; private static final int SHOWVALMAX = 400; @@ -107,8 +114,31 @@ public class FormArea extends JComponent implements ScrollRulerComponent { } this.setFocusTraversalKeysEnabled(false); this.addMouseWheelListener(showValSpinnerMouseWheelListener); + registerShortCutKey(); + } + /** + * 注册缩放快捷键 + * mac: command + 和 command - + * windows: ctr + 和 ctr - + */ + private void registerShortCutKey() { + this.registerKeyboardAction(new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + int old_resolution = slidePane.getShowValue(); + slidePane.setShowValue(old_resolution + SHOWVALMIN); + } + }, SCALE_PLUS_COMMAND, KeyStroke.getKeyStroke(KeyEvent.VK_EQUALS, DEFAULT_MODIFIER), WHEN_IN_FOCUSED_WINDOW); + this.registerKeyboardAction(new AbstractAction() { + @Override + public void actionPerformed(ActionEvent e) { + int old_resolution = slidePane.getShowValue(); + slidePane.setShowValue(old_resolution - SHOWVALMIN); + } + }, SCALE_MINUS_COMMAND, KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, DEFAULT_MODIFIER), WHEN_IN_FOCUSED_WINDOW); + } public void onMobileAttrModified() { FormMobileAttr formMobileAttr = designer.getTarget().getFormMobileAttr(); From b0f6f123f3ddfa9ab6979243be7ad93b6c3c6e70 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 11:42:37 +0800 Subject: [PATCH 69/72] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/designer/creator/XTextArea.java | 4 +++- .../main/java/com/fr/design/designer/creator/XTextEditor.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java index 845fe43d9e..62dc92a2d0 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextArea.java @@ -59,8 +59,10 @@ public class XTextArea extends XFieldEditor { TextArea area = (TextArea) data; if (area.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = FRFont.getInstance(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue() - .toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT) + .toString(), Style.getInstance(font.applySize(fontsize)).deriveHorizontalAlignment(Constants.LEFT) .deriveVerticalAlignment(SwingConstants.TOP) .deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT), ScreenResolution.getScreenResolution()); } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java index 00daae7c7d..8106653e2e 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XTextEditor.java @@ -67,8 +67,10 @@ public class XTextEditor extends XWrapperedFieldEditor { TextEditor area = (TextEditor) data; if (area.getWidgetValue() != null) { Graphics2D g2d = (Graphics2D) g.create(); + FRFont font = FRFont.getInstance(); + float fontsize = (float) (font.getSize() * this.getScale()); BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue() - .toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT) + .toString(), Style.getInstance(font.applySize(fontsize)).deriveHorizontalAlignment(Constants.LEFT) .deriveTextStyle(Style.TEXTSTYLE_SINGLELINE), ScreenResolution.getScreenResolution()); } } From b43aedba09586c37bf1852d68147c07775348df0 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 29 Jul 2020 14:22:39 +0800 Subject: [PATCH 70/72] =?UTF-8?q?REPORT-36310=E3=80=90=E5=86=92=E7=83=9F?= =?UTF-8?q?=E3=80=91=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=EF=BC=8C=E6=A8=A1=E6=9D=BF=E5=83=8F=E7=B4=A0?= =?UTF-8?q?=E7=9A=84=E4=BD=8D=E7=BD=AE=E4=B8=8D=E5=9C=A8=E6=AD=A3=E4=B8=AD?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 508be0327a..431cb07a45 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -151,9 +151,9 @@ public class FormArea extends JComponent implements ScrollRulerComponent { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; double[] rowSize = {f}; - double[] columnSize = {p, f, p, p, p, p, p, p}; + double[] columnSize = {p, f, p, p, p, p, p, f, p}; UILabel tipsPane = new UILabel("form"); - tipsPane.setPreferredSize(new Dimension(200, 0)); + tipsPane.setPreferredSize(new Dimension(375, 0)); widthPane = new UINumberField(); widthPane.setPreferredSize(new Dimension(60, 0)); heightPane = new UINumberField(); @@ -167,6 +167,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), new UILabel("x"), heightPane, new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Indent_Pixel")), + new UILabel(), slidePane}}, rowSize, columnSize, RESIZE_PANE_GAP); this.add(FormRulerLayout.BOTTOM, resizePane); setWidgetsConfig(); From b8f22b901def58d22a472f38ada25b663afcc3b8 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 29 Jul 2020 18:32:43 +0800 Subject: [PATCH 71/72] =?UTF-8?q?REPORT-29562=20=E3=80=90=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E3=80=91=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=B8=AD=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5=E5=92=8C=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6=E6=96=87=E5=AD=97=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/condition/HyperlinkPane.java | 4 +++- .../java/com/fr/design/condition/WidgetHighlightPane.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java index 643ad78906..594d2ed9c6 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java @@ -15,6 +15,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import javax.swing.*; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -30,6 +31,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane { private static final int DIALOG_WIDTH = 700; private static final int DIALOG_HEIGHT = 400; + private static final Dimension WINDOW_CUSTOM_SIZE = new Dimension(720, 600); private Widget widget; private UIComboBox box; @@ -45,8 +48,7 @@ public class WidgetHighlightPane extends ConditionAttrSingleConditionPane Date: Wed, 29 Jul 2020 19:24:19 +0800 Subject: [PATCH 72/72] =?UTF-8?q?REPORT-29562=20=E3=80=90=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E3=80=91=E6=9D=A1=E4=BB=B6=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E4=B8=AD=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5=E5=92=8C=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E4=BA=8B=E4=BB=B6=E6=96=87=E5=AD=97=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E4=BF=AE=E6=94=B9import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/condition/HyperlinkPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java index 594d2ed9c6..1df652a844 100644 --- a/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java +++ b/designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java @@ -15,7 +15,7 @@ import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import javax.swing.*; -import java.awt.*; +import java.awt.Dimension; import java.awt.event.ActionEvent; import java.awt.event.ActionListener;