|
|
|
@ -19,7 +19,6 @@ import com.fr.design.mainframe.alphafine.cell.model.PluginModel;
|
|
|
|
|
import com.fr.design.mainframe.alphafine.cell.model.RobotModel; |
|
|
|
|
import com.fr.design.mainframe.alphafine.cell.render.ContentCellRender; |
|
|
|
|
import com.fr.design.mainframe.alphafine.model.SearchResult; |
|
|
|
|
import com.fr.design.mainframe.alphafine.preview.ContainsCirclePane; |
|
|
|
|
import com.fr.design.mainframe.alphafine.preview.DocumentPreviewPane; |
|
|
|
|
import com.fr.design.mainframe.alphafine.preview.FilePreviewPane; |
|
|
|
|
import com.fr.design.mainframe.alphafine.preview.NoResultPane; |
|
|
|
@ -40,6 +39,7 @@ import com.fr.form.main.Form;
|
|
|
|
|
import com.fr.form.main.FormIO; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
import com.fr.general.http.HttpClient; |
|
|
|
|
import com.fr.general.http.HttpToolbox; |
|
|
|
|
import com.fr.io.TemplateWorkBookIO; |
|
|
|
|
import com.fr.io.exporter.ImageExporter; |
|
|
|
|
import com.fr.json.JSONException; |
|
|
|
@ -49,6 +49,7 @@ import com.fr.main.impl.WorkBook;
|
|
|
|
|
import com.fr.stable.CodeUtils; |
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.project.ProjectConstants; |
|
|
|
|
import com.fr.third.org.apache.http.client.methods.HttpGet; |
|
|
|
|
|
|
|
|
|
import javax.imageio.ImageIO; |
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
@ -142,6 +143,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
private static String beforeSearchStr = ""; |
|
|
|
|
private static boolean alreadySearch = false; |
|
|
|
|
private static boolean alreadyInitHot = false; |
|
|
|
|
public static String[][] data; |
|
|
|
|
|
|
|
|
|
public AlphaFineDialog(Frame parent, boolean forceOpen) { |
|
|
|
|
super(parent); |
|
|
|
@ -224,6 +226,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
* 初始化热门界面 |
|
|
|
|
*/ |
|
|
|
|
private void initHotPane() { |
|
|
|
|
removeHotPane(); |
|
|
|
|
hotPane = new JPanel(); |
|
|
|
|
hotPane.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
|
|
|
|
hotPane.setPreferredSize(AlphaFineConstants.CONTENT_SIZE); |
|
|
|
@ -232,25 +235,28 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Hot")); |
|
|
|
|
uiLabel.setFont(AlphaFineConstants.SMALL_FONT); |
|
|
|
|
uiLabel.setForeground(AlphaFineConstants.DARK_GRAY); |
|
|
|
|
JPanel panel = new JPanel(); |
|
|
|
|
|
|
|
|
|
hotPane.add(uiLabel, BorderLayout.NORTH); |
|
|
|
|
hotPane.add(panel, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
GridLayout gridLayout = new GridLayout(2, 3, 3, 3); |
|
|
|
|
JPanel panel = new JPanel(); |
|
|
|
|
panel.setLayout(gridLayout); |
|
|
|
|
|
|
|
|
|
String[][] ss = HotIssuesManager.getInstance().getHotIssues(); |
|
|
|
|
|
|
|
|
|
if(ss != null){ |
|
|
|
|
for (int i = 0; i < ss.length; i++) { |
|
|
|
|
panel.add(new HotIssueJpanel(ss[i], i + 1)); |
|
|
|
|
try { |
|
|
|
|
HttpGet getHelp = new HttpGet(AlphaFineConstants.ALPHA_HOT_SEARCH); |
|
|
|
|
HttpToolbox.getHttpClient(AlphaFineConstants.ALPHA_HOT_SEARCH).execute(getHelp).getStatusLine(); |
|
|
|
|
if (data == null) { |
|
|
|
|
data = HotIssuesManager.getInstance().getHotIssues(); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
for (int i = 0; i < data.length; i++) { |
|
|
|
|
panel.add(new HotIssueJpanel(data[i], i + 1)); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
data = null; |
|
|
|
|
for (int i = 0; i < AlphaFineConstants.HOT_ITEMS; i++) { |
|
|
|
|
panel.add(new HotIssueJpanel(new String[]{" "}, i + 1)); |
|
|
|
|
panel.add(new HotIssueJpanel(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Connection_Failed")}, i + 1)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hotPane.add(uiLabel, BorderLayout.NORTH); |
|
|
|
|
hotPane.add(panel, BorderLayout.CENTER); |
|
|
|
|
add(hotPane, BorderLayout.SOUTH); |
|
|
|
|
setSize(AlphaFineConstants.FULL_SIZE); |
|
|
|
|
} |
|
|
|
@ -313,9 +319,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { |
|
|
|
|
if (hotPane == null) { |
|
|
|
|
initHotPane(); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
removeHotPane(); |
|
|
|
|
setSize(AlphaFineConstants.FIELD_SIZE); |
|
|
|
@ -816,10 +820,8 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
removeSearchResult(); |
|
|
|
|
refreshContainer(); |
|
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { |
|
|
|
|
if (hotPane == null) { |
|
|
|
|
initHotPane(); |
|
|
|
|
setSize(AlphaFineConstants.FULL_SIZE); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
setSize(AlphaFineConstants.FIELD_SIZE); |
|
|
|
|
} |
|
|
|
@ -1198,6 +1200,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void mouseDragged(MouseEvent e) { |
|
|
|
|
} |
|
|
|
@ -1363,6 +1366,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
hotPane = null; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 增加返回面板 |
|
|
|
|
*/ |
|
|
|
@ -1382,9 +1386,7 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
searchResultPane = null; |
|
|
|
|
} |
|
|
|
|
if (DesignerEnvManager.getEnvManager().getAlphaFineConfigManager().isNeedIntelligentCustomerService()) { |
|
|
|
|
if (hotPane == null) { |
|
|
|
|
initHotPane(); |
|
|
|
|
} |
|
|
|
|
setSize(AlphaFineConstants.FULL_SIZE); |
|
|
|
|
} else { |
|
|
|
|
setSize(AlphaFineConstants.FIELD_SIZE); |
|
|
|
@ -1407,14 +1409,19 @@ public class AlphaFineDialog extends UIDialog {
|
|
|
|
|
this.setSize(AlphaFineConstants.HOT_ISSUES_JAPNEL_SIZE); |
|
|
|
|
|
|
|
|
|
JPanel pane1 = new JPanel(new BorderLayout()); |
|
|
|
|
ContainsCirclePane circle = new ContainsCirclePane(pngIndex); |
|
|
|
|
circle.setBorder(BorderFactory.createEmptyBorder(20,0,10,0)); |
|
|
|
|
pane1.add(circle, BorderLayout.NORTH); |
|
|
|
|
UILabel iconLabel = new UILabel(IconLoader.getIcon(AlphaFineConstants.IMAGE_URL + AlphaFineConstants.ALPHA_HOT_IMAGE_NAME + pngIndex + ".png")); |
|
|
|
|
iconLabel.setOpaque(true); |
|
|
|
|
iconLabel.setBackground(Color.WHITE); |
|
|
|
|
iconLabel.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0)); |
|
|
|
|
pane1.add(iconLabel, BorderLayout.NORTH); |
|
|
|
|
add(pane1, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
JPanel centerPanel = new JPanel(new BorderLayout()); |
|
|
|
|
centerPanel.setBackground(Color.white); |
|
|
|
|
UILabel title = new UILabel(); |
|
|
|
|
if (StringUtils.isEmpty(str[0])) { |
|
|
|
|
title.setText(StringUtils.EMPTY); |
|
|
|
|
} |
|
|
|
|
title.setText(str[0]); |
|
|
|
|
title.setFont(AlphaFineConstants.MEDIUM_FONT_ANOTHER); |
|
|
|
|
title.setForeground(AlphaFineConstants.DARK_GRAY); |
|
|
|
|