Browse Source

REPORT-79093 运营产品化二期(遗留)

1、修改pr
feature/x
Link.Zhao 2 years ago
parent
commit
17d98288c5
  1. 6
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java
  2. 18
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabel.java
  3. 6
      designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabelPane.java
  4. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java
  5. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java
  6. 6
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java
  7. 3
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java
  8. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java
  9. 10
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

6
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/CustomSortPane.java

@ -24,10 +24,10 @@ import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
/** /**
* @author Link
* @version 11.0 * @version 11.0
* @author: Link * Created by Link on 2022/9/18
* @date: 2022/9/9 * alphafine设置 - 搜索范围 - 自定义排序 - 弹出面板
* @Description: alphafine设置 - 搜索范围 - 自定义排序 - 弹出面板
*/ */
public class CustomSortPane extends JPanel { public class CustomSortPane extends JPanel {

18
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabel.java

@ -13,10 +13,10 @@ import java.awt.event.MouseListener;
import java.util.function.Function; import java.util.function.Function;
/** /**
* @author Link
* @version 11.0 * @version 11.0
* @author: Link * Created by Link on 2022/9/18
* @date: 2022/9/12 * 菜单选项label
* @Description: 菜单label
*/ */
public class MenuLabel extends UILabel { public class MenuLabel extends UILabel {
@ -28,7 +28,7 @@ public class MenuLabel extends UILabel {
private MenuLabelPane parentMenu; private MenuLabelPane parentMenu;
private Function function; private Function function;
private boolean isSelected; private boolean selected;
public MenuLabel(String text, Function function) { public MenuLabel(String text, Function function) {
super(text); super(text);
@ -56,15 +56,15 @@ public class MenuLabel extends UILabel {
parentMenu.setNoneSelected(); parentMenu.setNoneSelected();
setBackground(SELECTED_COLOR); setBackground(SELECTED_COLOR);
function.apply(this); function.apply(this);
isSelected = true; selected = true;
} else { } else {
setBackground(BACKGROUND_COLOR); setBackground(BACKGROUND_COLOR);
isSelected = false; selected = false;
} }
} }
public boolean isSelected() { public boolean isSelected() {
return isSelected; return selected;
} }
MouseListener createMouseListener() { MouseListener createMouseListener() {
@ -78,7 +78,7 @@ public class MenuLabel extends UILabel {
@Override @Override
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
super.mouseEntered(e); super.mouseEntered(e);
if (!isSelected) { if (!selected) {
setBackground(HOVERED_COLOR); setBackground(HOVERED_COLOR);
} }
} }
@ -86,7 +86,7 @@ public class MenuLabel extends UILabel {
@Override @Override
public void mouseExited(MouseEvent e) { public void mouseExited(MouseEvent e) {
super.mouseExited(e); super.mouseExited(e);
if (!isSelected) { if (!selected) {
setBackground(BACKGROUND_COLOR); setBackground(BACKGROUND_COLOR);
} }
} }

6
designer-base/src/main/java/com/fr/design/actions/help/alphafine/component/MenuLabelPane.java

@ -5,10 +5,10 @@ import java.awt.FlowLayout;
import java.util.List; import java.util.List;
/** /**
* @author Link
* @version 11.0 * @version 11.0
* @author: Link * Created by Link on 2022/9/18
* @date: 2022/9/12 * 简单菜单面板
* @Description: 简单菜单面板
*/ */
public class MenuLabelPane extends JPanel { public class MenuLabelPane extends JPanel {

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/RecommendSearchLabel.java

@ -34,6 +34,9 @@ public class RecommendSearchLabel extends JPanel {
} }
/**
* 推荐搜索词绑定alphaFine搜索事件
* */
public class SearchKeyLabel extends JLabel { public class SearchKeyLabel extends JLabel {
String searchKey; String searchKey;

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/SearchHintPane.java

@ -29,7 +29,7 @@ public class SearchHintPane extends JPanel {
private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title"); private static final String TITLE = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Search_Title");
private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search"); private static final String RECOMMEND = Toolkit.i18nText("Fine-Design_Report_AlphaFine_Recommend_Search");
private static final Icon icon = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg"); private static final Icon ICON = IconUtils.readIcon("com/fr/design/mainframe/alphafine/images/search_hint.svg");
private static final int HEIGHT = 305; private static final int HEIGHT = 305;
private static final int WIDTH = 300; private static final int WIDTH = 300;
private static final int TITLE_FONT_SIZE = 14; private static final int TITLE_FONT_SIZE = 14;
@ -39,7 +39,7 @@ public class SearchHintPane extends JPanel {
} }
public SearchHintPane(List<String> hints) { public SearchHintPane(List<String> hints) {
this(hints, icon, TITLE); this(hints, ICON, TITLE);
} }
public SearchHintPane(List<String> hints, Icon icon, String title) { public SearchHintPane(List<String> hints, Icon icon, String title) {

6
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/DefaultContentPane.java

@ -11,10 +11,10 @@ import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
/** /**
* @author Link
* @version 11.0 * @version 11.0
* @author: Link * Created by Link on 2022/9/18
* @date: 2022/9/16 * alphaFine - 默认展示页面
* @Description: alphaFine - 默认展示页面
*/ */
public class DefaultContentPane extends JPanel { public class DefaultContentPane extends JPanel {

3
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/SearchManager.java

@ -9,6 +9,9 @@ import com.fr.design.mainframe.alphafine.preview.DefaultContentPane;
*/ */
public interface SearchManager { public interface SearchManager {
/**
* 搜索
* */
void doSearch(SearchTextBean searchTextBean); void doSearch(SearchTextBean searchTextBean);
/** /**

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/FileSearchManager.java

@ -39,7 +39,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
private SearchResult moreModelList; private SearchResult moreModelList;
private String searchText; private String searchText;
private FileNode[] fileNodes = null; private FileNode[] fileNodes = null;
private static final int defaultListSize = 10; private static final int DEFAULT_LIST_SIZE = 10;
//停止搜索 //停止搜索
//隐藏的搜索功能,可根据特殊的字符标记判断搜索分类 //隐藏的搜索功能,可根据特殊的字符标记判断搜索分类
@ -145,7 +145,7 @@ public class FileSearchManager implements AlphaFineSearchProvider {
public SearchResult getDefaultResult() { public SearchResult getDefaultResult() {
List<String> list = DesignerEnvManager.getEnvManager().getRecentOpenedFilePathList(); List<String> list = DesignerEnvManager.getEnvManager().getRecentOpenedFilePathList();
defaultModelList = new SearchResult(); defaultModelList = new SearchResult();
for (int i = 0; i < Math.min(defaultListSize, list.size()); i++) { for (int i = 0; i < Math.min(DEFAULT_LIST_SIZE, list.size()); i++) {
String name = list.get(i).toLowerCase(); String name = list.get(i).toLowerCase();
name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY); name = name.replaceAll(StringUtils.BLANK, StringUtils.EMPTY);
FileModel model = new FileModel(name, name); FileModel model = new FileModel(name, name);

10
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/PluginSearchManager.java

@ -39,8 +39,8 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
private SearchResult searchResult; private SearchResult searchResult;
private SearchResult defaultModelList; private SearchResult defaultModelList;
private static final int defaultListSize = 10; private static final int DEFAULT_LIST_SIZE = 10;
private static final String timeFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; private static final String TIME_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
private static final String UPLOAD_TIME = "uploadTime"; private static final String UPLOAD_TIME = "uploadTime";
@ -200,12 +200,12 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) { List<PluginModel> parseDefaultPluginModel(List<Map> jsonObjects) {
List<PluginModel> pluginModels = new ArrayList<>(); List<PluginModel> pluginModels = new ArrayList<>();
if (!Collections.isEmpty(jsonObjects)) { if (!Collections.isEmpty(jsonObjects)) {
SimpleDateFormat format = new SimpleDateFormat(timeFormat); SimpleDateFormat format = new SimpleDateFormat(TIME_FORMAT);
try { try {
jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() { jsonObjects.sort(Comparator.comparingLong(new ToLongFunction<Map>() {
@Override @Override
public long applyAsLong(Map value) { public long applyAsLong(Map value) {
Long time = 0l; long time = 0L;
try { try {
time = format.parse((String) value.get(UPLOAD_TIME)).getTime(); time = format.parse((String) value.get(UPLOAD_TIME)).getTime();
} catch (ParseException e) { } catch (ParseException e) {
@ -217,7 +217,7 @@ public class PluginSearchManager implements AlphaFineSearchProvider {
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage()); FineLoggerFactory.getLogger().error(e, e.getMessage());
} }
for (int i = 0; i < defaultListSize; i++) { for (int i = 0; i < DEFAULT_LIST_SIZE; i++) {
pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false)); pluginModels.add(getPluginModel(new JSONObject(jsonObjects.get(i)), false));
} }
} }

Loading…
Cancel
Save