diff --git a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java index c8a2ec462..875bc705a 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java +++ b/designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/ColSelectedWithSummaryMethodEditor.java @@ -20,7 +20,7 @@ public class ColSelectedWithSummaryMethodEditor extends Editor summaryMethodComboBoxModel = new DefaultComboBoxModel<>(SummaryMethodComboBox.CALCULATE_ARRAY); public ColSelectedWithSummaryMethodEditor() { - this.setName(Toolkit.i18nText("Fine-Design_Chart_Summary_Array")); + this.setName(Toolkit.i18nText("Fine-Design_Chart_Summary_Field_Value")); this.setLayout(FRGUIPaneFactory.createLeftZeroLayout()); if (columnNameComboBox == null) { columnNameComboBox = new UIComboBox(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java index 28300c9b2..d97710ef1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineFrame.java @@ -171,38 +171,26 @@ public class AlphaFineFrame extends JFrame { this.settingSearchWorkerManager = new SearchWorkerManager( CellType.ACTION, - searchTextBean -> { - ActionSearchManager.getInstance().getLessSearchResult(searchTextBean.getSegmentation()); - return ActionSearchManager.getInstance().getMoreSearchResult(searchTextBean.getSearchText()); - }, + searchTextBean -> ActionSearchManager.getInstance().getSearchResult(searchTextBean), this, new SimpleRightSearchResultPane(new NoResultPane(NO_RESULT, AlphaFineConstants.NO_RESULT_ICON)) ); fileSearchWorkerManager = new SearchWorkerManager( CellType.FILE, - searchTextBean -> { - FileSearchManager.getInstance().getLessSearchResult(searchTextBean.getSearchText(), searchTextBean.getSegmentation()); - return FileSearchManager.getInstance().getMoreSearchResult(searchTextBean.getSearchText()); - }, + searchTextBean -> FileSearchManager.getInstance().getSearchResult(searchTextBean), this, new LoadingRightSearchResultPane() ); documentWorkerManager = new SearchWorkerManager( CellType.DOCUMENT, - searchTextBean -> { - DocumentSearchManager.getInstance().getLessSearchResult(searchTextBean.getSegmentation()); - return DocumentSearchManager.getInstance().getMoreSearchResult(searchTextBean.getSearchText()); - }, + searchTextBean -> DocumentSearchManager.getInstance().getSearchResult(searchTextBean), this, new SimpleRightSearchResultPane(new JPanel()) ); pluginSearchWorkerManager = new SearchWorkerManager( CellType.PLUGIN, - searchTextBean -> { - PluginSearchManager.getInstance().getLessSearchResult(searchTextBean.getSegmentation()); - return PluginSearchManager.getInstance().getMoreSearchResult(searchTextBean.getSearchText()); - }, + searchTextBean -> PluginSearchManager.getInstance().getSearchResult(searchTextBean), this, new LoadingRightSearchResultPane() ); @@ -663,6 +651,10 @@ public class AlphaFineFrame extends JFrame { resultPane.add(panel, flag); } + public void removeSearchResultPane(JPanel panel) { + resultPane.remove(panel); + } + private void doSearch(String text) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java index e0d528894..0d0d9ab63 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionPane.java @@ -9,7 +9,6 @@ import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; -import java.awt.RenderingHints; import javax.swing.JPanel; /** @@ -25,11 +24,6 @@ public class QuestionPane extends JPanel { private static final Image QUESTION_BACKGROUND_IMAGE = SVGLoader.load("/com/fr/design/mainframe/alphafine/images/groupbackgroud.svg"); - private static final int WIDTH = 40; - - private static final int HEIGHT = 40; - - public QuestionPane() { this.setBackground(new Color(0, 0, 0, 0)); } @@ -38,22 +32,20 @@ public class QuestionPane extends JPanel { protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; - g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); SvgPaintUtils.beforePaint(g2); // 宽高保持 int width = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getWidth() * SVGLoader.SYSTEM_SCALE) : getWidth(); int height = SystemScaleUtils.isJreHiDPIEnabled() ? (int) (getHeight() * SVGLoader.SYSTEM_SCALE) : getHeight(); if (AlphaFineUtil.unread()) { - g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, width, height, this); + g2.drawImage(NEW_MESSAGE_IMAGE, 0, 0, this); } else { - g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, width, height, this); + g2.drawImage(QUESTION_BACKGROUND_IMAGE, 0, 0, this); } int imageWidth = QUESTION_IMAGE.getWidth(this); int imageHeight = QUESTION_IMAGE.getHeight(this); - g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2, (height - imageHeight) / 2, imageWidth, imageHeight,this); + g2.drawImage(QUESTION_IMAGE, (width - imageWidth) / 2 - 2, (height - imageHeight) / 2 - 2,this); SvgPaintUtils.afterPaint(g2); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java index dc78c22ab..079eecadb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/question/QuestionWindow.java @@ -57,7 +57,6 @@ public class QuestionWindow extends JWindow { public void windowDeactivated(WindowEvent e) { QuestionWindow.getInstance().setVisible(false); } - }); questionPane.setToolTipText(Toolkit.i18nText("Fine-Design_Report_AlphaFine_Learn_More_About")); this.setContentPane(questionPane); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java index 0c230844b..40161e9ba 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/ProductNewsSearchWorkerManager.java @@ -48,10 +48,11 @@ public class ProductNewsSearchWorkerManager implements SearchManager { checkSearchWork(); searchOver = false; networkError = false; - if (searchResultPane == null) { - searchResultPane = new ProductNewsSearchResultPane(searchTextBean.getSegmentation()); - alphaFineFrame.addResult(searchResultPane, cellType.getFlagStr4Result()); + if (searchResultPane != null) { + alphaFineFrame.removeSearchResultPane(searchResultPane); } + searchResultPane = new ProductNewsSearchResultPane(searchTextBean.getSegmentation()); + alphaFineFrame.addResult(searchResultPane, cellType.getFlagStr4Result()); this.searchWorker = new SwingWorker, Void>() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java index 7aa86b84a..0b25c3ca1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchWorkerManager.java @@ -48,10 +48,11 @@ public class SearchWorkerManager implements SearchManager { } private void initSearchResult(SearchTextBean searchTextBean) { - if (searchResultPane == null) { - searchResultPane = new SearchResultPane(searchTextBean.getSegmentation(), resultShowPane); - alphaFineFrame.addResult(searchResultPane, cellType.getFlagStr4Result()); + if (searchResultPane != null) { + alphaFineFrame.removeSearchResultPane(searchResultPane); } + searchResultPane = new SearchResultPane(searchTextBean.getSegmentation(), resultShowPane); + alphaFineFrame.addResult(searchResultPane, cellType.getFlagStr4Result()); } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java index b75aa894c..631fce88e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/fun/AlphaFineSearchProvider.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.alphafine.search.manager.fun; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.search.SearchTextBean; /** * Created by XiaXiang on 2017/3/27. @@ -20,4 +21,15 @@ public interface AlphaFineSearchProvider { * @return */ SearchResult getMoreSearchResult(String searchText); + + + /** + * 获取所有搜索结果 取决于具体实现 + * + * @param searchTextBean + * @return + */ + default SearchResult getSearchResult(SearchTextBean searchTextBean) { + return new SearchResult(); + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java index 1c4fec090..a2a1a7037 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/ActionSearchManager.java @@ -8,6 +8,7 @@ import com.fr.design.mainframe.alphafine.cell.model.ActionModel; import com.fr.design.mainframe.alphafine.cell.model.AlphaCellModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.search.SearchTextBean; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.design.mainframe.toolbar.UpdateActionManager; import com.fr.design.mainframe.toolbar.UpdateActionModel; @@ -101,4 +102,10 @@ public class ActionSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return moreModelList; } + + @Override + public SearchResult getSearchResult(SearchTextBean searchTextBean) { + getLessSearchResult(searchTextBean.getSegmentation()); + return filterModelList; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java index 0b4953083..7a74ee6c1 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/DocumentSearchManager.java @@ -7,15 +7,14 @@ import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.DocumentModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.search.SearchTextBean; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.http.HttpToolbox; import com.fr.json.JSONArray; -import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; -import java.io.IOException; /** * Created by XiaXiang on 2017/3/27. @@ -24,6 +23,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { private static volatile DocumentSearchManager instance; private SearchResult lessModelList; private SearchResult moreModelList; + private SearchResult searchResult; public static DocumentSearchManager getInstance() { if (instance == null) { @@ -54,6 +54,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { public SearchResult getLessSearchResult(String[] searchText) { lessModelList = new SearchResult(); moreModelList = new SearchResult(); + searchResult = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainDocument()) { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Community_Help"))); @@ -63,7 +64,7 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { if(noConnectList != null){ return noConnectList; } - SearchResult searchResult = new SearchResult(); + searchResult = new SearchResult(); for (int j = 0; j < searchText.length; j++) { String url = AlphaFineConstants.DOCUMENT_SEARCH_URL + searchText[j]; try { @@ -106,4 +107,9 @@ public class DocumentSearchManager implements AlphaFineSearchProvider { return moreModelList; } + @Override + public SearchResult getSearchResult(SearchTextBean searchTextBean) { + getLessSearchResult(searchTextBean.getSegmentation()); + return searchResult; + } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java index 327d0555c..744b5a839 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java @@ -9,6 +9,7 @@ import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.FileModel; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.search.SearchTextBean; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNodes; @@ -114,6 +115,12 @@ public class FileSearchManager implements AlphaFineSearchProvider { return moreModelList; } + @Override + public SearchResult getSearchResult(SearchTextBean searchTextBean) { + getLessSearchResult(searchTextBean.getSearchText(), searchTextBean.getSegmentation()); + return filterModelList; + } + private void doSearch(String searchText) { if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainTemplate()) { for (FileNode node : fileNodes) { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java index 31a1b18ed..56f7078b4 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java @@ -7,6 +7,7 @@ import com.fr.design.mainframe.alphafine.CellType; import com.fr.design.mainframe.alphafine.cell.model.MoreModel; import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.design.mainframe.alphafine.search.SearchTextBean; import com.fr.design.mainframe.alphafine.search.manager.fun.AlphaFineSearchProvider; import com.fr.general.ComparatorUtils; import com.fr.general.http.HttpToolbox; @@ -28,6 +29,7 @@ import java.net.URLEncoder; public class PluginSearchManager implements AlphaFineSearchProvider { private SearchResult lessModelList; private SearchResult moreModelList; + private SearchResult searchResult; private PluginSearchManager() { @@ -97,7 +99,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider { public SearchResult getLessSearchResult(String[] searchText) { this.lessModelList = new SearchResult(); this.moreModelList = new SearchResult(); - SearchResult searchResult = new SearchResult(); + this.searchResult = new SearchResult(); if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isContainPlugin()) { if (ArrayUtils.isEmpty(searchText)) { lessModelList.add(new MoreModel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Plugin_Addon"))); @@ -146,4 +148,11 @@ public class PluginSearchManager implements AlphaFineSearchProvider { public SearchResult getMoreSearchResult(String searchText) { return this.moreModelList; } + + + @Override + public SearchResult getSearchResult(SearchTextBean searchTextBean) { + getLessSearchResult(searchTextBean.getSegmentation()); + return searchResult; + } }