|
|
@ -367,6 +367,87 @@ public class AlphaFineFrame extends JFrame { |
|
|
|
|
|
|
|
|
|
|
|
JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); |
|
|
|
JPanel tabPane = new JPanel(new FlowLayout(FlowLayout.LEFT, 20, 10)); |
|
|
|
tabPane.setBackground(Color.WHITE); |
|
|
|
tabPane.setBackground(Color.WHITE); |
|
|
|
|
|
|
|
List<SelectedLabel> selectedLabelList = createSelectedLabelList(); |
|
|
|
|
|
|
|
selectedType = selectedLabelList.get(0).getCellType(); |
|
|
|
|
|
|
|
// 第一个tab 非产品动态
|
|
|
|
|
|
|
|
if (selectedType != CellType.PRODUCT_NEWS) { |
|
|
|
|
|
|
|
tabLabel.setText(selectedLabelList.get(0).getText()); |
|
|
|
|
|
|
|
readLabel.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (SelectedLabel selectedLabel : selectedLabelList) { |
|
|
|
|
|
|
|
selectedLabel.addMouseListener(createMouseListener(selectedLabelList, selectedLabel, tabPane, tabLabel, readLabel)); |
|
|
|
|
|
|
|
tabPane.add(selectedLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
showPane.add(tabPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
showPane.add(labelPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
showPane.add(resultPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
return showPane; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private MouseAdapter createMouseListener(List<SelectedLabel> selectedLabelList, SelectedLabel selectedLabel, |
|
|
|
|
|
|
|
JPanel tabPane, UILabel tabLabel, UILabel readLabel) { |
|
|
|
|
|
|
|
return new MouseAdapter() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
|
|
|
for (SelectedLabel label : selectedLabelList) { |
|
|
|
|
|
|
|
label.setSelected(false); |
|
|
|
|
|
|
|
label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
selectedLabel.setSelected(true); |
|
|
|
|
|
|
|
// 处理产品动态 tab与下方文字展示不一致
|
|
|
|
|
|
|
|
if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { |
|
|
|
|
|
|
|
tabLabel.setText(PRODUCT_DYNAMICS); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
tabLabel.setText(selectedLabel.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
readLabel.setVisible(false); |
|
|
|
|
|
|
|
tabPane.repaint(); |
|
|
|
|
|
|
|
switch (selectedLabel.getCellType()) { |
|
|
|
|
|
|
|
case PRODUCT_NEWS: |
|
|
|
|
|
|
|
readLabel.setVisible(true); |
|
|
|
|
|
|
|
switchType(CellType.PRODUCT_NEWS); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case ACTION: |
|
|
|
|
|
|
|
currentSearchWorkerManager = settingSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.ACTION); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case FILE: |
|
|
|
|
|
|
|
currentSearchWorkerManager = fileSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.FILE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DOCUMENT: |
|
|
|
|
|
|
|
currentSearchWorkerManager = documentWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.DOCUMENT); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case PLUGIN: |
|
|
|
|
|
|
|
currentSearchWorkerManager = pluginSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.PLUGIN); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (currentSearchWorkerManager != null) { |
|
|
|
|
|
|
|
AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); |
|
|
|
|
|
|
|
if (alphaFineList != null) { |
|
|
|
|
|
|
|
alphaFineList.setSelectedIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Color defaultColor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
defaultColor = selectedLabel.getForeground(); |
|
|
|
|
|
|
|
selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
selectedLabel.setForeground(defaultColor); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private List<SelectedLabel> createSelectedLabelList() { |
|
|
|
List<SelectedLabel> selectedLabelList = new ArrayList<>(); |
|
|
|
List<SelectedLabel> selectedLabelList = new ArrayList<>(); |
|
|
|
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); |
|
|
|
AlphaFineConfigManager alphaFineConfigManager = DesignerEnvManager.getEnvManager().getAlphaFineConfigManager(); |
|
|
|
if (alphaFineConfigManager.isProductDynamics()) { |
|
|
|
if (alphaFineConfigManager.isProductDynamics()) { |
|
|
@ -384,79 +465,7 @@ public class AlphaFineFrame extends JFrame { |
|
|
|
if (alphaFineConfigManager.isContainPlugin()) { |
|
|
|
if (alphaFineConfigManager.isContainPlugin()) { |
|
|
|
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); |
|
|
|
selectedLabelList.add(new SelectedLabel(PLUGIN, CellType.PLUGIN)); |
|
|
|
} |
|
|
|
} |
|
|
|
selectedType = selectedLabelList.get(0).getCellType(); |
|
|
|
return selectedLabelList; |
|
|
|
// 第一个tab 非产品动态
|
|
|
|
|
|
|
|
if (selectedType != CellType.PRODUCT_NEWS) { |
|
|
|
|
|
|
|
tabLabel.setText(selectedLabelList.get(0).getText()); |
|
|
|
|
|
|
|
readLabel.setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (SelectedLabel selectedLabel : selectedLabelList) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedLabel.addMouseListener(new MouseAdapter() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
|
|
|
for (SelectedLabel label : selectedLabelList) { |
|
|
|
|
|
|
|
label.setSelected(false); |
|
|
|
|
|
|
|
label.setForeground(AlphaFineConstants.FOREGROUND_COLOR_8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
selectedLabel.setSelected(true); |
|
|
|
|
|
|
|
// 处理产品动态 tab与下方文字展示不一致
|
|
|
|
|
|
|
|
if (ComparatorUtils.equals(selectedLabel.getText().trim(), PRODUCT_NEWS)) { |
|
|
|
|
|
|
|
tabLabel.setText(PRODUCT_DYNAMICS); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
tabLabel.setText(selectedLabel.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
readLabel.setVisible(false); |
|
|
|
|
|
|
|
tabPane.repaint(); |
|
|
|
|
|
|
|
switch (selectedLabel.getCellType()) { |
|
|
|
|
|
|
|
case PRODUCT_NEWS: |
|
|
|
|
|
|
|
readLabel.setVisible(true); |
|
|
|
|
|
|
|
switchType(CellType.PRODUCT_NEWS); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case ACTION: |
|
|
|
|
|
|
|
currentSearchWorkerManager = settingSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.ACTION); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case FILE: |
|
|
|
|
|
|
|
currentSearchWorkerManager = fileSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.FILE); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DOCUMENT: |
|
|
|
|
|
|
|
currentSearchWorkerManager = documentWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.DOCUMENT); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case PLUGIN: |
|
|
|
|
|
|
|
currentSearchWorkerManager = pluginSearchWorkerManager; |
|
|
|
|
|
|
|
switchType(CellType.PLUGIN); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (currentSearchWorkerManager != null) { |
|
|
|
|
|
|
|
AlphaFineList alphaFineList = currentSearchWorkerManager.getSearchResultList(); |
|
|
|
|
|
|
|
if (alphaFineList != null) { |
|
|
|
|
|
|
|
alphaFineList.setSelectedIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Color defaultColor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseEntered(MouseEvent e) { |
|
|
|
|
|
|
|
defaultColor = selectedLabel.getForeground(); |
|
|
|
|
|
|
|
selectedLabel.setForeground(AlphaFineConstants.SUSPENDED_COLOR); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void mouseExited(MouseEvent e) { |
|
|
|
|
|
|
|
selectedLabel.setForeground(defaultColor); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
tabPane.add(selectedLabel); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
showPane.add(tabPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
showPane.add(labelPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
showPane.add(resultPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
return showPane; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void fireOneClickRead() { |
|
|
|
private void fireOneClickRead() { |
|
|
@ -699,7 +708,7 @@ public class AlphaFineFrame extends JFrame { |
|
|
|
} else if (searchText.startsWith(DS_MARK)) { |
|
|
|
} else if (searchText.startsWith(DS_MARK)) { |
|
|
|
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); |
|
|
|
return new SearchTextBean(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return new SearchTextBean(searchText, segmentationResult); |
|
|
|
return new SearchTextBean(searchText, segmentationResult == null ? new String[]{} : segmentationResult); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|