Browse Source

Merge pull request #539 in DESIGN/design from ~ALEX.SUNG/design:release/10.0 to release/10.0

REPORT-11709 & REPORT-11692

* commit '78c2f5222c2e998a0f7b49f0b7022c8bdef2c3ab':
  傻逼了
  代码质量
  REPORT-11709 AlphaFine整合小帆视觉验收 REPORT-11692 alphafine分词查询结果中包含了连词结果
final/10.0
Alex.Sung 6 years ago
parent
commit
13d27e3cf2
  1. 16
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineConstants.java
  2. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java
  3. 11
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  4. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/SegmentationManager.java
  5. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png
  6. BIN
      designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

16
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<String> CONJUNCTION = new ArrayList<String>() {{
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"));
}};
}

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/cell/render/BottomCellRender.java

@ -24,7 +24,7 @@ public class BottomCellRender implements ListCellRenderer<Object> {
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);

11
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);

4
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);
}
}

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

BIN
designer-realize/src/main/resources/com/fr/design/mainframe/alphafine/images/back@2x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Loading…
Cancel
Save