From 92324089d7b77a8bb28ca24bb7e38befbc37335d Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Tue, 14 Jul 2020 14:59:46 +0800 Subject: [PATCH 01/11] =?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 85aff8362..a3600a985 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 4459d9681..8d6fb2cf6 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/11] 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 b4b6d53c6..d94e8ea5c 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 3ede15950..a7aac0391 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 2a5c29d8c..df07acf1a 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 394dfca1e..b2ea7be11 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/11] =?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 c8be9aa7a..aeb72f07d 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 4c914b0cd..e8f9def4b 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/11] 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 1dd1f00aa..8c09eb303 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 36d2d44a5..42069e4d8 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 44d31554d8e9e0a2b67002e33cbf842fd77b7376 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Jul 2020 10:18:52 +0800 Subject: [PATCH 05/11] =?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 0e3f68897..2f30f70b9 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 000000000..54dbae3b0 --- /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 06/11] =?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 a3600a985..b23958341 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 8d6fb2cf6..80e836834 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 07/11] 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 96e722d11..b896542e6 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 088026ba7..019b4cdee 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 08/11] 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 b896542e6..43c3f43ad 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 89f5de1f09853c9adfe6bb30a57e166f25757a05 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 15 Jul 2020 15:35:09 +0800 Subject: [PATCH 09/11] =?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 c72aa4512..ea222f98c 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 10/11] =?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 ea222f98c..a15a1cd4e 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 11/11] =?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 a15a1cd4e..a91342d4a 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++;