From 98a24462d5f92b29db9c3186614b3a8d33cc5644 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 09:19:37 +0800 Subject: [PATCH 1/3] =?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 | 10 ++++++++- .../cell/render/BottomCellRender.java | 2 +- .../alphafine/component/AlphaFineDialog.java | 3 +++ .../manager/impl/SegmentationManager.java | 19 ++++++++++++++++++ .../mainframe/alphafine/images/back@1x.png | Bin 0 -> 221 bytes .../mainframe/alphafine/images/back@2x.png | Bin 0 -> 336 bytes 6 files changed, 32 insertions(+), 2 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 fe72f9c1d..250116542 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 @@ -5,7 +5,7 @@ import com.fr.general.CloudCenter; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; - +import java.util.ArrayList; /** * Created by XiaXiang on 2017/5/10. @@ -137,5 +137,13 @@ public class AlphaFineConstants { 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 824fc3bfc..43aca2cae 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 6b21b0b6a..c21dee121 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,6 +239,7 @@ 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); @@ -1378,6 +1379,8 @@ 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.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 6f1e3850a..7ca123a35 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 @@ -6,6 +6,7 @@ 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 +77,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 10:14:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?REPORT-11692=20alphafine=E5=88=86=E8=AF=8D?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=BB=93=E6=9E=9C=E4=B8=AD=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E4=BA=86=E8=BF=9E=E8=AF=8D=E7=BB=93=E6=9E=9C=20=E4=BB=A3?= =?UTF-8?q?=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 250116542..1166efad8 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 @@ -141,9 +141,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 7ca123a35..49075769b 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 @@ -6,7 +6,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; @@ -73,30 +72,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 01065e0accadc6759708de326f567b528120bb4e Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Tue, 9 Oct 2018 10:19:18 +0800 Subject: [PATCH 3/3] =?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 49075769b..03c39af8f 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 @@ -73,7 +73,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); } }