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..4cebe741c 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(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/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..5d0b2aff0 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 6f1e3850a..40c37341c 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,7 +2,6 @@ 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; @@ -72,7 +71,8 @@ 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.isNotEmpty(temp) && !AlphaFineConstants.CONJUNCTION.contains(temp)) { result.add(temp); } } 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 000000000..3cc829665 Binary files /dev/null and b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png differ 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 000000000..7a0e30162 Binary files /dev/null and b/designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png differ