From 0dbfac7719f17f4637d9f31eddfec88d8cf45e2d Mon Sep 17 00:00:00 2001 From: kerry Date: Tue, 16 Nov 2021 17:15:24 +0800 Subject: [PATCH 1/3] =?UTF-8?q?REPORT-62398=20=20&&=20REPORT-62397?= =?UTF-8?q?=E3=80=90=E6=8E=A5=E8=A7=A6=E7=82=B9=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E6=8E=A8=E8=8D=90=E7=BB=84=E4=BB=B6=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=85=A8;?= =?UTF-8?q?=E3=80=90=E6=8E=A5=E8=A7=A6=E7=82=B9=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E9=9D=A2=E6=9D=BF=E5=AD=98=E5=9C=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E4=B8=8A=E4=B8=8B=E6=BB=91=E5=8A=A8=E9=BC=A0=E6=A0=87?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/share/ui/block/OnlineWidgetBlock.java | 7 ++++--- .../share/ui/online/AbstractOnlineWidgetSelectPane.java | 4 ++-- .../mainframe/share/ui/online/OnlineWidgetRepoPane.java | 6 ++++++ .../mainframe/share/ui/online/OnlineWidgetTabPane.java | 7 +++++++ .../design/mainframe/share/ui/online/embed/EmbedPane.java | 2 +- .../share/ui/online/embed/OnlineEmbedFilterShowPane.java | 6 ++++++ 6 files changed, 26 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java index 9f5873771..cd4163b4b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java @@ -357,6 +357,9 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { if (isUnusable) { paintUnusableMask((Graphics2D) g); } + if (this.parentPane != null) { + this.parentPane.refreshShowPaneUI(); + } } protected void paintUnusableMask(Graphics2D g2d) { @@ -393,14 +396,12 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock { g2d.setColor(oldColor); g2d.setFont(oldFont); + } @Override public void repaint() { super.repaint(); - if (this.parentPane != null) { - this.parentPane.refreshUI(); - } } class WidgetDownloadProcess implements com.fr.design.extra.Process { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java index 4221e4b96..53239700d 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/AbstractOnlineWidgetSelectPane.java @@ -242,7 +242,7 @@ public abstract class AbstractOnlineWidgetSelectPane extends AbstractWidgetSele return this.getParent(); } - public void refreshUI() { - OnlineWidgetRepoPane.getInstance().repaint(); + public void refreshShowPaneUI() { + OnlineWidgetRepoPane.getInstance().refreshShowPaneUI(); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java index fcc59771e..b9e430fe4 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java @@ -228,6 +228,12 @@ public class OnlineWidgetRepoPane extends BasicPane { } } + public void refreshShowPaneUI(){ + if (componentTabPane != null) { + this.componentTabPane.refreshShowPaneUI(); + } + } + public void completeEmbedFilter(){ if (componentTabPane != null) { diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java index 96c3e2825..b48b74e67 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetTabPane.java @@ -87,6 +87,13 @@ public class OnlineWidgetTabPane extends JPanel { this.cardLayout.show(centerPane, ComponentShareUtil.needShowEmbedFilterPane() ? COMPONENT_EMBED : COMPONENT); } + public void refreshShowPaneUI(){ + if (embedFilterShowPane != null) { + this.embedFilterShowPane.refreshUI(); + } + } + + public void removeTabChangeListener(TabChangeListener listener) { tabChangeListeners.remove(listener); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/EmbedPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/EmbedPane.java index 04680753b..bf535b367 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/EmbedPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/EmbedPane.java @@ -86,7 +86,7 @@ public class EmbedPane extends JPanel { protected void paintBorder(Graphics g, UIButton b) { Color oldColor = g.getColor(); g.setColor(SEARCH_BUTTON_COLOR); - g.drawRoundRect(0, 0, b.getWidth(), b.getHeight(), 2, 2); + g.drawRoundRect(0, 0, b.getWidth() - 4, b.getHeight() - 4, 2, 2); g.setColor(oldColor); } }); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterShowPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterShowPane.java index 11e39c923..9141bf98a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterShowPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/embed/OnlineEmbedFilterShowPane.java @@ -36,6 +36,12 @@ public class OnlineEmbedFilterShowPane extends JPanel { selectPane.animate(); } + public void refreshUI(){ + if (embedPane != null) { + this.repaint(); + } + } + public void completeEmbedFilter(){ if (embedPane!= null && embedPane.isShowing()){ this.remove(embedPane); From 3430b56fae9b86e58e059a4d2ec87c7af6f86a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 16 Nov 2021 21:43:44 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-60748=20=E5=86=B3=E7=AD=96=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8-=E5=B1=9E=E6=80=A7-=E5=9D=90=E6=A0=87=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widget/WidgetBoundsPaneFactory.java | 6 +++--- .../design/designer/creator/XChartEditor.java | 5 +++++ .../fr/design/designer/creator/XCreator.java | 8 ++++++++ .../designer/creator/XCreatorUtils.java | 19 +++++++++++++++++++ .../design/designer/creator/XElementCase.java | 5 +++++ .../designer/creator/XLayoutContainer.java | 5 +++++ .../widget/ui/FormSingleWidgetCardPane.java | 11 +++-------- .../component/WidgetAbsoluteBoundPane.java | 2 +- .../designer/component/WidgetBoundPane.java | 15 ++++++++++++++- 9 files changed, 63 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java index 99b1ddaa0..2b2dcc532 100644 --- a/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -46,12 +46,12 @@ public class WidgetBoundsPaneFactory { private static final int RIGHT_PANE_WIDTH = 145; - public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked) { + public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height, JComponent ratioLocked, NameAttribute nameAttribute) { JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget_Size")), + new Component[]{FRWidgetFactory.createLineWrapLabel(nameAttribute.getSizeName()), ratioLocked != null ? createRightPane(width, ratioLocked, height) : createRightPane(width, height)}, new Component[]{null, createRightPane(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, }; @@ -65,7 +65,7 @@ public class WidgetBoundsPaneFactory { } public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { - return createBoundsPane(width, height, null); + return createBoundsPane(width, height, null, NameAttribute.DEFAULT); } public static JPanel createRightPane(Component com1, Component com2) { diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index 3d1550af6..b70754c11 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -363,4 +363,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { return false; } + @Override + public boolean isComponent() { + return true; + } + } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java index 87a1926cb..1fafe839c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreator.java @@ -894,4 +894,12 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo } return ((XCreator) this.getParent()).getLevel() + 1; } + + /** + * 是否是组件(控件还是组件) + * @return 是否是组件 + */ + public boolean isComponent() { + return false; + } } 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 945d3bfdd..2f797efa4 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 @@ -356,4 +356,23 @@ public class XCreatorUtils { } return null; } + + /** + * 把控件例如textEditor外层的容器剥掉 + * @param xCreator 控件 + * @return 内层控件 + */ + public static XCreator getXCreatorInnerWidget(XCreator xCreator) { + if (xCreator.acceptType(XWScaleLayout.class)) { + if (xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator()) { + return (XCreator) xCreator.getComponent(0); + } + } + + if (xCreator.acceptType(XWTitleLayout.class)) { + return (XCreator) xCreator.getComponent(0); + } + + return xCreator; + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java index cf8b7a766..f1a4f1716 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java @@ -365,4 +365,9 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme public void releaseResources() { imageLable.setIcon(null); } + + @Override + public boolean isComponent() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java index f1d4c4f6d..92c5dd654 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XLayoutContainer.java @@ -586,4 +586,9 @@ public abstract class XLayoutContainer extends XBorderStyleWidgetCreator impleme public void setDragInAble(boolean dragInAble) { this.dragInAble = dragInAble; } + + @Override + public boolean isComponent() { + return true; + } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java index 9f0c44ded..1fd1a3527 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java @@ -113,7 +113,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { } private void initComponents() { - XCreator innerCreator = getXCreatorDedicated(); + XCreator innerCreator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); attriCardPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); content.add(attriCardPane, BorderLayout.CENTER); @@ -166,7 +166,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { private void initDefinePane() { currentEditorDefinePane = null; - XCreator creator = getXCreatorDedicated(); + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); FormWidgetDefinePaneFactoryBase.RN rn = FormWidgetDefinePaneFactoryBase.createWidgetDefinePane(creator, designer, creator.toData(), new Operator() { @Override public void did(DataCreatorUI ui, String cardName) { @@ -190,11 +190,6 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { currentEditorDefinePane = definePane; } - private XCreator getXCreatorDedicated() { - boolean dedicateLayout = xCreator.acceptType(XWScaleLayout.class) && xCreator.getComponentCount() > 0 && ((XCreator) xCreator.getComponent(0)).shouldScaleCreator() || xCreator.acceptType(XWTitleLayout.class); - return dedicateLayout ? (XCreator) xCreator.getComponent(0) : xCreator; - } - @Override public String title4PopupWindow() { return "Widget"; @@ -283,7 +278,7 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane { } public void fireValueChanged() { - XCreator creator = getXCreatorDedicated(); + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.xCreator); creator.firePropertyChange(); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index e8aeb994d..f6d52a2d6 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -35,7 +35,7 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { width.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); height.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); ratioLockedButton.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size")); - this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, WidgetBoundsPaneFactory.NameAttribute.WIDGET)); + this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height, ratioLockedButton, getNameAttribute())); } @Override diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index a462a8aed..aee83889e 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -89,7 +89,20 @@ public class WidgetBoundPane extends BasicPane { ratioLockedButton.setLockEnabled(false); } - this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton)); + this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height, ratioLockedButton, getNameAttribute())); + } + + protected WidgetBoundsPaneFactory.NameAttribute getNameAttribute() { + WidgetBoundsPaneFactory.NameAttribute nameAttribute = WidgetBoundsPaneFactory.NameAttribute.DEFAULT; + if (!isComponent()) { + nameAttribute = WidgetBoundsPaneFactory.NameAttribute.WIDGET; + } + return nameAttribute; + } + + protected boolean isComponent() { + XCreator creator = XCreatorUtils.getXCreatorInnerWidget(this.creator); + return creator.isComponent(); } From f515d766e467e6ad28abe313cf03a041b9bdf80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Wed, 17 Nov 2021 15:38:24 +0800 Subject: [PATCH 3/3] =?UTF-8?q?REPORT-62596=20=E8=BF=9C=E7=A8=8B=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1websocket=E6=96=AD=E5=BC=80=E6=8F=90=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96-=E8=BF=9C=E7=A8=8B=E6=AD=A3=E5=B8=B8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E4=B8=8B=E5=90=AF=E5=8A=A8=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E6=97=B6=E5=87=BA=E7=8E=B0toast=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/socketio/DesignerSocketIO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c32e6673a..f3df35fb8 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 @@ -128,6 +128,7 @@ public class DesignerSocketIO { } else { //表示所有的uri都连接不成功 FineLoggerFactory.getLogger().warn("All uris failed to connect"); + showSocketDisconnectToast(); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -206,7 +207,6 @@ public class DesignerSocketIO { private static final Emitter.Listener failRetry = new Emitter.Listener() { @Override public void call(Object... args) { - showSocketDisconnectToast(); printLog(args, PrintEventLogImpl.WARN, "failed args: {}"); status = Status.Disconnecting; socket.close();