From 0478434302a6101f799ac20cb7a4273e53068c93 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 09:04:07 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-11709=20AlphaFine=E6=95=B4=E5=90=88?= =?UTF-8?q?=E5=B0=8F=E5=B8=86=E8=A7=86=E8=A7=89=E9=AA=8C=E6=94=B6=20REPORT?= =?UTF-8?q?-11692=20alphafine=E5=88=86=E8=AF=8D=E6=9F=A5=E8=AF=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=AD=E5=8C=85=E5=90=AB=E4=BA=86=E8=BF=9E=E8=AF=8D?= =?UTF-8?q?=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