From 24939bf44ab421791b0fd4f392cdd72803512e2c Mon Sep 17 00:00:00 2001 From: ju Date: Wed, 8 Aug 2018 11:28:25 +0800 Subject: [PATCH 01/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20master?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=9B=BD=E9=99=85=E5=8C=96=E5=8C=BA=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerActivator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index bac7d72476..5316eb8ff1 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -123,9 +123,9 @@ public class DesignerActivator extends Activator { public void start() { List markers = rightCollectMutable(InterMutableKey.Path); for (LocaleMarker marker : markers) { - if (marker.match(LocaleScope.DESIGN)) { +// if (marker.match(LocaleScope.DESIGN)) { Toolkit.addResource(marker.getPath()); - } +// } } designerModuleStart(); preLoadPane(); From b4b0e01924fb7855aa988d7d4faefda4467e16e6 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Tue, 4 Sep 2018 16:19:54 +0800 Subject: [PATCH 02/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=20=E5=86=B2=E7=AA=81=E4=BF=AE=E5=A4=8D.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/start/module/DesignerActivator.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java index 5316eb8ff1..80edec701d 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java @@ -27,7 +27,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.hyperlink.ReportletHyperlinkPane; import com.fr.design.hyperlink.WebHyperlinkPane; -import com.fr.design.i18n.Toolkit; +import com.fr.design.i18n.DesignI18nImpl; import com.fr.design.javascript.EmailPane; import com.fr.design.javascript.JavaScriptImplPane; import com.fr.design.javascript.ParameterJavaScriptPane; @@ -123,9 +123,9 @@ public class DesignerActivator extends Activator { public void start() { List markers = rightCollectMutable(InterMutableKey.Path); for (LocaleMarker marker : markers) { -// if (marker.match(LocaleScope.DESIGN)) { - Toolkit.addResource(marker.getPath()); -// } + if (marker.match(LocaleScope.DESIGN)) { + DesignI18nImpl.getInstance().addResource(marker.getPath()); + } } designerModuleStart(); preLoadPane(); @@ -252,11 +252,11 @@ public class DesignerActivator extends Activator { private static NameableCreator[] hyperlinkTypes() { return new NameableCreator[]{ - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Email"), EmailJavaScript.class, EmailPane.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Hyperlink-Web_link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("JavaScript-Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class), - new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("FR-Designer_JavaScript"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class) + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Reportlet"), ReportletHyperlink.class, ReportletHyperlinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Email"), EmailJavaScript.class, EmailPane.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Web_Link"), WebHyperlink.class, WebHyperlinkPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_JavaScript_Dynamic_Parameters"), ParameterJavaScript.class, ParameterJavaScriptPane.ChartNoRename.class), + new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"), JavaScriptImpl.class, JavaScriptImplPane.ChartNoRename.class) }; } @@ -410,4 +410,4 @@ public class DesignerActivator extends Activator { unloadLogAppender(); DesignerSocketIO.close(); } -} \ No newline at end of file +} From 6d2eccd17459d858e80afc57c585d0068545caf7 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 6 Sep 2018 10:39:16 +0800 Subject: [PATCH 03/62] =?UTF-8?q?REPORT-11123=20=E3=80=9010.0=E5=86=92?= =?UTF-8?q?=E7=83=9F=E3=80=91=E8=A1=A8=E5=8D=95=E9=A2=84=E8=A7=88=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=97=AE=E9=A2=98=EF=BC=8C=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=B2=A1=E5=8F=8D=E5=BA=94=EF=BC=88master=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E7=A7=BB=E5=8A=A8=E7=AB=AF=E9=A2=84=E8=A7=88=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/JTemplate.java | 4 +++- .../src/main/java/com/fr/design/preview/FormPreview.java | 3 +-- .../src/main/java/com/fr/design/preview/MobilePreview.java | 4 +--- .../src/main/java/com/fr/design/mainframe/JForm.java | 4 +--- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 7 ++----- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index 6f9383e4d4..c0d41814ca 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -16,6 +16,7 @@ import com.fr.design.actions.edit.RedoAction; import com.fr.design.actions.edit.UndoAction; import com.fr.design.actions.file.SaveAsTemplateAction; import com.fr.design.actions.file.SaveTemplateAction; +import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.dialog.InformationWarnPane; @@ -1102,7 +1103,8 @@ public abstract class JTemplate> * @param provider 预览模式 */ public void previewMenuActionPerformed(PreviewProvider provider) { - + setPreviewType(provider); + WebPreviewUtils.preview(this, provider); } /** diff --git a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java index d6206a2c0a..8522d67734 100644 --- a/designer-base/src/main/java/com/fr/design/preview/FormPreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/FormPreview.java @@ -1,7 +1,6 @@ package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; -import com.fr.locale.InterProviderFactory; /** @@ -13,7 +12,7 @@ public class FormPreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return InterProviderFactory.getProvider().getLocText("Fine-Design_Form_M_Form_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_M_Form_Preview"); } @Override diff --git a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java index 4ab9425010..c0f9e973dc 100644 --- a/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java +++ b/designer-base/src/main/java/com/fr/design/preview/MobilePreview.java @@ -1,8 +1,6 @@ package com.fr.design.preview; import com.fr.design.fun.impl.AbstractPreviewProvider; -import com.fr.general.Inter; - import java.util.HashMap; import java.util.Map; @@ -16,7 +14,7 @@ public class MobilePreview extends AbstractPreviewProvider { @Override public String nameForPopupItem() { - return Inter.getLocText("Fine-Design_Mobile_Preview"); + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Mobile_Preview"); } @Override 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 25fc777e61..b08a479e31 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 @@ -6,9 +6,7 @@ import com.fr.base.Parameter; import com.fr.base.vcs.DesignerMode; import com.fr.design.DesignState; import com.fr.design.actions.core.WorkBookSupportable; -import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.cell.FloatElementsProvider; -import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CutAction; @@ -938,7 +936,7 @@ public class JForm extends JTemplate implements BaseJForm { */ @Override public PreviewProvider[] supportPreview() { - return new PreviewProvider[]{new FormPreview(), new MobilePreview()}; + return new PreviewProvider[]{new FormPreview()}; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index e60fa59785..b546d618bb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -10,7 +10,6 @@ import com.fr.design.DesignModelAdapter; import com.fr.design.ExtraDesignClassManager; import com.fr.design.actions.AllowAuthorityEditAction; import com.fr.design.actions.ExitAuthorityEditAction; -import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.export.CSVExportAction; import com.fr.design.actions.file.export.EmbeddedExportExportAction; import com.fr.design.actions.file.export.ExcelExportAction; @@ -53,7 +52,6 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterInputPane; -import com.fr.design.preview.MobilePreview; import com.fr.design.preview.PagePreview; import com.fr.design.preview.ViewPreview; import com.fr.design.preview.WriteEnhancePreview; @@ -891,7 +889,7 @@ public class JWorkBook extends JTemplate { public PreviewProvider[] supportPreview() { Set set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING); return ArrayUtils.addAll(new PreviewProvider[]{ - new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview() + new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview() }, set.toArray(new PreviewProvider[set.size()])); } @@ -924,8 +922,7 @@ public class JWorkBook extends JTemplate { */ @Override public void previewMenuActionPerformed(PreviewProvider provider) { - setPreviewType(provider); - WebPreviewUtils.preview(this, provider); + super.previewMenuActionPerformed(provider); } /** From cf7064c27cc2aaf688402d3479cd17d1b9c64240 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 17 Sep 2018 11:22:09 +0800 Subject: [PATCH 04/62] =?UTF-8?q?REPORT-11107=E3=80=9010.0=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E3=80=91=E6=8F=92=E4=BB=B6-=E8=BE=93=E5=87=BA?= =?UTF-8?q?=E7=A6=BB=E7=BA=BFHTML=E6=8F=92=E4=BB=B6-=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E6=A0=8F=E4=BD=BF=E7=94=A8=E8=AF=A5=E6=8C=89=E9=92=AE=E6=8A=A5?= =?UTF-8?q?=E9=94=99=20=E5=88=A0=E9=99=A4=E8=80=81=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E7=A6=BB=E7=BA=BFhtml=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E2=80=9D=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/webattr/ReportWebWidgetConstants.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java b/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java index 9cc57ce503..9fc67c3fc8 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/ReportWebWidgetConstants.java @@ -40,7 +40,6 @@ import com.fr.report.web.button.write.StashButton; import com.fr.report.web.button.write.Submit; import com.fr.report.web.button.write.SubmitForcibly; import com.fr.report.web.button.write.Verify; -import com.fr.report.web.button.write.WriteOfflineHTML; public class ReportWebWidgetConstants { private ReportWebWidgetConstants() { @@ -57,7 +56,7 @@ public class ReportWebWidgetConstants { public static WidgetOption[] getWriteToolBarInstance() { return new WidgetOption[]{SUBMIT, VERIFY, EMAIL, EXPORT, PDF, EXCELP, EXCELO, EXCELS, WORD, NEW_PRINT, PRINT, FLASHPRINT, APPLETPRINT, PDFPRINT, IMPORTEXCELDATA, SHOWCELLVALUE, - APPENDCOLUMNROW, DELETECOLUMNROW, SETPRINTEROFFSET, WRITEOFFLINEHTML, CUSTOM_BUTTON, WRITESTASH, WRITESTASHCLEAR, IMPORTEXCELDATA_CUSTOMIZED, + APPENDCOLUMNROW, DELETECOLUMNROW, SETPRINTEROFFSET, CUSTOM_BUTTON, WRITESTASH, WRITESTASHCLEAR, IMPORTEXCELDATA_CUSTOMIZED, IMPORTEXCEL, IMPORTEXCEL_COVER, IMPORTEXCEL_CLEAN, IMPORTEXCEL_APPEND}; } @@ -151,9 +150,6 @@ public class ReportWebWidgetConstants { public static final WidgetOption CUSTOM_BUTTON = WidgetOptionFactory .createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Form_Button"), CustomToolBarButton.class); - // 输出离线html报表 - public static final WidgetOption WRITEOFFLINEHTML = WidgetOptionFactory - .createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Export-Offline-Html"), BaseUtils.readIcon("/com/fr/web/images/writeOffline.png"), WriteOfflineHTML.class); // 数据暂存 public static final WidgetOption WRITESTASH = WidgetOptionFactory .createByWidgetClass(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine-Write_Stash"), BaseUtils.readIcon("/com/fr/web/images/edit/stash.png"), StashButton.class); From 28b56fd047455308dcf27780cb22a526035ab85b Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 11:29:22 +0800 Subject: [PATCH 05/62] =?UTF-8?q?REPORT-11394=20=E4=BA=8C=E6=AC=A1?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=9F=90=E4=BA=9B=E5=9C=BA=E6=99=AF=E4=B8=8B?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=88=A0=E9=99=A4=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../remote/ui/AuthorityListControlPane.java | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java index 7404ed6995..d8692c443d 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java @@ -253,23 +253,17 @@ public class AuthorityListControlPane extends BasicPane { * @param authorities authority */ public void setAuthority(List authorities) { - - if (authorities == null || authorities.isEmpty()) { - return; - } - DefaultListModel model = (DefaultListModel) authorityList.getModel(); model.clear(); - - for (DesignAuthority authority : authorities) { - model.addElement(authority); + if (authorities != null && !authorities.isEmpty()) { + model.clear(); + for (DesignAuthority authority : authorities) { + model.addElement(authority); + } + int size = model.getSize() - 1; + authorityList.setSelectedIndex(size); + authorityList.ensureIndexIsVisible(size); } - - int size = model.getSize() - 1; - - authorityList.setSelectedIndex(size); - authorityList.ensureIndexIsVisible(size); - authorityList.revalidate(); authorityList.repaint(); } From f9191f54f340db523483c30d32f5261050476b49 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 11:40:57 +0800 Subject: [PATCH 06/62] =?UTF-8?q?REPORT-11395=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E4=BA=A4=E4=BA=92=E4=BF=AE=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/remote/ui/UserManagerPane.java | 12 +++++++----- .../images/buttonicon/user_search_normal.png | Bin 0 -> 444 bytes .../images/buttonicon/user_search_normal@2x.png | Bin 0 -> 844 bytes .../java/com/fr/start/preload/ImagePreLoader.java | 7 +++++-- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal@2x.png diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index a0fbb0babc..d23a5cbafb 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -1,5 +1,6 @@ package com.fr.design.remote.ui; +import com.fr.base.BaseUtils; import com.fr.design.border.UITitledBorder; import com.fr.design.constants.LayoutConstants; import com.fr.design.dialog.BasicPane; @@ -240,13 +241,14 @@ public class UserManagerPane extends BasicPane { ); // 搜索 - JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT)); - searchPanel.setBorder(BorderFactory.createEmptyBorder()); - keyField.setPreferredSize(new Dimension(250, 20)); + JPanel searchPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 5)); + searchPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5)); + keyField.setPreferredSize(new Dimension(270, 20)); keyField.requestFocus(); keyField.addKeyListener(keyFieldKeyListener); keyField.getDocument().addDocumentListener(documentListener); - keyButton.setText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); + keyButton.setIcon(BaseUtils.readIcon("com/fr/design/images/buttonicon/user_search_normal.png")); + keyButton.setToolTipText(Toolkit.i18nText("Fine-Design_Basic_Remote_Design_Search")); keyButton.addActionListener(keyButtonActionListener); searchPanel.add(keyField); searchPanel.add(keyButton); @@ -395,7 +397,7 @@ public class UserManagerPane extends BasicPane { final SwingWorker loadMoreWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - + String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { addingMembers.remove(RemoteDesignMember.DEFAULT_MEMBER); diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/user_search_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..9a9a2e65a42643407fb8f09966d6b6442c504a3f GIT binary patch literal 444 zcmV;t0YmPx$c1c7*R5%f(QN2sUP!PXMf)d+qLP(xi) z*)@PnxzVV;#cP$VDZ}&DO8}h*MEPkL+HNkFwOO;z@i4EdM|#*n_%nlz?Rx#TI!cEY zgQW~E0kSLUPNELFM~HCo6PPJD&iQD(1iu<#L)Z1IL?-1#dD=}< zq{S|!3nBt+_If?q`gjR~V3Dr!oUTwK)cXDYRyrB?IZqe4j>p)J2r^|UVQ1W_!YjZY zB39A_ItP6J=|hP5J3f^Vj+M{n-wTC8+p?@>+qUcq+cL zlsFv(gR^$K^Gf=h3QbMJ1w^evLbKTWrdiROoU!89d=Y}puf4fWo0000Px&21!IgR9Fe+R?lk_K^WbMY15EE@X|xpOTdEkT0=>RHPAmG-uw%^coP)=0u`~r zgGW6J-psiO(FQ_D>#>(Y^^z2Nk!V7iCS-gso0)FX?9Of>r|xBE=6m1!-hA`T56img zpD-mLpU>a!_xr`sNEU?<>r%=zeb8>9eH4j^ax4}rSF6=OCa!sQPXUEOVWr#cK11M_ za7@i}c8#?mwm`((guzX@S|LH|cGnQU^b)9Kh4 z-65_~@%k8PTQ)1Me(5qzJ%fYbPdQ~TV{ z$z)R;iqj9T1^9u&+6IGxDsCgc1|VH62I2`9HsCBC#W&6-D(Y<3Hrv+%kgg*dA!K_N z6t=H8P>erKzFGipHG+Azo19E`#UZ8GGhwv=Ua0`Lk%=81CMHKOJAKK4Ec}Z`#b+;^ z8rK4NV)06)ffox;Mgc zS$vsH=8Y*h?Nb8ynBaX50^H~F0Yub;EC(^f(#HuZS5HoUzYZcm?bj*nbsr?0IYg{p zl8MscVdME_|7vTl0K#~m2Yr&U;1IaPv}5M4&~^p&7vU*DY316^d6Z)5#2NQFw;HS6 zU2q#4*>^J{c9Dq}iqri!3UGtNw1bMc6^1kn_Vl#1mrmPB_-sx5w%F&mn`dDH7$k^@ zg$nQzVcU0xtyU8c*qL*H1B>{a0u;N7TguT>)n0f8R3I(~XO7)*4?E}s`c-AS+5i8I WHhpe=F>4_J0000 Date: Tue, 18 Sep 2018 11:47:13 +0800 Subject: [PATCH 07/62] =?UTF-8?q?REPORT-10946=20@Sung=EF=BC=9A=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E7=8A=B6=E6=80=81=E4=B8=8B=EF=BC=88=E6=96=AD=E7=BD=91?= =?UTF-8?q?=EF=BC=89alphafine=E9=83=BD=E6=89=93=E4=B8=8D=E5=BC=80=E4=BA=86?= =?UTF-8?q?=20=E4=B9=8B=E5=89=8D=E7=9A=84=E6=96=AD=E7=BD=91=E6=83=85?= =?UTF-8?q?=E5=86=B5=E9=80=BB=E8=BE=91=E8=80=A6=E5=90=88=E5=A4=AA=E4=B8=A5?= =?UTF-8?q?=E9=87=8D=E4=BA=86=EF=BC=8C=E5=89=A5=E7=A6=BB=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/AlphaFineHelper.java | 20 ++++++++++++++++++ .../alphafine/component/AlphaFineDialog.java | 21 +++++++------------ .../manager/fun/AlphaFineSearchProvider.java | 2 +- .../manager/impl/ActionSearchManager.java | 2 +- .../manager/impl/DocumentSearchManager.java | 4 ++-- .../manager/impl/FileSearchManager.java | 2 +- .../manager/impl/PluginSearchManager.java | 4 ++-- .../manager/impl/RecentSearchManager.java | 2 +- .../manager/impl/RecommendSearchManager.java | 4 ++-- .../manager/impl/SimilarSearchManeger.java | 4 ++-- 10 files changed, 40 insertions(+), 25 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 763c822a9f..433710ce76 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -16,11 +16,15 @@ import com.fr.design.mainframe.alphafine.search.manager.impl.RecentSearchManager import com.fr.design.mainframe.alphafine.search.manager.impl.RecommendSearchManager; import com.fr.design.mainframe.alphafine.search.manager.impl.SimilarSearchManeger; import com.fr.general.ProcessCanceledException; +import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.json.JSONUtils; import com.fr.stable.StringUtils; +import com.fr.third.org.apache.http.HttpStatus; +import com.fr.third.org.apache.http.StatusLine; +import com.fr.third.org.apache.http.client.methods.HttpGet; import java.util.List; @@ -30,6 +34,7 @@ import java.util.List; public class AlphaFineHelper { public static final NoResultModel NO_CONNECTION_MODEL = new NoResultModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")); private static AlphaFineDialog alphaFineDialog; + private static final String URL_FOR_TEST_NETWORK = "https://www.baidu.com"; /** * 弹出alphafine搜索面板 @@ -145,4 +150,19 @@ public class AlphaFineHelper { result.add(AlphaFineHelper.NO_CONNECTION_MODEL); return result; } + + /** + * 判断网络是否异常 + * @return + */ + public static boolean isNetworkOk(){ + HttpGet getHelp = new HttpGet(URL_FOR_TEST_NETWORK); + try { + StatusLine statusLine = HttpToolbox.getHttpClient(URL_FOR_TEST_NETWORK).execute(getHelp).getStatusLine(); + return statusLine.getStatusCode() == HttpStatus.SC_OK; + } catch (Exception ignore) { + // 网络异常 + return false; + } + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index ff61edda09..e8b7747049 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -39,7 +39,6 @@ import com.fr.form.main.Form; import com.fr.form.main.FormIO; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpClient; -import com.fr.general.http.HttpToolbox; import com.fr.io.TemplateWorkBookIO; import com.fr.io.exporter.ImageExporter; import com.fr.json.JSONException; @@ -49,7 +48,6 @@ import com.fr.main.impl.WorkBook; import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; import com.fr.stable.project.ProjectConstants; -import com.fr.third.org.apache.http.client.methods.HttpGet; import javax.imageio.ImageIO; import javax.swing.BorderFactory; @@ -247,22 +245,19 @@ public class AlphaFineDialog extends UIDialog { GridLayout gridLayout = new GridLayout(2, 3, 3, 3); JPanel panel = new JPanel(); panel.setLayout(gridLayout); - try { - HttpGet getHelp = new HttpGet(AlphaFineConstants.ALPHA_HOT_SEARCH); - HttpToolbox.getHttpClient(AlphaFineConstants.ALPHA_HOT_SEARCH).execute(getHelp).getStatusLine(); + if(AlphaFineHelper.isNetworkOk()) { if (hotData == null) { hotData = HotIssuesManager.getInstance().getHotIssues(); } for (int i = 0; i < hotData.length; i++) { panel.add(new HotIssueJpanel(hotData[i], i + 1)); } - } catch (Exception e) { + }else { hotData = null; for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); } } - hotPane.add(uiLabel, BorderLayout.NORTH); hotPane.add(panel, BorderLayout.CENTER); add(hotPane, BorderLayout.SOUTH); @@ -552,7 +547,7 @@ public class AlphaFineDialog extends UIDialog { } private void buildDocumentList(final String[] searchText) { - addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildFileList(String searchStr, final String[] searchText) { @@ -560,24 +555,24 @@ public class AlphaFineDialog extends UIDialog { } private void buildActionList(final String[] searchText) { - addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildPluginList(final String[] searchText) { - addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildRecommendList(final String[] searchText) { - addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildRecentList(final String[] searchText) { - addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText)); } private void buildSimilarList(final String[] searchText) { - addSearchResult(SimilarSearchManeger.getInstance().getLessSearchResult(getHotData(), searchText)); + addSearchResult(SimilarSearchManeger.getInstance().getLessSearchResult(searchText)); } private synchronized void addSearchResult(SearchResult searchResult) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java index 154e7c858e..b75aa894c4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java @@ -12,7 +12,7 @@ public interface AlphaFineSearchProvider { * @param searchText * @return */ - SearchResult getLessSearchResult(String[][] data, String[] searchText); + SearchResult getLessSearchResult(String[] searchText); /** * 获取剩余条数 diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 97bfde18d0..1c4fec0903 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -57,7 +57,7 @@ public class ActionSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { filterModelList = new SearchResult(); lessModelList = new SearchResult(); moreModelList = new SearchResult(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 1003c0e21b..d2ba8b8b07 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -51,14 +51,14 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { lessModelList = new SearchResult(); moreModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); return lessModelList; - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } SearchResult searchResult = new SearchResult(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index c7972753ca..17c58998df 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -96,7 +96,7 @@ public class FileSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { return null; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 0feff55215..293ba51e30 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -96,7 +96,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); SearchResult searchResult = new SearchResult(); @@ -104,7 +104,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); return lessModelList; - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 38f413423a..866c2c7349 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -72,7 +72,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.modelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { recentModelList = getRecentModelList(searchText[j]); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index de527d5513..64902e0f47 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -46,13 +46,13 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { this.modelList = new SearchResult(); this.recommendModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if(hotData == null){ + } else if(!AlphaFineHelper.isNetworkOk()){ return AlphaFineHelper.getNoConnectList(instance); } for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index 90d0489321..bf696529db 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -37,12 +37,12 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { } @Override - public SearchResult getLessSearchResult(String[][] hotData, String[] searchText) { + public SearchResult getLessSearchResult(String[] searchText) { lessModelList = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if (hotData == null) { + } else if (!AlphaFineHelper.isNetworkOk()) { return AlphaFineHelper.getNoConnectList(instance); } SearchResult allModelList = new SearchResult(); From 67ff7823ffe0e04aa37d0695de5c10312b661e68 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Sep 2018 12:56:13 +0800 Subject: [PATCH 08/62] =?UTF-8?q?=E5=9C=A8getNoConnectList=E9=87=8C?= =?UTF-8?q?=E5=88=A4=E6=96=ADisNetworkOk,=20=E5=AF=B9=E5=A4=96=E5=B0=B1?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E6=96=B9=E6=B3=95getNoConnectList?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/alphafine/AlphaFineHelper.java | 3 +++ .../search/manager/impl/DocumentSearchManager.java | 6 ++++-- .../alphafine/search/manager/impl/PluginSearchManager.java | 6 ++++-- .../search/manager/impl/RecommendSearchManager.java | 6 ++++-- .../alphafine/search/manager/impl/SimilarSearchManeger.java | 6 ++++-- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 433710ce76..7b20a44cf2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -135,6 +135,9 @@ public class AlphaFineHelper { * @return */ public static SearchResult getNoConnectList(Object object) { + if (isNetworkOk()){ + return null; + } SearchResult result = new SearchResult(); if (object instanceof RecommendSearchManager) { result.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"))); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index d2ba8b8b07..b5b517c1c1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -58,8 +58,10 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); return lessModelList; - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } SearchResult searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 293ba51e30..826aa7db22 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -104,8 +104,10 @@ public class PluginSearchManager implements AlphaFineSearchProvider { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); return lessModelList; - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } for (int j = 0; j < searchText.length; j++) { try { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 64902e0f47..c97e621e35 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -52,8 +52,10 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainRecommend()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if(!AlphaFineHelper.isNetworkOk()){ - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } for (int j = 0; j < searchText.length; j++) { searchText[j] = searchText[j].replaceAll(StringUtils.BLANK, StringUtils.EMPTY); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index bf696529db..1bc6411313 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -42,8 +42,10 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { if (ArrayUtils.isEmpty(searchText)) { return new SearchResult(); - } else if (!AlphaFineHelper.isNetworkOk()) { - return AlphaFineHelper.getNoConnectList(instance); + } + SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); + if(noConnectList != null){ + return noConnectList; } SearchResult allModelList = new SearchResult(); for (int j = 0; j < searchText.length; j++) { From ce5062b9a0ae25efd08e23dabb8805c462ab0401 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 14:54:42 +0800 Subject: [PATCH 09/62] =?UTF-8?q?=E5=85=B3=E9=97=AD=E6=9C=AA=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84=E6=96=87=E4=BB=B6=E4=BA=A4=E4=BA=92=E4=BF=AE?= =?UTF-8?q?=E8=AE=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index b1a3b8e34f..b6f18a1882 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -17,6 +17,7 @@ import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import com.fr.stable.ProductConstants; +import com.fr.third.javax.annotation.Nonnull; import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.workspace.WorkContext; import com.fr.workspace.server.lock.TplOperator; @@ -677,34 +678,31 @@ public class MutilTempalteTabPane extends JComponent { //当前激活的模板 String filename = openedTemplate.get(selectedIndex).getPath(); - - filename = FilenameUtils.standard(filename); - if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) { specifiedTemplate.stopEditing(); int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (returnVal == JOptionPane.YES_OPTION) { specifiedTemplate.saveTemplate(); - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); + } else if (returnVal == JOptionPane.NO_OPTION) { + closeTpl(specifiedTemplate, filename); } } else { - HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); - - activeTemplate(filename); - FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); + closeTpl(specifiedTemplate, filename); } } + private void closeTpl(@Nonnull JTemplate specifiedTemplate, @Nonnull String fileName) { + HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); + // release lock + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); + activeTemplate(fileName); + } + /** * 关闭模板 * From 896e6a6ff0e79e42f254d9997e208d0b0e5e77cb Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 15:03:03 +0800 Subject: [PATCH 10/62] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/remote/ui/AuthorityListControlPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java index d8692c443d..1d027ac8a1 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java @@ -256,7 +256,6 @@ public class AuthorityListControlPane extends BasicPane { DefaultListModel model = (DefaultListModel) authorityList.getModel(); model.clear(); if (authorities != null && !authorities.isEmpty()) { - model.clear(); for (DesignAuthority authority : authorities) { model.addElement(authority); } From abd64f7ba774b00ccd3919082fc27d60ba79853d Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 18 Sep 2018 15:46:41 +0800 Subject: [PATCH 11/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=A4=9A=E7=BA=BF=E7=A8=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/remote/ui/UserManagerPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index d23a5cbafb..1e22dc8083 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -369,9 +369,9 @@ public class UserManagerPane extends BasicPane { final SwingWorker getMemberWorker = new SwingWorker, Void>() { @Override protected List doInBackground() { - addingMembers.clear(); String username = WorkContext.getCurrent().getConnection().getUserName(); synchronized (addingMembers) { + addingMembers.clear(); Collection more = WorkContext.getCurrent().get(DecisionOperator.class).getMembers(username, keyword); pageNum = 1; if (!more.isEmpty()) { From 3847e66b0ba581505ac1a823f749c94e2bc73b97 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 18 Sep 2018 17:27:55 +0800 Subject: [PATCH 12/62] =?UTF-8?q?REPORT-11403=20@Sung=EF=BC=9A=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BB=93=E6=9E=9C=E5=87=BA=E6=9D=A5=E7=9A=84=E6=A8=AA?= =?UTF-8?q?=E5=90=91=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE=E5=81=8F?= =?UTF-8?q?=E4=B8=8A=E4=BA=86=20=E8=B0=83=E6=95=B4=E9=AB=98=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 2 +- .../alphafine/preview/RobotPreviewPane.java | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index e8b7747049..5137d56f13 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -735,7 +735,7 @@ public class AlphaFineDialog extends UIDialog { if (!isCancelled() && rightSearchResultPane != null) { rightSearchResultPane.removeAll(); try { - rightSearchResultPane.add(new RobotPreviewPane((selectedValue).getName(), get())); + rightSearchResultPane.add(new RobotPreviewPane(selectedValue, get())); } catch (InterruptedException e) { FineLoggerFactory.getLogger().error("get hot item content error: " + e.getMessage()); } catch (ExecutionException e) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index 120d15f2b0..bd13d6aae8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -4,6 +4,8 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; +import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; @@ -28,13 +30,14 @@ import java.net.URL; */ public class RobotPreviewPane extends JPanel { - private static final int TITLE_AREA_HEIGHT = 30; + private static final int TITLE_AREA_HEIGHT = 15; + private static final int HOT_TITLE_AREA_HEIGHT = 30; - public RobotPreviewPane(String title, String content) { + public RobotPreviewPane(AlphaCellModel model, String content) { this.setLayout(new BorderLayout()); this.setBackground(Color.WHITE); this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); - UITextArea titleArea = new UITextArea(title); + UITextArea titleArea = new UITextArea(model.getName()); titleArea.setBorder(null); titleArea.setEditable(false); titleArea.setForeground(AlphaFineConstants.BLUE); @@ -74,9 +77,13 @@ public class RobotPreviewPane extends JPanel { }); editorPane.setEditable(false); UIScrollPane jScrollPane = new UIScrollPane(editorPane); - jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); + jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 30, 0)); jScrollPane.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 10, Color.white)); - this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + if (((RobotModel) model).isHotItemModel()) { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - HOT_TITLE_AREA_HEIGHT)); + } else { + this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - TITLE_AREA_HEIGHT)); + } add(jScrollPane, BorderLayout.CENTER); } } From b4da2f3ee85554c6a1ad25014fa59a4b6f024caf Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 18 Sep 2018 20:33:33 +0800 Subject: [PATCH 13/62] =?UTF-8?q?CHART-3011=20=E5=9C=B0=E7=90=83=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/component/background/VanChartBackgroundPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java index 749fed8c9e..314408c682 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/component/background/VanChartBackgroundPane.java @@ -114,7 +114,7 @@ public class VanChartBackgroundPane extends BasicPane { } - private void fireStateChanged() { + protected void fireStateChanged() { Object[] listeners = listenerList.getListenerList(); ChangeEvent e = null; From c3741d27034a79e939907550066ee21829124f02 Mon Sep 17 00:00:00 2001 From: plough Date: Wed, 19 Sep 2018 16:54:10 +0800 Subject: [PATCH 14/62] =?UTF-8?q?REPORT-11445=20@plough:=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=AD=E6=89=93=E5=8D=B0=E4=BB=BD=E6=95=B0?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=BA0=E4=B8=8D=E5=90=88=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/webattr/printsettings/NativePrintSettingPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java index cc6154aec1..a000cc2096 100644 --- a/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java +++ b/designer-realize/src/main/java/com/fr/design/webattr/printsettings/NativePrintSettingPane.java @@ -166,7 +166,7 @@ public class NativePrintSettingPane extends JPanel { printerPane.add(printerComboBox); // 份数 - copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1)); + copySpinner = new UIBasicSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1)); GUICoreUtils.setColumnForSpinner(copySpinner, 5); JPanel copyPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); copyPane.add(copySpinner); From b7a81c4daccf6047e9d8c43f58853547f183355a Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Wed, 19 Sep 2018 17:35:53 +0800 Subject: [PATCH 15/62] =?UTF-8?q?=E4=B8=BA=E8=AF=B4=E6=98=8E=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=92=8C=E5=80=BC=E4=B8=8B=E6=8B=89=E6=A1=86=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=80=89=E9=A1=B9=E2=80=9C=E6=97=A0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/ExtendedCustomFieldComboBoxPane.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java index 5ff47c128e..dfa7d793ed 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java @@ -11,16 +11,12 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itable.UITable; import com.fr.design.gui.itable.UITableEditor; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper; import com.fr.stable.StringUtils; - -import javax.swing.JComponent; -import javax.swing.JPanel; -import javax.swing.JTable; -import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -30,6 +26,10 @@ import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ArrayList; import java.util.List; +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.SwingConstants; /** * Created by shine on 2018/9/12. @@ -119,6 +119,7 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane Date: Wed, 19 Sep 2018 18:16:00 +0800 Subject: [PATCH 16/62] =?UTF-8?q?REPORT-11403=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E5=87=BA=E6=9D=A5=E7=9A=84=E6=A8=AA=E5=90=91?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE=E5=81=8F=E4=B8=8A?= =?UTF-8?q?=E4=BA=86=20=E8=B0=83=E6=95=B4=E4=B8=8B=E7=BA=B5=E5=90=91?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/preview/RobotPreviewPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index bd13d6aae8..4582d186be 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -77,7 +77,7 @@ public class RobotPreviewPane extends JPanel { }); editorPane.setEditable(false); UIScrollPane jScrollPane = new UIScrollPane(editorPane); - jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 30, 0)); + jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); jScrollPane.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 10, Color.white)); if (((RobotModel) model).isHotItemModel()) { this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - HOT_TITLE_AREA_HEIGHT)); From 611df1e0ab70d8d78035c35ba8f5070deb335710 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 18:18:27 +0800 Subject: [PATCH 17/62] UT --- .../alphafine/cell/model/ModelTest.java | 77 +++++++++++++ .../component/AlphaFineDialogTest.java | 33 ++++++ .../manager/impl/SearchManegerTest.java | 104 ++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java new file mode 100644 index 0000000000..e2ba354d56 --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -0,0 +1,77 @@ +package com.fr.design.mainframe.alphafine.cell.model; + +import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.json.JSONException; +import com.fr.json.JSONObject; +import org.junit.Assert; +import org.junit.Test; + +public class ModelTest { + @Test + public void documentModelTest(){ + DocumentModel documentModel = new DocumentModel("name","content",1); + Assert.assertEquals("name",documentModel.getName()); + Assert.assertEquals("content",documentModel.getContent()); + Assert.assertEquals(1,documentModel.getDocumentId()); + Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); + Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); + Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); + Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); + Assert.assertEquals(true, documentModel.hasAction()); + Assert.assertEquals(true, documentModel.isNeedToSendToServer()); + + documentModel.setDescription("test"); + Assert.assertEquals("test", documentModel.getDescription()); + + DocumentModel another = new DocumentModel("another","another",1); + documentModel.doAction(); + Assert.assertTrue(another.equals(documentModel)); + Assert.assertNotNull(documentModel.modelToJson()); + } + + @Test + public void bottomModelTest(){ + BottomModel bottomModel = new BottomModel(); + Assert.assertEquals(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Internet_Forum"), bottomModel.getGoToWeb()); + Assert.assertEquals(CellType.BOTTOM, bottomModel.getType()); + try { + Assert.assertEquals(JSONObject.EMPTY, bottomModel.modelToJson()); + } catch (JSONException e) { + e.printStackTrace(); + } + Assert.assertEquals(true, bottomModel.hasAction()); + bottomModel.doAction(); + + } + + @Test + public void fileModelTest(){ + FileModel fileModel = new FileModel("name", "test\\\\"); + Assert.assertEquals(CellType.FILE, fileModel.getType()); + Assert.assertNotNull(fileModel.modelToJson()); + FileModel anotherFileModel = new FileModel("anotherFileModel", "test\\\\"); + Assert.assertTrue(anotherFileModel.equals(fileModel)); + } + + @Test + public void moreModelTest(){ + MoreModel moreModel = new MoreModel("name"); + Assert.assertTrue(!moreModel.hasAction()); + Assert.assertTrue(!moreModel.isNeedToSendToServer()); + Assert.assertEquals(CellType.MORE, moreModel.getType()); + } + + @Test + public void noResultModelTest(){ + NoResultModel noResultModel = new NoResultModel("test"); + Assert.assertTrue(!noResultModel.hasAction()); + Assert.assertTrue(!noResultModel.isNeedToSendToServer()); + Assert.assertEquals(CellType.NO_RESULT, noResultModel.getType()); + } + + @Test + public void pluginModelTest(){ +// PluginModel pluginModel = new PluginModel("name","content"); + } +} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java new file mode 100644 index 0000000000..25a555ed8d --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java @@ -0,0 +1,33 @@ +package com.fr.design.mainframe.alphafine.component; + +import org.junit.Before; +import org.junit.Test; + +public class AlphaFineDialogTest { + +// AlphaFineDialog alphaFineDialog; + + @Before + public void setUp() { +// alphaFineDialog = EasyMock.createMock(AlphaFineDialog.class); + + } + + + @Test + public void doNormalSearchTest() { +// try { +// EasyMock.expect(AlphaFineConfigManager.isALPHALicAvailable()).andReturn(true); +// AlphaFineHelper.showAlphaFineDialog(false); +// Method format = AlphaFineDialog.class.getDeclaredMethod("doNormalSearch", String.class); +// format.setAccessible(true); +// EasyMock.expect(alphaFineDialog.getSegmentationResult()).andReturn(new String[]{"数据集"}); +// format.invoke(alphaFineDialog, "数据集"); +//// EasyMock.replay(alphaFineDialog); +// Assert.assertNotNull(alphaFineDialog.getSegmentationResult()); +// } catch (Exception e) { +// e.printStackTrace(); +// } + + } +} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java new file mode 100644 index 0000000000..f7a377c53f --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java @@ -0,0 +1,104 @@ +package com.fr.design.mainframe.alphafine.search.manager.impl; + +import com.fr.design.mainframe.alphafine.AlphaFineHelper; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.json.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class SearchManegerTest { + SimilarSearchManeger similarSearchManeger; + ComplementAdviceManager complementAdviceManager; + DocumentSearchManager documentSearchManager; + PluginSearchManager pluginSearchManager; + RecommendSearchManager recommendSearchManager; + RecentSearchManager recentSearchManager; + ActionSearchManager actionSearchManager; + FileSearchManager fileSearchManager; + SegmentationManager segmentationManager; + + @Before + public void setUp() { + recentSearchManager = RecentSearchManager.getInstance(); + recommendSearchManager = RecommendSearchManager.getInstance(); + similarSearchManeger = SimilarSearchManeger.getInstance(); + complementAdviceManager = ComplementAdviceManager.getInstance(); + documentSearchManager = DocumentSearchManager.getInstance(); + pluginSearchManager = PluginSearchManager.getInstance(); + actionSearchManager = ActionSearchManager.getInstance(); + fileSearchManager = FileSearchManager.getInstance(); + segmentationManager = SegmentationManager.getInstance(); + } + + @Test + public void getSearchResultTest() { + + //断网情况 + SearchResult noConnectList; + noConnectList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(similarSearchManeger).get(1).getName()); + + noConnectList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(documentSearchManager).get(1).getName()); + + noConnectList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(pluginSearchManager).get(1).getName()); + + noConnectList = recommendSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(recommendSearchManager).get(1).getName()); + + //正常搜索情况 + String[][] hotData = HotIssuesManager.getInstance().getHotIssues(); + SearchResult lessModelList; + lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertNotNull(lessModelList); + + lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); + + lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); + + lessModelList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.DOCUMENT); + + lessModelList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.PLUGIN); + + //返回MoreSearchResult + SearchResult moreModelList; + moreModelList = similarSearchManeger.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = documentSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = pluginSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = recommendSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + } + + @Test + public void getModelFromCloudTest() { + Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject())); + Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject())); + Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject())); + } + + @Test + public void isNeedSegmentationTest() { + Assert.assertEquals(segmentationManager.isNeedSegmentation("多维数据集"), true); + } + + @Test + public void startSegmentationTest() { + String[] result = {"结果报表", "结果", "报表"}; + Assert.assertEquals(segmentationManager.startSegmentation("结果报表"), result); + + } + +} From 687bc4a92358ee49107a873ed8bfa31d185f059a Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 18:22:18 +0800 Subject: [PATCH 18/62] =?UTF-8?q?UT=E6=9A=82=E6=97=B6=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/cell/model/ModelTest.java | 77 ------------- .../component/AlphaFineDialogTest.java | 33 ------ .../manager/impl/SearchManegerTest.java | 104 ------------------ 3 files changed, 214 deletions(-) delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java deleted file mode 100644 index e2ba354d56..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.fr.design.mainframe.alphafine.cell.model; - -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.design.mainframe.alphafine.CellType; -import com.fr.json.JSONException; -import com.fr.json.JSONObject; -import org.junit.Assert; -import org.junit.Test; - -public class ModelTest { - @Test - public void documentModelTest(){ - DocumentModel documentModel = new DocumentModel("name","content",1); - Assert.assertEquals("name",documentModel.getName()); - Assert.assertEquals("content",documentModel.getContent()); - Assert.assertEquals(1,documentModel.getDocumentId()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); - Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); - Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); - Assert.assertEquals(true, documentModel.hasAction()); - Assert.assertEquals(true, documentModel.isNeedToSendToServer()); - - documentModel.setDescription("test"); - Assert.assertEquals("test", documentModel.getDescription()); - - DocumentModel another = new DocumentModel("another","another",1); - documentModel.doAction(); - Assert.assertTrue(another.equals(documentModel)); - Assert.assertNotNull(documentModel.modelToJson()); - } - - @Test - public void bottomModelTest(){ - BottomModel bottomModel = new BottomModel(); - Assert.assertEquals(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Internet_Forum"), bottomModel.getGoToWeb()); - Assert.assertEquals(CellType.BOTTOM, bottomModel.getType()); - try { - Assert.assertEquals(JSONObject.EMPTY, bottomModel.modelToJson()); - } catch (JSONException e) { - e.printStackTrace(); - } - Assert.assertEquals(true, bottomModel.hasAction()); - bottomModel.doAction(); - - } - - @Test - public void fileModelTest(){ - FileModel fileModel = new FileModel("name", "test\\\\"); - Assert.assertEquals(CellType.FILE, fileModel.getType()); - Assert.assertNotNull(fileModel.modelToJson()); - FileModel anotherFileModel = new FileModel("anotherFileModel", "test\\\\"); - Assert.assertTrue(anotherFileModel.equals(fileModel)); - } - - @Test - public void moreModelTest(){ - MoreModel moreModel = new MoreModel("name"); - Assert.assertTrue(!moreModel.hasAction()); - Assert.assertTrue(!moreModel.isNeedToSendToServer()); - Assert.assertEquals(CellType.MORE, moreModel.getType()); - } - - @Test - public void noResultModelTest(){ - NoResultModel noResultModel = new NoResultModel("test"); - Assert.assertTrue(!noResultModel.hasAction()); - Assert.assertTrue(!noResultModel.isNeedToSendToServer()); - Assert.assertEquals(CellType.NO_RESULT, noResultModel.getType()); - } - - @Test - public void pluginModelTest(){ -// PluginModel pluginModel = new PluginModel("name","content"); - } -} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java deleted file mode 100644 index 25a555ed8d..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.fr.design.mainframe.alphafine.component; - -import org.junit.Before; -import org.junit.Test; - -public class AlphaFineDialogTest { - -// AlphaFineDialog alphaFineDialog; - - @Before - public void setUp() { -// alphaFineDialog = EasyMock.createMock(AlphaFineDialog.class); - - } - - - @Test - public void doNormalSearchTest() { -// try { -// EasyMock.expect(AlphaFineConfigManager.isALPHALicAvailable()).andReturn(true); -// AlphaFineHelper.showAlphaFineDialog(false); -// Method format = AlphaFineDialog.class.getDeclaredMethod("doNormalSearch", String.class); -// format.setAccessible(true); -// EasyMock.expect(alphaFineDialog.getSegmentationResult()).andReturn(new String[]{"数据集"}); -// format.invoke(alphaFineDialog, "数据集"); -//// EasyMock.replay(alphaFineDialog); -// Assert.assertNotNull(alphaFineDialog.getSegmentationResult()); -// } catch (Exception e) { -// e.printStackTrace(); -// } - - } -} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java deleted file mode 100644 index f7a377c53f..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.fr.design.mainframe.alphafine.search.manager.impl; - -import com.fr.design.mainframe.alphafine.AlphaFineHelper; -import com.fr.design.mainframe.alphafine.CellType; -import com.fr.design.mainframe.alphafine.model.SearchResult; -import com.fr.json.JSONObject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -public class SearchManegerTest { - SimilarSearchManeger similarSearchManeger; - ComplementAdviceManager complementAdviceManager; - DocumentSearchManager documentSearchManager; - PluginSearchManager pluginSearchManager; - RecommendSearchManager recommendSearchManager; - RecentSearchManager recentSearchManager; - ActionSearchManager actionSearchManager; - FileSearchManager fileSearchManager; - SegmentationManager segmentationManager; - - @Before - public void setUp() { - recentSearchManager = RecentSearchManager.getInstance(); - recommendSearchManager = RecommendSearchManager.getInstance(); - similarSearchManeger = SimilarSearchManeger.getInstance(); - complementAdviceManager = ComplementAdviceManager.getInstance(); - documentSearchManager = DocumentSearchManager.getInstance(); - pluginSearchManager = PluginSearchManager.getInstance(); - actionSearchManager = ActionSearchManager.getInstance(); - fileSearchManager = FileSearchManager.getInstance(); - segmentationManager = SegmentationManager.getInstance(); - } - - @Test - public void getSearchResultTest() { - - //断网情况 - SearchResult noConnectList; - noConnectList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(similarSearchManeger).get(1).getName()); - - noConnectList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(documentSearchManager).get(1).getName()); - - noConnectList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(pluginSearchManager).get(1).getName()); - - noConnectList = recommendSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(recommendSearchManager).get(1).getName()); - - //正常搜索情况 - String[][] hotData = HotIssuesManager.getInstance().getHotIssues(); - SearchResult lessModelList; - lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertNotNull(lessModelList); - - lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); - - lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); - - lessModelList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.DOCUMENT); - - lessModelList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.PLUGIN); - - //返回MoreSearchResult - SearchResult moreModelList; - moreModelList = similarSearchManeger.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = documentSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = pluginSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = recommendSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - } - - @Test - public void getModelFromCloudTest() { - Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject())); - Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject())); - Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject())); - } - - @Test - public void isNeedSegmentationTest() { - Assert.assertEquals(segmentationManager.isNeedSegmentation("多维数据集"), true); - } - - @Test - public void startSegmentationTest() { - String[] result = {"结果报表", "结果", "报表"}; - Assert.assertEquals(segmentationManager.startSegmentation("结果报表"), result); - - } - -} From 7452f05304f7da97c6718375a943241e36dc83c4 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 20:34:28 +0800 Subject: [PATCH 19/62] =?UTF-8?q?=E5=8E=9F=E5=85=88=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=BD=91=E7=BB=9C=E6=96=AD=E5=BC=80=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E7=94=A8swingworker=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=81=B6=E7=8E=B0=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E4=BC=9A=E5=8D=A1=E4=BD=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/AlphaFineHelper.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 7b20a44cf2..93e60182c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -22,9 +22,6 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.json.JSONUtils; import com.fr.stable.StringUtils; -import com.fr.third.org.apache.http.HttpStatus; -import com.fr.third.org.apache.http.StatusLine; -import com.fr.third.org.apache.http.client.methods.HttpGet; import java.util.List; @@ -159,10 +156,9 @@ public class AlphaFineHelper { * @return */ public static boolean isNetworkOk(){ - HttpGet getHelp = new HttpGet(URL_FOR_TEST_NETWORK); try { - StatusLine statusLine = HttpToolbox.getHttpClient(URL_FOR_TEST_NETWORK).execute(getHelp).getStatusLine(); - return statusLine.getStatusCode() == HttpStatus.SC_OK; + HttpToolbox.get(URL_FOR_TEST_NETWORK); + return true; } catch (Exception ignore) { // 网络异常 return false; From ca1ab3c67077139b31f0935d29174481aaa89487 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 20 Sep 2018 10:37:54 +0800 Subject: [PATCH 20/62] =?UTF-8?q?=E4=B8=BA=E2=80=9C=E5=80=BC=E2=80=9D?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E6=A1=86=E6=B7=BB=E5=8A=A0=E9=80=89=E9=A1=B9?= =?UTF-8?q?=E2=80=9C=E6=97=A0=E2=80=9D=E7=9A=84=E5=88=A4=E6=96=AD=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AbstractExtendedChartTableDataPane.java | 13 ++++++---- .../ExtendedCustomFieldComboBoxPane.java | 26 ++++++++++++++++--- 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java index 19a7b8e16b..0ac4546345 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java @@ -10,14 +10,13 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.GeneralUtils; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; import java.util.Arrays; import java.util.List; +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; /** * Created by shine on 2018/3/2. @@ -54,7 +53,7 @@ public abstract class AbstractExtendedChartTableDataPane fieldList = new ArrayList(); + public ExtendedCustomFieldComboBoxPane(boolean hasNoneItem) { + this.hasNoneItem = hasNoneItem; + } + @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 6)); @@ -119,7 +126,11 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane list = ob.getCustomFields(); + if (hasNoneItem) { + value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); + } + if (list.size() == 2) { series.setSelectedItem(list.get(0).getFieldName()); value.setSelectedItem(list.get(1).getFieldName()); - value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); function.populateBean((AbstractDataFunction) list.get(1).getDataFunction()); } + + if (value.getSelectedItem() == null) { + value.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); + } } @Override From 319e23a029f4d6442b08167ed2e81595840ec8a9 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Thu, 20 Sep 2018 14:23:02 +0800 Subject: [PATCH 21/62] REPORT-11448 & REPORT-10678 --- .../design/actions/file/PreferencePane.java | 42 ------------------- .../form/mobile/FormMobileAttrPane.java | 5 --- .../report/mobile/ReportMobileAttrPane.java | 5 --- 3 files changed, 52 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 325df90e09..c6aebd2a28 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -155,8 +155,6 @@ public class PreferencePane extends BasicPane { createServerPane(advancePane); - createJdkHomePane(advancePane); - JPanel oraclePane = FRGUIPaneFactory.createTitledBorderPane("Oracle" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Oracle_All_Tables")); oracleSpace = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Show_All_Oracle_Tables")); oraclePane.add(oracleSpace); @@ -470,42 +468,6 @@ public class PreferencePane extends BasicPane { serverPortPane.add(choosePortPane, BorderLayout.CENTER); } - private void createJdkHomePane(JPanel advancePane) { - double p = TableLayout.PREFERRED; - double rowSize[] = {p}; - double columnSize[] = {p, p, p}; - - JPanel serverPortPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_JDK_Home")); - advancePane.add(serverPortPane); - jdkHomeTextField = new UITextField(); - UIButton chooseBtn = new UIButton("..."); - chooseBtn.setPreferredSize(new Dimension(20, 20)); - JPanel panel = GUICoreUtils.createBorderLayoutPane( - jdkHomeTextField, BorderLayout.CENTER, - chooseBtn, BorderLayout.EAST - ); - chooseBtn.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - JFileChooser fileChooser = new JFileChooser(); - fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); - int returnValue = fileChooser.showOpenDialog(PreferencePane.this); - if (returnValue == JFileChooser.APPROVE_OPTION) { - File file = fileChooser.getSelectedFile(); - jdkHomeTextField.setText(file.getAbsolutePath()); - } - } - }); - panel.setPreferredSize(new Dimension(300, 20)); - UILabel notiJlabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Work_After_Restart_Designer")); - UILabel serverPortLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_JDK_Home") + ":"); - Component[][] portComponents = { - {serverPortLabel, panel, notiJlabel}, - }; - JPanel choosePortPane = TableLayoutHelper.createTableLayoutPane(portComponents, rowSize, columnSize); - serverPortPane.add(choosePortPane, BorderLayout.CENTER); - } - private JPanel createMemoryPane() { JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template")); UILabel memoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Max_Caching_Template")); @@ -575,8 +537,6 @@ public class PreferencePane extends BasicPane { this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort())); - this.jdkHomeTextField.setText(designerEnvManager.getJdkHome()); - this.oracleSpace.setSelected(designerEnvManager.isOracleSystemSpace()); this.cachingTemplateSpinner.setValue(designerEnvManager.getCachingTemplateLimit()); this.joinProductImprove.setSelected(designerEnvManager.isJoinProductImprove()); @@ -636,8 +596,6 @@ public class PreferencePane extends BasicPane { designerEnvManager.setJettyServerPort(portEditor.getValue().intValue()); - designerEnvManager.setJdkHome(jdkHomeTextField.getText()); - designerEnvManager.setOracleSystemSpace(this.oracleSpace.isSelected()); designerEnvManager.setCachingTemplateLimit((int) this.cachingTemplateSpinner.getValue()); designerEnvManager.setJoinProductImprove(this.joinProductImprove.isSelected()); diff --git a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileAttrPane.java b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileAttrPane.java index 297e854699..a274048a45 100644 --- a/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileAttrPane.java +++ b/designer-form/src/main/java/com/fr/design/form/mobile/FormMobileAttrPane.java @@ -13,8 +13,6 @@ import java.awt.*; * Created by fanglei on 2016/11/17. */ public class FormMobileAttrPane extends BasicBeanPane{ - //工具栏容器 - private MobileToolBarPane mobileToolBarPane; // 模版设置面板 private FormMobileTemplateSettingsPane formMobileTemplateSettingsPane; // 其他 @@ -33,7 +31,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ panel.setBorder(BorderFactory.createEmptyBorder(PADDING, PADDING, PADDING, PADDING)); panel.add(formMobileTemplateSettingsPane = new FormMobileTemplateSettingsPane()); - panel.add(mobileToolBarPane = new MobileToolBarPane()); panel.add(formMobileOthersPane = new FormMobileOthersPane()); JPanel panelWrapper = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -47,7 +44,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ if (ob == null) { ob = new FormMobileAttr(); } - this.mobileToolBarPane.populateBean(ob); this.formMobileTemplateSettingsPane.populateBean(ob); this.formMobileOthersPane.populateBean(ob); } @@ -55,7 +51,6 @@ public class FormMobileAttrPane extends BasicBeanPane{ @Override public FormMobileAttr updateBean() { FormMobileAttr formMobileAttr = new FormMobileAttr(); - this.mobileToolBarPane.updateBean(formMobileAttr); this.formMobileTemplateSettingsPane.updateBean(formMobileAttr); this.formMobileOthersPane.updateBean(formMobileAttr); return formMobileAttr; diff --git a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java b/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java index 28030a37d5..668027f5f8 100644 --- a/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/mobile/ReportMobileAttrPane.java @@ -15,8 +15,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ private ReportMobileTemplateSettingsPane reportMobileTemplateSettingsPane; // 模版设置面板 private AppFitBrowserPane appFitBrowserPane; - //工具栏容器 - private MobileToolBarPane mobileToolBarPane; // 其他 private MobileOthersPane mobileOthersPane; @@ -38,7 +36,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); jPanel.add(appFitBrowserPane); - jPanel.add(mobileToolBarPane = new MobileToolBarPane()); jPanel.add(mobileOthersPane = new MobileOthersPane()); jPanel.add(appFitPreviewPane); @@ -52,7 +49,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ ob = new ElementCaseMobileAttr(); } appFitBrowserPane.populateBean(ob); - mobileToolBarPane.populateBean(ob); mobileOthersPane.populateBean(ob); reportMobileTemplateSettingsPane.populateBean(ob); } @@ -60,7 +56,6 @@ public class ReportMobileAttrPane extends BasicBeanPane{ @Override public ElementCaseMobileAttr updateBean() { ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); - mobileToolBarPane.updateBean(caseMobileAttr); mobileOthersPane.updateBean(caseMobileAttr); reportMobileTemplateSettingsPane.updateBean(caseMobileAttr); From c3fc7be77cfde08fb878fefc316e206ca904f254 Mon Sep 17 00:00:00 2001 From: "Qinghui.Liu" Date: Thu, 20 Sep 2018 14:35:16 +0800 Subject: [PATCH 22/62] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/ExtendedCustomFieldComboBoxPane.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java index 426540d134..c4e23faf90 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedCustomFieldComboBoxPane.java @@ -166,24 +166,19 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane list = ob.getCustomFields(); - if (hasNoneItem) { - value.addItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); - } - if (list.size() == 2) { series.setSelectedItem(list.get(0).getFieldName()); value.setSelectedItem(list.get(1).getFieldName()); function.populateBean((AbstractDataFunction) list.get(1).getDataFunction()); } - - if (value.getSelectedItem() == null) { - value.setSelectedItem(Toolkit.i18nText("Fine-Design_Chart_Use_None")); - } } @Override From c62de9f2020e3ddb1274c84f17d2058891e934cc Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Thu, 20 Sep 2018 18:51:42 +0800 Subject: [PATCH 23/62] =?UTF-8?q?REPORT-11487=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=9C=BA=E6=99=AF=E4=B8=8B=20=E6=96=B0=E5=BB=BA=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=8A=B6=E6=80=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesignerFrameFileDealerPane.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java index d0800c087d..7127c9763e 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesignerFrameFileDealerPane.java @@ -246,6 +246,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt } new MkdirDialog(); + stateChange(); } } @@ -263,7 +264,6 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt @Override public void actionPerformed(ActionEvent evt) { - selectedOperation.showInExplorer(); } } @@ -281,10 +281,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt @Override public void actionPerformed(ActionEvent evt) { - selectedOperation.refresh(); stateChange(); - } } @@ -322,6 +320,7 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt new FileRenameDialog(node); MutilTempalteTabPane.getInstance().repaint(); + stateChange(); } } @@ -347,8 +346,8 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt WARNING_MESSAGE); return; } - selectedOperation.deleteFile(); + stateChange(); } } From 8dfe80a6a58c5e05e6e5cbc4235f73e6274fb945 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Tue, 25 Sep 2018 12:20:43 +0800 Subject: [PATCH 24/62] =?UTF-8?q?REPORT-11538=20=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E6=8F=90=E4=BA=A4=E4=BA=8B=E4=BB=B6=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=83=A8=E5=88=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/columnrow/ColumnRowPane.java | 475 +++++++++--------- .../design/javascript/ListenerEditPane.java | 260 +++++----- 2 files changed, 371 insertions(+), 364 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java index 8f9e508d93..615a17bcef 100644 --- a/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/columnrow/ColumnRowPane.java @@ -1,8 +1,17 @@ package com.fr.design.gui.columnrow; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridLayout; +import com.fr.design.designer.IntervalConstants; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ispinner.ColumnRowSpinner; +import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.gui.ispinner.UpperCaseSpinner; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.utils.gui.GUICoreUtils; +import com.fr.general.ComparatorUtils; +import com.fr.stable.ColumnRow; +import com.fr.stable.StableUtils; +import com.fr.stable.StringUtils; import javax.swing.JFormattedTextField; import javax.swing.JPanel; @@ -16,19 +25,9 @@ import javax.swing.text.AbstractDocument; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DocumentFilter; - -import com.fr.design.designer.IntervalConstants; -import com.fr.design.event.UIObserver; -import com.fr.design.event.UIObserverListener; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.gui.ispinner.UIBasicSpinner; -import com.fr.design.gui.ispinner.UpperCaseSpinner; -import com.fr.design.gui.ispinner.ColumnRowSpinner; -import com.fr.general.ComparatorUtils; -import com.fr.stable.ColumnRow; -import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; -import com.fr.design.utils.gui.GUICoreUtils; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; /** * the component to edit ColumnRow @@ -37,224 +36,228 @@ import com.fr.design.utils.gui.GUICoreUtils; */ public class ColumnRowPane extends JPanel implements UIObserver { - private static final long serialVersionUID = 1L; - private static String[] columnarray = new String[1000]; - private static String[] rowarray = new String[5000]; - - - protected UpperCaseSpinner columnSpinner; - protected UIBasicSpinner rowSpinner; - - static { - for (int i = 1; i < 1000; i++) { - columnarray[i - 1] = StableUtils.convertIntToABC(i); - } - for (int i = 1; i < 5000; i++) { - rowarray[i - 1] = StringUtils.EMPTY + i; - } - } - - protected DocumentListener d = new DocumentListener() { - - - @Override - public void removeUpdate(DocumentEvent e) { - String rolText = ((DefaultEditor) columnSpinner.getEditor()).getTextField().getText(); - String rowText = ((DefaultEditor) rowSpinner.getEditor()).getTextField().getText(); - if (rolText == null || rolText.length() == 0 || rowText == null || rowText.length() == 0) { - return; - } - int col = StableUtils.convertABCToInt(rolText) - 1; - int row = Integer.parseInt(rowText) - 1; - setColumnRow(ColumnRow.valueOf(col, row)); - } - - @Override - public void insertUpdate(DocumentEvent e) { - int col = StableUtils.convertABCToInt(((DefaultEditor) columnSpinner.getEditor()).getTextField().getText()) - 1; - int row = Integer.parseInt(((DefaultEditor) rowSpinner.getEditor()).getTextField().getText()) - 1; - setColumnRow(ColumnRow.valueOf(col, row)); - } - - @Override - public void changedUpdate(DocumentEvent e) { - - } - }; - - - private UIObserverListener uiObserverListener; - private ColumnRow cr; - - - public ColumnRowPane() { - this.initComponents(); - iniListener(); - } - - - /** - * 初始化元素 - */ - public void initComponents() { - this.setLayout(new GridLayout(0, 2, IntervalConstants.INTERVAL_L6, 0)); - initColSpinner(); - this.add(columnSpinner, BorderLayout.WEST); - initRowSpinner(); - this.add(rowSpinner); - this.addDocumentListener(d); - } - - private void iniListener() { - if (shouldResponseChangeListener()) { - this.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - if (uiObserverListener == null) { - return; - } - uiObserverListener.doChange(); - } - }); - } - } - - - protected void initRowSpinner() { - rowSpinner = new ColumnRowSpinner((new SpinnerListModel(rowarray))) { - public boolean shouldResponseChangeListener() { - return false; - } - - }; - rowSpinner.setPreferredSize(new Dimension(60, 24)); - JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner); - if (rftf != null) { - rftf.setColumns(4); // specify more width than we need - rftf.setHorizontalAlignment(UITextField.LEFT); - } - } - - protected void initColSpinner() { - SpinnerListModel columnSpinnerListModel = new SpinnerListModel(columnarray); - columnSpinner = new UpperCaseSpinner(columnSpinnerListModel) { - public boolean shouldResponseChangeListener() { - return false; - } - }; - columnSpinner.setPreferredSize(new Dimension(60, 24)); - JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner); - if (cftf != null) { - cftf.setColumns(3); // specify more width than we need - cftf.setHorizontalAlignment(UITextField.LEFT); - } - - ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { - public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { - fb.insertString(offset, string.toUpperCase(), attr); - } - - public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException { - if (string != null) { - string = string.toUpperCase(); - } - fb.replace(offset, length, string, attr); - } - }); - } - - protected void addDocumentListener(DocumentListener l) { - ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); - ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); - } - - private void removeDocumentListener(DocumentListener l) { - ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); - ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); - } - - /** - * columnSpinner与rowSpinner应该整体考虑,设置ColumnRow应该只触发一次事件 - * - * @param columnRow - */ - public void setColumnRow(ColumnRow columnRow) { - if (!ComparatorUtils.equals(cr, columnRow)) { - setGlobalName(); - removeDocumentListener(d); - cr = columnRow; - addDocumentListener(d); - fireChanged(); - } - } - - public void setGlobalName(){ - - } - - public void populate(ColumnRow columnRow) { - cr = columnRow; - int column = columnRow.getColumn(); - if (column < 0) { - column = 0; - } - removeDocumentListener(d); - columnSpinner.setValue(StableUtils.convertIntToABC(column + 1)); - int row = columnRow.getRow(); - // shoc 小于0就蹦了 - if (row < 0) { - row = 0; - } - rowSpinner.setValue("" + (row + 1)); - addDocumentListener(d); - fireChanged(); - } - - - public ColumnRow update() { - return cr; - } - - /** - * 添加一个listener到listenerList中 - * @param l 监听 - */ - public void addChangeListener(ChangeListener l) { - this.listenerList.add(ChangeListener.class, l); - } - - /** - * 从listenerList中移除一个listener - * @param l 监听 - */ - public void removeChangeListener(ChangeListener l) { - this.listenerList.remove(ChangeListener.class, l); - } - - // august: Process the listeners last to first - protected void fireChanged() { - Object[] listeners = listenerList.getListenerList(); - - for (int i = listeners.length - 2; i >= 0; i -= 2) { - if (listeners[i] == ChangeListener.class) { - ((ChangeListener) listeners[i + 1]).stateChanged(new ChangeEvent(this)); - } - } - } - - /** - * 给组件登记一个观察者监听事件 - * @param listener 监听 - */ - public void registerChangeListener(UIObserverListener listener) { - uiObserverListener = listener; - } - - /** - * 组件是否需要响应添加的观察者事件 - * @return 如果需要响应观察者事件则返回true,否则返回false - */ - public boolean shouldResponseChangeListener() { - return true; - } + private static final long serialVersionUID = 1L; + private static String[] columnarray = new String[1000]; + private static String[] rowarray = new String[5000]; + + + protected UpperCaseSpinner columnSpinner; + protected UIBasicSpinner rowSpinner; + + static { + for (int i = 1; i <= 1000; i++) { + columnarray[i - 1] = StableUtils.convertIntToABC(i); + } + for (int i = 1; i <= 5000; i++) { + rowarray[i - 1] = StringUtils.EMPTY + i; + } + } + + protected DocumentListener d = new DocumentListener() { + + + @Override + public void removeUpdate(DocumentEvent e) { + String rolText = ((DefaultEditor) columnSpinner.getEditor()).getTextField().getText(); + String rowText = ((DefaultEditor) rowSpinner.getEditor()).getTextField().getText(); + if (rolText == null || rolText.length() == 0 || rowText == null || rowText.length() == 0) { + return; + } + int col = StableUtils.convertABCToInt(rolText) - 1; + int row = Integer.parseInt(rowText) - 1; + setColumnRow(ColumnRow.valueOf(col, row)); + } + + @Override + public void insertUpdate(DocumentEvent e) { + int col = StableUtils.convertABCToInt(((DefaultEditor) columnSpinner.getEditor()).getTextField().getText()) - 1; + int row = Integer.parseInt(((DefaultEditor) rowSpinner.getEditor()).getTextField().getText()) - 1; + setColumnRow(ColumnRow.valueOf(col, row)); + } + + @Override + public void changedUpdate(DocumentEvent e) { + + } + }; + + + private UIObserverListener uiObserverListener; + private ColumnRow cr; + + + public ColumnRowPane() { + this.initComponents(); + iniListener(); + } + + + /** + * 初始化元素 + */ + public void initComponents() { + this.setLayout(new GridLayout(0, 2, IntervalConstants.INTERVAL_L6, 0)); + initColSpinner(); + this.add(columnSpinner, BorderLayout.WEST); + initRowSpinner(); + this.add(rowSpinner); + this.addDocumentListener(d); + } + + private void iniListener() { + if (shouldResponseChangeListener()) { + this.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + if (uiObserverListener == null) { + return; + } + uiObserverListener.doChange(); + } + }); + } + } + + + protected void initRowSpinner() { + rowSpinner = new ColumnRowSpinner((new SpinnerListModel(rowarray))) { + public boolean shouldResponseChangeListener() { + return false; + } + + }; + rowSpinner.setPreferredSize(new Dimension(60, 24)); + JFormattedTextField rftf = GUICoreUtils.getSpinnerTextField(rowSpinner); + if (rftf != null) { + rftf.setColumns(4); // specify more width than we need + rftf.setHorizontalAlignment(UITextField.LEFT); + } + } + + protected void initColSpinner() { + SpinnerListModel columnSpinnerListModel = new SpinnerListModel(columnarray); + columnSpinner = new UpperCaseSpinner(columnSpinnerListModel) { + public boolean shouldResponseChangeListener() { + return false; + } + }; + columnSpinner.setPreferredSize(new Dimension(60, 24)); + JFormattedTextField cftf = GUICoreUtils.getSpinnerTextField(columnSpinner); + if (cftf != null) { + cftf.setColumns(3); // specify more width than we need + cftf.setHorizontalAlignment(UITextField.LEFT); + } + + ((AbstractDocument) cftf.getDocument()).setDocumentFilter(new DocumentFilter() { + public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException { + fb.insertString(offset, string.toUpperCase(), attr); + } + + public void replace(FilterBypass fb, int offset, int length, String string, AttributeSet attr) throws BadLocationException { + if (string != null) { + string = string.toUpperCase(); + } + fb.replace(offset, length, string, attr); + } + }); + } + + protected void addDocumentListener(DocumentListener l) { + ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); + ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().addDocumentListener(l); + } + + private void removeDocumentListener(DocumentListener l) { + ((DefaultEditor) columnSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); + ((DefaultEditor) rowSpinner.getEditor()).getTextField().getDocument().removeDocumentListener(l); + } + + /** + * columnSpinner与rowSpinner应该整体考虑,设置ColumnRow应该只触发一次事件 + * + * @param columnRow + */ + public void setColumnRow(ColumnRow columnRow) { + if (!ComparatorUtils.equals(cr, columnRow)) { + setGlobalName(); + removeDocumentListener(d); + cr = columnRow; + addDocumentListener(d); + fireChanged(); + } + } + + public void setGlobalName() { + + } + + public void populate(ColumnRow columnRow) { + cr = columnRow; + int column = columnRow.getColumn(); + if (column < 0) { + column = 0; + } + removeDocumentListener(d); + columnSpinner.setValue(StableUtils.convertIntToABC(column + 1)); + int row = columnRow.getRow(); + // shoc 小于0就蹦了 + if (row < 0) { + row = 0; + } + rowSpinner.setValue("" + (row + 1)); + addDocumentListener(d); + fireChanged(); + } + + + public ColumnRow update() { + return cr; + } + + /** + * 添加一个listener到listenerList中 + * + * @param l 监听 + */ + public void addChangeListener(ChangeListener l) { + this.listenerList.add(ChangeListener.class, l); + } + + /** + * 从listenerList中移除一个listener + * + * @param l 监听 + */ + public void removeChangeListener(ChangeListener l) { + this.listenerList.remove(ChangeListener.class, l); + } + + // august: Process the listeners last to first + protected void fireChanged() { + Object[] listeners = listenerList.getListenerList(); + + for (int i = listeners.length - 2; i >= 0; i -= 2) { + if (listeners[i] == ChangeListener.class) { + ((ChangeListener) listeners[i + 1]).stateChanged(new ChangeEvent(this)); + } + } + } + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 监听 + */ + public void registerChangeListener(UIObserverListener listener) { + uiObserverListener = listener; + } + + /** + * 组件是否需要响应添加的观察者事件 + * + * @return 如果需要响应观察者事件则返回true,否则返回false + */ + public boolean shouldResponseChangeListener() { + return true; + } } \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java b/designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java index 196da69c42..91ccd38028 100644 --- a/designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java +++ b/designer-realize/src/main/java/com/fr/design/javascript/ListenerEditPane.java @@ -7,6 +7,7 @@ import com.fr.design.fun.JavaScriptActionProvider; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; @@ -28,140 +29,143 @@ import java.util.List; import java.util.Set; public class ListenerEditPane extends BasicBeanPane { - private UITextField nameText; - private UIComboBox styleBox; - private CardLayout card; - private List> cards; - private JPanel hyperlinkPane; - - private JavaScriptImplPane javaScriptPane; - private FormSubmitJavaScriptPane formSubmitScriptPane; - private Commit2DBJavaScriptPane commit2DBJavaScriptPane; - // 自定义事件 - private CustomActionPane customActionPane; - // 发送邮件 - private EmailPane emailPane; - - private static final String JS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"); - private static final String FORMSUBMIT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Form_Submit"); - private static final String DBCOMMIT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Commit_To_Database"); - private static final String CUSTOMACTION= com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Custom_Submit"); - private static final String EMAIL = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Email_Sent_Email"); - - private Listener listener; - - public ListenerEditPane() { - this.initComponents(new String[0]); - } + private UITextField nameText; + private UIComboBox styleBox; + private CardLayout card; + private List> cards; + private JPanel hyperlinkPane; - public ListenerEditPane(String[] defaultArgs) { - this.initComponents(defaultArgs); - } + private static final String JS = Toolkit.i18nText("Fine-Design_Report_JavaScript"); + private static final String DBCOMMIT = Toolkit.i18nText("Fine-Design_Basic_JavaScript_Commit_To_Database"); + private static final String CUSTOMACTION = Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"); + private static final String EMAIL = Toolkit.i18nText("Fine-Design_Report_Email_Sent_Email"); - /** - * 初始化各个组件 - * @param defaultArgs 初始化参数 - */ - public void initComponents(String[] defaultArgs) { - cards = new ArrayList>(); - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); - nameText = new UITextField(8); - nameText.setEditable(false); - namePane.add(nameText, BorderLayout.WEST); - String[] style = {JS, DBCOMMIT, CUSTOMACTION,EMAIL}; - styleBox = new UIComboBox(style); - namePane.add(styleBox); - namePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), nameText, new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"), styleBox}, FlowLayout.LEFT); - namePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name_Type"))); - this.add(namePane, BorderLayout.NORTH); - card = new CardLayout(); - hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane(); - hyperlinkPane.setLayout(card); - javaScriptPane = new JavaScriptImplPane(defaultArgs); - hyperlinkPane.add(JS, javaScriptPane); - // 提交入库 - List dbmaniList = new ArrayList(); - dbmaniList.add(autoCreateDBManipulationPane()); - commit2DBJavaScriptPane = new Commit2DBJavaScriptPane(JavaScriptActionPane.defaultJavaScriptActionPane, - dbmaniList); - hyperlinkPane.add(DBCOMMIT, commit2DBJavaScriptPane); - // 自定义事件 - customActionPane = new CustomActionPane(); - hyperlinkPane.add(CUSTOMACTION, customActionPane); - // 发送邮件 - emailPane = new EmailPane(); - hyperlinkPane.add(EMAIL,emailPane); - cards.add(javaScriptPane); - cards.add(commit2DBJavaScriptPane); - cards.add(customActionPane); - cards.add(emailPane); - //其他事件 - addOtherEvent(); - hyperlinkPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Set"))); - this.add(hyperlinkPane); - styleBox.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - card.show(hyperlinkPane, styleBox.getSelectedItem().toString()); - } - }); - } + private Listener listener; - private void addOtherEvent(){ - Set javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); - if (javaScriptActionProviders != null) { - for (JavaScriptActionProvider jsp : javaScriptActionProviders) { - FurtherBasicBeanPane pane = jsp.getJavaScriptActionPane(); - String title = pane.title4PopupWindow(); - styleBox.addItem(title); - hyperlinkPane.add(title, pane); - cards.add(pane); - } - } - } + public ListenerEditPane() { + this.initComponents(new String[0]); + } + + public ListenerEditPane(String[] defaultArgs) { + this.initComponents(defaultArgs); + } /** - * 根据有无单元格创建 DBManipulationPane - * @return 有单元格。有智能添加单元格等按钮,返回 SmartInsertDBManipulationPane + * 初始化各个组件 + * + * @param defaultArgs 初始化参数 */ - private DBManipulationPane autoCreateDBManipulationPane() { - JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); - return jTemplate.createDBManipulationPane(); - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Set"); - } - - @Override - public void populateBean(Listener listener) { - this.listener = listener; - if (this.listener == null) { - this.listener = new Listener(); - } - this.nameText.setText(listener.getEventName()); - JavaScript js = listener.getAction(); - for (int i = 0; i < this.cards.size(); i++) { - FurtherBasicBeanPane pane = cards.get(i); - if (pane.accept(js)) { - styleBox.setSelectedItem(pane.title4PopupWindow()); - card.show(hyperlinkPane, pane.title4PopupWindow()); - pane.populateBean(js); - return; - } - } - } + public void initComponents(String[] defaultArgs) { + cards = new ArrayList<>(); + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + nameText = new UITextField(8); + nameText.setEditable(false); + namePane.add(nameText, BorderLayout.WEST); + final String[] style = {JS, DBCOMMIT, CUSTOMACTION, EMAIL}; + styleBox = new UIComboBox(style); + namePane.add(styleBox); + namePane = GUICoreUtils.createFlowPane(new Component[]{ + new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), + nameText, + new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"), + styleBox}, + FlowLayout.LEFT); + namePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type"))); + this.add(namePane, BorderLayout.NORTH); + card = new CardLayout(); + hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane(); + hyperlinkPane.setLayout(card); + JavaScriptImplPane javaScriptPane = new JavaScriptImplPane(defaultArgs); + hyperlinkPane.add(JS, javaScriptPane); + // 提交入库 + List dbManiList = new ArrayList(); + dbManiList.add(autoCreateDBManipulationPane()); + Commit2DBJavaScriptPane commit2DBJavaScriptPane = new Commit2DBJavaScriptPane(JavaScriptActionPane.defaultJavaScriptActionPane, + dbManiList); + hyperlinkPane.add(DBCOMMIT, commit2DBJavaScriptPane); + // 自定义事件 + CustomActionPane customActionPane = new CustomActionPane(); + hyperlinkPane.add(CUSTOMACTION, customActionPane); + // 发送邮件 + EmailPane emailPane = new EmailPane(); + hyperlinkPane.add(EMAIL, emailPane); + cards.add(javaScriptPane); + cards.add(commit2DBJavaScriptPane); + cards.add(customActionPane); + cards.add(emailPane); + //其他事件 + addOtherEvent(); + hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_JavaScript_Set"))); + this.add(hyperlinkPane); + styleBox.addItemListener(new ItemListener() { + @Override + public void itemStateChanged(ItemEvent e) { + Object selected = styleBox.getSelectedItem(); + if (selected == null) { + return; + } + card.show(hyperlinkPane, selected.toString()); + } + }); + } + + private void addOtherEvent() { + Set javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); + if (javaScriptActionProviders != null) { + for (JavaScriptActionProvider jsp : javaScriptActionProviders) { + FurtherBasicBeanPane pane = jsp.getJavaScriptActionPane(); + String title = pane.title4PopupWindow(); + styleBox.addItem(title); + hyperlinkPane.add(title, pane); + cards.add(pane); + } + } + } + + /** + * 根据有无单元格创建 DBManipulationPane + * + * @return 有单元格。有智能添加单元格等按钮,返回 SmartInsertDBManipulationPane + */ + private DBManipulationPane autoCreateDBManipulationPane() { + JTemplate jTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); + return jTemplate.createDBManipulationPane(); + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Report_Event_Set"); + } + + @Override + public void populateBean(Listener listener) { + this.listener = listener; + if (this.listener == null) { + this.listener = new Listener(); + } + this.nameText.setText(listener.getEventName()); + JavaScript js = listener.getAction(); + for (int i = 0; i < this.cards.size(); i++) { + FurtherBasicBeanPane pane = cards.get(i); + if (pane.accept(js)) { + styleBox.setSelectedItem(pane.title4PopupWindow()); + card.show(hyperlinkPane, pane.title4PopupWindow()); + pane.populateBean(js); + return; + } + } + } - public void checkValid() throws Exception{ - this.cards.get(this.styleBox.getSelectedIndex()).checkValid(); - } + public void checkValid() throws Exception { + this.cards.get(this.styleBox.getSelectedIndex()).checkValid(); + } - @Override - public Listener updateBean(){ - this.listener.setEventName(this.nameText.getText()); - FurtherBasicBeanPane pane = this.cards.get(this.styleBox.getSelectedIndex()); - this.listener.setAction(pane.updateBean()); - return this.listener; - } + @Override + public Listener updateBean() { + this.listener.setEventName(this.nameText.getText()); + FurtherBasicBeanPane pane = this.cards.get(this.styleBox.getSelectedIndex()); + this.listener.setAction(pane.updateBean()); + return this.listener; + } } \ No newline at end of file From ea49ba5f14dbd4c3afadf284b117b3a01db489b5 Mon Sep 17 00:00:00 2001 From: zheng Date: Tue, 25 Sep 2018 14:52:38 +0800 Subject: [PATCH 25/62] CHART-2848 linemap startareaname not areaname --- .../designer/other/VanChartMapHyperLinkPane.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapHyperLinkPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapHyperLinkPane.java index 3c520d31f4..272b0cec27 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapHyperLinkPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/other/VanChartMapHyperLinkPane.java @@ -1,7 +1,11 @@ package com.fr.van.chart.map.designer.other; +import com.fr.base.BaseFormula; +import com.fr.base.FormulaBuilder; import com.fr.chart.chartattr.Plot; import com.fr.design.dialog.BasicScrollPane; +import com.fr.extended.chart.HyperLinkPara; +import com.fr.extended.chart.HyperLinkParaHelper; import com.fr.js.NameJavaScriptGroup; import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.type.MapType; @@ -11,6 +15,8 @@ import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; import javax.swing.BorderFactory; import javax.swing.JPanel; import java.awt.BorderLayout; +import java.util.LinkedHashMap; +import java.util.Map; /** * Created by hufan on 2016/12/20. @@ -193,6 +199,16 @@ public class VanChartMapHyperLinkPane extends BasicScrollPane { protected NameJavaScriptGroup populateHotHyperLink(Plot plot) { return ((VanChartMapPlot)plot).getLineHotHyperLink(); } + + @Override + protected Map getHyperLinkEditorMap() { + FormulaBuilder builder = BaseFormula.createFormulaBuilder(); + Map map = new LinkedHashMap<>(); + for (HyperLinkPara para : HyperLinkParaHelper.LINE_MAP) { + map.put(para.getName(), builder.build(para.getFormulaContent())); + } + return map; + } }; } From b224ba62795436f8c94dc972eb2c6286e16aea2e Mon Sep 17 00:00:00 2001 From: plough Date: Tue, 25 Sep 2018 17:40:14 +0800 Subject: [PATCH 26/62] =?UTF-8?q?REPORT-11335=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E7=9A=84=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index d4905b645b..81d52d4e63 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -35,6 +35,7 @@ public class JDBCDefPane extends JPanel { public static final String DRIVER_TYPE = "driver_type"; public static final String USER_NAME = "user_name"; public static final int TIME_MULTIPLE = 1000; + private static final String EMPTY_DB = StringUtils.EMPTY; private static Map jdbcMap = new HashMap(); @@ -64,7 +65,7 @@ public class JDBCDefPane extends JPanel { private UITextField userNameTextField; private JPasswordField passwordTextField; // 请不要改动dbtype,只应该最后添加 - private final String[] dbtype = {"", "Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", "Others"}; + private final String[] dbtype = {EMPTY_DB, "Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", "Others"}; // carl:DBCP的一些属性 private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor(); @@ -182,6 +183,9 @@ public class JDBCDefPane extends JPanel { break; } } + if (!out) { + this.dbtypeComboBox.setSelectedItem(EMPTY_DB); + } } this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); this.urlTextField.setText(jdbcDatabase.getURL()); From ee37af303fa314ad6e36e3beeb01b2db48436f8c Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 26 Sep 2018 12:00:38 +0800 Subject: [PATCH 27/62] =?UTF-8?q?1.REPORT-11523=20@Sung:mac=E4=B8=8Balphaf?= =?UTF-8?q?ine=E6=89=93=E5=BC=80=E7=BD=91=E9=A1=B5=E8=B6=85=E9=93=BE?= =?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98=20---=E4=BF=AE=E5=A4=8D=E8=AF=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=202.=E5=A2=9E=E5=BC=BA=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E5=81=A5=E5=A3=AE=E6=80=A7=EF=BC=9B=E8=BF=94=E5=9B=9E=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=A2=9E=E5=8A=A0=E5=B0=8F=E6=89=8B=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E4=BA=A4=E4=BA=92=E6=80=A7=203.=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=AC=A1=E8=A6=81=E7=A8=8B=E5=BA=A6=E7=9A=84?= =?UTF-8?q?log=E7=9A=84=E7=BA=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 17 ++++++++++------- .../alphafine/preview/RobotPreviewPane.java | 4 +++- .../manager/impl/ComplementAdviceManager.java | 12 ++++-------- .../manager/impl/RecommendSearchManager.java | 4 ++-- .../manager/impl/SimilarSearchManeger.java | 4 ++-- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 5137d56f13..6b21b0b6a7 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -947,11 +947,13 @@ public class AlphaFineDialog extends UIDialog { Thread sendThread = new Thread(new Runnable() { @Override public void run() { - RecentSearchManager searchManager = RecentSearchManager.getInstance(); - searchManager.addModel(storeText, cellModel); - sendDataToServer(storeText, cellModel); - TemplateInfoCollector.getInstance().sendTemplateInfo(); - ErrorInfoUploader.getInstance().sendErrorInfo(); + if(StringUtils.isNotEmpty(storeText)){ + RecentSearchManager searchManager = RecentSearchManager.getInstance(); + searchManager.addModel(storeText, cellModel); + sendDataToServer(storeText, cellModel); + TemplateInfoCollector.getInstance().sendTemplateInfo(); + ErrorInfoUploader.getInstance().sendErrorInfo(); + } } }); sendThread.start(); @@ -1376,10 +1378,11 @@ public class AlphaFineDialog extends UIDialog { private void initBackPane() { backPane = new JPanel(new BorderLayout()); JLabel jLabel = new JLabel(" < " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back")); - jLabel.setPreferredSize(new Dimension(680, 20)); + jLabel.setPreferredSize(new Dimension(80, 20)); jLabel.setFont(AlphaFineConstants.SMALL_FONT); jLabel.setForeground(AlphaFineConstants.DARK_GRAY); - backPane.add(jLabel, BorderLayout.CENTER); + jLabel.setCursor(new Cursor(Cursor.HAND_CURSOR)); + backPane.add(jLabel, BorderLayout.WEST); jLabel.addMouseListener(new MouseAdapter() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index 4582d186be..d7849d29c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -23,6 +23,7 @@ import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.net.URLEncoder; /** @@ -32,6 +33,7 @@ public class RobotPreviewPane extends JPanel { private static final int TITLE_AREA_HEIGHT = 15; private static final int HOT_TITLE_AREA_HEIGHT = 30; + private static final String STRING_ENCODER = "UTF-8"; public RobotPreviewPane(AlphaCellModel model, String content) { this.setLayout(new BorderLayout()); @@ -58,7 +60,7 @@ public class RobotPreviewPane extends JPanel { .replaceAll("\\('", StringUtils.EMPTY) .replaceAll("'\\)", StringUtils.EMPTY); try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + s)); + Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(s, STRING_ENCODER))); } catch (IOException e1) { FineLoggerFactory.getLogger().error(e1.getMessage()); } catch (URISyntaxException e1) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 16182d5f19..0390f67da9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -3,18 +3,14 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.DesignerEnvManager; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; -import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.http.HttpToolbox; -import com.fr.json.JSONArray; import com.fr.json.JSONException; -import com.fr.json.JSONObject; -import com.fr.json.JSONUtils; import com.fr.log.FineLoggerFactory; -import com.fr.stable.StringUtils; -import java.io.IOException; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; +import java.io.IOException; + /** * @author alex.sung created on 2018/7/23. @@ -52,9 +48,9 @@ public class ComplementAdviceManager { AlphaFineHelper.checkCancel(); allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"keywords"); } catch(ClassCastException | JSONException e){ - FineLoggerFactory.getLogger().error("complement advice search error: " + e.getMessage()); + FineLoggerFactory.getLogger().debug("complement advice search error: " + e.getMessage()); } catch (IOException e1) { - FineLoggerFactory.getLogger().error("complement advice get result error: " + e1.getMessage()); + FineLoggerFactory.getLogger().debug("complement advice get result error: " + e1.getMessage()); } } if (searchResult.isEmpty()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index c97e621e35..9988b90ddd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -77,9 +77,9 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } } } catch (JSONException e) { - FineLoggerFactory.getLogger().error("recommend search error! :" + e.getMessage()); + FineLoggerFactory.getLogger().debug("recommend search error! :" + e.getMessage()); } catch (IOException e) { - FineLoggerFactory.getLogger().error("recommend search get result error! :" + e.getMessage()); + FineLoggerFactory.getLogger().debug("recommend search get result error! :" + e.getMessage()); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index 1bc6411313..e361ec71af 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -56,9 +56,9 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { AlphaFineHelper.checkCancel(); allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"title"); } catch (ClassCastException | JSONException e) { - FineLoggerFactory.getLogger().error("similar search error: " + e.getMessage()); + FineLoggerFactory.getLogger().debug("similar search error: " + e.getMessage()); } catch (IOException e) { - FineLoggerFactory.getLogger().error("similar search get result error: " + e.getMessage()); + FineLoggerFactory.getLogger().debug("similar search get result error: " + e.getMessage()); } } moreModelList.clear(); From 2c5649fedb6bd4dcd6fc6c89d96f8d9e0c865737 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 26 Sep 2018 12:57:07 +0800 Subject: [PATCH 28/62] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/preview/RobotPreviewPane.java | 4 ++-- .../manager/impl/ComplementAdviceManager.java | 7 +------ .../manager/impl/RecommendSearchManager.java | 14 +++++--------- .../search/manager/impl/SimilarSearchManeger.java | 7 +------ 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index d7849d29c2..4da974bbfe 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -7,6 +7,7 @@ import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.log.FineLoggerFactory; +import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; import javax.swing.BorderFactory; @@ -33,7 +34,6 @@ public class RobotPreviewPane extends JPanel { private static final int TITLE_AREA_HEIGHT = 15; private static final int HOT_TITLE_AREA_HEIGHT = 30; - private static final String STRING_ENCODER = "UTF-8"; public RobotPreviewPane(AlphaCellModel model, String content) { this.setLayout(new BorderLayout()); @@ -60,7 +60,7 @@ public class RobotPreviewPane extends JPanel { .replaceAll("\\('", StringUtils.EMPTY) .replaceAll("'\\)", StringUtils.EMPTY); try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(s, STRING_ENCODER))); + Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(s, EncodeConstants.ENCODING_UTF_8))); } catch (IOException e1) { FineLoggerFactory.getLogger().error(e1.getMessage()); } catch (URISyntaxException e1) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 0390f67da9..8dd88cdc22 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -5,12 +5,9 @@ import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.design.mainframe.alphafine.AlphaFineHelper; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.general.http.HttpToolbox; -import com.fr.json.JSONException; import com.fr.log.FineLoggerFactory; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; -import java.io.IOException; - /** * @author alex.sung created on 2018/7/23. @@ -47,10 +44,8 @@ public class ComplementAdviceManager { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"keywords"); - } catch(ClassCastException | JSONException e){ + } catch(Exception e){ FineLoggerFactory.getLogger().debug("complement advice search error: " + e.getMessage()); - } catch (IOException e1) { - FineLoggerFactory.getLogger().debug("complement advice get result error: " + e1.getMessage()); } } if (searchResult.isEmpty()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 9988b90ddd..13aa7ce7fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -12,14 +12,12 @@ import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; -import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.CodeUtils; import com.fr.stable.StringUtils; -import java.io.IOException; import java.util.Iterator; import java.util.List; @@ -54,7 +52,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { return new SearchResult(); } SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); - if(noConnectList != null){ + if (noConnectList != null) { return noConnectList; } for (int j = 0; j < searchText.length; j++) { @@ -76,9 +74,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } } } - } catch (JSONException e) { - FineLoggerFactory.getLogger().debug("recommend search error! :" + e.getMessage()); - } catch (IOException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().debug("recommend search get result error! :" + e.getMessage()); } } @@ -113,7 +109,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { /** * 将推荐接口获取的数据分别放入“显示部分”,“显示更多”的list */ - private void getRecommendSearchResult(){ + private void getRecommendSearchResult() { if (recommendModelList.size() > AlphaFineConstants.RECOMMEND_MAX_ITEM_NUM) { if (recommendModelList.size() > AlphaFineConstants.SHOW_SIZE) { modelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_ShowAll"), true, CellType.RECOMMEND)); @@ -131,7 +127,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { /** * 将补全接口获取的数据分别放入“显示部分”,“显示更多”的list */ - private void getComplementAdviceSearchResult(){ + private void getComplementAdviceSearchResult() { if (complementAdviceModelList.size() > AlphaFineConstants.SHOW_SIZE) { modelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_ShowAll"), true, CellType.RECOMMEND)); modelList.addAll(complementAdviceModelList.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -145,7 +141,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { /** * 将推荐接口和补全接口获取的数据分别放入“显示部分”,“显示更多”的list */ - private void getRecommendAndAdviceSearchResult(){ + private void getRecommendAndAdviceSearchResult() { if (recommendModelList.size() + complementAdviceModelList.size() > AlphaFineConstants.SHOW_SIZE) { modelList.add(0, new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_ShowAll"), true, CellType.RECOMMEND)); if (recommendModelList.size() > AlphaFineConstants.RECOMMEND_MAX_ITEM_NUM) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index e361ec71af..f4e3d8f9bf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -9,14 +9,11 @@ import com.fr.design.mainframe.alphafine.cell.model.RobotModel; import com.fr.design.mainframe.alphafine.model.SearchResult; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.http.HttpToolbox; -import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.third.org.apache.commons.codec.digest.DigestUtils; -import java.io.IOException; - /** * Created by alex.sung on 2018/8/3. */ @@ -55,10 +52,8 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"title"); - } catch (ClassCastException | JSONException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().debug("similar search error: " + e.getMessage()); - } catch (IOException e) { - FineLoggerFactory.getLogger().debug("similar search get result error: " + e.getMessage()); } } moreModelList.clear(); From 88db8fbe547d1a58b8eb6058a81d32b5c9f1f2b0 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 26 Sep 2018 15:39:17 +0800 Subject: [PATCH 29/62] =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=89=93debug=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/impl/ComplementAdviceManager.java | 7 ++++--- .../search/manager/impl/RecommendSearchManager.java | 2 +- .../search/manager/impl/SimilarSearchManeger.java | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java index 8dd88cdc22..aa3690cb68 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ComplementAdviceManager.java @@ -30,6 +30,7 @@ public class ComplementAdviceManager { /** * 从接口中获取补全建议结果 + * * @param searchText * @return */ @@ -43,9 +44,9 @@ public class ComplementAdviceManager { try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); - allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"keywords"); - } catch(Exception e){ - FineLoggerFactory.getLogger().debug("complement advice search error: " + e.getMessage()); + allModelList = AlphaFineHelper.getModelListFromJSONArray(result, "keywords"); + } catch (Exception e) { + FineLoggerFactory.getLogger().debug("complement advice search error. search str {}", searchText[j]); } } if (searchResult.isEmpty()) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java index 13aa7ce7fb..b5f01f0b0c 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java @@ -75,7 +75,7 @@ public class RecommendSearchManager implements AlphaFineSearchProvider { } } } catch (Exception e) { - FineLoggerFactory.getLogger().debug("recommend search get result error! :" + e.getMessage()); + FineLoggerFactory.getLogger().debug("recommend search get result error! search str {}", searchText[j]); } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java index f4e3d8f9bf..b1da3d72b1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SimilarSearchManeger.java @@ -24,7 +24,7 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { public static SimilarSearchManeger getInstance() { if (instance == null) { - synchronized (SimilarSearchManeger.class){ + synchronized (SimilarSearchManeger.class) { if (instance == null) { instance = new SimilarSearchManeger(); } @@ -41,7 +41,7 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { return new SearchResult(); } SearchResult noConnectList = AlphaFineHelper.getNoConnectList(instance); - if(noConnectList != null){ + if (noConnectList != null) { return noConnectList; } SearchResult allModelList = new SearchResult(); @@ -51,9 +51,9 @@ public class SimilarSearchManeger implements AlphaFineSearchProvider { try { String result = HttpToolbox.get(url); AlphaFineHelper.checkCancel(); - allModelList = AlphaFineHelper.getModelListFromJSONArray(result,"title"); + allModelList = AlphaFineHelper.getModelListFromJSONArray(result, "title"); } catch (Exception e) { - FineLoggerFactory.getLogger().debug("similar search error: " + e.getMessage()); + FineLoggerFactory.getLogger().debug("similar search error.search str {}", searchText[j]); } } moreModelList.clear(); From c117c537f3411469b7501985b27f3374a8b8e856 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 26 Sep 2018 19:48:29 +0800 Subject: [PATCH 30/62] =?UTF-8?q?REPORT-11523=20@Sung:mac=E4=B8=8Balphafin?= =?UTF-8?q?e=E6=89=93=E5=BC=80=E7=BD=91=E9=A1=B5=E8=B6=85=E9=93=BE?= =?UTF-8?q?=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/mainframe/alphafine/cell/model/RobotModel.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java index 273b29fef0..cb159745fb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/model/RobotModel.java @@ -7,6 +7,7 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.AssistUtils; +import com.fr.stable.EncodeConstants; import com.fr.stable.StringUtils; import org.apache.commons.codec.digest.DigestUtils; @@ -14,6 +15,7 @@ import java.awt.Desktop; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.net.URLEncoder; /** * Created by alex.sung on 2018/8/3. @@ -85,7 +87,7 @@ public class RobotModel extends AlphaCellModel { @Override public void doAction() { try { - Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + super.getName())); + Desktop.getDesktop().browse(new URI(AlphaFineConstants.ALPHA_PREVIEW + URLEncoder.encode(super.getName(), EncodeConstants.ENCODING_UTF_8))); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage()); } catch (URISyntaxException e) { From 740ae4fb47100874febc9b8a568d7147b2db028e Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 27 Sep 2018 15:26:30 +0800 Subject: [PATCH 31/62] =?UTF-8?q?CHART-3073=20=E5=AD=97=E6=AE=B5=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E5=8C=85=E5=90=AB=E6=97=A0=E8=BF=99=E4=B8=AA?= =?UTF-8?q?=E9=80=89=E9=A1=B9=20&&=20CHART-3060=20=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=97=A0=E5=92=8C=E8=8B=B1=E6=96=87none?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/icombobox/UIComboBox.java | 16 +++++++ .../chart/gui/data/table/DataPaneHelper.java | 12 +---- .../AbstractExtendedChartTableDataPane.java | 23 +++++----- .../ExtendedCustomFieldComboBoxPane.java | 32 +++++--------- .../fr/extended/chart/UIComboBoxWithNone.java | 44 +++++++++++++++++++ 5 files changed, 82 insertions(+), 45 deletions(-) create mode 100644 designer-chart/src/main/java/com/fr/extended/chart/UIComboBoxWithNone.java diff --git a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java index 14a90da7b2..e6130ca3da 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombobox/UIComboBox.java @@ -15,6 +15,7 @@ import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; +import java.util.List; import java.util.Vector; /** @@ -131,6 +132,21 @@ public class UIComboBox extends JComboBox implements UIObserver, GlobalNameObser return new Dimension(super.getPreferredSize().width + SIZE5, SIZE); } + public void refreshBoxItems(List list) { + Object ob = getSelectedItem(); + + removeAllItems(); + for (Object o : list) { + addItem(o); + } + + getModel().setSelectedItem(ob); + } + + public void clearBoxItems() { + removeAllItems(); + } + /** * 鼠标进入事件 */ diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java index 3fb9d6a63e..69cf88286f 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/DataPaneHelper.java @@ -21,15 +21,7 @@ public class DataPaneHelper { return; } - Object ob = box.getSelectedItem(); - box.removeAllItems(); - - int length = list.size(); - for (int i = 0; i < length; i++) { - box.addItem(list.get(i)); - } - - box.getModel().setSelectedItem(ob); + box.refreshBoxItems(list); } /** @@ -39,7 +31,7 @@ public class DataPaneHelper { */ public static void clearBoxItems(UIComboBox box) { if (box != null) { - box.removeAllItems(); + box.clearBoxItems(); } } diff --git a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java index 0ac4546345..e0bf8de70a 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/AbstractExtendedChartTableDataPane.java @@ -10,13 +10,14 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.general.GeneralUtils; + +import javax.swing.BorderFactory; +import javax.swing.JPanel; +import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Component; import java.util.Arrays; import java.util.List; -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.SwingConstants; /** * Created by shine on 2018/3/2. @@ -52,8 +53,8 @@ public abstract class AbstractExtendedChartTableDataPane fieldList = new ArrayList(); - public ExtendedCustomFieldComboBoxPane(boolean hasNoneItem) { - this.hasNoneItem = hasNoneItem; - } - @Override protected void initLayout() { this.setLayout(new BorderLayout(0, 6)); @@ -76,6 +70,10 @@ public class ExtendedCustomFieldComboBoxPane extends UIComboBoxPane Date: Thu, 27 Sep 2018 16:34:50 +0800 Subject: [PATCH 32/62] =?UTF-8?q?REPORT-11586=20=E4=B8=8D=E5=90=8C?= =?UTF-8?q?=E8=AF=AD=E8=A8=80=E7=8E=AF=E5=A2=83=E8=B6=85=E9=93=BE=E9=80=89?= =?UTF-8?q?=E9=A1=B9=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/HyperlinkFilterHelper.java | 59 ------------- .../gui/controlpane/NameableCreator.java | 38 ++++----- .../shortcutfactory/OldShortCutFactory.java | 6 +- .../shortcutfactory/ShortCutFactory.java | 25 +++--- .../design/gui/frpane/BaseHyperlinkGroup.java | 33 ++++++-- .../gui/frpane/HyperLinkGroupFilter.java | 22 +++++ .../design/gui/frpane/HyperlinkGroupType.java | 19 +++-- .../gui/frpane/UICorrelationComboBoxPane.java | 39 ++++++--- .../fr/design/module/ChartHyperlinkGroup.java | 83 ++++++++++++++++++- .../fr/design/module/FormHyperlinkGroup.java | 8 +- .../component/VanChartShortCutFactory.java | 22 +---- 11 files changed, 208 insertions(+), 146 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/gui/HyperlinkFilterHelper.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java diff --git a/designer-base/src/main/java/com/fr/design/gui/HyperlinkFilterHelper.java b/designer-base/src/main/java/com/fr/design/gui/HyperlinkFilterHelper.java deleted file mode 100644 index bc2cbdbf90..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/HyperlinkFilterHelper.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.fr.design.gui; - -import com.fr.design.file.HistoryTemplateListPane; -import com.fr.design.mainframe.BaseJForm; -import com.fr.design.mainframe.JTemplate; -import com.fr.general.ComparatorUtils; - - -/** - * Created by mengao on 2017/9/22. - * 单元格超链、图表超链在不同类型模版中,下拉选项不同 - */ -public class HyperlinkFilterHelper { - - public static boolean whetherAddHyperlink4cell(String itemName) { - JTemplate jTemplate = getCurrentEditingTemplate(); - if (jTemplate == null) { - return false; - } - //先屏蔽掉这个,之后还有别的 - String[] names = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ Hyperlink_Chart_Float")}; - for (String name : names) { - if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) { - return false; - } - } - return whetherAddFormLink(jTemplate, itemName); - } - - public static boolean whetherAddHyperlink4Chart(String itemName) { - JTemplate jTemplate = getCurrentEditingTemplate(); - if (jTemplate == null) { - return false; - } - //先屏蔽掉这个,之后还有别的 - String[] names = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ Hyperlink_Chart_Float"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Chart_Cell")}; - for (String name : names) { - if (!jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, name)) { - if (jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB && ComparatorUtils.equals(itemName, names[0])) { - //表单报表块中图表悬浮元素超链,只屏蔽联动悬浮元素 - return false; - } else if (jTemplate.getEditingReportIndex() == BaseJForm.FORM_TAB) { - //表单图表超链屏蔽掉联动悬浮元素和联动单元格 - return false; - } - } - } - return whetherAddFormLink(jTemplate, itemName); - } - - private static JTemplate getCurrentEditingTemplate() { - return HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - } - - private static boolean whetherAddFormLink(JTemplate jTemplate, String itemName) { - String formName = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link"); - return !(jTemplate.isJWorkBook() && ComparatorUtils.equals(itemName, formName)); - } -} diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/NameableCreator.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/NameableCreator.java index e667675ec3..97fadec005 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/NameableCreator.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/NameableCreator.java @@ -5,25 +5,25 @@ import com.fr.design.gui.ilist.ListModelElement; import com.fr.js.JavaScript; import com.fr.stable.Nameable; -import javax.swing.*; +import javax.swing.Icon; public interface NameableCreator { - public String menuName(); - - public Icon menuIcon(); - - public String createTooltip(); - - public Nameable createNameable(UnrepeatedNameHelper helper); - - public Class getUpdatePane(); - - public Object acceptObject2Populate(Object ob); - - public void saveUpdatedBean(ListModelElement wrapper, Object bean); - - public Class getHyperlink(); - - - public boolean isNeedParameterWhenPopulateJControlPane(); + String menuName(); + + Icon menuIcon(); + + String createTooltip(); + + Nameable createNameable(UnrepeatedNameHelper helper); + + Class getUpdatePane(); + + Object acceptObject2Populate(Object ob); + + void saveUpdatedBean(ListModelElement wrapper, Object bean); + + Class getHyperlink(); + + + boolean isNeedParameterWhenPopulateJControlPane(); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java index a7608e2bdf..9ea8bb8fcf 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java @@ -2,13 +2,14 @@ package com.fr.design.gui.controlpane.shortcutfactory; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; -import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.gui.frpane.HyperLinkGroupFilter; import com.fr.design.menu.LineSeparator; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; +import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; @@ -83,7 +84,8 @@ public class OldShortCutFactory extends AbstractShortCutFactory { private void wrapActionListener(NameableCreator[] creators) { for (final NameableCreator creator : creators) { - if (!HyperlinkFilterHelper.whetherAddHyperlink4cell(creator.menuName())) { + HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); + if (!filter.filter(creator.getHyperlink())) { continue; } boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) || diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java index b561c28bac..a09d859f6f 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java @@ -3,14 +3,15 @@ package com.fr.design.gui.controlpane.shortcutfactory; import com.fr.base.BaseUtils; import com.fr.design.actions.UpdateAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCutListenerProvider; +import com.fr.design.gui.frpane.HyperLinkGroupFilter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.menu.LineSeparator; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; +import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -36,11 +37,11 @@ public class ShortCutFactory extends AbstractShortCutFactory { @Override public ShortCut4JControlPane[] createShortCuts() { return new ShortCut4JControlPane[]{ - copyItemShortCut(), - moveUpItemShortCut(), - moveDownItemShortCut(), - sortItemShortCut(), - removeItemShortCut() + copyItemShortCut(), + moveUpItemShortCut(), + moveDownItemShortCut(), + sortItemShortCut(), + removeItemShortCut() }; } @@ -77,7 +78,7 @@ public class ShortCutFactory extends AbstractShortCutFactory { Object object = this.getValue(UIButton.class.getName()); if (!(object instanceof AbstractButton)) { // 直接使用默认UI - UIButton button = new UIButton(); + UIButton button = new UIButton(); // 添加一个名字作为自动化测试用 button.setName(getName()); @@ -124,7 +125,8 @@ public class ShortCutFactory extends AbstractShortCutFactory { /** * 生成UIButton - * @return 菜单按钮 + * + * @return 菜单按钮 */ public UIButton createUIButton() { createdButton = super.createUIButton(); @@ -139,7 +141,8 @@ public class ShortCutFactory extends AbstractShortCutFactory { private void wrapActionListener(NameableCreator[] creators) { for (final NameableCreator creator : creators) { - if (!whetherAdd(creator.menuName())) { + HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); + if (!filter.filter(creator.getHyperlink())) { continue; } boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) || @@ -163,9 +166,5 @@ public class ShortCutFactory extends AbstractShortCutFactory { }); } } - - protected boolean whetherAdd(String itemName){ - return HyperlinkFilterHelper.whetherAddHyperlink4cell(itemName); - } } } diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java b/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java index fbc9678d5a..f971e9ae2d 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java @@ -2,6 +2,7 @@ package com.fr.design.gui.frpane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.module.DesignModuleFactory; +import com.fr.js.JavaScript; /** * 基础的超级链接类型, 不包括图表相关超链. @@ -11,13 +12,29 @@ import com.fr.design.module.DesignModuleFactory; */ public class BaseHyperlinkGroup implements HyperlinkGroupType { - /** - * 返回支持的超级链接类型 - * - * @return - */ - public NameableCreator[] getHyperlinkCreators() { - return DesignModuleFactory.getCreators4Hyperlink(); - } + /** + * 返回支持的超级链接类型 + * + * @return NameableCreator[] + */ + public NameableCreator[] getHyperlinkCreators() { + return DesignModuleFactory.getCreators4Hyperlink(); + } + + @Override + public HyperLinkGroupFilter getFilter() { + return new HyperLinkGroupFilter() { + @Override + public boolean filter(Class clazz) { + return true; + } + + @Override + public boolean filter(Object object) { + return true; + } + }; + } + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java new file mode 100644 index 0000000000..cb4096574f --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java @@ -0,0 +1,22 @@ +package com.fr.design.gui.frpane; + +import com.fr.js.JavaScript; + +public interface HyperLinkGroupFilter { + + /** + * @param clazz clazz + * @return 是否可用,返回true表示可用,返回false表示不可用 + */ + boolean filter(Class clazz); + + /** + * 兼容老图表 + * + * @param object object + * @return 是否可用,返回true表示可用,返回false表示不可用 + * @see HyperLinkGroupFilter#filter(Class) + */ + boolean filter(Object object); + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java index 37a64a2905..48b5c12827 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java @@ -3,16 +3,21 @@ package com.fr.design.gui.frpane; import com.fr.design.gui.controlpane.NameableCreator; /** - * 超级链接 支持的类型 种类. + * 超级链接 支持的类型 种类. + * * @author kunsnat E-mail:kunsnat@gmail.com * @version 创建时间:2013-6-26 下午04:41:55 */ public interface HyperlinkGroupType { - - /** - * 返回支持的超级链接类型 - * @return NameableCreator[] - */ - public NameableCreator[] getHyperlinkCreators(); + + /** + * 返回支持的超级链接类型 + * + * @return NameableCreator[] + */ + NameableCreator[] getHyperlinkCreators(); + + + HyperLinkGroupFilter getFilter(); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java index a1f92ddd0e..5bf5044448 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java @@ -8,7 +8,6 @@ import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.UIDialog; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; -import com.fr.design.gui.HyperlinkFilterHelper; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenutable.UIMenuNameableCreator; @@ -16,9 +15,9 @@ import com.fr.design.gui.imenutable.UIMenuTable; import com.fr.design.hyperlink.ReportletHyperlinkPane; import com.fr.design.hyperlink.WebHyperlinkPane; import com.fr.design.javascript.EmailPane; +import com.fr.design.module.DesignModuleFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.ComparatorUtils; - import com.fr.js.AbstractJavaScript; import com.fr.js.EmailJavaScript; import com.fr.js.ReportletHyperlink; @@ -26,10 +25,17 @@ import com.fr.js.WebHyperlink; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; -import javax.swing.*; +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.LayoutManager; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.ArrayList; @@ -76,6 +82,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 刷新下拉列表和按钮 + * * @param values 下拉列表里的值 */ public void refreshMenuAndAddMenuAction(List values) { @@ -88,7 +95,8 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { if (values.size() > 1) { for (UIMenuNameableCreator value : values) { final String itemName = value.getName(); - if(!HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName)){ + HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); + if (!filter.filter(value.getObj())) { continue; } UIMenuItem item = new UIMenuItem(itemName); @@ -238,6 +246,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 增加布局 + * * @param name 名字 * @param comp 组件 */ @@ -247,6 +256,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 删除组件 + * * @param comp 组件 */ public void removeLayoutComponent(Component comp) { @@ -255,6 +265,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 获得组件的大小 + * * @param parent 上层容器 * @return 组件的大小 */ @@ -265,6 +276,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 最小的布局大小 + * * @param parent 上层容器 * @return 最小的大小 */ @@ -274,6 +286,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 布局容器 + * * @param parent 上层容器 */ public void layoutContainer(Container parent) { @@ -287,6 +300,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 增加监听事件 + * * @param l 监听的对象 */ public void addChangeListener(ChangeListener l) { @@ -296,6 +310,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 删除监听事件 + * * @param l 需要删除的事件 */ public void removeChangeListener(ChangeListener l) { @@ -337,6 +352,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 更新并且重载 当前列表的值 + * * @param list 更新的列表 */ public void populateBean(List list) { @@ -353,14 +369,14 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 重置每个条目的名字 */ - public void resetItemName(){ - for(int i = 0; i < tablePane.getRowCount(); i++){ + public void resetItemName() { + for (int i = 0; i < tablePane.getRowCount(); i++) { UIMenuNameableCreator line = tablePane.getLine(i); Object obj = line.getObj(); - if(obj instanceof AbstractJavaScript){ - AbstractJavaScript script = (AbstractJavaScript)obj; + if (obj instanceof AbstractJavaScript) { + AbstractJavaScript script = (AbstractJavaScript) obj; String itemName = script.getItemName(); - if(!StringUtils.isBlank(itemName)){ + if (!StringUtils.isBlank(itemName)) { line.setName(itemName); } } @@ -369,6 +385,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 测试例子界面 + * * @param args 参数向量 */ public static void main(String... args) { @@ -397,6 +414,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 注册观察者监听事件 + * * @param listener 观察者监听事件 */ public void registerChangeListener(UIObserverListener listener) { @@ -406,6 +424,7 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { /** * 是否需要响应事件 + * * @return 需要相应 */ public boolean shouldResponseChangeListener() { diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java index 583a669ef6..33d15367db 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java @@ -7,11 +7,16 @@ import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane; import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; +import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.frpane.BaseHyperlinkGroup; - +import com.fr.design.gui.frpane.HyperLinkGroupFilter; +import com.fr.design.mainframe.BaseJForm; +import com.fr.design.mainframe.JTemplate; +import com.fr.general.ComparatorUtils; import com.fr.js.FormHyperlinkProvider; +import com.fr.js.JavaScript; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; @@ -31,12 +36,84 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { public NameableCreator[] getHyperlinkCreators() { FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - NameableCreator[] realted4CharthyperUse = { + NameableCreator[] related4ChartHyper = { new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float"), ChartHyperRelateFloatLink.class, ChartHyperRelateFloatLinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), formHyperlink.getClass(), FormHyperlinkPane.class)}; - return (NameableCreator[]) ArrayUtils.addAll(super.getHyperlinkCreators(), realted4CharthyperUse); + return ArrayUtils.addAll(super.getHyperlinkCreators(), related4ChartHyper); + + } + + @Override + public HyperLinkGroupFilter getFilter() { + return new HyperLinkGroupFilter() { + @Override + public boolean filter(Class clazz) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template == null) { + return false; + } + + if (template.isJWorkBook()) { + // 如果是普通报表单元格,那么没有 FormHyperlink 选项 + FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + //返回true表示可用,返回false表示不可用 + return !ComparatorUtils.equals(clazz, formHyperlink.getClass()); + + } else { + // 如果是决策报表 + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + for (Class aClass : classes) { + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 + if (ComparatorUtils.equals(aClass, clazz)) { + return false; + } + } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项 + return !ComparatorUtils.equals(clazz, ChartHyperRelateFloatLink.class); + } + } + } + return true; + } + + /** + * 兼容老图表 + * @param object + * @return + */ + @Override + public boolean filter(Object object) { + JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); + if (template == null) { + return false; + } + + if (template.isJWorkBook()) { + // 如果是普通报表单元格,那么没有 FormHyperlink 选项 + FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + //返回true表示可用,返回false表示不可用 + return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass()); + } else { + // 如果是决策报表 + Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; + for (Class aClass : classes) { + if (template.getEditingReportIndex() == BaseJForm.FORM_TAB) { + // 编辑的是决策报表中的图表,那么没有ChartHyperRelateFloatLink 和 ChartHyperRelateCellLink 选项,有FormHyperlink 选项 + if (ComparatorUtils.equals(aClass, object.getClass())) { + return false; + } + } else if (template.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) { + // 编辑的是决策报表中的报表块,那么没有 ChartHyperRelateFloatLink,有ChartHyperRelateCellLink 和 FormHyperlink 选项 + return !ComparatorUtils.equals(object.getClass(), ChartHyperRelateFloatLink.class); + } + } + } + return true; + } + }; } } diff --git a/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java index 473d55a405..f10964d4c8 100644 --- a/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/FormHyperlinkGroup.java @@ -8,7 +8,6 @@ import com.fr.design.chart.series.SeriesCondition.impl.FormHyperlinkPane; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.frpane.BaseHyperlinkGroup; - import com.fr.js.FormHyperlinkProvider; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; @@ -23,15 +22,16 @@ public class FormHyperlinkGroup extends BaseHyperlinkGroup { /** * 返回支持的超级链接类型 + * * @return NameableCreator[] */ public NameableCreator[] getHyperlinkCreators() { - FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); - NameableCreator[] realted4CharthyperUse = { + FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); + NameableCreator[] related4ChartHyper = { new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Float_Chart"), ChartHyperPoplink.class, ChartHyperPoplinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Cell"), ChartHyperRelateCellLink.class, ChartHyperRelateCellLinkPane.ChartNoRename.class), new NameObjectCreator(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Hyperlink_Form_Link"), formHyperlink.getClass(), FormHyperlinkPane.class)}; - return (NameableCreator[]) ArrayUtils.addAll(super.getHyperlinkCreators(), realted4CharthyperUse); + return ArrayUtils.addAll(super.getHyperlinkCreators(), related4ChartHyper); } } diff --git a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java index b9b41302e0..2ab52f2f4b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java +++ b/designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartShortCutFactory.java @@ -1,10 +1,7 @@ package com.fr.van.chart.custom.component; -import com.fr.design.gui.HyperlinkFilterHelper; -import com.fr.design.gui.controlpane.NameableCreator; -import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; import com.fr.design.gui.controlpane.ShortCutListenerProvider; -import com.fr.design.menu.ShortCut; +import com.fr.design.gui.controlpane.shortcutfactory.ShortCutFactory; /** * Created by plough on 2018/8/13. @@ -17,21 +14,4 @@ class VanChartShortCutFactory extends ShortCutFactory { public static VanChartShortCutFactory newInstance(ShortCutListenerProvider listenerProvider) { return new VanChartShortCutFactory(listenerProvider); } - - @Override - public ShortCut createAddItemMenuDef(NameableCreator[] creators) { - return new AddVanChartItemMenuDef(creators); - } - - private class AddVanChartItemMenuDef extends AddItemMenuDef { - - AddVanChartItemMenuDef(NameableCreator[] creators) { - super(creators); - } - - @Override - protected boolean whetherAdd(String itemName) { - return HyperlinkFilterHelper.whetherAddHyperlink4Chart(itemName); - } - } } From ceea3afd2817809ab2e7b2af51e2f2b7c36eafd9 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 27 Sep 2018 16:37:40 +0800 Subject: [PATCH 33/62] =?UTF-8?q?CHART-3044=20=E6=96=B0=E5=A2=9E=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=99=A8=EF=BC=8C=E5=88=9D=E5=A7=8B=E5=8C=96=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ColorBackgroundQuickPane.java | 113 +++++++++--------- .../style/color/NewColorSelectPane.java | 16 ++- 2 files changed, 72 insertions(+), 57 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 8309a802d2..0861af63d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -6,7 +6,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.color.NewColorSelectPane; import com.fr.general.Background; - import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -18,18 +17,24 @@ import java.awt.Color; */ public class ColorBackgroundQuickPane extends BackgroundQuickPane { - private NewColorSelectPane detailColorSelectPane; - private boolean isBackGroundColor; + private NewColorSelectPane detailColorSelectPane; + private boolean isBackGroundColor; + + public ColorBackgroundQuickPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(); + this.add(detailColorSelectPane, BorderLayout.NORTH); + } - public ColorBackgroundQuickPane() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); + public ColorBackgroundQuickPane(Color color) { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(color); + this.add(detailColorSelectPane, BorderLayout.NORTH); + } - detailColorSelectPane = new NewColorSelectPane(); - this.add(detailColorSelectPane, BorderLayout.NORTH); - } - public void populateBean(Background background) { - ColorBackground colorBackgroud = (ColorBackground) background; + public void populateBean(Background background) { + ColorBackground colorBackgroud = (ColorBackground) background; populateColor(colorBackgroud.getColor()); } @@ -47,48 +52,48 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { return this.detailColorSelectPane.getNotNoneColor(); } - public boolean isBackGroundColor(){ - return isBackGroundColor; - } - - /** - * 给组件登记一个观察者监听事件 - * - * @param listener 观察者监听事件 - */ - public void registerChangeListener(final UIObserverListener listener) { - detailColorSelectPane.addChangeListener(new ChangeListener() { - public void stateChanged(ChangeEvent e) { - isBackGroundColor = true; - listener.doChange(); - isBackGroundColor = false; - } - }); - } - - @Override - /** - * 是否为ColorBackground 类型 - * - * @param background 背景 - * @return 同上 - * - */ - public boolean accept(Background background) { - return background instanceof ColorBackground; - } - - @Override - /** - * 窗口名称 - * @return 同上 - */ - public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"); - } - - @Override - public void reset() { - this.detailColorSelectPane.setColor(null); - } + public boolean isBackGroundColor() { + return isBackGroundColor; + } + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ + public void registerChangeListener(final UIObserverListener listener) { + detailColorSelectPane.addChangeListener(new ChangeListener() { + public void stateChanged(ChangeEvent e) { + isBackGroundColor = true; + listener.doChange(); + isBackGroundColor = false; + } + }); + } + + @Override + /** + * 是否为ColorBackground 类型 + * + * @param background 背景 + * @return 同上 + * + */ + public boolean accept(Background background) { + return background instanceof ColorBackground; + } + + @Override + /** + * 窗口名称 + * @return 同上 + */ + public String title4PopupWindow() { + return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Color"); + } + + @Override + public void reset() { + this.detailColorSelectPane.setColor(null); + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index fec4993221..5b3dd97a47 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -8,11 +8,16 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; - -import javax.swing.*; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JPanel; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -49,6 +54,11 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } + public NewColorSelectPane(Color color) { + this(false); + this.setColor(color); + } + /** * Constructor. */ From 6de15112dd0fb7c53ccf2c105fcee3775e0b24d0 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Thu, 27 Sep 2018 18:09:20 +0800 Subject: [PATCH 34/62] revert code --- .../mainframe/backgroundpane/ColorBackgroundQuickPane.java | 7 ------- .../java/com/fr/design/style/color/NewColorSelectPane.java | 4 ---- 2 files changed, 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 0861af63d0..6ae9ce5ebc 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -26,13 +26,6 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { this.add(detailColorSelectPane, BorderLayout.NORTH); } - public ColorBackgroundQuickPane(Color color) { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - detailColorSelectPane = new NewColorSelectPane(color); - this.add(detailColorSelectPane, BorderLayout.NORTH); - } - - public void populateBean(Background background) { ColorBackground colorBackgroud = (ColorBackground) background; populateColor(colorBackgroud.getColor()); diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 5b3dd97a47..e06e55a059 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -54,10 +54,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } - public NewColorSelectPane(Color color) { - this(false); - this.setColor(color); - } /** * Constructor. From 8f44f809e13f37c43c490a9d492b56c718307d92 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 28 Sep 2018 10:04:31 +0800 Subject: [PATCH 35/62] REPORT-11257 --- .../src/main/java/com/fr/design/EnvChangeEntrance.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 9ad3b4ab11..9f72e6258c 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -16,6 +16,7 @@ import com.fr.general.GeneralContext; import com.fr.license.exception.RegistEditionException; import com.fr.log.FineLoggerFactory; import com.fr.stable.EnvChangedListener; +import com.fr.start.server.ServerTray; import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContextCallback; import com.fr.workspace.Workspace; @@ -85,6 +86,10 @@ public class EnvChangeEntrance { template.refreshToolArea(); } DesignTableDataManager.fireDSChanged(new HashMap()); + if (WorkContext.getCurrent().isLocal()) { + //初始化一下serverTray + ServerTray.init(); + } } }); From fe66bd8aa18b782327909e1e3641e928cfe280e5 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 28 Sep 2018 12:38:58 +0800 Subject: [PATCH 36/62] =?UTF-8?q?REPORT-11590=20=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E6=89=A7=E8=A1=8C=E5=AE=8C=E6=AF=95=E5=90=8E?= =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=80=89=E6=8B=A9=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=EF=BC=8C=E5=90=AF=E5=8A=A8=E6=97=B6=E7=8E=AF=E5=A2=83=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=92=8C9=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/EnvChangeEntrance.java | 87 +++++++++++++++---- 1 file changed, 72 insertions(+), 15 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java index 9ad3b4ab11..f75fb8b62b 100644 --- a/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java +++ b/designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java @@ -51,19 +51,28 @@ public class EnvChangeEntrance { }); } - private boolean envListOkAction(EnvListPane envListPane) { + private boolean envListOkAction(EnvListPane envListPane, PopTipStrategy strategy) { final String selectedName = envListPane.updateEnvManager(); - return switch2Env(selectedName); + return switch2Env(selectedName, strategy); } + /** + * 切换到指定名称的工作目录 + * + * @param envName 目标工作目录名称 + */ + public void switch2Env(final String envName) { + switch2Env(envName, PopTipStrategy.LATER); + } + /** * 切换到新环境 * * @param envName 新工作环境名称 * @return 是否成功 */ - public boolean switch2Env(final String envName) { + private boolean switch2Env(final String envName, PopTipStrategy strategy) { DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); DesignerWorkspaceInfo selectedEnv = envManager.getWorkspaceInfo(envName); @@ -71,8 +80,13 @@ public class EnvChangeEntrance { Workspace workspace = DesignerWorkspaceGenerator.generate(selectedEnv); boolean checkValid = workspace != null && selectedEnv.checkValid(); if (!checkValid) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), - UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + strategy.showTip(new PopTip() { + @Override + public void show() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), + UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + } + }); return false; } WorkContext.switchTo(workspace, new WorkContextCallback() { @@ -91,13 +105,24 @@ public class EnvChangeEntrance { } catch (AuthException | RegistEditionException e) { // String title = Toolkit.i18nText("Fine-Design_Basic_Remote_Connect_Auth_Failed"); // String title = Toolkit.i18nText("Fine-Design_Basic_Lic_Does_Not_Support_Remote"); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), - UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + strategy.showTip(new PopTip() { + @Override + public void show() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), + UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + } + }); return false; } catch (Exception exception) { FineLoggerFactory.getLogger().error(exception.getMessage(), exception); - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), - UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + strategy.showTip(new PopTip() { + @Override + public void show() { + JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Switch_Workspace_Failed"), + UIManager.getString("OptionPane.messageDialogTitle"), ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon")); + } + }); + return false; } TemplateTreePane.getInstance().refreshDockingView(); @@ -131,13 +156,11 @@ public class EnvChangeEntrance { @Override public void doOk() { - envListDialog.dispose(); - envListOkAction(envListPane); + envListOkAction(envListPane, PopTipStrategy.LATER); } @Override public void doCancel() { - envListDialog.dispose(); } }); @@ -155,11 +178,9 @@ public class EnvChangeEntrance { @Override public void doOk() { - - if (!envListOkAction(envListPane)) { + if (!envListOkAction(envListPane, PopTipStrategy.NOW)) { System.exit(0); } - } @Override @@ -170,4 +191,40 @@ public class EnvChangeEntrance { envListDialog.setVisible(true); } + + /** + * 提示显示策略 + */ + enum PopTipStrategy { + + /** + * 切换失败,就马上提示失败,不关闭选择列表对话框 + */ + NOW { + @Override + void showTip(PopTip tip) { + tip.show(); + } + }, + /** + * 切换失败,自动关闭选择列表对话框,然后提示切换失败 + */ + LATER { + @Override + void showTip(final PopTip tip) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + tip.show(); + } + }); + } + }; + + abstract void showTip(PopTip tip); + } + + interface PopTip { + void show(); + } } From 3c28ceda91422a74ffb70d4166b77848d55294df Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Fri, 28 Sep 2018 16:17:09 +0800 Subject: [PATCH 37/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=EF=BC=8C?= =?UTF-8?q?=E5=A4=8D=E7=94=A8=E5=8E=9F=E6=9C=89=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shortcutfactory/OldShortCutFactory.java | 7 +++--- .../shortcutfactory/ShortCutFactory.java | 7 +++--- .../design/gui/frpane/BaseHyperlinkGroup.java | 14 ++++++++---- .../gui/frpane/HyperLinkGroupFilter.java | 22 ------------------- .../design/gui/frpane/HyperlinkGroupType.java | 16 +++++++++++++- .../gui/frpane/UICorrelationComboBoxPane.java | 5 +++-- .../fr/design/module/ChartHyperlinkGroup.java | 22 +++++++++---------- 7 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java index 9ea8bb8fcf..d0cf10f7e8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/OldShortCutFactory.java @@ -5,13 +5,14 @@ import com.fr.design.actions.UpdateAction; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCutListenerProvider; -import com.fr.design.gui.frpane.HyperLinkGroupFilter; import com.fr.design.menu.LineSeparator; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; +import com.fr.js.JavaScript; +import com.fr.stable.Filter; import javax.swing.Icon; import java.awt.event.ActionEvent; @@ -84,8 +85,8 @@ public class OldShortCutFactory extends AbstractShortCutFactory { private void wrapActionListener(NameableCreator[] creators) { for (final NameableCreator creator : creators) { - HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); - if (!filter.filter(creator.getHyperlink())) { + Filter> filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); + if (!filter.accept(creator.getHyperlink())) { continue; } boolean isTrue = ComparatorUtils.equals(creator.menuName(), Inter.getLocText("Datasource-Stored_Procedure")) || diff --git a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java index a09d859f6f..7d16995435 100644 --- a/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java +++ b/designer-base/src/main/java/com/fr/design/gui/controlpane/shortcutfactory/ShortCutFactory.java @@ -6,13 +6,14 @@ import com.fr.design.actions.core.ActionFactory; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.ShortCut4JControlPane; import com.fr.design.gui.controlpane.ShortCutListenerProvider; -import com.fr.design.gui.frpane.HyperLinkGroupFilter; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.menu.LineSeparator; import com.fr.design.menu.MenuDef; import com.fr.design.menu.ShortCut; import com.fr.design.module.DesignModuleFactory; import com.fr.general.ComparatorUtils; +import com.fr.js.JavaScript; +import com.fr.stable.Filter; import com.fr.stable.StringUtils; import javax.swing.AbstractButton; @@ -141,8 +142,8 @@ public class ShortCutFactory extends AbstractShortCutFactory { private void wrapActionListener(NameableCreator[] creators) { for (final NameableCreator creator : creators) { - HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); - if (!filter.filter(creator.getHyperlink())) { + Filter> filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); + if (!filter.accept(creator.getHyperlink())) { continue; } boolean isTrue = ComparatorUtils.equals(creator.menuName(), com.fr.design.i18n.Toolkit.i18nText("Datasource-Stored_Procedure")) || diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java b/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java index f971e9ae2d..8981016982 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/BaseHyperlinkGroup.java @@ -3,6 +3,7 @@ package com.fr.design.gui.frpane; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.module.DesignModuleFactory; import com.fr.js.JavaScript; +import com.fr.stable.Filter; /** * 基础的超级链接类型, 不包括图表相关超链. @@ -22,15 +23,20 @@ public class BaseHyperlinkGroup implements HyperlinkGroupType { } @Override - public HyperLinkGroupFilter getFilter() { - return new HyperLinkGroupFilter() { + public Filter> getFilter() { + return new Filter>() { @Override - public boolean filter(Class clazz) { + public boolean accept(Class aClass) { return true; } + }; + } + @Override + public Filter getOldFilter() { + return new Filter() { @Override - public boolean filter(Object object) { + public boolean accept(Object object) { return true; } }; diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java deleted file mode 100644 index cb4096574f..0000000000 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperLinkGroupFilter.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.fr.design.gui.frpane; - -import com.fr.js.JavaScript; - -public interface HyperLinkGroupFilter { - - /** - * @param clazz clazz - * @return 是否可用,返回true表示可用,返回false表示不可用 - */ - boolean filter(Class clazz); - - /** - * 兼容老图表 - * - * @param object object - * @return 是否可用,返回true表示可用,返回false表示不可用 - * @see HyperLinkGroupFilter#filter(Class) - */ - boolean filter(Object object); - -} diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java index 48b5c12827..8db0b9b948 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/HyperlinkGroupType.java @@ -1,6 +1,8 @@ package com.fr.design.gui.frpane; import com.fr.design.gui.controlpane.NameableCreator; +import com.fr.js.JavaScript; +import com.fr.stable.Filter; /** * 超级链接 支持的类型 种类. @@ -18,6 +20,18 @@ public interface HyperlinkGroupType { NameableCreator[] getHyperlinkCreators(); - HyperLinkGroupFilter getFilter(); + /** + * 图表超链过滤 + * + * @return 图表超链过滤 + */ + Filter> getFilter(); + + /** + * 老图表超链的过滤 + * + * @return 老图表超链的过滤 + */ + Filter getOldFilter(); } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java index 5bf5044448..79dece5057 100644 --- a/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/frpane/UICorrelationComboBoxPane.java @@ -23,6 +23,7 @@ import com.fr.js.EmailJavaScript; import com.fr.js.ReportletHyperlink; import com.fr.js.WebHyperlink; import com.fr.stable.ArrayUtils; +import com.fr.stable.Filter; import com.fr.stable.StringUtils; import javax.swing.JFrame; @@ -95,8 +96,8 @@ public class UICorrelationComboBoxPane extends JPanel implements UIObserver { if (values.size() > 1) { for (UIMenuNameableCreator value : values) { final String itemName = value.getName(); - HyperLinkGroupFilter filter = DesignModuleFactory.getHyperlinkGroupType().getFilter(); - if (!filter.filter(value.getObj())) { + Filter filter = DesignModuleFactory.getHyperlinkGroupType().getOldFilter(); + if (!filter.accept(value.getObj())) { continue; } UIMenuItem item = new UIMenuItem(itemName); diff --git a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java index 33d15367db..4e50371099 100644 --- a/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java +++ b/designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java @@ -11,13 +11,13 @@ import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.controlpane.NameObjectCreator; import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.frpane.BaseHyperlinkGroup; -import com.fr.design.gui.frpane.HyperLinkGroupFilter; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.JTemplate; import com.fr.general.ComparatorUtils; import com.fr.js.FormHyperlinkProvider; import com.fr.js.JavaScript; import com.fr.stable.ArrayUtils; +import com.fr.stable.Filter; import com.fr.stable.bridge.StableFactory; /** @@ -46,10 +46,10 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { } @Override - public HyperLinkGroupFilter getFilter() { - return new HyperLinkGroupFilter() { + public Filter> getFilter() { + return new Filter>() { @Override - public boolean filter(Class clazz) { + public boolean accept(Class clazz) { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template == null) { return false; @@ -78,25 +78,23 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup { } return true; } + }; + } - /** - * 兼容老图表 - * @param object - * @return - */ + @Override + public Filter getOldFilter() { + return new Filter() { @Override - public boolean filter(Object object) { + public boolean accept(Object object) { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); if (template == null) { return false; } - if (template.isJWorkBook()) { // 如果是普通报表单元格,那么没有 FormHyperlink 选项 FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); //返回true表示可用,返回false表示不可用 return !ComparatorUtils.equals(object.getClass(), formHyperlink.getClass()); - } else { // 如果是决策报表 Class[] classes = new Class[]{ChartHyperRelateCellLink.class, ChartHyperRelateFloatLink.class}; From 49e23ae96eec8cfe1df818db2782b613417183d1 Mon Sep 17 00:00:00 2001 From: zheng Date: Sat, 29 Sep 2018 16:10:52 +0800 Subject: [PATCH 38/62] =?UTF-8?q?CHART-3122=20=E6=B5=81=E5=90=91=E5=9C=B0?= =?UTF-8?q?=E7=90=83=E4=B8=8D=E6=94=AF=E6=8C=81=E8=B6=85=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/extended/chart/ExtendedOtherPane.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java index a92e100e53..31aa2d0033 100644 --- a/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer-chart/src/main/java/com/fr/extended/chart/ExtendedOtherPane.java @@ -16,22 +16,24 @@ import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; import java.awt.Component; +import java.util.Arrays; /** * Created by shine on 2018/3/12. */ -public class ExtendedOtherPane extends AbstractChartAttrPane { +public class ExtendedOtherPane extends AbstractChartAttrPane { private ExtendedChartHyperLinkPane hyperLinkPane; private UIButtonGroup refreshEnabled; private UISpinner autoRefreshTime; private JPanel contentPane; - protected AbstractChart getAbstractChart(Chart chart) { - if (chart != null && chart instanceof AbstractChart) { - return (AbstractChart) chart; + private T chart; + + protected void setChart(Chart chart) { + if (chart instanceof AbstractChart) { + this.chart = (T) chart; } - return null; } @Override @@ -40,7 +42,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane { return; } - AbstractChart chart = getAbstractChart(collection.getSelectedChart()); + setChart(collection.getSelectedChart()); if (chart != null) { hyperLinkPane.populateBean(chart); @@ -57,7 +59,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane { return; } - AbstractChart chart = getAbstractChart(collection.getSelectedChart()); + setChart(collection.getSelectedChart()); if (chart != null) { hyperLinkPane.updateBean(chart); @@ -77,16 +79,20 @@ public class ExtendedOtherPane extends AbstractChartAttrPane { double f = TableLayout.FILL; double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double[] columnSize = {f, e}; - double[] rowSize = {p, p, p, p, p, p}; - - Component[][] components = new Component[][]{ - new Component[]{createRefreshPane(), null}, - new Component[]{createHyperlinkPane(), null} - }; + Component[][] components = getComponents(createRefreshPane(), createHyperlinkPane()); + double[] rowSize = new double[components.length]; + Arrays.fill(rowSize, p); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); } + protected Component[][] getComponents(JPanel refresh, JPanel hyperlink) { + return new Component[][]{ + new Component[]{refresh, null}, + new Component[]{hyperlink, null} + }; + } + @Override public String getIconPath() { return null; From 6675c853b82799b507df9b4c1364e8f88ba1cd87 Mon Sep 17 00:00:00 2001 From: ju Date: Sat, 29 Sep 2018 16:55:43 +0800 Subject: [PATCH 39/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=A5=E9=87=8Dfindbugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/gui/itree/filetree/FileNodeComparator.java | 11 ++++++----- .../src/main/java/com/fr/file/FILEChooserPane.java | 10 ++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java index 68dbec78cc..bf4a5155c7 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileNodeComparator.java @@ -1,6 +1,6 @@ package com.fr.design.gui.itree.filetree; -import com.fr.file.filetree.LocalFileNodes; +import com.fr.base.FRContext; import com.fr.file.filetree.FileNode; import java.util.Comparator; @@ -59,13 +59,14 @@ public class FileNodeComparator implements Comparator { private int groupByFileType(FileNode nameNode1, FileNode nameNode2, int i) { - if (i < LocalFileNodes.FILE_TYPE.length) { - if (nameNode1.isFileType(LocalFileNodes.FILE_TYPE[i])) - if (nameNode2.isFileType(LocalFileNodes.FILE_TYPE[i])) + String[] supportTypes = FRContext.getFileNodes().getSupportedTypes(); + if (i < supportTypes.length) { + if (nameNode1.isFileType(supportTypes[i])) + if (nameNode2.isFileType(supportTypes[i])) return nameNode1.getName().toLowerCase().compareTo(nameNode2.getName().toLowerCase()); else return-1; - else if (nameNode2.isFileType(LocalFileNodes.FILE_TYPE[i])) + else if (nameNode2.isFileType(supportTypes[i])) return 1; else{ return groupByFileType(nameNode1, nameNode2, i+1); diff --git a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java index 1e4ec0d659..f3f9c7d285 100644 --- a/designer-base/src/main/java/com/fr/file/FILEChooserPane.java +++ b/designer-base/src/main/java/com/fr/file/FILEChooserPane.java @@ -23,7 +23,6 @@ import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.JTemplate; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.file.filetree.FileNode; -import com.fr.file.filetree.LocalFileNodes; import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.FILEFilter; import com.fr.general.ComparatorUtils; @@ -693,14 +692,9 @@ public class FILEChooserPane extends BasicPane { String appName = ProductConstants.APP_NAME; JTemplate editing = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); if (editing == null || !editing.isChartBook()) { - String[] fileSuffix_local = LocalFileNodes.FILE_TYPE; - EnumSet fileExtensions = EnumSet.of(FileExtension.CPT, FileExtension.CPTX, FileExtension.FRM, FileExtension.FRMX, FileExtension.CHT); + if (type == JFileChooser.OPEN_DIALOG) { - if (WorkContext.getCurrent().isLocal()) { //本地连接 - this.addChooseFILEFilter(new ChooseFileFilter(fileSuffix_local, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - } else { - this.addChooseFILEFilter(new ChooseFileFilter(fileExtensions, appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); - } + this.addChooseFILEFilter(new ChooseFileFilter(FRContext.getFileNodes().getSupportedTypes(), appName + Toolkit.i18nText("Fine-Design_Report_Template_File"))); } // ben:filefilter设置初值为cpt过滤 From 294fddc2b0043482018a3b6ebbcf0d3abe7aef90 Mon Sep 17 00:00:00 2001 From: ju Date: Sat, 29 Sep 2018 19:27:59 +0800 Subject: [PATCH 40/62] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=94=B9=E4=B8=80=E9=83=A8=E5=88=86findbugs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/remote/ui/UserManagerPane.java | 4 +- .../manager/impl/RecentSearchManager.java | 40 ++++++------------- .../mainframe/socketio/DesignerSocketIO.java | 2 +- 3 files changed, 16 insertions(+), 30 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java index 1e22dc8083..8b8688e99a 100644 --- a/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/remote/ui/UserManagerPane.java @@ -58,7 +58,7 @@ public class UserManagerPane extends BasicPane { /** * 每页个数 */ - private final int DEFAULT_NUM_EACH_PAGE = 50; + private static final int DEFAULT_NUM_EACH_PAGE = 50; /** * 获取的决策平台成员 @@ -171,7 +171,7 @@ public class UserManagerPane extends BasicPane { /** * 搜索关键词变更监听 */ - private DocumentListener documentListener = new DocumentListener() { + private transient DocumentListener documentListener = new DocumentListener() { @Override public void insertUpdate(DocumentEvent e) { keyWord = keyField.getText(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java index 866c2c7349..0b48d7cf91 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java @@ -45,9 +45,10 @@ import java.util.List; */ public class RecentSearchManager implements AlphaFineSearchProvider { private static final int MAX_SIZE = 100; - private static volatile RecentSearchManager instance; - IndexReader indexReader = null; - IndexSearcher indexSearcher = null; + + private static final RecentSearchManager INSTANCE = new RecentSearchManager(); + + private IndexReader indexReader = null; //索引存储路径 private String path = ProductConstants.getEnvHome() + File.separator + "searchIndex"; //分词器,暂时先用这个 @@ -57,25 +58,18 @@ public class RecentSearchManager implements AlphaFineSearchProvider { private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriter indexWriter = null; private SearchResult recentModelList; - private SearchResult modelList; - + public static RecentSearchManager getInstance() { - if (instance == null) { - synchronized (RecentSearchManager.class) { - if (instance == null) { - instance = new RecentSearchManager(); - instance.initWriter(); - } - } - } - return instance; + + return INSTANCE; } @Override public SearchResult getLessSearchResult(String[] searchText) { - this.modelList = new SearchResult(); - for (int j = 0; j < searchText.length; j++) { - recentModelList = getRecentModelList(searchText[j]); + + SearchResult modelList = new SearchResult(); + for (String aSearchText : searchText) { + recentModelList = getRecentModelList(aSearchText); } if (recentModelList != null && recentModelList.size() > 0) { modelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Latest"))); @@ -92,8 +86,8 @@ public class RecentSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return new SearchResult(); } - - public synchronized SearchResult getRecentModelList(String searchText) { + + private synchronized SearchResult getRecentModelList(String searchText) { return searchBySort(searchText); } @@ -121,7 +115,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { try { indexWriter.close(); indexReader = DirectoryReader.open(directory); - indexSearcher = new IndexSearcher(indexReader); } catch (IOException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -130,8 +123,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 添加模型 * - * @param searchKey - * @param cellModel */ public void addModel(String searchKey, AlphaCellModel cellModel) { if(cellModel == null){ @@ -151,8 +142,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 写文档,建立索引 - * - * @param doc */ private void writeDoc(Document doc) { try { @@ -166,9 +155,6 @@ public class RecentSearchManager implements AlphaFineSearchProvider { /** * 按序搜索 - * - * @param key - * @return */ private synchronized SearchResult searchBySort(String key) { recentModelList = new SearchResult(); 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 3c04dff358..132d72d17c 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 @@ -38,7 +38,7 @@ public class DesignerSocketIO { } private static Optional socketIO = Optional.absent(); - public static Status status = Status.Disconnected; + private static Status status = Status.Disconnected; private static final Emitter.Listener printLog = new Emitter.Listener() { @Override From 7505fdd631479e28eaa3c3703a63144aecefdb54 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sat, 29 Sep 2018 20:00:53 +0800 Subject: [PATCH 41/62] revert code --- .../backgroundpane/ColorBackgroundQuickPane.java | 2 ++ .../fr/design/style/color/NewColorSelectPane.java | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java index 6ae9ce5ebc..89c61ec9d0 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/ColorBackgroundQuickPane.java @@ -6,6 +6,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.color.NewColorSelectPane; import com.fr.general.Background; + import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.BorderLayout; @@ -22,6 +23,7 @@ public class ColorBackgroundQuickPane extends BackgroundQuickPane { public ColorBackgroundQuickPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + detailColorSelectPane = new NewColorSelectPane(); this.add(detailColorSelectPane, BorderLayout.NORTH); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index e06e55a059..fec4993221 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -8,16 +8,11 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DesignerContext; -import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.JPanel; + +import javax.swing.*; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Cursor; -import java.awt.Dimension; -import java.awt.GridLayout; +import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseAdapter; @@ -54,7 +49,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { this(false); } - /** * Constructor. */ From 6f1fa596446448698da5ba8afbf7bea36f38b0da Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 11:35:41 +0800 Subject: [PATCH 42/62] =?UTF-8?q?=E6=9A=82=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=8C=BA=E9=97=B4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=9C=80=E4=B8=8B=E9=9D=A2=E9=A2=9C=E8=89=B2=E8=A2=AB=E9=81=AE?= =?UTF-8?q?=E6=8C=A1=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SectionIntervalConfigPaneWithOutNum.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index eff5060620..1c8cfdb464 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -3,7 +3,6 @@ package com.fr.van.chart.range.component; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; - import com.fr.van.chart.designer.TableLayout4VanChartHelper; import javax.swing.JPanel; @@ -16,7 +15,7 @@ import java.awt.Dimension; * Created by Mitisky on 16/10/20. * 没有主题颜色,自动的时候没有划分阶段 */ -public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula{ +public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula { private BoldFontTextLabel numLabel; public SectionIntervalConfigPaneWithOutNum(AbstractAttrNoScrollPane container) { @@ -24,7 +23,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF getDesignTypeButtonGroup().addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { - if(getDesignTypeButtonGroup().getSelectedIndex() == 0){ + if (getDesignTypeButtonGroup().getSelectedIndex() == 0) { setRegionVisible(false); } else { setRegionVisible(true); @@ -33,15 +32,16 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF }); } - protected JPanel getUpControlPane (Component[][] components) { + @Override + protected JPanel getUpControlPane(Component[][] components) { double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH; double d = TableLayout4VanChartHelper.DESCRIPTION_AREA_WIDTH; double[] columnSize = {d, e}; - JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze (), columnSize); + JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, getRowSIze(), columnSize); return panel; } - private void setRegionVisible(boolean visible){ + private void setRegionVisible(boolean visible) { getRegionNumPane().setVisible(visible); numLabel.setVisible(visible); } @@ -53,13 +53,14 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF setRegionVisible(false); return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")),getDesignTypeButtonGroup()}, + new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")), getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; } - public Dimension getPreferredSize(){ + @Override + public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - return new Dimension((int)dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); + return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); } } From 8332a48601a1df4acceac4f013f76d8a57f01d82 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 17:20:47 +0800 Subject: [PATCH 43/62] CHART-3043 --- .../component/SectionIntervalConfigPaneWithOutNum.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index 1c8cfdb464..c3146ff89c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -1,5 +1,6 @@ package com.fr.van.chart.range.component; +import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.BoldFontTextLabel; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; @@ -63,4 +64,10 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF Dimension dim = super.getPreferredSize(); return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); } + + @Override + public void populateBean(MapHotAreaColor hotAreaColor) { + super.populateBean(hotAreaColor); + setRegionVisible(hotAreaColor.getUseType() == 1); + } } From be8e1af2f67dd41581284b465507c67336fb8a1f Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Sun, 30 Sep 2018 17:22:03 +0800 Subject: [PATCH 44/62] REPORT-11473 --- .../actions/FormMobileAttrAction.java | 1 + .../FRAbsoluteBodyLayoutDefinePane.java | 128 +---------------- .../layout/FRFitLayoutDefinePane.java | 27 ++-- .../ui/designer/layout/WLayoutSwitchUtl.java | 134 ++++++++++++++++++ 4 files changed, 157 insertions(+), 133 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java b/designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java index df6139da9d..2707e8f9b8 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/actions/FormMobileAttrAction.java @@ -72,6 +72,7 @@ public class FormMobileAttrAction extends JTemplateAction { // 设置移动端属性并刷新界面 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); + jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); WidgetPropertyPane.getInstance().refreshDockingView(); jf.fireTargetModified(); } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index bdd011f032..5b58e9f7cb 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -63,13 +63,13 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { watermarkEditor = new AccessibleBodyWatermarkEditor(); JPanel jPanel = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), borderStyleEditor}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), borderStyleEditor}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} }, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); jPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); borderPane.add(jPanel, BorderLayout.CENTER); - UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, borderPane ); + UIExpandablePane advancedPane = new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"), 280, 20, borderPane); centerPane.add(advancedPane, BorderLayout.NORTH); this.add(centerPane, BorderLayout.NORTH); } @@ -122,9 +122,9 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { } if (layoutType == WBodyLayoutType.ABSOLUTE) { - ((XWFitLayout)creator.getBackupParent()).toData().resetStyle(); + ((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); if (state == WBodyLayoutType.FIT.getTypeValue()) { - switch2FitBodyLayout(); + WLayoutSwitchUtl.switch2FitBodyLayout(creator); } } layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); @@ -149,123 +149,5 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { return null; } - private boolean switch2FitBodyLayout() { - try { - XWFitLayout xfl = (XWFitLayout) creator.getBackupParent(); - //备份一下组件间隔 - int compInterval = xfl.toData().getCompInterval(); - Component[] components = creator.getComponents(); - - Arrays.sort(components, new ComparatorComponentLocation()); - - xfl.getLayoutAdapter().removeBean(creator, creator.getWidth(), creator.getHeight()); - xfl.remove(creator); - - for (Component comp : components) { - XCreator xCreator = (XCreator) comp; - if (xCreator.shouldScaleCreator()) { - XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); - xfl.add(parentPanel, xCreator.toData().getWidgetName()); - parentPanel.updateChildBound(xfl.getActualMinHeight()); - continue; - } - xfl.add(xCreator); - } - //这边计算的时候会先把组件间隔去掉 - moveComponents2FitLayout(xfl); - - - for (int i = 0; i < components.length; i++) { - Component comp = xfl.getComponent(i); - XCreator creator = (XCreator) comp; - creator.setBackupBound(components[i].getBounds()); - } - - //把组件间隔加上 - if (xfl.toData().getCompInterval() != compInterval) { - xfl.moveContainerMargin(); - xfl.moveCompInterval(xfl.getAcualInterval()); - xfl.toData().setCompInterval(compInterval); - xfl.addCompInterval(xfl.getAcualInterval()); - } - xfl.toData().setLayoutType(WBodyLayoutType.FIT); - FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - formDesigner.getSelectionModel().setSelectedCreator(xfl); - return true; - } catch (Exception e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return false; - } - } - - // 把绝对布局中的元素按规则移动到自适应布局中 - // 规则:各元素按顺序放置,其中每行最多4个元素,超出则换行,各元素均分body的高度和宽度 - private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { - Component[] components = xwFitLayout.getComponents(); - if (components.length == 0) { - xwFitLayout.updateBoundsWidget(); - return; - } - int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight(); - int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom(); - int leftMargin = xwFitLayout.toData().getMargin().getLeft(); - int topMargin = xwFitLayout.toData().getMargin().getTop(); - xwFitLayout.toData().setCompInterval(0); - int row = (components.length / EACH_ROW_COUNT) + (components.length % EACH_ROW_COUNT == 0 ? 0 : 1); - //最后一行的列数不定 - int column = components.length % EACH_ROW_COUNT == 0 ? EACH_ROW_COUNT : components.length % EACH_ROW_COUNT; - int componentWidth = layoutWidth / EACH_ROW_COUNT; - int componentHeight = layoutHeight / row; - for (int i = 0; i < row - 1; i++) { - for (int j = 0; j < EACH_ROW_COUNT; j++) { - components[EACH_ROW_COUNT * i + j].setBounds( - leftMargin + componentWidth * j, - topMargin + componentHeight * i, - j == EACH_ROW_COUNT - 1 ? layoutWidth - componentWidth * (EACH_ROW_COUNT - 1) : componentWidth, - componentHeight - ); - } - } - //最后一行列数是特殊的,要单独处理 - int lastRowWidth = layoutWidth / column; - int lastRowHeight = layoutHeight - componentHeight * (row - 1); - for (int i = 0; i < column; i++) { - components[EACH_ROW_COUNT * (row - 1) + i].setBounds( - leftMargin + lastRowWidth * i, - topMargin + componentHeight * (row - 1), - i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth, - lastRowHeight - ); - } - for (int i = 0; i < components.length; i++) { - if (components[i] instanceof XWCardMainBorderLayout) { - ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth(), false); - ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight(), false); - } - xwFitLayout.dealDirections((XCreator) components[i], false); - } - xwFitLayout.updateBoundsWidget(); - } - - //以组件的位置来确定先后顺序,y小的在前,x小的在前 - private class ComparatorComponentLocation implements Comparator { - @Override - public int compare(Object o1, Object o2) { - if (((Component) o1).getY() < ((Component) o2).getY()) { - return -1; - } else if (((Component) o1).getY() > ((Component) o2).getY()) { - return 1; - } else { - if (((Component) o1).getX() < ((Component) o2).getX()) { - return -1; - } else if (((Component) o1).getX() > ((Component) o2).getX()) { - return 1; - } else { - return 0; - } - } - } - } - } diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index 8be0e931ca..fa720a05cd 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -26,6 +26,7 @@ import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.component.PaddingBoundPane; +import com.fr.form.main.Form; import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WAbsoluteBodyLayout; @@ -81,8 +82,8 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { paddingBound = new PaddingBoundPane(); JPanel jp2 = TableLayoutHelper.createGapTableLayoutPane( new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), stylePane}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Style")), stylePane}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), watermarkEditor} }, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W3, IntervalConstants.INTERVAL_L1); jp2.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); jPanel.add(paddingBound, BorderLayout.CENTER); @@ -136,8 +137,14 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { XLayoutContainer rootLayout = selectedBodyLayout(formDesigner); if (rootLayout != formDesigner.getRootComponent() && formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) { - formDesigner.getSelectionModel().setSelectedCreators( - FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); + //原单例面板populate根据当前样式populate属性面板,现加入移动端逻辑:可能需要根据面板属性改变样式 + Form form = formDesigner.getTarget(); + if (form.getFormMobileAttr().isMobileOnly() && form.getFormMobileAttr().isAdaptivePropertyAutoMatch()) { + WLayoutSwitchUtl.switch2FitBodyLayout(rootLayout); + } else { + formDesigner.getSelectionModel().setSelectedCreators( + FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); + } } paddingBound.populate(ob); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); @@ -149,8 +156,8 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) { XLayoutContainer rootLayout = formDesigner.getRootComponent(); - if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)){ - rootLayout = (XWAbsoluteBodyLayout)rootLayout.getXCreator(0); + if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)) { + rootLayout = (XWAbsoluteBodyLayout) rootLayout.getXCreator(0); } return rootLayout; } @@ -162,8 +169,8 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_Padding_Duplicate"))) { paddingBound.update(layout); } - LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue(); - if(borderStyle != null){ + LayoutBorderStyle borderStyle = (LayoutBorderStyle) stylePane.getValue(); + if (borderStyle != null) { layout.setBorderStyle(borderStyle); } updateWatermark(); @@ -205,7 +212,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { } - int intervelValue = (int)componentIntervel.getValue(); + int intervelValue = (int) componentIntervel.getValue(); if (xWFitLayout.canAddInterval(intervelValue)) { // 设置完间隔后,要同步处理界面组件,容器刷新后显示出对应效果 setLayoutGap(intervelValue); @@ -227,7 +234,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { } private void setLayoutGap(int value) { - int interval = wFitLayout.getCompInterval(); + int interval = wFitLayout.getCompInterval(); if (value != interval) { xWFitLayout.moveContainerMargin(); xWFitLayout.moveCompInterval(xWFitLayout.getAcualInterval()); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java new file mode 100644 index 0000000000..3725ef2b95 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java @@ -0,0 +1,134 @@ +package com.fr.design.widget.ui.designer.layout; + +import com.fr.design.designer.creator.XCreator; +import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; +import com.fr.form.ui.container.WBodyLayoutType; +import com.fr.general.FRLogger; + +import java.awt.*; +import java.util.Arrays; +import java.util.Comparator; + +public class WLayoutSwitchUtl { + private static final int EACH_ROW_COUNT = 4; + + public static boolean switch2FitBodyLayout(XCreator creator) { + try { + XWFitLayout xfl = (XWFitLayout) creator.getBackupParent(); + //备份一下组件间隔 + int compInterval = xfl.toData().getCompInterval(); + Component[] components = creator.getComponents(); + + Arrays.sort(components, new ComparatorComponentLocation()); + + xfl.getLayoutAdapter().removeBean(creator, creator.getWidth(), creator.getHeight()); + xfl.remove(creator); + + for (Component comp : components) { + XCreator xCreator = (XCreator) comp; + if (xCreator.shouldScaleCreator()) { + XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); + xfl.add(parentPanel, xCreator.toData().getWidgetName()); + parentPanel.updateChildBound(xfl.getActualMinHeight()); + continue; + } + xfl.add(xCreator); + } + //这边计算的时候会先把组件间隔去掉 + moveComponents2FitLayout(xfl); + + + for (int i = 0; i < components.length; i++) { + Component comp = xfl.getComponent(i); + creator = (XCreator) comp; + creator.setBackupBound(components[i].getBounds()); + } + + //把组件间隔加上 + if (xfl.toData().getCompInterval() != compInterval) { + xfl.moveContainerMargin(); + xfl.moveCompInterval(xfl.getAcualInterval()); + xfl.toData().setCompInterval(compInterval); + xfl.addCompInterval(xfl.getAcualInterval()); + } + xfl.toData().setLayoutType(WBodyLayoutType.FIT); + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + formDesigner.getSelectionModel().setSelectedCreator(xfl); + return true; + } catch (Exception e) { + FRLogger.getLogger().error(e.getMessage()); + return false; + } + } + + private static void moveComponents2FitLayout(XWFitLayout xwFitLayout) { + Component[] components = xwFitLayout.getComponents(); + if (components.length == 0) { + xwFitLayout.updateBoundsWidget(); + return; + } + int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight(); + int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom(); + int leftMargin = xwFitLayout.toData().getMargin().getLeft(); + int topMargin = xwFitLayout.toData().getMargin().getTop(); + xwFitLayout.toData().setCompInterval(0); + int row = (components.length / EACH_ROW_COUNT) + (components.length % EACH_ROW_COUNT == 0 ? 0 : 1); + //最后一行的列数不定 + int column = components.length % EACH_ROW_COUNT == 0 ? EACH_ROW_COUNT : components.length % EACH_ROW_COUNT; + int componentWidth = layoutWidth / EACH_ROW_COUNT; + int componentHeight = layoutHeight / row; + for (int i = 0; i < row - 1; i++) { + for (int j = 0; j < EACH_ROW_COUNT; j++) { + components[EACH_ROW_COUNT * i + j].setBounds( + leftMargin + componentWidth * j, + topMargin + componentHeight * i, + j == EACH_ROW_COUNT - 1 ? layoutWidth - componentWidth * (EACH_ROW_COUNT - 1) : componentWidth, + componentHeight + ); + } + } + //最后一行列数是特殊的,要单独处理 + int lastRowWidth = layoutWidth / column; + int lastRowHeight = layoutHeight - componentHeight * (row - 1); + for (int i = 0; i < column; i++) { + components[EACH_ROW_COUNT * (row - 1) + i].setBounds( + leftMargin + lastRowWidth * i, + topMargin + componentHeight * (row - 1), + i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth, + lastRowHeight + ); + } + for (int i = 0; i < components.length; i++) { + if (components[i] instanceof XWCardMainBorderLayout) { + ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth(), false); + ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight(), false); + } + xwFitLayout.dealDirections((XCreator) components[i], false); + } + xwFitLayout.updateBoundsWidget(); + } + + //以组件的位置来确定先后顺序,y小的在前,x小的在前 + private static class ComparatorComponentLocation implements Comparator { + @Override + public int compare(Object o1, Object o2) { + if (((Component) o1).getY() < ((Component) o2).getY()) { + return -1; + } else if (((Component) o1).getY() > ((Component) o2).getY()) { + return 1; + } else { + if (((Component) o1).getX() < ((Component) o2).getX()) { + return -1; + } else if (((Component) o1).getX() > ((Component) o2).getX()) { + return 1; + } else { + return 0; + } + } + } + } +} From aa983470dcf3f24da3f4d1cc86fa9d6ab53d9c6c Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 30 Sep 2018 17:28:48 +0800 Subject: [PATCH 45/62] CHART-3043 --- .../range/component/SectionIntervalConfigPaneWithOutNum.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index c3146ff89c..e8342aad5c 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -62,7 +62,7 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF @Override public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (getDesignTypeButtonGroup().getSelectedIndex() == 1 ? 0 : 30)); + return new Dimension((int) dim.getWidth(), (int) dim.getHeight() - (numLabel.isVisible() ? 0 : 30)); } @Override From 81bd4bc2bc3c2b688b624501d637e15c67e52656 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Sun, 30 Sep 2018 17:37:09 +0800 Subject: [PATCH 46/62] REPORT-11473 --- .../design/designer/creator/XWFitLayout.java | 125 +++++++++++++++- .../FRAbsoluteBodyLayoutDefinePane.java | 2 +- .../layout/FRFitLayoutDefinePane.java | 2 +- .../ui/designer/layout/WLayoutSwitchUtl.java | 134 ------------------ 4 files changed, 124 insertions(+), 139 deletions(-) delete mode 100644 designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 73c1949fb9..1f81602251 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -5,24 +5,26 @@ import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ContainerEvent; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import java.util.*; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.location.Direction; +import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI; import com.fr.design.form.layout.FRFitLayout; import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.mainframe.FormArea; +import com.fr.design.mainframe.FormDesigner; +import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.Widget; import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WLayout; +import com.fr.general.FRLogger; import com.fr.general.FRScreen; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; @@ -38,6 +40,7 @@ import javax.swing.JOptionPane; public class XWFitLayout extends XLayoutContainer { private static final long serialVersionUID = 8112908607102660176L; + private static final int EACH_ROW_COUNT = 4; //由于屏幕分辨率不同,界面上的容器大小可能不是默认的100%,此时拖入组件时,保存的大小按照100%时的计算 protected double containerPercent = 1.0; @@ -1209,4 +1212,120 @@ public class XWFitLayout extends XLayoutContainer { public boolean isMovable() { return false; } + + public static boolean switch2FitBodyLayout(XCreator creator) { + try { + XWFitLayout xfl = (XWFitLayout) creator.getBackupParent(); + //备份一下组件间隔 + int compInterval = xfl.toData().getCompInterval(); + Component[] components = creator.getComponents(); + + Arrays.sort(components, new ComparatorComponentLocation()); + + xfl.getLayoutAdapter().removeBean(creator, creator.getWidth(), creator.getHeight()); + xfl.remove(creator); + + for (Component comp : components) { + XCreator xCreator = (XCreator) comp; + if (xCreator.shouldScaleCreator()) { + XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); + xfl.add(parentPanel, xCreator.toData().getWidgetName()); + parentPanel.updateChildBound(xfl.getActualMinHeight()); + continue; + } + xfl.add(xCreator); + } + //这边计算的时候会先把组件间隔去掉 + moveComponents2FitLayout(xfl); + + + for (int i = 0; i < components.length; i++) { + Component comp = xfl.getComponent(i); + creator = (XCreator) comp; + creator.setBackupBound(components[i].getBounds()); + } + + //把组件间隔加上 + if (xfl.toData().getCompInterval() != compInterval) { + xfl.moveContainerMargin(); + xfl.moveCompInterval(xfl.getAcualInterval()); + xfl.toData().setCompInterval(compInterval); + xfl.addCompInterval(xfl.getAcualInterval()); + } + xfl.toData().setLayoutType(WBodyLayoutType.FIT); + FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); + formDesigner.getSelectionModel().setSelectedCreator(xfl); + return true; + } catch (Exception e) { + FRLogger.getLogger().error(e.getMessage()); + return false; + } + } + + private static void moveComponents2FitLayout(XWFitLayout xwFitLayout) { + Component[] components = xwFitLayout.getComponents(); + if (components.length == 0) { + xwFitLayout.updateBoundsWidget(); + return; + } + int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight(); + int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom(); + int leftMargin = xwFitLayout.toData().getMargin().getLeft(); + int topMargin = xwFitLayout.toData().getMargin().getTop(); + xwFitLayout.toData().setCompInterval(0); + int row = (components.length / EACH_ROW_COUNT) + (components.length % EACH_ROW_COUNT == 0 ? 0 : 1); + //最后一行的列数不定 + int column = components.length % EACH_ROW_COUNT == 0 ? EACH_ROW_COUNT : components.length % EACH_ROW_COUNT; + int componentWidth = layoutWidth / EACH_ROW_COUNT; + int componentHeight = layoutHeight / row; + for (int i = 0; i < row - 1; i++) { + for (int j = 0; j < EACH_ROW_COUNT; j++) { + components[EACH_ROW_COUNT * i + j].setBounds( + leftMargin + componentWidth * j, + topMargin + componentHeight * i, + j == EACH_ROW_COUNT - 1 ? layoutWidth - componentWidth * (EACH_ROW_COUNT - 1) : componentWidth, + componentHeight + ); + } + } + //最后一行列数是特殊的,要单独处理 + int lastRowWidth = layoutWidth / column; + int lastRowHeight = layoutHeight - componentHeight * (row - 1); + for (int i = 0; i < column; i++) { + components[EACH_ROW_COUNT * (row - 1) + i].setBounds( + leftMargin + lastRowWidth * i, + topMargin + componentHeight * (row - 1), + i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth, + lastRowHeight + ); + } + for (int i = 0; i < components.length; i++) { + if (components[i] instanceof XWCardMainBorderLayout) { + ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth(), false); + ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight(), false); + } + xwFitLayout.dealDirections((XCreator) components[i], false); + } + xwFitLayout.updateBoundsWidget(); + } + + //以组件的位置来确定先后顺序,y小的在前,x小的在前 + private static class ComparatorComponentLocation implements Comparator { + @Override + public int compare(Object o1, Object o2) { + if (((Component) o1).getY() < ((Component) o2).getY()) { + return -1; + } else if (((Component) o1).getY() > ((Component) o2).getY()) { + return 1; + } else { + if (((Component) o1).getX() < ((Component) o2).getX()) { + return -1; + } else if (((Component) o1).getX() > ((Component) o2).getX()) { + return 1; + } else { + return 0; + } + } + } + } } \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index 5b58e9f7cb..aa828c8691 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -124,7 +124,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { if (layoutType == WBodyLayoutType.ABSOLUTE) { ((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); if (state == WBodyLayoutType.FIT.getTypeValue()) { - WLayoutSwitchUtl.switch2FitBodyLayout(creator); + XWFitLayout.switch2FitBodyLayout(creator); } } layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index fa720a05cd..dedd5304be 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -140,7 +140,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { //原单例面板populate根据当前样式populate属性面板,现加入移动端逻辑:可能需要根据面板属性改变样式 Form form = formDesigner.getTarget(); if (form.getFormMobileAttr().isMobileOnly() && form.getFormMobileAttr().isAdaptivePropertyAutoMatch()) { - WLayoutSwitchUtl.switch2FitBodyLayout(rootLayout); + XWFitLayout.switch2FitBodyLayout(rootLayout); } else { formDesigner.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java deleted file mode 100644 index 3725ef2b95..0000000000 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WLayoutSwitchUtl.java +++ /dev/null @@ -1,134 +0,0 @@ -package com.fr.design.widget.ui.designer.layout; - -import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; -import com.fr.design.designer.creator.XWFitLayout; -import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout; -import com.fr.design.mainframe.FormDesigner; -import com.fr.design.mainframe.WidgetPropertyPane; -import com.fr.form.ui.container.WBodyLayoutType; -import com.fr.general.FRLogger; - -import java.awt.*; -import java.util.Arrays; -import java.util.Comparator; - -public class WLayoutSwitchUtl { - private static final int EACH_ROW_COUNT = 4; - - public static boolean switch2FitBodyLayout(XCreator creator) { - try { - XWFitLayout xfl = (XWFitLayout) creator.getBackupParent(); - //备份一下组件间隔 - int compInterval = xfl.toData().getCompInterval(); - Component[] components = creator.getComponents(); - - Arrays.sort(components, new ComparatorComponentLocation()); - - xfl.getLayoutAdapter().removeBean(creator, creator.getWidth(), creator.getHeight()); - xfl.remove(creator); - - for (Component comp : components) { - XCreator xCreator = (XCreator) comp; - if (xCreator.shouldScaleCreator()) { - XLayoutContainer parentPanel = xCreator.initCreatorWrapper(xCreator.getHeight()); - xfl.add(parentPanel, xCreator.toData().getWidgetName()); - parentPanel.updateChildBound(xfl.getActualMinHeight()); - continue; - } - xfl.add(xCreator); - } - //这边计算的时候会先把组件间隔去掉 - moveComponents2FitLayout(xfl); - - - for (int i = 0; i < components.length; i++) { - Component comp = xfl.getComponent(i); - creator = (XCreator) comp; - creator.setBackupBound(components[i].getBounds()); - } - - //把组件间隔加上 - if (xfl.toData().getCompInterval() != compInterval) { - xfl.moveContainerMargin(); - xfl.moveCompInterval(xfl.getAcualInterval()); - xfl.toData().setCompInterval(compInterval); - xfl.addCompInterval(xfl.getAcualInterval()); - } - xfl.toData().setLayoutType(WBodyLayoutType.FIT); - FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); - formDesigner.getSelectionModel().setSelectedCreator(xfl); - return true; - } catch (Exception e) { - FRLogger.getLogger().error(e.getMessage()); - return false; - } - } - - private static void moveComponents2FitLayout(XWFitLayout xwFitLayout) { - Component[] components = xwFitLayout.getComponents(); - if (components.length == 0) { - xwFitLayout.updateBoundsWidget(); - return; - } - int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight(); - int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom(); - int leftMargin = xwFitLayout.toData().getMargin().getLeft(); - int topMargin = xwFitLayout.toData().getMargin().getTop(); - xwFitLayout.toData().setCompInterval(0); - int row = (components.length / EACH_ROW_COUNT) + (components.length % EACH_ROW_COUNT == 0 ? 0 : 1); - //最后一行的列数不定 - int column = components.length % EACH_ROW_COUNT == 0 ? EACH_ROW_COUNT : components.length % EACH_ROW_COUNT; - int componentWidth = layoutWidth / EACH_ROW_COUNT; - int componentHeight = layoutHeight / row; - for (int i = 0; i < row - 1; i++) { - for (int j = 0; j < EACH_ROW_COUNT; j++) { - components[EACH_ROW_COUNT * i + j].setBounds( - leftMargin + componentWidth * j, - topMargin + componentHeight * i, - j == EACH_ROW_COUNT - 1 ? layoutWidth - componentWidth * (EACH_ROW_COUNT - 1) : componentWidth, - componentHeight - ); - } - } - //最后一行列数是特殊的,要单独处理 - int lastRowWidth = layoutWidth / column; - int lastRowHeight = layoutHeight - componentHeight * (row - 1); - for (int i = 0; i < column; i++) { - components[EACH_ROW_COUNT * (row - 1) + i].setBounds( - leftMargin + lastRowWidth * i, - topMargin + componentHeight * (row - 1), - i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth, - lastRowHeight - ); - } - for (int i = 0; i < components.length; i++) { - if (components[i] instanceof XWCardMainBorderLayout) { - ((XWCardMainBorderLayout) components[i]).recalculateChildWidth(components[i].getWidth(), false); - ((XWCardMainBorderLayout) components[i]).recalculateChildHeight(components[i].getHeight(), false); - } - xwFitLayout.dealDirections((XCreator) components[i], false); - } - xwFitLayout.updateBoundsWidget(); - } - - //以组件的位置来确定先后顺序,y小的在前,x小的在前 - private static class ComparatorComponentLocation implements Comparator { - @Override - public int compare(Object o1, Object o2) { - if (((Component) o1).getY() < ((Component) o2).getY()) { - return -1; - } else if (((Component) o1).getY() > ((Component) o2).getY()) { - return 1; - } else { - if (((Component) o1).getX() < ((Component) o2).getX()) { - return -1; - } else if (((Component) o1).getX() > ((Component) o2).getX()) { - return 1; - } else { - return 0; - } - } - } - } -} From 7e2cc5da13746416b585f01a17c58ea406e852b5 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Sun, 30 Sep 2018 17:51:52 +0800 Subject: [PATCH 47/62] REPORT-11473 --- .../com/fr/design/designer/creator/XWFitLayout.java | 12 ++++++++---- .../layout/FRAbsoluteBodyLayoutDefinePane.java | 2 +- .../ui/designer/layout/FRFitLayoutDefinePane.java | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java index 1f81602251..c9b55b298f 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWFitLayout.java @@ -5,7 +5,10 @@ import java.awt.Dimension; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.event.ContainerEvent; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; import com.fr.design.designer.beans.LayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; @@ -29,6 +32,7 @@ import com.fr.general.FRScreen; import com.fr.form.ui.container.WAbsoluteLayout.BoundsWidget; import com.fr.stable.ArrayUtils; +import edu.emory.mathcs.backport.java.util.Arrays; import javax.swing.JOptionPane; @@ -1213,7 +1217,7 @@ public class XWFitLayout extends XLayoutContainer { return false; } - public static boolean switch2FitBodyLayout(XCreator creator) { + public boolean switch2FitBodyLayout(XCreator creator) { try { XWFitLayout xfl = (XWFitLayout) creator.getBackupParent(); //备份一下组件间隔 @@ -1262,7 +1266,7 @@ public class XWFitLayout extends XLayoutContainer { } } - private static void moveComponents2FitLayout(XWFitLayout xwFitLayout) { + private void moveComponents2FitLayout(XWFitLayout xwFitLayout) { Component[] components = xwFitLayout.getComponents(); if (components.length == 0) { xwFitLayout.updateBoundsWidget(); @@ -1310,7 +1314,7 @@ public class XWFitLayout extends XLayoutContainer { } //以组件的位置来确定先后顺序,y小的在前,x小的在前 - private static class ComparatorComponentLocation implements Comparator { + private class ComparatorComponentLocation implements Comparator { @Override public int compare(Object o1, Object o2) { if (((Component) o1).getY() < ((Component) o2).getY()) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index aa828c8691..04c33f35b8 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -124,7 +124,7 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { if (layoutType == WBodyLayoutType.ABSOLUTE) { ((XWFitLayout) creator.getBackupParent()).toData().resetStyle(); if (state == WBodyLayoutType.FIT.getTypeValue()) { - XWFitLayout.switch2FitBodyLayout(creator); + ((XWFitLayout)creator.getBackupParent()).switch2FitBodyLayout(creator); } } layout.setBorderStyle((LayoutBorderStyle) borderStyleEditor.getValue()); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java index dedd5304be..35c8ddee97 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java @@ -140,7 +140,7 @@ public class FRFitLayoutDefinePane extends AbstractDataModify { //原单例面板populate根据当前样式populate属性面板,现加入移动端逻辑:可能需要根据面板属性改变样式 Form form = formDesigner.getTarget(); if (form.getFormMobileAttr().isMobileOnly() && form.getFormMobileAttr().isAdaptivePropertyAutoMatch()) { - XWFitLayout.switch2FitBodyLayout(rootLayout); + ((XWFitLayout)formDesigner.getRootComponent()).switch2FitBodyLayout(rootLayout); } else { formDesigner.getSelectionModel().setSelectedCreators( FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); From a5ae68000703e81233b6db1d49288bbe08002476 Mon Sep 17 00:00:00 2001 From: richie Date: Sun, 30 Sep 2018 20:05:13 +0800 Subject: [PATCH 48/62] =?UTF-8?q?=20=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E4=B8=8D=E7=9F=A5=E9=81=93=E5=95=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/start/fx/PrismImageLoader2.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java b/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java index e943df011c..91318e8f71 100644 --- a/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java +++ b/designer-realize/src/main/java/com/fr/start/fx/PrismImageLoader2.java @@ -10,7 +10,7 @@ import com.sun.javafx.iio.gif.GIFImageLoaderFactory; import com.sun.javafx.tk.PlatformImage; import com.sun.prism.Image; import com.sun.prism.impl.PrismSettings; -import sun.util.logging.PlatformLogger; + import java.io.IOException; import java.io.InputStream; @@ -22,8 +22,6 @@ import java.io.InputStream; */ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader { - private static PlatformLogger imageioLogger = null; - private Image[] images; private int[] delayTimes; private int width; @@ -174,21 +172,11 @@ class PrismImageLoader2 implements com.sun.javafx.tk.ImageLoader { return image; } - /** - * Returns the PlatformLogger for logging imageio-related activities. - */ - private static synchronized PlatformLogger getImageioLogger() { - if (imageioLogger == null) { - imageioLogger = PlatformLogger.getLogger("imageio"); - } - - return imageioLogger; - } private class PrismLoadListener implements ImageLoadListener { @Override public void imageLoadWarning(ImageLoader loader, String message) { - getImageioLogger().warning(message); + } @Override From 2667d6bdf98aefdf34cfd050ad9a0997fed8682e Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 8 Oct 2018 14:32:05 +0800 Subject: [PATCH 49/62] =?UTF-8?q?REPORT-10699=20=E5=B1=8F=E8=94=BD?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E9=87=8C=E9=9D=A2=E7=9A=84=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/fun/JavaScriptActionProvider.java | 2 ++ .../fun/impl/AbstractJavaScriptActionProvider.java | 9 +++++++++ .../com/fr/design/javascript/JavaScriptActionPane.java | 5 +++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java b/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java index 6d70e8785b..754bdaeb4a 100644 --- a/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/JavaScriptActionProvider.java @@ -18,4 +18,6 @@ public interface JavaScriptActionProvider extends Mutable{ FurtherBasicBeanPane getJavaScriptActionPane(JavaScriptActionPane pane); + boolean isSupportType(); + } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java index daf4f92c81..4640eaf4fa 100644 --- a/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java +++ b/designer-base/src/main/java/com/fr/design/fun/impl/AbstractJavaScriptActionProvider.java @@ -26,4 +26,13 @@ public abstract class AbstractJavaScriptActionProvider extends AbstractProvider public FurtherBasicBeanPane getJavaScriptActionPane(JavaScriptActionPane pane) { return getJavaScriptActionPane(); } + + /** + * 判断是否是支持的类型(cpt,frm),默认是 + * @return + */ + @Override + public boolean isSupportType(){ + return true; + } } \ No newline at end of file diff --git a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java index 3734800964..05208762e3 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/JavaScriptActionPane.java @@ -9,7 +9,6 @@ import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.write.submit.DBManipulationPane; import com.fr.form.ui.WebContentUtils; - import com.fr.js.JavaScript; import javax.swing.BorderFactory; @@ -46,7 +45,9 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane { Set javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG); if (javaScriptActionProviders != null) { for (JavaScriptActionProvider jsp : javaScriptActionProviders) { - paneList.add(jsp.getJavaScriptActionPane(this)); + if(jsp.isSupportType()){ + paneList.add(jsp.getJavaScriptActionPane(this)); + } } } // 自定义事件 From 019898e98a5d4d05b9b0d733c74eea7ef157abd7 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 8 Oct 2018 16:23:31 +0800 Subject: [PATCH 50/62] =?UTF-8?q?REPORT-11335=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E7=9A=84=E8=AE=B0=E5=BD=95=3D>?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JDBCDefPane.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index 81d52d4e63..d0b0ce346b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -35,7 +35,7 @@ public class JDBCDefPane extends JPanel { public static final String DRIVER_TYPE = "driver_type"; public static final String USER_NAME = "user_name"; public static final int TIME_MULTIPLE = 1000; - private static final String EMPTY_DB = StringUtils.EMPTY; + private static final String OTHER_DB = "Others"; private static Map jdbcMap = new HashMap(); @@ -65,7 +65,7 @@ public class JDBCDefPane extends JPanel { private UITextField userNameTextField; private JPasswordField passwordTextField; // 请不要改动dbtype,只应该最后添加 - private final String[] dbtype = {EMPTY_DB, "Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", "Others"}; + private final String[] dbtype = {"Oracle", "DB2", "SQL Server", "MySQL", "Sybase", "Access", "Derby", "Postgre","SQLite","Inceptor", OTHER_DB}; // carl:DBCP的一些属性 private IntegerEditor DBCP_INITIAL_SIZE = new IntegerEditor(); @@ -184,7 +184,7 @@ public class JDBCDefPane extends JPanel { } } if (!out) { - this.dbtypeComboBox.setSelectedItem(EMPTY_DB); + this.dbtypeComboBox.setSelectedItem(OTHER_DB); } } this.driverComboBox.setSelectedItem(jdbcDatabase.getDriver()); From 346bc0f42ffa82dff028372164f5e44f089ceaf3 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 8 Oct 2018 16:26:41 +0800 Subject: [PATCH 51/62] =?UTF-8?q?REPORT-11335=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BC=9A=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E7=9A=84=E8=AE=B0=E5=BD=95=3D>?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E9=97=AE=E9=A2=98=3D>=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/data/datapane/connect/JDBCDefPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java index d0b0ce346b..d6137b986e 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JDBCDefPane.java @@ -40,7 +40,7 @@ public class JDBCDefPane extends JPanel { private static Map jdbcMap = new HashMap(); static { - jdbcMap.put("Others", new DriverURLName[]{new DriverURLName("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:"), + jdbcMap.put(OTHER_DB, new DriverURLName[]{new DriverURLName("sun.jdbc.odbc.JdbcOdbcDriver", "jdbc:odbc:"), new DriverURLName("org.hsqldb.jdbcDriver", "jdbc:hsqldb:file:[PATH_TO_DB_FILES]"), new DriverURLName("com.inet.tds.TdsDriver", "jdbc:inetdae7:localhost:1433/"), new DriverURLName("COM.cloudscape.JDBCDriver", "jdbc:cloudscape:/cloudscape/"), new DriverURLName("com.internetcds.jdbc.tds.Driver", "jdbc:freetds:sqlserver://localhost/")}); From 0478434302a6101f799ac20cb7a4273e53068c93 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 09:04:07 +0800 Subject: [PATCH 52/62] =?UTF-8?q?REPORT-11709=20AlphaFine=E6=95=B4?= =?UTF-8?q?=E5=90=88=E5=B0=8F=E5=B8=86=E8=A7=86=E8=A7=89=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=20REPORT-11692=20alphafine=E5=88=86=E8=AF=8D=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=BB=93=E6=9E=9C=E4=B8=AD=E5=8C=85=E5=90=AB=E4=BA=86=E8=BF=9E?= =?UTF-8?q?=E8=AF=8D=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConstants.java | 16 +++++++++++--- .../cell/render/BottomCellRender.java | 2 +- .../alphafine/component/AlphaFineDialog.java | 11 ++++++---- .../manager/impl/SegmentationManager.java | 20 +++++++++++++++++- .../mainframe/alphafine/images/back@1x.png | Bin 0 -> 221 bytes .../mainframe/alphafine/images/back@2x.png | Bin 0 -> 336 bytes 6 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png create mode 100644 designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index fe72f9c1de..ea0d6331dd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -2,9 +2,11 @@ package com.fr.design.mainframe.alphafine; import com.fr.base.extension.FileExtension; import com.fr.general.CloudCenter; + import java.awt.Color; import java.awt.Dimension; import java.awt.Font; +import java.util.ArrayList; /** @@ -49,7 +51,7 @@ public class AlphaFineConstants { public static final Dimension HOT_ICON_LABEL_SIZE = new Dimension(36, 36); - public static final Dimension HOT_ISSUES_JAPNEL_SIZE = new Dimension(213,182); + public static final Dimension HOT_ISSUES_JAPNEL_SIZE = new Dimension(213, 182); public static final Dimension CLOSE_BUTTON_SIZE = new Dimension(40, 40); @@ -83,7 +85,7 @@ public class AlphaFineConstants { public static final String IMAGE_URL = "/com/fr/design/mainframe/alphafine/images/"; - public static final String ALPHA_HOT_IMAGE_NAME = "alphafine_hot"; + public static final String ALPHA_HOT_IMAGE_NAME = "alphafine_hot"; public static final String PLUGIN_SEARCH_URL = CloudCenter.getInstance().acquireUrlByKind("plugin.searchAPI"); @@ -134,8 +136,16 @@ public class AlphaFineConstants { public static final String FIRST_PAGE = "-1"; - public static final FileExtension[] FILE_EXTENSIONS= new FileExtension[]{FileExtension.CPT, FileExtension.FRM}; + public static final FileExtension[] FILE_EXTENSIONS = new FileExtension[]{FileExtension.CPT, FileExtension.FRM}; public static final int RECOMMEND_MAX_ITEM_NUM = 3; + public static final String BACK_ICON_NAME = "back@1x.png"; + + public static final ArrayList CONJUNCTION = new ArrayList() {{ + add("和"); + add("与"); + add("的"); + }}; + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java index 824fc3bfc0..43aca2cae8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java @@ -24,7 +24,7 @@ public class BottomCellRender implements ListCellRenderer { JPanel line = new JPanel(); line.setPreferredSize(new Dimension(200, 1)); - line.setBackground(AlphaFineConstants.GRAY); + line.setBackground(AlphaFineConstants.WHITE); panel.add(line, BorderLayout.NORTH); goToWebLabel.setFont(AlphaFineConstants.MEDIUM_FONT); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 6b21b0b6a7..5d0b2aff0d 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -239,20 +239,21 @@ public class AlphaFineDialog extends UIDialog { hotPane.setLayout(new BorderLayout()); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot")); + uiLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); uiLabel.setFont(AlphaFineConstants.SMALL_FONT); uiLabel.setForeground(AlphaFineConstants.DARK_GRAY); GridLayout gridLayout = new GridLayout(2, 3, 3, 3); JPanel panel = new JPanel(); panel.setLayout(gridLayout); - if(AlphaFineHelper.isNetworkOk()) { + if (AlphaFineHelper.isNetworkOk()) { if (hotData == null) { hotData = HotIssuesManager.getInstance().getHotIssues(); } for (int i = 0; i < hotData.length; i++) { panel.add(new HotIssueJpanel(hotData[i], i + 1)); } - }else { + } else { hotData = null; for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); @@ -947,7 +948,7 @@ public class AlphaFineDialog extends UIDialog { Thread sendThread = new Thread(new Runnable() { @Override public void run() { - if(StringUtils.isNotEmpty(storeText)){ + if (StringUtils.isNotEmpty(storeText)) { RecentSearchManager searchManager = RecentSearchManager.getInstance(); searchManager.addModel(storeText, cellModel); sendDataToServer(storeText, cellModel); @@ -1377,7 +1378,9 @@ public class AlphaFineDialog extends UIDialog { */ private void initBackPane() { backPane = new JPanel(new BorderLayout()); - JLabel jLabel = new JLabel(" < " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back")); + JLabel jLabel = new JLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Back")); + jLabel.setIcon(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.BACK_ICON_NAME)); + jLabel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0)); jLabel.setPreferredSize(new Dimension(80, 20)); jLabel.setFont(AlphaFineConstants.SMALL_FONT); jLabel.setForeground(AlphaFineConstants.DARK_GRAY); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java index 6f1e3850a0..d52ff529cf 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java @@ -2,10 +2,10 @@ package com.fr.design.mainframe.alphafine.search.manager.impl; import com.fr.design.mainframe.alphafine.AlphaFineConstants; import com.fr.stable.StringUtils; - import com.fr.third.ibm.icu.text.BreakIterator; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -76,8 +76,26 @@ public class SegmentationManager { result.add(temp); } } + result = removeConjunction(result); String[] strings = new String[result.size()]; result.toArray(strings); return strings; } + + /** + * 去除连词 + * + * @param result + * @return + */ + public static List removeConjunction(List result) { + Iterator it = result.iterator(); + while (it.hasNext()) { + String s = it.next(); + if (AlphaFineConstants.CONJUNCTION.contains(s)) { + it.remove(); + } + } + return result; + } } diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png new file mode 100644 index 0000000000000000000000000000000000000000..3cc82966536005104870347a6260ffbd0055445a GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2V8<6ZZI=>f4F%}28J29*~C-V}>neOT07$PB= zoN$1#r?SPn$UL=D#m5FY_xDuF110es)H4!SYA{{{B|y3SwbmsNi-x Uc>1{o(1i>Pp00i_>zopr0PZqZkN^Mx literal 0 HcmV?d00001 diff --git a/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..7a0e30162f762e2edc9597e25356b45a7497b5cb GIT binary patch literal 336 zcmV-W0k8gvP)Px$3Q0skR5%f1U?3BOhK90X)5?NP5TBTXg9Fc(FJCs_yLV3vs7@PQEfcx`K0e5> z&!0bU`~UyH15n*YY-$;?31Sn283vTIWn^URJ9FktF*bEX8Az;QAPWc@NQz+u4J6et zyatkE7)}GpH4J1R)?@=r8Y_Tucw-Z!85_WAAd*6Yk%pue%*1M-u&{7AQ1&n|0T-H> znDn7*!pCRECVBVn-QT*px~sl_|85JE50{pf=709=*-mU~(Z#SD2vS6@p*RgB*HF9$ zl4B@A14%WMC<9@Js;jH7{`Kn@IHIJaq}ZQ7f4&zahYYYL8)OB@>;nf5eBtHg^#Y3R i2V#F@If~i1ssI4qxto(zpcf Date: Tue, 9 Oct 2018 09:20:38 +0800 Subject: [PATCH 53/62] =?UTF-8?q?REPORT-10617=2010.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E6=9C=89=E9=83=A8=E4=BB=BD9.0=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E7=AB=AF=E7=9A=84=E5=8A=9F=E8=83=BD=E7=BC=BA=E5=A4=B1?= 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 | 2 +- .../src/main/java/com/fr/design/mainframe/JWorkBook.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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 95d4e16ce3..2fb5febd3c 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 @@ -936,7 +936,7 @@ public class JForm extends JTemplate implements BaseJForm { */ @Override public PreviewProvider[] supportPreview() { - return new PreviewProvider[]{new FormPreview()}; + return new PreviewProvider[]{new FormPreview(), new MobilePreview()}; } /** diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index b546d618bb..bfc01d0bf9 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -52,6 +52,7 @@ import com.fr.design.menu.ToolBarDef; import com.fr.design.module.DesignModuleFactory; import com.fr.design.parameter.ParameterDefinitePane; import com.fr.design.parameter.ParameterInputPane; +import com.fr.design.preview.MobilePreview; import com.fr.design.preview.PagePreview; import com.fr.design.preview.ViewPreview; import com.fr.design.preview.WriteEnhancePreview; @@ -889,7 +890,7 @@ public class JWorkBook extends JTemplate { public PreviewProvider[] supportPreview() { Set set = ExtraDesignClassManager.getInstance().getArray(PreviewProvider.MARK_STRING); return ArrayUtils.addAll(new PreviewProvider[]{ - new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview() + new PagePreview(), new WritePreview(), new ViewPreview(), new WriteEnhancePreview(), new MobilePreview() }, set.toArray(new PreviewProvider[set.size()])); } From dc4894321f606da0c9bdb29181b5bf72df3f2a05 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 09:40:06 +0800 Subject: [PATCH 54/62] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/AlphaFineConstants.java | 6 ++--- .../manager/impl/SegmentationManager.java | 22 ++----------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java index ea0d6331dd..4cebe741ca 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java @@ -143,9 +143,9 @@ public class AlphaFineConstants { public static final String BACK_ICON_NAME = "back@1x.png"; public static final ArrayList CONJUNCTION = new ArrayList() {{ - add("和"); - add("与"); - add("的"); + add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_HE")); + add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_YU")); + add(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Conjunction_DE")); }}; } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java index d52ff529cf..79506cd9f6 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java @@ -5,7 +5,6 @@ import com.fr.stable.StringUtils; import com.fr.third.ibm.icu.text.BreakIterator; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -72,30 +71,13 @@ public class SegmentationManager { int start = itor.first(); for (int end = itor.next(); end != BreakIterator.DONE; start = end, end = itor.next()) { String temp = searchText.substring(start, end); - if (!StringUtils.isEmpty(temp)) { + //去掉空和连词 + if (!StringUtils.isEmpty(temp) & !AlphaFineConstants.CONJUNCTION.contains(temp)) { result.add(temp); } } - result = removeConjunction(result); String[] strings = new String[result.size()]; result.toArray(strings); return strings; } - - /** - * 去除连词 - * - * @param result - * @return - */ - public static List removeConjunction(List result) { - Iterator it = result.iterator(); - while (it.hasNext()) { - String s = it.next(); - if (AlphaFineConstants.CONJUNCTION.contains(s)) { - it.remove(); - } - } - return result; - } } From 78c2f5222c2e998a0f7b49f0b7022c8bdef2c3ab Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 10:17:44 +0800 Subject: [PATCH 55/62] =?UTF-8?q?=E5=82=BB=E9=80=BC=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/impl/SegmentationManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java index 79506cd9f6..40c37341c1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java @@ -72,7 +72,7 @@ public class SegmentationManager { for (int end = itor.next(); end != BreakIterator.DONE; start = end, end = itor.next()) { String temp = searchText.substring(start, end); //去掉空和连词 - if (!StringUtils.isEmpty(temp) & !AlphaFineConstants.CONJUNCTION.contains(temp)) { + if (StringUtils.isNotEmpty(temp) && !AlphaFineConstants.CONJUNCTION.contains(temp)) { result.add(temp); } } From 203702a85cee613d57b93eb4bb9df882d5a0d2cc Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 9 Oct 2018 12:09:21 +0800 Subject: [PATCH 56/62] =?UTF-8?q?BI-33768=20=E6=8F=90=E4=BE=9B=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=89=80=E6=9C=89=E5=90=AF=E5=8A=A8=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/start/module/DesignerStartup.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java index 237a19fa90..71f197ea6e 100644 --- a/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java +++ b/designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java @@ -7,6 +7,7 @@ import com.fr.event.Listener; import com.fr.module.Activator; import com.fr.record.analyzer.EnableMetrics; import com.fr.record.analyzer.Metrics; +import com.fr.runtime.FineRuntime; import com.fr.start.Designer; import com.fr.start.ServerStarter; import com.fr.start.SplashContext; @@ -63,7 +64,7 @@ public class DesignerStartup extends Activator { DesignerContext.getDesignerFrame().getProgressDialog().setVisible(true); startSub(StartFinishActivator.class); - + FineRuntime.startFinish(); } private void browserDemo() { From 19a1f65822a018b0b7a826df87d08daf72fcbb57 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 10 Oct 2018 19:33:36 +0800 Subject: [PATCH 57/62] =?UTF-8?q?REPORT-11794=2010.0=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E5=AE=89=E8=A3=85=E8=B7=AF=E5=BE=84=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E7=89=B9=E6=AE=8A=E7=AC=A6=E5=8F=B7=E4=BC=9A=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E7=AE=A1=E7=90=86=E7=95=8C=E9=9D=A2=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginWebPane.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java index 3e2cafdfea..4257cb2349 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java @@ -4,6 +4,7 @@ import com.fr.base.TemplateUtils; import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; +import com.fr.stable.EncodeConstants; import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import javafx.application.Platform; @@ -32,6 +33,8 @@ import java.util.Map; public class PluginWebPane extends JFXPanel { private static final String RESOURCE_URL = "resourceURL"; private static final String LANGUAGE = "language"; + private static final String URL_PLUS = "+"; + private static final String URL_SPACING = "%20"; private WebEngine webEngine; public PluginWebPane(final String installHome, final String mainJs) { @@ -75,8 +78,9 @@ public class PluginWebPane extends JFXPanel { StringBuffer sb = new StringBuffer(); String line; Map map4Tpl = new HashMap(); - - map4Tpl.put(RESOURCE_URL, "file:///" + URLEncoder.encode(installHome, "UTF-8")); + //URL中关于空格的编码与空格所在位置相关:空格被编码成+的情况只能在查询字符串部分出现,而被编码成%20则可以出现在路径和查询字符串中 + //URLEncoder会将空格转成+,这边需要+转成%20 + map4Tpl.put(RESOURCE_URL, "file:///" + URLEncoder.encode(installHome, EncodeConstants.ENCODING_UTF_8).replace(URL_PLUS, URL_SPACING)); map4Tpl.put(LANGUAGE, GeneralContext.getLocale().toString()); while ((line = read.readLine()) != null) { if (sb.length() > 0) { From c030289603513e447a9b0d8f025cc6206b92fd97 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 10 Oct 2018 19:35:12 +0800 Subject: [PATCH 58/62] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/extra/PluginWebPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java b/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java index 4257cb2349..627d16855e 100644 --- a/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java +++ b/designer-base/src/main/java/com/fr/design/extra/PluginWebPane.java @@ -35,6 +35,7 @@ public class PluginWebPane extends JFXPanel { private static final String LANGUAGE = "language"; private static final String URL_PLUS = "+"; private static final String URL_SPACING = "%20"; + private static final String URL_PREFIX = "file:///"; private WebEngine webEngine; public PluginWebPane(final String installHome, final String mainJs) { @@ -80,7 +81,7 @@ public class PluginWebPane extends JFXPanel { Map map4Tpl = new HashMap(); //URL中关于空格的编码与空格所在位置相关:空格被编码成+的情况只能在查询字符串部分出现,而被编码成%20则可以出现在路径和查询字符串中 //URLEncoder会将空格转成+,这边需要+转成%20 - map4Tpl.put(RESOURCE_URL, "file:///" + URLEncoder.encode(installHome, EncodeConstants.ENCODING_UTF_8).replace(URL_PLUS, URL_SPACING)); + map4Tpl.put(RESOURCE_URL, URL_PREFIX + URLEncoder.encode(installHome, EncodeConstants.ENCODING_UTF_8).replace(URL_PLUS, URL_SPACING)); map4Tpl.put(LANGUAGE, GeneralContext.getLocale().toString()); while ((line = read.readLine()) != null) { if (sb.length() > 0) { From 90bd695b0d14afe31dfb79e4d25a50e6dd7e63c6 Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 11 Oct 2018 14:54:52 +0800 Subject: [PATCH 59/62] =?UTF-8?q?CHART-2982=20gis=E8=BD=AE=E6=92=AD?= =?UTF-8?q?=E5=9B=BE=20=E4=BF=AE=E6=94=B9typepane=20update=E6=97=B6?= =?UTF-8?q?=E5=80=99=E4=BC=9A=E6=9B=BF=E6=8D=A2=E9=BB=98=E8=AE=A4chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/chart/gui/ChartTypePane.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java index e847f190c6..5f9dd9a15b 100644 --- a/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -152,8 +152,9 @@ public class ChartTypePane extends AbstractChartAttrPane{ try{ Chart newDefaultChart = (Chart)((AbstractChartTypePane)getSelectedPane()).getDefaultChart().clone(); - if(!chart.accept(newDefaultChart.getClass())){ - //vanChart 和 chart 之间切换 + if (!ComparatorUtils.equals(chart.getClass(), newDefaultChart.getClass())) { + //vanChart 和 chart 之间切换 + //不同chart之间切换 editingCollection.removeNameObject(editingCollection.getSelectedIndex()); editingCollection.addChart(newDefaultChart); chart = newDefaultChart; From 3c9a20bd9e22fb5da318675540a13ad20eb7e6d5 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 12 Oct 2018 14:34:42 +0800 Subject: [PATCH 60/62] REPORT-11193 --- .../gui/icombocheckbox/UICheckListPopup.java | 234 +++++++++++++ .../gui/icombocheckbox/UIComboCheckBox.java | 330 ++++++++++++++++++ .../com/fr/design/icon/IconPathConstants.java | 4 + .../buttonicon/control_checkbox_normal.png | Bin 0 -> 164 bytes .../buttonicon/control_checkbox_part.png | Bin 0 -> 200 bytes .../buttonicon/control_checkbox_selected.png | Bin 0 -> 337 bytes 6 files changed, 568 insertions(+) create mode 100644 designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java create mode 100644 designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_normal.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_part.png create mode 100644 designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_selected.png diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java new file mode 100644 index 0000000000..2884e2279b --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -0,0 +1,234 @@ +package com.fr.design.gui.icombocheckbox; + +import com.fr.base.BaseUtils; +import com.fr.design.constants.UIConstants; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.icon.IconPathConstants; +import com.fr.design.layout.FRGUIPaneFactory; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; +import java.util.ArrayList; +import java.util.List; + +public class UICheckListPopup extends UIPopupMenu { + private List listeners = new ArrayList(); + private List checkBoxList = new ArrayList(); + + private Object[] values; + private JPanel checkboxPane; + private UIScrollPane jScrollPane; + private Color mouseEnteredColor = UIConstants.CHECKBOX_HOVER_SELECTED; + private int maxDisplayNumber = 8; + + public static final String COMMIT_EVENT = "commit"; + public static final String SELECT_ALL = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Choose_All"); + private static final int CHECKBOX_HEIGHT = 25; + + public UICheckListPopup(Object[] value) { + super(); + values = value; + initComponent(); + } + + public void setMouseEnteredColor(Color color) { + this.mouseEnteredColor = color; + } + + public void setMaxDisplayNumber(int maxDisplayNumber) { + this.maxDisplayNumber = maxDisplayNumber; + //全选加在第一个位置 + addCheckboxValues(values); + } + + private void initComponent() { + checkboxPane = new JPanel(); + checkboxPane.setLayout(new GridLayout(checkBoxList.size(), 1, 0, 0)); + checkboxPane.setBackground(Color.WHITE); + jScrollPane = new UIScrollPane(checkboxPane); + + this.setLayout(new BorderLayout()); + this.add(jScrollPane, BorderLayout.CENTER); + + addCheckboxValues(values); + } + + public void addCheckboxValues(Object[] value) { + checkboxPane.removeAll(); + checkBoxList.clear(); + + //全选加在第一个位置 + addOneCheckValue(SELECT_ALL); + for (Object checkValue : value) { + addOneCheckValue(checkValue); + } + addSelectListener(); + + jScrollPane.setPreferredSize(new Dimension(200, checkBoxList.size() * CHECKBOX_HEIGHT + 10)); + //超过1页的数量时显示滚动条 + if (checkBoxList.size() > maxDisplayNumber) { + jScrollPane.setPreferredSize(new Dimension(200, maxDisplayNumber * CHECKBOX_HEIGHT)); + } + checkboxPane.repaint(); + jScrollPane.repaint(); + } + + private void addOneCheckValue(Object checkValue) { + JPanel checkPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + checkPane.setPreferredSize(new Dimension(185, CHECKBOX_HEIGHT)); + final JCheckBox temp = createCheckbox(); + final UILabel label = new UILabel(checkValue.toString()); + label.setBackground(Color.WHITE); + label.setPreferredSize(new Dimension(156, 20)); + checkPane.setBackground(Color.WHITE); + checkPane.add(temp); + checkPane.add(label); + addMouseListener(temp, label); + + checkBoxList.add(temp); + checkboxPane.add(checkPane); + } + + private JCheckBox createCheckbox() { + JCheckBox checkBox = new JCheckBox(); + checkBox.setPreferredSize(new Dimension(20, 20)); + checkBox.setBackground(Color.WHITE); + checkBox.setIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_NORMAL)); + checkBox.setSelectedIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_SELECTED)); + + return checkBox; + } + + /** + * 设置鼠标事件,鼠标进入时背景色变换 + * + * @param checkBox + * @param label + */ + private void addMouseListener(final JCheckBox checkBox, final UILabel label) { + label.addMouseListener(new MouseAdapter() { + public void mouseExited(MouseEvent e) { + label.setBackground(Color.WHITE); + } + + public void mouseEntered(MouseEvent e) { + label.setOpaque(true); + label.setBackground(mouseEnteredColor); + } + + @Override + public void mouseClicked(MouseEvent e) { + checkBox.doClick(); + } + }); + } + + /** + * 单选框选中事件 + */ + private void addSelectListener() { + for (int i = 0; i < checkBoxList.size(); i++) { + JCheckBox checkBox = checkBoxList.get(i); + if (i == 0) { + checkBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + //全选checkbox事件 + doSelectAll(checkBoxList.get(0).isSelected()); + } + }); + } else { + checkBox.addItemListener(new ItemListener() { + public void itemStateChanged(ItemEvent e) { + //do半选判断放在commit事件里 + commit(); + } + }); + } + } + } + + /** + * 全选 + * + * @param isSelected 选中是true,未选是false + */ + private void doSelectAll(boolean isSelected) { + for (int i = 1; i < checkBoxList.size(); i++) { + //全选和反全选都不考虑全选按钮本身 + if (!SELECT_ALL.equals(checkBoxList.get(i).getText())) + checkBoxList.get(i).setSelected(isSelected); + } + } + + /** + * 获取所有选中的值 + * + * @return + */ + public Object[] getSelectedValues() { + List selectedValues = new ArrayList(); + int selectCount = 0; + + for (int i = 1; i < checkBoxList.size(); i++) { + if (checkBoxList.get(i).isSelected()) { + selectedValues.add(values[i - 1]); + selectCount++; + } + } + //全选半选切换 + switchSelectIcon(selectCount); + + return selectedValues.toArray(new Object[selectedValues.size()]); + } + + + /** + * 切换全选半选图片 + */ + private void switchSelectIcon(int selectCount) { + JCheckBox checkBox = checkBoxList.get(0); + if (selectCount == 0) { + checkBox.setIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_NORMAL)); + } else if (selectCount < checkBoxList.size() - 1) { + //虽然有选中,但是要判断此时全选状态去换图标 + if (checkBoxList.get(0).isSelected()) { + checkBox.setSelectedIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_HATFSELECT)); + } else { + checkBox.setIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_HATFSELECT)); + } + } else { + //全选了,图标要换回来 + checkBox.setSelectedIcon(BaseUtils.readIcon(IconPathConstants.CHECKBOX_SELECTED)); + } + } + + public void commit() { + fireActionPerformed(new ActionEvent(this, 0, COMMIT_EVENT)); + } + + @Override + public Insets getInsets() { + return new Insets(0, 0, 0, 0); + } + + public void addActionListener(ActionListener listener) { + if (!listeners.contains(listener)) + listeners.add(listener); + } + + public void removeActionListener(ActionListener listener) { + if (listeners.contains(listener)) { + listeners.remove(listener); + } + } + + protected void fireActionPerformed(ActionEvent e) { + for (ActionListener l : listeners) { + l.actionPerformed(e); + } + } + +} diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java new file mode 100644 index 0000000000..11cfeb6fe4 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UIComboCheckBox.java @@ -0,0 +1,330 @@ +package com.fr.design.gui.icombocheckbox; + +import com.fr.base.BaseUtils; +import com.fr.design.event.GlobalNameListener; +import com.fr.design.event.GlobalNameObserver; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.gui.ibutton.UIButton; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.icon.IconPathConstants; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.stable.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.List; + +/** + * 设计器下拉复选框组件 + * 支持全选、半选 + * 可以设置悬停颜色、一页最多显示单选框个数 + * 可以省略显示 + */ +public class UIComboCheckBox extends JComponent implements UIObserver, GlobalNameObserver { + //下拉框的值 + private Object[] values; + //已经选中的值 + private Object[] selectedValues; + + private List listeners = new ArrayList(); + private UICheckListPopup popup; + private UITextField editor; + private UIButton arrowButton; + //选中的值之间显示的分隔符 + private String valueSperator; + private static final String DEFAULT_VALUE_SPERATOR = ","; + private static final String OMIT_TEXT = "..."; + + private UIObserverListener uiObserverListener; + private GlobalNameListener globalNameListener = null; + private String multiComboName = StringUtils.EMPTY; + private boolean showOmitText = true; + + public UIComboCheckBox(Object[] value) { + this(value, DEFAULT_VALUE_SPERATOR); + } + + /** + * 自定义分隔符的复选框 + * + * @param value + * @param valueSperator + */ + public UIComboCheckBox(Object[] value, String valueSperator) { + values = value; + this.valueSperator = valueSperator; + initComponent(); + } + + /** + * 设置鼠标悬停的背景色 + * + * @param color + */ + public void setCheckboxEnteredColor(Color color) { + this.popup.setMouseEnteredColor(color); + } + + /** + * 设置弹出框最多显示单选的个数,超过显示滚动条 + */ + public void setPopupMaxDisplayNumber(int maxDisplayNumber) { + this.popup.setMaxDisplayNumber(maxDisplayNumber); + } + + /** + * 是否要超过文本框长度后显示省略号 + * + * @param isShowOmitText + */ + public void isShowOmitText(boolean isShowOmitText) { + this.showOmitText = isShowOmitText; + } + + private void initComponent() { + this.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0)); + this.popup = new UICheckListPopup(values); + this.popup.addActionListener(new PopupAction()); + this.editor = createEditor(); + this.arrowButton = createArrowButton(); + this.add(editor); + this.add(arrowButton); + setText(); + } + + private UIButton createArrowButton() { + final UIButton arrowBtn = new UIButton(); + arrowBtn.setNormalPainted(false); + arrowBtn.setPreferredSize(new Dimension(20, 5)); + arrowBtn.setBackground(new Color(218, 218, 218)); + arrowBtn.setOpaque(true); + arrowBtn.setIcon(getIcon()); + arrowBtn.setExtraPainted(false); + addPopupListener(arrowBtn); + arrowBtn.addMouseListener(new MouseAdapter() { + @Override + public void mouseEntered(MouseEvent e) { + arrowBtn.setBackground(new Color(200, 200, 200)); + } + + @Override + public void mouseExited(MouseEvent e) { + arrowBtn.setBackground(new Color(218, 218, 218)); + } + }); + + return arrowBtn; + } + + private UITextField createEditor() { + UITextField editor = new UITextField(); + editor.setEditable(false); + editor.setPreferredSize(new Dimension(180, 20)); + addPopupListener(editor); + + return editor; + } + + /** + * 弹出框事件 + * + * @param component + */ + private void addPopupListener(Component component) { + component.addMouseListener(new MouseAdapter() { + public void mouseClicked(MouseEvent e) { + togglePopup(); + } + }); + + } + + /** + * 刷新复选框的列表值 + * + * @param value + */ + public void refreshCombo(Object[] value) { + this.values = value; + this.popup.addCheckboxValues(value); + } + + /** + * 获取复选框选中的值 + * + * @return 复选框选中的值 + */ + public Object[] getSelectedValues() { + return popup.getSelectedValues(); + } + + private class PopupAction implements ActionListener { + + public void actionPerformed(ActionEvent e) { + if (e.getActionCommand().equals(UICheckListPopup.COMMIT_EVENT)) { + selectedValues = popup.getSelectedValues(); + setText(); + //把事件继续传递出去 + fireActionPerformed(e); + } + } + } + + private void togglePopup() { + if (this.arrowButton.isEnabled()) { + popup.show(this, 0, getHeight()); + } + } + + /** + * 清除文本框 + */ + public void clearText() { + editor.setText(StringUtils.EMPTY); + } + + /** + * 获取文本框内容 + */ + public String getText() { + return editor.getText(); + } + + /** + * 文本框设置显示值 + */ + private void setText() { + StringBuilder builder = new StringBuilder(); + if (selectedValues != null) { + for (Object value : selectedValues) { + builder.append(value); + builder.append(valueSperator); + } + } + //去掉末尾多余的逗号 + String text = builder.length() > 0 ? builder.substring(0, builder.length() - 1) : StringUtils.EMPTY; + //计算加省略号后的文本 + editor.setText(this.showOmitText ? omitEditorText(editor, text) : text); + } + + /** + * 根据字体大小计算得到省略后的文字 + * + * @param textEditor + * @param text + * @return 省略后的文字 + */ + private static String omitEditorText(UITextField textEditor, String text) { + char[] omitChars = OMIT_TEXT.toCharArray(); + //获取字体的大小 + FontMetrics fontMetrics = textEditor.getFontMetrics(textEditor.getFont()); + //计算省略号的长度 + int omitLength = fontMetrics.charsWidth(omitChars, 0, omitChars.length); + String omitText = StringUtils.EMPTY; + char[] chars = text.toCharArray(); + + for (int i = 1; i <= chars.length; i++) { + //如果原文本+省略号长度超过文本框 + if (fontMetrics.charsWidth(chars, 0, i) + omitLength > textEditor.getPreferredSize().getWidth()) { + //从第i-1的位置截断再拼上省略号 + omitText = text.substring(0, i - 2) + OMIT_TEXT; + break; + } + } + + return omitText == StringUtils.EMPTY ? text : omitText; + } + + /** + * 给组件登记一个观察者监听事件 + * + * @param listener 观察者监听事件 + */ + @Override + public void registerChangeListener(UIObserverListener listener) { + this.uiObserverListener = listener; + } + + + @Override + public void setGlobalName(String name) { + multiComboName = name; + } + + /** + * 组件是否需要响应添加的观察者事件 + * + * @return 如果需要响应观察者事件则返回true,否则返回false + */ + @Override + public boolean shouldResponseChangeListener() { + return true; + } + + /** + * 注册观察者监听事件 + * + * @param listener 观察者监听事件 + */ + @Override + public void registerNameListener(GlobalNameListener listener) { + globalNameListener = listener; + } + + private Icon getIcon() { + return BaseUtils.readIcon(IconPathConstants.ARROW_ICON_PATH); + } + + /** + * 组件是否需要响应观察者事件 + * + * @return 如果需要响应观察者事件则返回true,否则返回false + */ + @Override + public boolean shouldResponseNameListener() { + return true; + } + + public void addActionListener(ActionListener listener) { + if (!listeners.contains(listener)) + listeners.add(listener); + } + + public void removeActionListener(ActionListener listener) { + if (listeners.contains(listener)) + listeners.remove(listener); + } + + protected void fireActionPerformed(ActionEvent e) { + for (ActionListener l : listeners) { + l.actionPerformed(e); + } + } + + /** + * 简单的测试demo + * @param args + */ + public static void main(String args[]) { + UIComboCheckBox comboBox = new UIComboCheckBox(new Object[] + {"MATA", "HANA", "KAKA", "KUKA", "INFI", "LILY", "RIBO", "CUBE", "MATA", "HANA", "KAKA", "KUKA"}); + + comboBox.isShowOmitText(false); + comboBox.setPopupMaxDisplayNumber(6); + + JPanel jPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); + jPanel.add(comboBox); + + JFrame jFrame = new JFrame(); + jFrame.setVisible(true); + jFrame.setSize(600, 400); + jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + jFrame.add(jPanel, BorderLayout.CENTER); + } +} diff --git a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java index 9a670fa4c6..e01aa5251a 100644 --- a/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java +++ b/designer-base/src/main/java/com/fr/design/icon/IconPathConstants.java @@ -33,4 +33,8 @@ public class IconPathConstants { public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png"; public static final String EDIT_ICON_PATH = "/com/fr/design/images/control/newEdit.png"; + public static final String ARROW_ICON_PATH = "com/fr/design/images/buttonicon/arrow.png"; + public static final String CHECKBOX_NORMAL = "com/fr/design/images/buttonicon/control_checkbox_normal.png"; + public static final String CHECKBOX_SELECTED = "com/fr/design/images/buttonicon/control_checkbox_selected.png"; + public static final String CHECKBOX_HATFSELECT = "com/fr/design/images/buttonicon/control_checkbox_part.png"; } diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_normal.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_normal.png new file mode 100644 index 0000000000000000000000000000000000000000..9aeac2db177320ba7cacae76f6a36852137c3fbe GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@q#X;^)4C~IxyaaOMJY5_^G(?kQ zHYT+m{r~^}bHl6CrK78B`t<2j&Wyx_iXR^qKKuCi_;bU?90fP# z6D||1CRC|49ZL>0Sj8!&QNqI!aEalV$+Q~>M3`1GtE(1Wl4Ee_(q+>t-17`*6N9I# KpUXO@geCyEjX47V literal 0 HcmV?d00001 diff --git a/designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_part.png b/designer-base/src/main/resources/com/fr/design/images/buttonicon/control_checkbox_part.png new file mode 100644 index 0000000000000000000000000000000000000000..10fff7cc1450e1c6cc2fd069610ad8e8c851d49c GIT binary patch literal 200 zcmeAS@N?(olHy`uVBq!ia0vp@Ak4uAB#T}@sR2@q#X;^)4C~IxyaaNZJY5_^G(?k2 zX8k_?`Tzd?nPx$3rR#lR45f=bej9e^Z&oUvlti{WPq3uc*4lUoW|%l`{!ezN@6s?41B^wj0R># z28I{|kWw&^fwN#D=rmA0Lzx{j!|_M|;Zg)O727g1JpatVaQ7XNnsO|d88k#085W=a z3%3QtfZJ4L!^|KjfRIZvW@hl$Vq)k#_?O`?!V<6o7MQYaH~%qA_h)68eflp0Co9n7 zhRh60FZ^Y={T59JPy<}kjo1GfcHjBOkY@!Ey8r$k!@_f@&VpG0cOFOpWXrp6{~7-N z`_Iq?bk?7LFlDGT+$NCl*Ix__(@y+lP!MEfxcLUtSum|2O;3Oro+9?$!(lv32T(l| jC@n!XB7||Xz-bQv)`(Bkjygt300000NkvXXu0mjfdP9u? literal 0 HcmV?d00001 From 85d7fb705c910b49916da3db89bf2d57d6ad2d70 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Fri, 12 Oct 2018 14:36:30 +0800 Subject: [PATCH 61/62] REPORT-11193 --- .../java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java index 2884e2279b..a0f4420743 100644 --- a/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java +++ b/designer-base/src/main/java/com/fr/design/gui/icombocheckbox/UICheckListPopup.java @@ -40,7 +40,6 @@ public class UICheckListPopup extends UIPopupMenu { public void setMaxDisplayNumber(int maxDisplayNumber) { this.maxDisplayNumber = maxDisplayNumber; - //全选加在第一个位置 addCheckboxValues(values); } From e668acc1e88f84f1abd6f1f39aceef0fe81aafe0 Mon Sep 17 00:00:00 2001 From: "Wim.Zhai" Date: Sun, 14 Oct 2018 22:56:20 +0800 Subject: [PATCH 62/62] =?UTF-8?q?CHART-2808=20=E6=96=B0=E5=A2=9E=E4=B8=80?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=8C=BA=E9=97=B4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A4=84=E9=BB=98=E8=AE=A4=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/SectionIntervalConfigPaneWithOutNum.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java index e8342aad5c..cad289f100 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java +++ b/designer-chart/src/main/java/com/fr/van/chart/range/component/SectionIntervalConfigPaneWithOutNum.java @@ -3,6 +3,7 @@ package com.fr.van.chart.range.component; import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.ilable.BoldFontTextLabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.van.chart.designer.TableLayout4VanChartHelper; @@ -19,6 +20,10 @@ import java.awt.Dimension; public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithFormula { private BoldFontTextLabel numLabel; + public String getNameOfSubRange() { + return Toolkit.i18nText("Fine-Design_Chart_Range_Num"); + } + public SectionIntervalConfigPaneWithOutNum(AbstractAttrNoScrollPane container) { super(container); getDesignTypeButtonGroup().addChangeListener(new ChangeListener() { @@ -49,12 +54,12 @@ public class SectionIntervalConfigPaneWithOutNum extends MapColorPickerPaneWithF @Override protected Component[][] createComponents() { - numLabel = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")); + numLabel = new BoldFontTextLabel(Toolkit.i18nText("Fine-Design_Chart_Value_Divided_Stage")); setRegionVisible(false); return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Range_Num")), getDesignTypeButtonGroup()}, + new Component[]{new BoldFontTextLabel(getNameOfSubRange()), getDesignTypeButtonGroup()}, new Component[]{numLabel, getRegionNumPane()}, }; }