From ef86abec5ae2a96c5d27acc2d895c98cbf132453 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 8 Oct 2021 09:42:58 +0800 Subject: [PATCH 01/16] =?UTF-8?q?REPORT-63310=20=E5=B7=B2=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E6=97=A0=E8=BE=B9=E6=A1=86tab=E5=9D=97?= =?UTF-8?q?=E5=9C=A8=E7=BB=9D=E5=AF=B9=E5=B8=83=E5=B1=80=E5=86=85=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E7=BB=84=E4=BB=B6=E5=A4=A7=E5=B0=8F=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=E4=BA=86=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=BB=91=E8=89=B2=E8=BE=B9=E6=A1=86=20&=20REPORT-59963=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4Tab=E5=9D=97=E6=A0=B7=E5=BC=8F=E4=BC=9A?= =?UTF-8?q?=E5=AF=BC=E8=87=B4Tab=E6=A0=87=E9=A2=98=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E8=89=B2=E9=87=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 11.0上修复了一个相同的问题REPORT-59963,需要在10.0 上也提交下 调整Tab块样式导致样式刷新时,标题栏的样式均被初始化 【改动思路】 1. Tab组件虽然在样式面板上没有设置标题样式的设置项,即 TitlePacker,但依然使用了标题样式相关的字段,如背景, 是否显示标题栏等,这些标题相关的字段不能在调整样式时被重置, 所以需要在Tab的StylePane中始终保持 2. Tab组件的样式数据初始化应该在数据模型层完成 --- .../creator/cardlayout/XWCardLayout.java | 18 ------------------ .../gui/xpane/CardTagLayoutStylePane.java | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java index e1d4a416e..578b509ec 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java @@ -62,10 +62,6 @@ public class XWCardLayout extends XLayoutContainer { public static final String DEFAULT_NAME = "cardlayout"; - - //默认蓝色标题背景 - private static final Color TITLE_COLOR = new Color(51, 132, 240); - public XWCardLayout(WCardLayout widget, Dimension initSize) { super(widget, initSize); } @@ -399,24 +395,10 @@ public class XWCardLayout extends XLayoutContainer { @Override public void refreshStylePreviewEffect() { BorderPacker style = toData().getBorderStyle(); - initBorderTitleStyle(style); refreshBorderAndBackgroundStylePreviewEffect(); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); } - private void initBorderTitleStyle(BorderPacker style) { - //初始化默认标题样式 - if (!initFlag) { - return; - } - - style.setType(LayoutBorderStyle.TITLE); - style.setBorder(Constants.LINE_THIN); - TitlePacker widgetTitle = style.getTitle(); - widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR)); - initFlag = false; - } - //隐藏或显示标题部分 protected void clearOrShowTitleLayout(boolean isTitleStyle) { XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent(); diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java index 37db55102..ab953166c 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java @@ -3,6 +3,8 @@ */ package com.fr.design.gui.xpane; +import com.fr.form.ui.LayoutBorderStyle; + import javax.swing.JPanel; /** @@ -10,6 +12,8 @@ import javax.swing.JPanel; */ public class CardTagLayoutStylePane extends LayoutStylePane { + private LayoutBorderStyle backupStyleFromPopulating = new LayoutBorderStyle(); + @Override protected JPanel createTitleStylePane(){ JPanel panel = super.createTitleStylePane(); @@ -21,4 +25,18 @@ public class CardTagLayoutStylePane extends LayoutStylePane { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { return super.createBackgroundStylePane(false); } + + @Override + public void populateBean(LayoutBorderStyle style) { + this.backupStyleFromPopulating = style; + super.populateBean(style); + } + + @Override + public LayoutBorderStyle updateBean() { + LayoutBorderStyle style = super.updateBean(); + style.setTitle(backupStyleFromPopulating.getTitle()); + style.setType(backupStyleFromPopulating.getType()); + return style; + } } From 0ce53a60b463b61088d9038f5b0e62a5aa0f9345 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 30 Nov 2021 15:32:07 +0800 Subject: [PATCH 02/16] =?UTF-8?q?REPORT-62691=2011.0=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BA=A7=E5=87=BA=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=9C=A8?= =?UTF-8?q?10.0=E4=B8=8B=E6=AD=A3=E5=B8=B8=E5=AE=89=E8=A3=85=EF=BC=8C?= =?UTF-8?q?=E4=BD=86=E5=A4=8D=E7=94=A8=E6=97=B6=E6=A8=A1=E6=9D=BF=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 10.0设计器上对组件版本进行检测,并限制使用不兼容的组件 【改动思路】 同上 --- .../share/ui/block/LocalWidgetBlock.java | 73 ++++++++++++++++++- 1 file changed, 69 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java index 911ff7b77..223e4a66d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java @@ -1,5 +1,6 @@ package com.fr.design.mainframe.share.ui.block; +import com.fr.base.FRContext; import com.fr.base.GraphHelper; import com.fr.base.iofile.attr.SharableAttrMark; import com.fr.design.actions.UpdateAction; @@ -37,17 +38,24 @@ import org.jetbrains.annotations.Nullable; import javax.swing.Action; import javax.swing.Icon; +import javax.swing.JOptionPane; import javax.swing.JPanel; +import javax.swing.UIManager; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Cursor; import java.awt.Dimension; +import java.awt.Font; import java.awt.Graphics; +import java.awt.Graphics2D; import java.awt.Image; import java.awt.Rectangle; +import java.awt.RenderingHints; import java.awt.dnd.DnDConstants; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.LineMetrics; import java.util.UUID; /** @@ -67,6 +75,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock private boolean hover; private final Icon markedMode = IOUtils.readIcon("/com/fr/base/images/share/marked.png"); private final Icon unMarkedMode = IOUtils.readIcon("/com/fr/base/images/share/unmarked.png"); + private final Icon incompatibleMarker = IOUtils.readIcon("/com/fr/base/images/share/marker_incompatible.png"); public LocalWidgetBlock(DefaultSharableWidget provider, LocalWidgetSelectPane parentPane) { super(provider); @@ -198,11 +207,24 @@ public class LocalWidgetBlock extends PreviewWidgetBlock Widget creatorSource; String shareId; if (source instanceof LocalWidgetBlock) { - LocalWidgetBlock no = (LocalWidgetBlock) e.getSource(); - if (no == null) { + LocalWidgetBlock widgetBlock = (LocalWidgetBlock) e.getSource(); + if (widgetBlock == null) { return; } - shareId = no.getBindInfo().getId(); + SharableWidgetProvider widget = widgetBlock.getWidget(); + if (widget == null) { + return; + } + if (!widget.isCompatibleWithCurrentEnv()) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Share_Drag_And_Make_Incompatible_Component_Tip"), + Toolkit.i18nText("Fine-Design_Basic_Error"), + JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon") + ); + return; + } + shareId = widgetBlock.getBindInfo().getId(); creatorSource = getGroup().getElCaseEditorById(shareId); if (creatorSource == null) { ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); @@ -211,7 +233,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock creatorSource.setWidgetID(UUID.randomUUID().toString()); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); //tab布局WCardMainBorderLayout通过反射出来的大小是960*480 - XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, no.getBindInfo()); + XCreator xCreator = ShareComponentUtils.createXCreator(creatorSource, shareId, widgetBlock.getBindInfo()); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); lastPressEvent = null; this.setBorder(null); @@ -221,6 +243,13 @@ public class LocalWidgetBlock extends PreviewWidgetBlock @Override public void paint(Graphics g) { super.paint(g); + Graphics2D g2d = (Graphics2D) g; + + boolean isUnusable = !getWidget().isCompatibleWithCurrentEnv(); + if (isUnusable) { + paintUnusableMask(g2d); + } + //绘制删除标志 if (isEdit) { Icon icon = isMarked ? markedMode : unMarkedMode; @@ -235,6 +264,42 @@ public class LocalWidgetBlock extends PreviewWidgetBlock } } + protected void paintUnusableMask(Graphics2D g2d) { + Color oldColor = g2d.getColor(); + Font oldFont = g2d.getFont(); + + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + Dimension coverDim = getCoverDimension(); + double canvasX = 0; + double canvasY = 0; + double canvasW = coverDim.getWidth(); + double canvasH = coverDim.getHeight(); + + g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.4F)); + GraphHelper.fillRect(g2d, canvasX, canvasY, canvasW, canvasH); + + g2d.setColor(new Color(0.0F, 0.0F, 0.0F, 0.5F)); + GraphHelper.fillRect(g2d, canvasX, canvasH - 16, canvasW, 16); + + String tipText = Toolkit.i18nText("Fine-Design_Share_Incompatible_Version_Tip"); + Font tipFont = FRContext.getDefaultValues().getFRFont().deriveFont(8.0F); + FontRenderContext frc = g2d.getFontRenderContext(); + double tipTextWidth = GraphHelper.stringWidth(tipText, tipFont, frc); + LineMetrics metrics = tipFont.getLineMetrics(tipText, frc); + double tipTextHeight = metrics.getHeight(); + g2d.setColor(Color.WHITE); + g2d.setFont(tipFont); + GraphHelper.drawString(g2d, tipText, canvasX + (canvasW - tipTextWidth) / 2.0F, canvasY + canvasH - (16 - tipTextHeight) / 2.0F); + + int markerX = (int) (canvasX + (canvasW - incompatibleMarker.getIconWidth()) / 2); + int markerY = (int) (canvasY + (canvasH - incompatibleMarker.getIconHeight()) / 2); + incompatibleMarker.paintIcon(this, g2d, markerX, markerY); + + g2d.setColor(oldColor); + g2d.setFont(oldFont); + } + /** * 由鼠标释放时调用该方法来触发左键点击事件 */ From afe4c1e5b59c02838ee3ca871eb5ee6b9ca84fa6 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 30 Nov 2021 17:29:21 +0800 Subject: [PATCH 03/16] =?UTF-8?q?REPORT-63322=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=8F=8A=E8=81=9A=E5=90=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E6=B3=95=E6=8B=96=E5=8A=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 在某些场景下,组件可能会被破坏或无法被当前设计器解析,从而出现 异常。若拖拽时的异常不被处理,会导致无法完成整个swing拖拽过程, 从而影响后续其他所有的组件拖拽。 【改动思路】 同产品以及交互讨论,新增了一个错误提示信息,当拖拽组件出现 异常时,提示用户,同时终结当前的拖拽。 --- .../mainframe/FormCreatorDropTarget.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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 a2c1ba66c..c1a08dded 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 @@ -18,6 +18,7 @@ import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWParameterLayout; +import com.fr.design.dialog.FineJOptionPane; import com.fr.design.form.util.XCreatorConstants; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.icon.IconPathConstants; @@ -31,12 +32,15 @@ import com.fr.form.share.SharableWidgetProvider; import com.fr.form.share.ShareLoader; import com.fr.form.share.editor.SharableEditorProvider; import com.fr.form.ui.Widget; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; +import javax.swing.JOptionPane; import javax.swing.JWindow; import javax.swing.SwingUtilities; +import javax.swing.UIManager; import java.awt.Color; import java.awt.Component; import java.awt.Point; @@ -318,6 +322,24 @@ public class FormCreatorDropTarget extends DropTarget { */ @Override public synchronized void drop(DropTargetDropEvent dtde) { + + try { + dropXCreator(dtde); + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + if (addingModel.getXCreator().isShared()) { + FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Share_Drag_Component_Error_Info"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), + JOptionPane.ERROR_MESSAGE, + UIManager.getIcon("OptionPane.errorIcon") + ); + } + dtde.rejectDrop(); + } + } + + private void dropXCreator(DropTargetDropEvent dtde) { Point loc = dtde.getLocation(); this.adding(designer.getRelativeX(loc.x), designer.getRelativeY(loc.y)); // 放到事件末尾执行 From 6621921d0dd5f2af4a9a6060bfd409b9254ddb0e Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 3 Dec 2021 14:37:52 +0800 Subject: [PATCH 04/16] =?UTF-8?q?REPORT-56014=20&=20REPORT-56015=20?= =?UTF-8?q?=E3=80=90=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB?= =?UTF-8?q?=E3=80=91=E3=80=90=E4=B8=8B=E4=B8=AA=E7=89=88=E6=9C=AC=E3=80=91?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8-=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E8=BE=B9=E6=A1=86=E7=82=B9=E4=B9=9D=E5=9B=BE=EF=BC=8C=E5=A6=82?= =?UTF-8?q?=E6=9E=9C=E7=BA=BF=E9=87=8D=E5=8F=A0=E4=BA=86=E7=9A=84=E8=AF=9D?= =?UTF-8?q?=EF=BC=8Cweb=E7=AB=AF=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 点九图小而组件大,且中间不可缩放的尺寸为0时,就会出现空白。从点九图的 使用机制上看无法避免上上述情况,需要在生成点九图的时候,强制中间缩放 区域的尺寸最小为1才行,即两条平行线之间的最小间距为1. 【改动思路】 同上 --- .../gui/xpane/BorderLineAndImagePane.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java index 6e8cac0d8..1db2db2e2 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java @@ -503,6 +503,7 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private int ninePointBottom = -1; private static final int MIN_NINE_POINT = 0; + private static final int MIN_GAP_PARALLEL_LINES = 1; private int imgWidth; private int imgHeight; @@ -773,8 +774,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointTopChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgHeight - ninePointBottom) { - value = imgHeight - ninePointBottom - MIN_NINE_POINT; + } else if (value >= imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES) { + value = imgHeight - ninePointBottom - MIN_GAP_PARALLEL_LINES; } this.ninePointTop = value; repaint(); @@ -783,8 +784,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointBottomChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgHeight - ninePointTop) { - value = imgHeight - ninePointTop - MIN_NINE_POINT; + } else if (value >= imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES) { + value = imgHeight - ninePointTop - MIN_GAP_PARALLEL_LINES; } this.ninePointBottom = value; repaint(); @@ -793,8 +794,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointLeftChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgWidth - ninePointRight) { - value = imgWidth - ninePointRight - MIN_NINE_POINT; + } else if (value >= imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES) { + value = imgWidth - ninePointRight - MIN_GAP_PARALLEL_LINES; } this.ninePointLeft = value; repaint(); @@ -803,8 +804,8 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { private void onNinePointRightChanged(int value) { if (value < MIN_NINE_POINT) { value = MIN_NINE_POINT; - } else if (value >= imgWidth - ninePointLeft) { - value = imgWidth - ninePointLeft - MIN_NINE_POINT; + } else if (value >= imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES) { + value = imgWidth - ninePointLeft - MIN_GAP_PARALLEL_LINES; } this.ninePointRight = value; repaint(); From 84b3103890b1620c393be4657a8ca9720301f800 Mon Sep 17 00:00:00 2001 From: Starryi Date: Fri, 3 Dec 2021 14:40:32 +0800 Subject: [PATCH 05/16] =?UTF-8?q?REPORT-60161=20=E3=80=90=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB=E3=80=91=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E4=B9=9D=E7=82=B9=E5=9B=BE=E7=9A=84=E7=BA=BF=E5=9C=A8?= =?UTF-8?q?=E8=BE=B9=E7=95=8C=E4=B8=8A=E5=90=8E=EF=BC=8C=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E5=9B=9E=E6=9D=A5=E5=8F=91=E7=8E=B0=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E6=88=90=E9=BB=98=E8=AE=A4=E4=BA=95=E5=AD=97=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 点九图边界线值为0也是有效值 【改动思路 --- .../com/fr/design/gui/xpane/BorderLineAndImagePane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java index 1db2db2e2..47ea7fb0d 100644 --- a/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java +++ b/designer-form/src/main/java/com/fr/design/gui/xpane/BorderLineAndImagePane.java @@ -298,15 +298,16 @@ public class BorderLineAndImagePane extends JPanel implements UIObserver { Background borderImage = style.getBorderImage(); if (borderImage instanceof ImageBackground) { // 图片类型边框 - Image image = ((ImageBackground) borderImage).getImage(); - int[] ninePoint = ((ImageBackground) borderImage).getNinePoint(); + ImageBackground imageBackground = (ImageBackground) borderImage; + Image image = imageBackground.getImage(); if (image != null) { this.borderLineCombo.selectBorderImage(); this.imagePreviewPane.setImageWithSuffix(((ImageBackground) borderImage).getImageWithSuffix()); this.tweakNinePointButton.setEnabled(true); this.borderImageOpacityPane.populateBean(style.getBorderImageOpacity()); - if (ninePoint != null && ninePoint.length == 4 && ninePoint[0] > 0 && ninePoint[1] > 0 && ninePoint[2] > 0 && ninePoint[3] > 0) { + int[] ninePoint = ((ImageBackground) borderImage).getNinePoint(); + if (ninePoint != null && ninePoint.length == 4 && ninePoint[0] >= 0 && ninePoint[1] >= 0 && ninePoint[2] >= 0 && ninePoint[3] >= 0) { this.ninePoint = Arrays.copyOf(ninePoint, 4); } else { this.ninePoint = new int[4]; From dceeb24569152f68c5618735292f4b41c48043ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 3 Dec 2021 18:26:56 +0800 Subject: [PATCH 06/16] =?UTF-8?q?REPORT-63092=20=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=A4=8D=E7=94=A8-=E6=8B=96=E5=85=A5=E5=B8=A6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E7=9A=84=E5=A4=8D=E7=94=A8=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E5=88=A0=E9=99=A4=E8=AE=BE=E8=AE=A1=E7=94=BB=E5=B8=83?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E7=BB=84=E4=BB=B6=E5=90=8E=EF=BC=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E9=9B=86=E6=B2=A1=E6=9C=89=E8=A2=AB=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/constants/TableDataConstants.java | 5 +++++ .../main/java/com/fr/design/data/BasicTableDataUtils.java | 7 +++---- .../src/main/java/com/fr/design/mainframe/JForm.java | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java diff --git a/designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java b/designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java new file mode 100644 index 000000000..7d8c66c09 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/constants/TableDataConstants.java @@ -0,0 +1,5 @@ +package com.fr.design.constants; + +public class TableDataConstants { + public static final String SEPARATOR = "_"; +} 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 c711a1999..ae90c5bac 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,6 +1,7 @@ package com.fr.design.data; import com.fr.data.TableDataSource; +import com.fr.design.constants.TableDataConstants; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.stable.StringUtils; @@ -11,8 +12,6 @@ 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; @@ -38,10 +37,10 @@ public abstract class BasicTableDataUtils { public static String getTableDataName(boolean isCover, TableDataSource tds, String tdName, String srcName, boolean isDsNameRepeaded) { if (isCover) { - return srcName + SEPARATOR + tdName; + return srcName + TableDataConstants.SEPARATOR + tdName; } if (tds.getTableData(tdName) != null || isDsNameRepeaded) {//如果有同名的就拼上来源名称 - tdName = srcName + SEPARATOR + tdName; + tdName = srcName + TableDataConstants.SEPARATOR + tdName; } int i = 0; while (tds.getTableData(tdName) != null) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index 6d7bf83ae..d8680e4ad 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -1085,7 +1085,7 @@ public class JForm extends JTemplate implements BaseJForm Date: Mon, 6 Dec 2021 09:49:04 +0800 Subject: [PATCH 07/16] =?UTF-8?q?CHART-21584=20feat:fvs.chart.font=20?= =?UTF-8?q?=E5=8D=95=E4=BD=8Dpx=20=E8=8C=83=E5=9B=B46-200?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartTextAttrPane.java | 10 ++++++++-- .../chart/gui/style/ChartTextAttrPaneWithAuto.java | 13 +++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 9a906cc7c..956a28e14 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -13,6 +13,7 @@ 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.mode.ChartEditContext; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; @@ -29,16 +30,21 @@ public class ChartTextAttrPane extends BasicPane { private static final long serialVersionUID = 6731679928019436869L; public static final int FONT_START = 6; public static final int FONT_END = 72; + public static final int FONT_END_4_DUCHAMP = 200; private UIComboBox fontNameComboBox; private UIComboBox fontSizeComboBox; private UIToggleButton bold; private UIToggleButton italic; private UIColorButton fontColor; - public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + private static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + private static Integer[] FONT_SIZES_4_DUCHAMP = new Integer[FONT_END_4_DUCHAMP - FONT_START + 1]; static { for (int i = FONT_START; i <= FONT_END; i++) { FONT_SIZES[i - FONT_START] = i; } + for (int i = FONT_START; i <= FONT_END_4_DUCHAMP; i++) { + FONT_SIZES_4_DUCHAMP[i - FONT_START] = i; + } } public ChartTextAttrPane() { @@ -176,7 +182,7 @@ public class ChartTextAttrPane extends BasicPane { } protected Object[] getFontSizeComboBoxModel() { - return FONT_SIZES; + return ChartEditContext.duchampMode() ? FONT_SIZES_4_DUCHAMP : FONT_SIZES; } protected void initState() { diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java index 292d83c9e..af157afca 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPaneWithAuto.java @@ -4,23 +4,30 @@ import com.fr.chart.base.ChartConstants; import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButtonWithAuto; import com.fr.design.i18n.Toolkit; -import com.fr.plugin.chart.type.FontAutoType; +import com.fr.design.mainframe.chart.mode.ChartEditContext; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; import com.fr.general.GeneralUtils; +import com.fr.plugin.chart.type.FontAutoType; public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { private static final String AUTO = Toolkit.i18nText("Fine-Design_Basic_ChartF_Auto"); private FontAutoType type; public static String[] FONT_SIZES_WITH_AUTO = new String[FONT_END - FONT_START + 2]; + private static String[] FONT_SIZES_WITH_AUTO_4_DUCHAMP = new String[FONT_END_4_DUCHAMP - FONT_START + 2]; static { FONT_SIZES_WITH_AUTO[0] = AUTO; + FONT_SIZES_WITH_AUTO_4_DUCHAMP[0] = AUTO; for (int i = 1; i < FONT_SIZES_WITH_AUTO.length; i++) { FONT_SIZES_WITH_AUTO[i] = FONT_START + i - 1 + ""; } + + for (int i = 1; i < FONT_SIZES_WITH_AUTO_4_DUCHAMP.length; i++) { + FONT_SIZES_WITH_AUTO_4_DUCHAMP[i] = FONT_START + i - 1 + ""; + } } public ChartTextAttrPaneWithAuto(FontAutoType type) { @@ -42,7 +49,9 @@ public class ChartTextAttrPaneWithAuto extends ChartTextAttrPane { } protected Object[] getFontSizeComboBoxModel() { - return isFontSizeAuto() ? FONT_SIZES_WITH_AUTO : FONT_SIZES; + return isFontSizeAuto() + ? (ChartEditContext.duchampMode() ? FONT_SIZES_WITH_AUTO_4_DUCHAMP : FONT_SIZES_WITH_AUTO) + : super.getFontSizeComboBoxModel(); } protected float updateFontSize() { From adf49bfded20a12f7fc261119314b1fc582069f4 Mon Sep 17 00:00:00 2001 From: shine Date: Mon, 6 Dec 2021 09:50:47 +0800 Subject: [PATCH 08/16] update --- .../fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java index 956a28e14..d07ec476e 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java @@ -36,7 +36,7 @@ public class ChartTextAttrPane extends BasicPane { private UIToggleButton bold; private UIToggleButton italic; private UIColorButton fontColor; - private static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; + public static Integer[] FONT_SIZES = new Integer[FONT_END - FONT_START + 1]; private static Integer[] FONT_SIZES_4_DUCHAMP = new Integer[FONT_END_4_DUCHAMP - FONT_START + 1]; static { for (int i = FONT_START; i <= FONT_END; i++) { From c19bb8edeb53d4c7cc911fe3e6a9d14c5afea91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 11:29:57 +0800 Subject: [PATCH 09/16] =?UTF-8?q?REPORT-63499=20=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E6=A0=91=E8=8A=82=E7=82=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E4=BA=8B=E4=BB=B6=EF=BC=8C=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=8A=E6=98=BE=E7=A4=BA=E6=9C=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/controlpane/UIListGroupControlPane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index 6ec5f496a..e82cbac82 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -122,10 +122,11 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li protected void populateNameObjects(Widget widget) { ArrayList nameObjectList = new ArrayList<>(); - for (int i = 0, size = widget.getListenerSize(); i < size; i++) { + for (int i = 0, j = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { - nameObjectList.add(i, new NameObject(switchLang(listener.getEventName()) + (i + 1), listener)); + nameObjectList.add(j, new NameObject(switchLang(listener.getEventName()) + (j + 1), listener)); + j++; } } populate(getHelper().processCatalog(nameObjectList)); From 72b7bdacaef2cd278727d73ba32f9848cf6178cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 13:49:59 +0800 Subject: [PATCH 10/16] REPORT-63499 --- .../fr/design/gui/controlpane/UIListGroupControlPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java index e82cbac82..063491f88 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/UIListGroupControlPane.java @@ -122,11 +122,12 @@ public abstract class UIListGroupControlPane extends UIControlPane implements Li protected void populateNameObjects(Widget widget) { ArrayList nameObjectList = new ArrayList<>(); - for (int i = 0, j = 0, size = widget.getListenerSize(); i < size; i++) { + for (int i = 0, size = widget.getListenerSize(); i < size; i++) { Listener listener = widget.getListener(i); if (!listener.isDefault()) { - nameObjectList.add(j, new NameObject(switchLang(listener.getEventName()) + (j + 1), listener)); - j++; + String eventName = switchLang(listener.getEventName()) + (nameObjectList.size() + 1); + NameObject nameObject = new NameObject(eventName, listener); + nameObjectList.add(nameObject); } } populate(getHelper().processCatalog(nameObjectList)); From ca2fcb358e038e9564ac0f5edc6aad48c554316d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 14:55:46 +0800 Subject: [PATCH 11/16] =?UTF-8?q?REPORT-63092=20=E6=BC=8F=E4=BC=A0?= =?UTF-8?q?=E4=BA=86import=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer-form/src/main/java/com/fr/design/mainframe/JForm.java | 1 + 1 file changed, 1 insertion(+) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java index d8680e4ad..66dc972c4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/JForm.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/JForm.java @@ -16,6 +16,7 @@ import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.base.mode.DesignModeContext; import com.fr.design.cell.FloatElementsProvider; +import com.fr.design.constants.TableDataConstants; import com.fr.design.data.datapane.TableDataTreePane; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; From a0798b48218e0f93de6a42859ff3504c4e22d5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Mon, 6 Dec 2021 16:36:46 +0800 Subject: [PATCH 12/16] =?UTF-8?q?REPORT-63106=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E4=B8=A4=E4=B8=AA=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=80=89=E4=B8=AD=E6=97=B6=E6=8B=96=E6=8B=BD=E5=88=B0=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E4=BD=8D=E7=BD=AE=EF=BC=8C=E7=84=B6=E5=90=8E=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=AF=B9=E9=BD=90=E4=BB=BB=E6=84=8F=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=EF=BC=8C=E4=B8=A4=E4=B8=AA=E7=BB=84=E4=BB=B6=E4=BC=9A=E8=B7=B3?= =?UTF-8?q?=E5=9B=9E=E5=88=9A=E6=89=8D=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ArrangementType.java | 33 ++++++++ .../mainframe/MultiSelectionArrangement.java | 81 ++++++++++++++----- ...stractMultiSelectionArrangementButton.java | 14 ++++ .../buttons/BottomAlignButton.java | 15 ++-- .../buttons/HorizontalCenterButton.java | 15 ++-- .../buttons/HorizontalDistributionButton.java | 15 ++-- .../arrangement/buttons/LeftAlignButton.java | 15 ++-- .../MultiSelectionArrangementButton.java | 4 + .../arrangement/buttons/RightAlignButton.java | 15 ++-- .../arrangement/buttons/TopAlignButton.java | 15 ++-- .../buttons/VerticalCenterButton.java | 13 +-- .../buttons/VerticalDistributionButton.java | 13 +-- .../widget/ui/FormMultiWidgetCardPane.java | 5 +- 13 files changed, 149 insertions(+), 104 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java b/designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java new file mode 100644 index 000000000..58f4b3464 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/ArrangementType.java @@ -0,0 +1,33 @@ +package com.fr.design.mainframe; + +public enum ArrangementType { + LEFT_ALIGN(0), + RIGHT_ALIGN(1), + TOP_ALIGN(2), + BOTTOM_ALIGN(3), + HORIZONTAL_CENTER_ALIGN(4), + VERTICAL_CENTER_ALIGN(5), + HORIZONTAL_AUTO_DISTRIBUTION(6), + HORIZONTAL_MANUAL_DISTRIBUTION(7), + VERTICAL_AUTO_DISTRIBUTION(8), + VERTICAL_MANUAL_DISTRIBUTION(9); + + private int type; + + ArrangementType(int type) { + this.type = type; + } + + public int getType() { + return this.type; + } + + public static ArrangementType parse(int type) { + for (ArrangementType arrangementType : ArrangementType.values()) { + if (arrangementType.getType() == type) { + return arrangementType; + } + } + return LEFT_ALIGN; + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java index 49dbc8c97..3ffe7d94a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/MultiSelectionArrangement.java @@ -15,67 +15,103 @@ import java.util.Comparator; import java.util.List; public class MultiSelectionArrangement { + private static final int DEFAULT_GAP = 10; + private FormDesigner designer; - private XLayoutContainer parent; // 当前选中的那些组件所在父容器 private List selectedCreators; private Rectangle rec; public MultiSelectionArrangement(FormDesigner designer) { this.designer = designer; - update(); } - public void leftAlign() { + public void doArrangement(ArrangementType type) { + doArrangement(type, DEFAULT_GAP); + } + + public void doArrangement(ArrangementType type, int gap) { + updatePosition(); + switch (type) { + case RIGHT_ALIGN: + rightAlign(); + break; + case TOP_ALIGN: + topAlign(); + break; + case BOTTOM_ALIGN: + bottomAlign(); + break; + case HORIZONTAL_CENTER_ALIGN: + horizontalCenterAlign(); + break; + case VERTICAL_CENTER_ALIGN: + verticalCenterAlign(); + break; + case HORIZONTAL_AUTO_DISTRIBUTION: + horizontalAutoDistribution(); + break; + case HORIZONTAL_MANUAL_DISTRIBUTION: + horizontalManualDistribution(gap); + break; + case VERTICAL_AUTO_DISTRIBUTION: + verticalAutoDistribution(); + break; + case VERTICAL_MANUAL_DISTRIBUTION: + verticalManualDistribution(gap); + break; + case LEFT_ALIGN: + default: + leftAlign(); + break; + } + updateModel(); + } + + private void leftAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(rec.x, creator.getY()); } - update(); } - public void rightAlign() { + private void rightAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(rec.x + rec.width - creator.getWidth(), creator.getY()); } - update(); } - public void topAlign() { + private void topAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y); } - update(); } - public void bottomAlign() { + private void bottomAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y + rec.height - creator.getHeight()); } - update(); } - public void horizontalCenterAlign() { + private void horizontalCenterAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(rec.x + rec.width / 2 - creator.getWidth() / 2, creator.getY()); } - update(); } - public void verticalCenterAlign() { + private void verticalCenterAlign() { for (XCreator creator : selectedCreators) { creator.setLocation(creator.getX(), rec.y + rec.height / 2 - creator.getHeight() / 2); } - update(); } // 水平分布,自动,间距由selectedCreators和border共同计算而来 - public void horizontalAutoDistribution() { + private void horizontalAutoDistribution() { sortHorizontal(); int[] gaps = calculateHorizontalGaps(); horizontalDistribution(gaps); } // 水平分布,手动,传入一个间距,排列selectedCreators - public void horizontalManualDistribution(int gap) { + private void horizontalManualDistribution(int gap) { sortHorizontal(); reSizeRecByHorizontal(gap); horizontalDistribution(fillGaps(gap, selectedCreators.size() - 1)); @@ -87,7 +123,6 @@ public class MultiSelectionArrangement { XCreator preCreator = selectedCreators.get(i - 1); creator.setLocation(preCreator.getX() + preCreator.getWidth() + gaps[i - 1], creator.getY()); } - update(); } private void reSizeRecByHorizontal(int gap) { @@ -145,13 +180,13 @@ public class MultiSelectionArrangement { return calculateIntegerGaps(distanceBetweenHeadAndTailCreators - sum, gapCount); } - public void verticalAutoDistribution() { + private void verticalAutoDistribution() { sortVertical(); int[] gaps = calculateVerticalGaps(); verticalDistribution(gaps); } - public void verticalManualDistribution(int gap) { + private void verticalManualDistribution(int gap) { sortVertical(); reSizeRecByVertical(gap); verticalDistribution(fillGaps(gap, selectedCreators.size() - 1)); @@ -163,7 +198,6 @@ public class MultiSelectionArrangement { XCreator preCreator = selectedCreators.get(i - 1); creator.setLocation(creator.getX(), preCreator.getY() + preCreator.getHeight() + gaps[i - 1]); } - update(); } private void reSizeRecByVertical(int gap) { @@ -252,12 +286,15 @@ public class MultiSelectionArrangement { return gaps; } - private void update() { + private void updatePosition() { FormSelection selection = designer.getSelectionModel().getSelection(); this.selectedCreators = Arrays.asList(selection.getSelectedCreators()); this.rec = selection.getSelctionBounds(); - this.parent = getParent(selection.getSelectedCreator()); + } + private void updateModel() { + FormSelection selection = designer.getSelectionModel().getSelection(); + XLayoutContainer parent = getParent(selection.getSelectedCreator()); if (parent != null) { // 这里要修改修改engine里面的对象才能成功保存,光修改设计器对象没用 WLayout wabs = parent.toData(); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java index dc268f4c5..947429504 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/AbstractMultiSelectionArrangementButton.java @@ -5,6 +5,9 @@ import com.fr.design.event.UIObserverListener; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.mainframe.MultiSelectionArrangement; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + public abstract class AbstractMultiSelectionArrangementButton extends UIButton implements MultiSelectionArrangementButton, UIObserver { private static final long serialVersionUID = -2114423583742242771L; protected MultiSelectionArrangement arrangement; @@ -29,4 +32,15 @@ public abstract class AbstractMultiSelectionArrangementButton extends UIButton i public boolean shouldResponseChangeListener() { return true; } + + @Override + public ActionListener getActionListener() { + return new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + arrangement.doArrangement(getArrangementType()); + uiObserverListener.doChange(); + } + }; + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java index 99bf3a6c3..97974298a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/BottomAlignButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 2397455240682353024L; + public BottomAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class BottomAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.bottomAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.BOTTOM_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java index 6dc9c09b4..ec8f315df 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalCenterButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class HorizontalCenterButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 6290178236460051049L; + public HorizontalCenterButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class HorizontalCenterButton extends AbstractMultiSelectionArrangementBut } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalCenterAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.HORIZONTAL_CENTER_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java index 0a0e225fc..0702248ed 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/HorizontalDistributionButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class HorizontalDistributionButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 5052092252720664954L; + public HorizontalDistributionButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class HorizontalDistributionButton extends AbstractMultiSelectionArrangem } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.horizontalAutoDistribution(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.HORIZONTAL_AUTO_DISTRIBUTION; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java index 20a25a87c..02a6a2c79 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/LeftAlignButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = -8177637788632733710L; + public LeftAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class LeftAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.leftAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.LEFT_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java index 99b763570..96f576598 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/MultiSelectionArrangementButton.java @@ -1,5 +1,7 @@ package com.fr.design.mainframe.widget.arrangement.buttons; +import com.fr.design.mainframe.ArrangementType; + import javax.swing.Icon; import java.awt.event.ActionListener; @@ -9,4 +11,6 @@ public interface MultiSelectionArrangementButton { String getTipText(); ActionListener getActionListener(); + + ArrangementType getArrangementType(); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java index 5fac70bd7..1b047b6ba 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/RightAlignButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class RightAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = -8698936349956288409L; + public RightAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class RightAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.rightAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.RIGHT_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java index ebb2c4d21..0adfb9378 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/TopAlignButton.java @@ -1,14 +1,15 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class TopAlignButton extends AbstractMultiSelectionArrangementButton { + private static final long serialVersionUID = 2896267783075870924L; + public TopAlignButton(MultiSelectionArrangement arrangement) { super(arrangement); } @@ -24,13 +25,7 @@ public class TopAlignButton extends AbstractMultiSelectionArrangementButton { } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.topAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.TOP_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java index 9898f9002..4fb8b62a2 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalCenterButton.java @@ -1,12 +1,11 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class VerticalCenterButton extends AbstractMultiSelectionArrangementButton { public VerticalCenterButton(MultiSelectionArrangement arrangement) { @@ -24,13 +23,7 @@ public class VerticalCenterButton extends AbstractMultiSelectionArrangementButto } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalCenterAlign(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.VERTICAL_CENTER_ALIGN; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java index 50ec6ac89..76dcf9427 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/arrangement/buttons/VerticalDistributionButton.java @@ -1,12 +1,11 @@ package com.fr.design.mainframe.widget.arrangement.buttons; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.ArrangementType; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.general.IOUtils; import javax.swing.Icon; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; public class VerticalDistributionButton extends AbstractMultiSelectionArrangementButton { public VerticalDistributionButton(MultiSelectionArrangement arrangement) { @@ -24,13 +23,7 @@ public class VerticalDistributionButton extends AbstractMultiSelectionArrangemen } @Override - public ActionListener getActionListener() { - return new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - arrangement.verticalAutoDistribution(); - uiObserverListener.doChange(); - } - }; + public ArrangementType getArrangementType() { + return ArrangementType.VERTICAL_AUTO_DISTRIBUTION; } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java index ffd2a0f74..cf59b595c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormMultiWidgetCardPane.java @@ -9,6 +9,7 @@ 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.ArrangementType; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.MultiSelectionArrangement; import com.fr.design.mainframe.widget.arrangement.buttons.BottomAlignButton; @@ -186,9 +187,9 @@ public class FormMultiWidgetCardPane extends FormWidgetCardPane { int gap = (int) Math.floor(Float.parseFloat(text)); numberField.setValue(gap); if (isVertical) { - arrangement.verticalManualDistribution(gap); + arrangement.doArrangement(ArrangementType.VERTICAL_MANUAL_DISTRIBUTION, gap); } else { - arrangement.horizontalManualDistribution(gap); + arrangement.doArrangement(ArrangementType.HORIZONTAL_MANUAL_DISTRIBUTION, gap); } attributeChanged(); } From 123b0ce7e144e9952abf6aac425c657f9fafc70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 7 Dec 2021 22:02:38 +0800 Subject: [PATCH 13/16] =?UTF-8?q?REPORT-62804=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=B7=A5=E5=85=B7=E6=A0=8F=E7=9A=84=E9=93=BE=E6=8E=A5?= =?UTF-8?q?=E6=94=B9=E5=8A=A8(=E7=A4=BE=E5=8C=BAurl=E6=94=B9=E5=8A=A8?= =?UTF-8?q?=E9=9C=80=E6=B1=82)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/community/BugAction.java | 2 +- .../design/actions/community/NeedAction.java | 2 +- .../actions/community/StudyPlanAction.java | 17 +++++++++++++++++ .../mainframe/toolbar/ToolBarMenuDock.java | 2 ++ .../com/fr/design/images/bbs/studyPlan.png | Bin 0 -> 1129 bytes .../fr/design/images/bbs/studyPlan_normal.svg | 1 + .../com/fr/start/preload/ImagePreLoader.java | 1 + 7 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan_normal.svg diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index a16257100..bb2de54ba 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -17,7 +17,7 @@ public class BugAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "http://bbs.fanruan.com/forum-156-1.html"); + return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "https://service.fanruan.com/PF/FR/feedback"); } public static final MenuKeySet BUG = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index c8b2ccdae..4a9b80a9b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -18,7 +18,7 @@ public class NeedAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "http://bbs.fanruan.com/forum-56-1.html"); + return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "https://service.fanruan.com/PF/FR/feedback"); } public static final MenuKeySet NEED = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java b/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java new file mode 100644 index 000000000..d0dcc4195 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/actions/community/StudyPlanAction.java @@ -0,0 +1,17 @@ +package com.fr.design.actions.community; + +import com.fr.design.i18n.Toolkit; +import com.fr.design.login.AbstractDesignerSSO; +import com.fr.general.CloudCenter; + +public class StudyPlanAction extends AbstractDesignerSSO { + public StudyPlanAction() { + this.setName(Toolkit.i18nText("Fine-Design_Study_Plan")); + this.setSmallIcon("/com/fr/design/images/bbs/studyPlan"); + } + + @Override + public String getJumpUrl() { + return CloudCenter.getInstance().acquireUrlByKind("bbs.studyPlan", "https://edu.fanruan.com/studypath/finereport"); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index cfc4483c9..5043e8307 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -17,6 +17,7 @@ import com.fr.design.actions.community.FacebookFansAction; import com.fr.design.actions.community.NeedAction; import com.fr.design.actions.community.QuestionAction; import com.fr.design.actions.community.SignAction; +import com.fr.design.actions.community.StudyPlanAction; import com.fr.design.actions.community.TechSolutionAction; import com.fr.design.actions.community.TechSupportAction; import com.fr.design.actions.community.TemplateStoreAction; @@ -597,6 +598,7 @@ public abstract class ToolBarMenuDock { shortCuts.add(new TutorialAction()); } }, SupportLocaleImpl.TUTORIAL_COMMUNITY); + shortCuts.add(new StudyPlanAction()); shortCuts.add(new QuestionAction()); shortCuts.add(new TechSolutionAction()); diff --git a/designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png b/designer-base/src/main/resources/com/fr/design/images/bbs/studyPlan.png new file mode 100644 index 0000000000000000000000000000000000000000..1a27244653e92d08f20967f7b423605328f3cea3 GIT binary patch literal 1129 zcmb`_KS-NF7{~ETjhb2_#){TB=-^N*D1uTaAt9v(N-CmA9IP(R1sytwgPV(pINE}U z|3IY$r5!@RE`p#Gp(@(OMZrZx92}Iy?=N^EDam9X_`G-TbN3$aJ$K_Bp||cLZ;>&^ z9c&MD(w2y;fM@k}Vu0r9$M*1$F{Q)ehz(YMGR9dI4EVZQJ&qFRfpaut3#%wc)^L%H;wNge%y>?29$LI2%ea{!xe5J+ z2hWf#W=KZtfUSX-gjR0E8P<`HLnso^{->d1)7%e;s6dK7==3xp4nI!u6$j8lVccL3 zszVbtY!P4b@(T(rFp6zdKF}W)LklQ&@Jb!09)wzZDN5;UkIQK}x@HPL)FJMW{MIh; zm&9w05H&c)2yD3N=x*51{m?h5&=#(sqtdn(Z~`qPx(iWgOm$OTx{(n}ye+0>G*KrZ zDq0H^YIkA(Ub$qH@zn8rL9RQHoS6Qw_rT^}(3wR8=Ade;V5+$ELU$q+|1Mw$d~|wH g2kkqCZ_vGnl \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java index 138e7df2b..24d23565c 100644 --- a/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java +++ b/designer-realize/src/main/java/com/fr/start/preload/ImagePreLoader.java @@ -175,6 +175,7 @@ public class ImagePreLoader { "/com/fr/design/images/bbs/center_normal.svg", "/com/fr/design/images/bbs/sign_normal.svg", "/com/fr/design/images/bbs/facebook_normal.svg", + "/com/fr/design/images/bbs/studyPlan_normal.svg", "/com/fr/design/images/update/update_new_normal.svg", "com/fr/design/images/signature.png", "com/fr/design/images/m_file/switch.png", From e981ca8eb1d9c0896988891da0bd7a26253a2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Thu, 9 Dec 2021 09:50:40 +0800 Subject: [PATCH 14/16] =?UTF-8?q?REPORT-64013=20=E7=A4=BE=E5=8C=BAurl?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=EF=BC=88=E6=B7=BB=E5=8A=A0=E9=94=9A=E7=82=B9?= =?UTF-8?q?=E6=A0=87=E8=87=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/actions/community/BugAction.java | 2 +- .../main/java/com/fr/design/actions/community/NeedAction.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java index bb2de54ba..5365e556b 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/BugAction.java @@ -17,7 +17,7 @@ public class BugAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "https://service.fanruan.com/PF/FR/feedback"); + return CloudCenter.getInstance().acquireUrlByKind("bbs.bugs", "https://service.fanruan.com/PF/FR/feedback?type=2"); } public static final MenuKeySet BUG = new MenuKeySet() { diff --git a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java index 4a9b80a9b..62d4b9c95 100644 --- a/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/community/NeedAction.java @@ -18,7 +18,7 @@ public class NeedAction extends AbstractDesignerSSO { @Override public String getJumpUrl() { - return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "https://service.fanruan.com/PF/FR/feedback"); + return CloudCenter.getInstance().acquireUrlByKind("bbs.needs", "https://service.fanruan.com/PF/FR/feedback?type=1"); } public static final MenuKeySet NEED = new MenuKeySet() { From c6677e6906cb0f518aa8d76e56fb18e196a88928 Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 10 Dec 2021 11:12:50 +0800 Subject: [PATCH 15/16] =?UTF-8?q?REPORT-64095=20websocket=E9=A2=91?= =?UTF-8?q?=E7=B9=81=E5=87=BA=E7=8E=B0=E6=96=AD=E5=BC=80=E5=8F=88=E8=BF=9E?= =?UTF-8?q?=E4=B8=8A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/socketio/DesignerSocketIO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java index 2cb2099bf..97e8692dc 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java @@ -34,6 +34,8 @@ import io.socket.client.IO; import io.socket.client.Socket; import io.socket.emitter.Emitter; +import io.socket.engineio.client.transports.Polling; +import io.socket.engineio.client.transports.WebSocket; import java.io.File; import java.io.FileInputStream; import java.security.KeyStore; @@ -116,6 +118,7 @@ public class DesignerSocketIO { private static IO.Options createOptions() { IO.Options options = new IO.Options(); options.path = WebSocketConfig.getInstance().getSocketContext(); + options.transports = new String[]{WebSocket.NAME, Polling.NAME}; try { if (ComparatorUtils.equals(currentProtocol, HTTPS)) { options.sslContext = getSSLContext(); From 6c57ae3713ab5b5bb8c807d6b5e33adcb29b7988 Mon Sep 17 00:00:00 2001 From: shine Date: Wed, 8 Dec 2021 17:08:57 +0800 Subject: [PATCH 16/16] =?UTF-8?q?CHART-22213=20fix:=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=AD=A6=E6=88=92=E7=BA=BF=20=E9=BB=98=E8=AE=A4=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=98=AF9px12px=20=E4=B8=8D=E6=98=AF9px?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/config/DefaultStyleConstants.java | 26 +++++------ .../chart/config/DefaultStyleHelper4Van.java | 45 ++++++++++++++----- 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java index 6d0de41ce..4cbba6290 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleConstants.java @@ -18,35 +18,35 @@ import java.awt.Font; * Created by shine on 2021/6/25 */ public class DefaultStyleConstants { - static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 14, new Color(241, 246, 255)); - static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.BOLD, 19, new Color(241, 246, 255)); + static final FRFont LEGEND = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); - static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); - static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(200, 211, 228)); + static final FRFont AXIS_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); + static final FRFont AXIS_TITLE = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(200, 211, 228)); static final Color AXIS_LINE = new Color(46, 75, 102); static final Color GRID_LINE = new Color(30, 55, 78); - static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(255, 0, 0)); + static final FRFont ALERT_FONT = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(255, 0, 0)); - static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 9, new Color(159, 173, 191)); + static final FRFont DATA_SHEET = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 12, new Color(159, 173, 191)); static final Color DATA_SHEET_BORDER = new Color(46, 75, 102); static final Color BORDER = Color.BLACK; static final int BORDER_WIDTH = Constants.LINE_NONE; static final int SPECIAL_BORDER_WIDTH = Constants.LINE_THIN; - static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 10, new Color(232, 232, 232)); + static final FRFont PIE_CATEGORY_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 13, new Color(232, 232, 232)); static final Color GAUGE_PANE_BACK_COLOR = null; static final Color GAUGE_HINGE = null; static final Color GAUGE_PANE_BACK_COLOR_4_RING = new Color(72, 73, 79); static final Color GAUGE_SLOT_BACKGROUND_COLOR = new Color(72, 73, 79); private static final String FONT_NAME = ChartBaseUtils.getLocalDefaultFont("verdana"); - static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 9, new Color(232, 232, 232));//试管仪表盘标签的默认样式 - static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 8, new Color(159, 173, 191)); + static final FRFont THERMOMETER_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.BOLD, 12, new Color(232, 232, 232));//试管仪表盘标签的默认样式 + static final FRFont THERMOMETER_AXIS_LABEL = FRFont.getInstance(FONT_NAME, Font.PLAIN, 11, new Color(159, 173, 191)); static final FRFont RING_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//百分比圆环仪表盘值标签的默认样式 static final FRFont POINTER_VALUE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, ChartConstants.AUTO_FONT_SIZE, new Color(232, 232, 232));//多指针仪表盘值标签的默认样式 - static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 10, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 + static final FRFont POINTER_CATE_LABEL_FONT = FRFont.getInstance(FONT_NAME, Font.PLAIN, 13, new Color(232, 232, 232));//多指针仪表盘分类标签的默认样式 static final Color MAP_NULL_VALUE_COLOR = new Color(168, 168, 168); static final Color MAP_BORDER = Color.BLACK; @@ -56,12 +56,6 @@ public class DefaultStyleConstants { static final Color DRILL_MAP_DRILL_TOOLS_BACK = Color.BLACK; static final float DRILL_MAP_DRILL_TOOLS_BACK_OPACITY = 0.8f; - //todo vancharts - private static final Color GANTT_OUT_LINE = GRID_LINE; - private static final FRFont GANTT_LABEL = FRFont.getInstance(ChartBaseUtils.getLocalDefaultFont("Microsoft YaHei"), Font.PLAIN, 8, new Color(217, 217, 217)); - private static final Color GANTT_BORDER_LINE = new Color(30, 36, 58); - private static final Color GAUGE_TICK = new Color(39, 49, 71); - static final Background BACK = null; static String COLORS = null; diff --git a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java index d6fc30bd5..31694433f 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java +++ b/designer-chart/src/main/java/com/fr/van/chart/config/DefaultStyleHelper4Van.java @@ -1,5 +1,7 @@ package com.fr.van.chart.config; +import com.fr.base.ChartColorMatching; +import com.fr.base.ChartPreStyleConfig; import com.fr.chart.base.AttrBorder; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; @@ -28,8 +30,17 @@ import com.fr.plugin.chart.type.GaugeStyle; */ public class DefaultStyleHelper4Van { + private static boolean duchampMode() { + try { + return ChartEditContext.duchampMode(); + } catch (Throwable e) { + //tomcat预览 默认数据的图表 + return true; + } + } + public static void dealVanPlot4Custom(VanChartPlot plot, CustomPlotType customPlotType) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } dealVanPlotCommonAttr(plot); @@ -60,7 +71,7 @@ public class DefaultStyleHelper4Van { } public static VanChartAxis dealAxisDefault(VanChartAxis axis) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return axis; } axis.getTitle().getTextAttr().setFRFont(DefaultStyleConstants.AXIS_TITLE); @@ -71,28 +82,38 @@ public class DefaultStyleHelper4Van { } public static void dealAxisAlert(VanChartAlertValue vanChartAlertValue) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } vanChartAlertValue.setAlertFont(DefaultStyleConstants.ALERT_FONT); } static void dealVanPlotCommonAttr(Plot plot) { - if (!ChartEditContext.duchampMode()) { + if (!duchampMode()) { return; } if (plot instanceof VanChartPlot) { VanChartPlot vanChartPlot = (VanChartPlot) plot; - ColorFillStyle colorFillStyle = new ColorFillStyle(); - colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); - colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); - AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); - if (plotFillStyle == null) { - plotFillStyle = new AttrFillStyle(); - vanChartPlot.setPlotFillStyle(plotFillStyle); + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(DefaultStyleConstants.COLORS); + if (preStyle instanceof ChartColorMatching) { + ColorFillStyle colorFillStyle = new ColorFillStyle(); + //default是默认的意思,为服务器默认配色方案 + //acc为多个颜色组合 + //gradient为渐变颜色 + colorFillStyle.setColorStyle(ChartConstants.COLOR_ACC); + colorFillStyle.setFillStyleName(DefaultStyleConstants.COLORS); + colorFillStyle.setColorList(((ChartColorMatching) preStyle).getColorList()); + + AttrFillStyle plotFillStyle = vanChartPlot.getPlotFillStyle(); + if (plotFillStyle == null) { + plotFillStyle = new AttrFillStyle(); + vanChartPlot.setPlotFillStyle(plotFillStyle); + } + plotFillStyle.setColorFillStyle(colorFillStyle); } - plotFillStyle.setColorFillStyle(colorFillStyle); + if (vanChartPlot.getLegend() != null) { vanChartPlot.getLegend().setFRFont(DefaultStyleConstants.LEGEND);