From 369bd13951c1f51916cb62fed336c8b2d60d42a4 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 14 Aug 2017 15:53:46 +0800 Subject: [PATCH 1/7] =?UTF-8?q?alphafine=E9=81=97=E7=95=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../search/manager/ActionSearchManager.java | 11 +++-------- .../search/manager/DocumentSearchManager.java | 10 +++------- .../alphafine/search/manager/FileSearchManager.java | 10 +++------- .../search/manager/PluginSearchManager.java | 12 ++++-------- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java index 3756b03aec..33387ffbcf 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java @@ -74,15 +74,10 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { if (!AlphaFineHelper.getFilterResult().contains(object)) { result.add(object); } - } - if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); - if (result.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(result); - } + lessModelList.addAll(result); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.ACTION)); lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -97,4 +92,4 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { public SearchResult getMoreSearchResult() { return moreModelList; } -} +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java index ebabc9aa23..cbd1d49884 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java @@ -76,13 +76,9 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } - if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); - if (searchResult.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(searchResult); - } + lessModelList.addAll(searchResult); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.DOCUMENT)); lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -114,4 +110,4 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { return moreModelList; } -} +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index 21f2b5fc40..ac7d4fbdcb 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -100,13 +100,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } } - if (result.size() < AlphaFineConstants.SHOW_SIZE + 1) { + if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); - if (result.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(result); - } + lessModelList.addAll(result); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.FILE)); lessModelList.addAll(result.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -248,4 +244,4 @@ public class FileSearchManager implements AlphaFineSearchProcessor { public void setContainFrm(boolean containFrm) { isContainFrm = containFrm; } -} +} \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java index 5855168d7b..efcb02c4a3 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java @@ -109,13 +109,9 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } - if (searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { - lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"))); - if (searchResult.size() == 0) { - lessModelList.add(AlphaFineHelper.NO_RESULT_MODEL); - } else { - lessModelList.addAll(searchResult); - } + if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { + lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); + lessModelList.addAll(searchResult); } else { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer-Plugin_Addon"), Inter.getLocText("FR-Designer_AlphaFine_ShowAll"), true, CellType.PLUGIN)); lessModelList.addAll(searchResult.subList(0, AlphaFineConstants.SHOW_SIZE)); @@ -142,4 +138,4 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { public SearchResult getMoreSearchResult() { return this.moreModelList; } -} +} \ No newline at end of file From c0cc67020350244dd97b7f3f3ce3be4d8cbf687c Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Mon, 14 Aug 2017 23:24:17 +0800 Subject: [PATCH 2/7] =?UTF-8?q?alphafine=E4=BA=A4=E4=BA=92=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/search/manager/ActionSearchManager.java | 3 +++ .../alphafine/search/manager/DocumentSearchManager.java | 3 +++ .../mainframe/alphafine/search/manager/FileSearchManager.java | 3 +++ .../alphafine/search/manager/PluginSearchManager.java | 3 +++ 4 files changed, 12 insertions(+) diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java index 33387ffbcf..14135a2b23 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/ActionSearchManager.java @@ -75,6 +75,9 @@ public class ActionSearchManager implements AlphaFineSearchProcessor { result.add(object); } } + if (result.size() == 0) { + return lessModelList; + } if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Set"))); lessModelList.addAll(result); diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java index cbd1d49884..7067dd17c9 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/DocumentSearchManager.java @@ -76,6 +76,9 @@ public class DocumentSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } + if (searchResult.size() == 0) { + return lessModelList; + } if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_COMMUNITY_HELP"))); lessModelList.addAll(searchResult); diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java index ac7d4fbdcb..d67d434bda 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/FileSearchManager.java @@ -100,6 +100,9 @@ public class FileSearchManager implements AlphaFineSearchProcessor { } } + if (result.size() == 0) { + return lessModelList; + } if (result.size() > 0 && result.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); lessModelList.addAll(result); diff --git a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java index efcb02c4a3..04c5074ef3 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java +++ b/designer/src/com/fr/design/mainframe/alphafine/search/manager/PluginSearchManager.java @@ -109,6 +109,9 @@ public class PluginSearchManager implements AlphaFineSearchProcessor { searchResult.add(cellModel); } } + if (searchResult.size() == 0) { + return this.lessModelList; + } if (searchResult.size() > 0 && searchResult.size() < AlphaFineConstants.SHOW_SIZE + 1) { lessModelList.add(0, new MoreModel(Inter.getLocText("FR-Designer_Templates"))); lessModelList.addAll(searchResult); From bc1dead4468b260ff3d01f84709017d7916de689 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Tue, 15 Aug 2017 00:41:18 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E7=A7=BB=E5=8A=A8alphafine=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java index 5d0cefed2e..17d9d6e364 100644 --- a/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java +++ b/designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java @@ -379,10 +379,9 @@ public abstract class ToolBarMenuDock { // shortCuts.add(new ForumAction()); } shortCuts.add(SeparatorDef.DEFAULT); - shortCuts.add(new AboutAction()); - shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(new AlphaFineAction()); - + shortCuts.add(SeparatorDef.DEFAULT); + shortCuts.add(new AboutAction()); return shortCuts.toArray(new ShortCut[shortCuts.size()]); } From 5f4f608c371f26dfea615934041e0c4392ac19c3 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 16 Aug 2017 13:43:02 +0800 Subject: [PATCH 4/7] =?UTF-8?q?alphafine=E4=BA=A4=E4=BA=92=E9=AA=8C?= =?UTF-8?q?=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 32 ++++++++++++--- .../mainframe/alphafine/images/no_result.png | Bin 0 -> 4747 bytes .../alphafine/preview/DefaulPane.java | 37 ++++++++++++++++++ .../com/fr/design/locale/designer.properties | 3 +- .../design/locale/designer_en_US.properties | 3 +- .../design/locale/designer_zh_CN.properties | 3 +- .../design/locale/designer_zh_TW.properties | 1 + 7 files changed, 71 insertions(+), 8 deletions(-) create mode 100644 designer/src/com/fr/design/mainframe/alphafine/images/no_result.png create mode 100644 designer/src/com/fr/design/mainframe/alphafine/preview/DefaulPane.java diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 6b1113f358..32de9a078f 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -16,10 +16,7 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel; import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; import com.fr.design.mainframe.alphafine.listener.DocumentAdapter; import com.fr.design.mainframe.alphafine.model.SearchResult; -import com.fr.design.mainframe.alphafine.preview.ActionPreviewPane; -import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane; -import com.fr.design.mainframe.alphafine.preview.FilePreviewPane; -import com.fr.design.mainframe.alphafine.preview.PluginPreviewPane; +import com.fr.design.mainframe.alphafine.preview.*; import com.fr.design.mainframe.alphafine.search.manager.*; import com.fr.form.main.Form; import com.fr.form.main.FormIO; @@ -75,6 +72,7 @@ public class AlphaFineDialog extends UIDialog { private JPanel searchResultPane; private Point pressedPoint; private UIScrollPane leftSearchResultPane; + private JPanel defaultPane; private JPanel rightSearchResultPane; private AlphaFineList searchResultList; private SearchListModel searchListModel; @@ -344,6 +342,31 @@ public class AlphaFineDialog extends UIDialog { */ private void fireStopLoading() { searchListModel.resetState(); + replaceLeftPane(); + } + + private void refreshContainer() { + validate(); + repaint(); + revalidate(); + } + + /** + * 重置结果面板 + */ + private void replaceLeftPane() { + if (searchListModel.getSize() > 0 && defaultPane != null) { + searchResultPane.remove(defaultPane); + defaultPane = null; + searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); + refreshContainer(); + } else if (searchListModel.getSize() == 0 && defaultPane == null){ + defaultPane = new DefaulPane(); + searchResultPane.remove(leftSearchResultPane); + searchResultPane.add(defaultPane, BorderLayout.WEST); + refreshContainer(); + } + } /** @@ -625,7 +648,6 @@ public class AlphaFineDialog extends UIDialog { */ private void initGlobalListener() { initAWTEventListener(); - initMouseListener(); } /** diff --git a/designer/src/com/fr/design/mainframe/alphafine/images/no_result.png b/designer/src/com/fr/design/mainframe/alphafine/images/no_result.png new file mode 100644 index 0000000000000000000000000000000000000000..cd3d803af0b8f2e5a440e7673fc6b54dd3723d00 GIT binary patch literal 4747 zcmWkyc|25Y6u$N?+gP$S4I#VnWtc2sEX_zrgUN1WUmA*t!q}2z&r*~a8T(+!nq9Ue z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E_Q0n|&WGwks9#VGX8E_-s!bxpr)Xw z4KK+A8fJ2+NuwUrMN+z58yIMuu&U2|YXlR7Z2S^Q1H219R491+R$|{;N{G`TlIwFh z;bAtb7ktzuV?&Zg>%Wj}X;K`o*n9QIbD%Ai?nSS?cJ-_3SD_}(VNf_fYoLn?W2GZPi^dB!Ee)Qgo z)nxa#)amt$X`f(B?CzG7lq76TA=aCEdNBX^ytH=N%5~pAEPSj(6PcnK)%P~ zU7???4qT5yWt?k*4}FwXRaZ-X%AEy|OmHnNMN<4%VcA$acM}s%;~Wk0S_l#55E3F1 z&~R>MX2v6J)UEzf#&=a=SM`a%p}E4M(a>tIcT%@QOUud@w-?&iHa5(37X>bn-AM=RDRq8|a zJkAzdwO^DIwf8S%!7KTh-}?)tHX$WRw4*0?Z^H*_l82Xe=$$=RP=98_ zuD_am*7d7Gr>L=_r=7v4*1B4j?P0+i87wEMXR%-+AVT*R_g_$Z!RarPM1fM=`+)y;f&%zv|_kkHN31Fs*glz0eD z=yv70X6+`}#|rw0LBndNH6!1%K~B-&QC@)TVutv%6wp8iO^8v&=GNF1Sd4N;_>nt4 z+)c36s_Jv&+E`X$+B1@AmsNH^%l%tXpwM_JJLu7^CRuQi4}Oj3ro8J1T&qIA_|($% zb|DxqeXA+b8=b_lLMrToHK3M^WZF+<##gLAzsu13rFn2%Bx#8#YC~N*_n$-x&y Date: Wed, 16 Aug 2017 15:36:00 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E6=97=A0=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=98=BE=E7=A4=BA=E7=9A=84=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/component/AlphaFineDialog.java | 24 ++++++------ .../alphafine/preview/ActionPreviewPane.java | 37 ------------------- .../alphafine/preview/DefaulPane.java | 37 ------------------- .../alphafine/preview/NoResultPane.java | 31 ++++++++++++++++ 4 files changed, 42 insertions(+), 87 deletions(-) delete mode 100644 designer/src/com/fr/design/mainframe/alphafine/preview/ActionPreviewPane.java delete mode 100644 designer/src/com/fr/design/mainframe/alphafine/preview/DefaulPane.java create mode 100644 designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 32de9a078f..8fb2118d96 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -22,6 +22,7 @@ import com.fr.form.main.Form; import com.fr.form.main.FormIO; import com.fr.general.ComparatorUtils; import com.fr.general.FRLogger; +import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.general.http.HttpClient; import com.fr.io.TemplateWorkBookIO; @@ -297,15 +298,10 @@ public class AlphaFineDialog extends UIDialog { leftSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); rightSearchResultPane = new JPanel(); rightSearchResultPane.setBackground(Color.WHITE); - UILabel splitLine = new UILabel(); - splitLine.setBackground(AlphaFineConstants.GRAY); - splitLine.setPreferredSize(new Dimension(1, AlphaFineConstants.CONTENT_HEIGHT)); rightSearchResultPane.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH - 1, AlphaFineConstants.CONTENT_HEIGHT)); searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); - searchResultPane.add(splitLine, BorderLayout.CENTER); searchResultPane.add(rightSearchResultPane, BorderLayout.EAST); UILabel splitLabel = new UILabel(); - splitLabel.setBackground(AlphaFineConstants.GRAY); splitLabel.setPreferredSize(new Dimension(AlphaFineConstants.HEIGHT, 1)); searchResultPane.add(splitLabel, BorderLayout.NORTH); add(searchResultPane, BorderLayout.SOUTH); @@ -345,6 +341,9 @@ public class AlphaFineDialog extends UIDialog { replaceLeftPane(); } + /** + * 刷新容器 + */ private void refreshContainer() { validate(); repaint(); @@ -355,18 +354,17 @@ public class AlphaFineDialog extends UIDialog { * 重置结果面板 */ private void replaceLeftPane() { - if (searchListModel.getSize() > 0 && defaultPane != null) { + if (searchListModel.getSize() == 0 && defaultPane == null) { + defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); + searchResultPane.remove(leftSearchResultPane); + searchResultPane.add(defaultPane, BorderLayout.WEST); + refreshContainer(); + } else if (searchListModel.getSize() > 0 && defaultPane != null) { searchResultPane.remove(defaultPane); defaultPane = null; searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); refreshContainer(); - } else if (searchListModel.getSize() == 0 && defaultPane == null){ - defaultPane = new DefaulPane(); - searchResultPane.remove(leftSearchResultPane); - searchResultPane.add(defaultPane, BorderLayout.WEST); - refreshContainer(); } - } /** @@ -557,7 +555,7 @@ public class AlphaFineDialog extends UIDialog { break; case ACTION: rightSearchResultPane.removeAll(); - rightSearchResultPane.add(new ActionPreviewPane()); + rightSearchResultPane.add(new NoResultPane(Inter.getLocText("FR-Designer_NoResult"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/noresult.png"))); validate(); repaint(); break; diff --git a/designer/src/com/fr/design/mainframe/alphafine/preview/ActionPreviewPane.java b/designer/src/com/fr/design/mainframe/alphafine/preview/ActionPreviewPane.java deleted file mode 100644 index c7286850f8..0000000000 --- a/designer/src/com/fr/design/mainframe/alphafine/preview/ActionPreviewPane.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.design.mainframe.alphafine.preview; - - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.general.IOUtils; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; - - -/** - * Created by XiaXiang on 2017/5/5. - */ -public class ActionPreviewPane extends JPanel { - private static final Font NAME = new Font("Song_TypeFace", 0, 14); - - public ActionPreviewPane() { - setLayout(new BorderLayout()); - setBackground(null); - setBorder(BorderFactory.createEmptyBorder(135, 0, 0, 0)); - UILabel image = new UILabel(); - image.setPreferredSize(new Dimension(150, 111)); - image.setHorizontalAlignment(SwingConstants.CENTER); - image.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); - image.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/noresult.png")); - UILabel description = new UILabel(Inter.getLocText("FR-Designer_NoResult")); - description.setForeground(AlphaFineConstants.MEDIUM_GRAY); - description.setFont(NAME); - description.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - description.setHorizontalAlignment(SwingConstants.CENTER); - this.add(image, BorderLayout.CENTER); - this.add(description, BorderLayout.SOUTH); - } - -} diff --git a/designer/src/com/fr/design/mainframe/alphafine/preview/DefaulPane.java b/designer/src/com/fr/design/mainframe/alphafine/preview/DefaulPane.java deleted file mode 100644 index 88572a0027..0000000000 --- a/designer/src/com/fr/design/mainframe/alphafine/preview/DefaulPane.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.design.mainframe.alphafine.preview; - -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.general.IOUtils; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; - -/** - * Created by XiaXiang on 2017/8/14. - */ -public class DefaulPane extends JPanel { - private static final Font NAME = new Font("Song_TypeFace", 0, 14); - public DefaulPane() { - setLayout(new BorderLayout()); - setBackground(Color.WHITE); - setBorder(BorderFactory.createEmptyBorder(135, 80, 135, 80)); - UILabel image = new UILabel(); - image.setPreferredSize(new Dimension(150, 111)); - image.setHorizontalAlignment(SwingConstants.CENTER); - image.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); - image.setIcon(IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); - UILabel description = new UILabel(Inter.getLocText("FR-Designer-AlphaFine_NO_Result")); - description.setForeground(AlphaFineConstants.MEDIUM_GRAY); - description.setFont(NAME); - description.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); - description.setHorizontalAlignment(SwingConstants.CENTER); - this.add(image, BorderLayout.CENTER); - this.add(description, BorderLayout.SOUTH); - UILabel splitLine = new UILabel(); - splitLine.setBackground(AlphaFineConstants.GRAY); - splitLine.setPreferredSize(new Dimension(10, AlphaFineConstants.CONTENT_HEIGHT)); - this.add(splitLine, BorderLayout.EAST); - } -} diff --git a/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java b/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java new file mode 100644 index 0000000000..5ed9004f23 --- /dev/null +++ b/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java @@ -0,0 +1,31 @@ +package com.fr.design.mainframe.alphafine.preview; + +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.mainframe.alphafine.AlphaFineConstants; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by XiaXiang on 2017/8/14. + */ +public class NoResultPane extends JPanel { + private static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 14); + public NoResultPane(String title, Icon icon) { + setLayout(new BorderLayout()); + setBackground(Color.white); + setPreferredSize(new Dimension(AlphaFineConstants.LEFT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT)); + UILabel image = new UILabel(); + image.setPreferredSize(new Dimension(150, 111)); + image.setHorizontalAlignment(SwingConstants.CENTER); + image.setIcon(icon); + image.setBorder(BorderFactory.createEmptyBorder(100,0,0,0)); + UILabel description = new UILabel(title); + description.setForeground(AlphaFineConstants.MEDIUM_GRAY); + description.setFont(MEDIUM_FONT); + description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); + description.setHorizontalAlignment(SwingConstants.CENTER); + add(image, BorderLayout.CENTER); + add(description, BorderLayout.SOUTH); + } +} From dd38ed8c6e985ecb61912fa591ebb92046572192 Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 16 Aug 2017 16:02:03 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E9=94=AE=E7=9B=98=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/alphafine/component/AlphaFineDialog.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java index 8fb2118d96..83945d324e 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java +++ b/designer/src/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java @@ -358,13 +358,12 @@ public class AlphaFineDialog extends UIDialog { defaultPane = new NoResultPane(Inter.getLocText("FR-Designer-AlphaFine_NO_Result"), IOUtils.readIcon("/com/fr/design/mainframe/alphafine/images/no_result.png")); searchResultPane.remove(leftSearchResultPane); searchResultPane.add(defaultPane, BorderLayout.WEST); - refreshContainer(); } else if (searchListModel.getSize() > 0 && defaultPane != null) { searchResultPane.remove(defaultPane); defaultPane = null; searchResultPane.add(leftSearchResultPane, BorderLayout.WEST); - refreshContainer(); } + refreshContainer(); } /** @@ -932,6 +931,8 @@ public class AlphaFineDialog extends UIDialog { if (getSelectedIndex() == 1) { searchTextField.requestFocus(); } + } else if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + searchTextField.requestFocus(); } } }); From 9a850ab6f9c852897f57244f8ea827d50323f25a Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Wed, 16 Aug 2017 16:19:30 +0800 Subject: [PATCH 7/7] rt --- .../fr/design/mainframe/alphafine/preview/NoResultPane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java b/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java index 5ed9004f23..67157aee2f 100644 --- a/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java +++ b/designer/src/com/fr/design/mainframe/alphafine/preview/NoResultPane.java @@ -2,6 +2,7 @@ package com.fr.design.mainframe.alphafine.preview; import com.fr.design.gui.ilable.UILabel; import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.general.FRFont; import javax.swing.*; import java.awt.*; @@ -10,7 +11,6 @@ import java.awt.*; * Created by XiaXiang on 2017/8/14. */ public class NoResultPane extends JPanel { - private static final Font MEDIUM_FONT = new Font("Song_TypeFace", 0, 14); public NoResultPane(String title, Icon icon) { setLayout(new BorderLayout()); setBackground(Color.white); @@ -22,7 +22,7 @@ public class NoResultPane extends JPanel { image.setBorder(BorderFactory.createEmptyBorder(100,0,0,0)); UILabel description = new UILabel(title); description.setForeground(AlphaFineConstants.MEDIUM_GRAY); - description.setFont(MEDIUM_FONT); + description.setFont(FRFont.getInstance("SimSun", Font.PLAIN, 14)); description.setBorder(BorderFactory.createEmptyBorder(0, 0, 135, 0)); description.setHorizontalAlignment(SwingConstants.CENTER); add(image, BorderLayout.CENTER);