From 0529d6924a7e819198ff8604d17de2270938fa74 Mon Sep 17 00:00:00 2001 From: lee <854954082@qq.com> Date: Mon, 7 Nov 2016 18:28:18 +0800 Subject: [PATCH 1/5] 1 1 --- .../com/fr/design/extra/LoginWebBridge.java | 25 +++++----- .../com/fr/design/extra/PluginWebBridge.java | 13 ++++- .../design/extra/exe/PluginLoginExecutor.java | 49 +++++++++++++++++++ 3 files changed, 73 insertions(+), 14 deletions(-) create mode 100644 designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java diff --git a/designer_base/src/com/fr/design/extra/LoginWebBridge.java b/designer_base/src/com/fr/design/extra/LoginWebBridge.java index b604ae8d8b..41ed99beb9 100644 --- a/designer_base/src/com/fr/design/extra/LoginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/LoginWebBridge.java @@ -68,11 +68,11 @@ public class LoginWebBridge { public static com.fr.design.extra.LoginWebBridge getHelper() { if (helper != null) { - return helper; + return helper; } synchronized (com.fr.design.extra.LoginWebBridge.class) { if (helper == null) { - helper = new com.fr.design.extra.LoginWebBridge(); + helper = new com.fr.design.extra.LoginWebBridge(); } return helper; } @@ -118,14 +118,13 @@ public class LoginWebBridge { if(!StringUtils.isEmpty(this.userName)){ updateMessageCount(); } - DesignerEnvManager.getEnvManager().setBBSName(userName); this.userName = userName; } /** * 定时取后台论坛消息 */ - private void updateMessageCount(){ + public void updateMessageCount(){ //启动获取消息更新的线程 //登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数. Thread updateMessageThread = new Thread(new Runnable() { @@ -171,7 +170,7 @@ public class LoginWebBridge { } this.messageCount = count; StringBuilder sb = new StringBuilder(); - sb.append(StringUtils.BLANK).append(this.userName) + sb.append(StringUtils.BLANK).append(DesignerEnvManager.getEnvManager().getBBSName()) .append("(").append(this.messageCount) .append(")").append(StringUtils.BLANK); DesignerEnvManager.getEnvManager().setInShowBBsName(sb.toString()); @@ -244,7 +243,7 @@ public class LoginWebBridge { * @param uiLabel 两边的label显示 * @return 登录信息标志 */ - private String login(String username, String password, UILabel uiLabel) { + public String login(String username, String password, UILabel uiLabel) { if (!StringUtils.isNotBlank(username) && !StringUtils.isNotBlank(password)) { return LOGIN_INFO_EMPTY; } @@ -253,7 +252,7 @@ public class LoginWebBridge { } String loginResult = login(username, password); if (loginResult.equals(LOGININ)) { - updateUserInfo(username, password); + updateUserInfo(username); loginSuccess(username, uiLabel); setUserName(username, uiLabel); } @@ -275,10 +274,7 @@ public class LoginWebBridge { * @param username 用户名 * @param password 密码 */ - public void updateUserInfo(String username,String password) { - DesignerEnvManager.getEnvManager().setBBSName(username); - DesignerEnvManager.getEnvManager().setBBSPassword(password); - DesignerEnvManager.getEnvManager().setInShowBBsName(username); + public void updateUserInfo(String username) { this.userName = username; } @@ -309,7 +305,7 @@ public class LoginWebBridge { }); } - public String login(String username, String password) { + private String login(String username, String password) { try { Client uc = new Client(); String result = uc.uc_user_login(username, password); @@ -319,6 +315,9 @@ public class LoginWebBridge { int $uid = Integer.parseInt(list.get(0)); if ($uid > 0) { DesignerEnvManager.getEnvManager().setBbsUid($uid); + DesignerEnvManager.getEnvManager().setBBSName(username); + DesignerEnvManager.getEnvManager().setInShowBBsName(username); + DesignerEnvManager.getEnvManager().setBBSPassword(password); return LOGININ;//登录成功,0 } else if ($uid == -1) { return USERNAME_NOT_EXSIT;//用户名不存在,-1 @@ -335,4 +334,4 @@ public class LoginWebBridge { } return UNKNOWN_ERROR; } -} +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java index 12c3e85c41..15bd72c09c 100644 --- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java +++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java @@ -529,6 +529,17 @@ public class PluginWebBridge { return LoginWebBridge.getHelper().pluginManageLogin(username, password, uiLabel); } + /** + * 插件管理部分的登陆的回调处理 + * @param username + * @param password + * @param callback + */ + public void defaultLogin(String username, String password, final JSObject callback) { + Task task = new PluginTask<>(webEngine, callback, new PluginLoginExecutor(username, password, uiLabel)); + new Thread(task).start(); + } + /** * 弹出QQ授权页面 */ @@ -545,4 +556,4 @@ public class PluginWebBridge { DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); uiLabel.setText(Inter.getLocText("FR-Base_UnSignIn")); } -} +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java b/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java new file mode 100644 index 0000000000..c1101f8005 --- /dev/null +++ b/designer_base/src/com/fr/design/extra/exe/PluginLoginExecutor.java @@ -0,0 +1,49 @@ +package com.fr.design.extra.exe; + +import com.fr.design.extra.LoginWebBridge; +import com.fr.design.extra.Process; +import com.fr.design.gui.ilable.UILabel; + +/** + * Created by Slpire on 2016/11/7. + */ +public class PluginLoginExecutor implements Executor { + + private String result = "[]"; + + private String username; + private String password; + private UILabel uiLabel; + + public PluginLoginExecutor(String username, String password, UILabel uiLabel) { + this.username = username; + this.password = password; + this.uiLabel = uiLabel; + } + + @Override + public String getTaskFinishMessage() { + return result; + } + + @Override + public Command[] getCommands() { + return new Command[] { + new Command() { + @Override + public String getExecuteMessage() { + return null; + } + + @Override + public void run(Process process) { + String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel); + if (Integer.valueOf(loginResult) == 0) { + LoginWebBridge.getHelper().updateMessageCount(); + } + result = loginResult; + } + } + }; + } +} From 46199cf5a75e7386f87af53c75c5882a688b4457 Mon Sep 17 00:00:00 2001 From: richie Date: Mon, 7 Nov 2016 18:54:08 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E5=9C=A8web=E7=AB=AF=E5=8F=AF=E4=BB=A5?= =?UTF-8?q?=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/actions/file/LocalePane.java | 75 +++++++------------ 1 file changed, 28 insertions(+), 47 deletions(-) diff --git a/designer_base/src/com/fr/design/actions/file/LocalePane.java b/designer_base/src/com/fr/design/actions/file/LocalePane.java index 27dad46df9..3356fa70af 100644 --- a/designer_base/src/com/fr/design/actions/file/LocalePane.java +++ b/designer_base/src/com/fr/design/actions/file/LocalePane.java @@ -8,13 +8,7 @@ import java.awt.BorderLayout; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Properties; -import java.util.Set; -import java.util.Vector; +import java.util.*; import javax.swing.JTable; import javax.swing.RowFilter; @@ -31,10 +25,7 @@ import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.dialog.BasicPane; import com.fr.file.filetree.FileNode; -import com.fr.general.FRLogger; -import com.fr.general.GeneralUtils; -import com.fr.general.IOUtils; -import com.fr.general.Inter; +import com.fr.general.*; import com.fr.stable.ArrayUtils; import com.fr.stable.project.ProjectConstants; @@ -43,12 +34,6 @@ import com.fr.stable.project.ProjectConstants; * @since : 8.0 */ public class LocalePane extends BasicPane { - private static final String FR = "fr.properties"; - private static final String US = "fr_en_US.properties"; - private static final String CN = "fr_zh_CN.properties"; - private static final String JP = "fr_ja_JP.properties"; - private static final String TW = "fr_zh_TW.properties"; - private static final String KR = "fr_ko_KR.properties"; private static final String PREFIX = "fr_"; private static final int LOCALE_NAME_LEN = 5; @@ -124,39 +109,35 @@ public class LocalePane extends BasicPane { } private void initPredefinedProperties() { - Properties fr = loadLocaleProperties(FR); - Properties us = loadLocaleProperties(US); - Properties cn = loadLocaleProperties(CN); - Properties jp = loadLocaleProperties(JP); - Properties tw = loadLocaleProperties(TW); - Properties kr = loadLocaleProperties(KR); - - Set keys = fr.stringPropertyNames(); - List sortKeys = new ArrayList(keys); + Map map = Inter.getPredefinedPackageMap(); + LocalePackage chinese = map.get(Locale.SIMPLIFIED_CHINESE); + + List sortKeys = new ArrayList(); + + + Set bundles = chinese.getKindsOfResourceBundle(); + for (ResourceBundle bundle : bundles) { + sortKeys.addAll(bundle.keySet()); + } Collections.sort(sortKeys); - Vector keyVector = new Vector(); - Vector valueVector = new Vector(); - Vector usVector = new Vector(); - Vector cnVector = new Vector(); - Vector jpVector = new Vector(); - Vector twVector = new Vector(); - Vector krVector = new Vector(); - for (String key : sortKeys) { - keyVector.add(key); - valueVector.add(fr.getProperty(key)); - usVector.add(us.getProperty(key)); - cnVector.add(cn.getProperty(key)); - jpVector.add(jp.getProperty(key)); - twVector.add(tw.getProperty(key)); - krVector.add(kr.getProperty(key)); + + Map> data = new HashMap>(); + for (Map.Entry entry : map.entrySet()) { + Vector column = new Vector(); + for (String key : sortKeys) { + column.add(entry.getValue().getLocText(key)); + } + data.put(entry.getKey(), column); } + + Vector keyVector = new Vector(); + keyVector.addAll(sortKeys); + + predefineTableModel.addColumn(Inter.getLocText("Key"), keyVector); - predefineTableModel.addColumn(Inter.getLocText("Value"), valueVector); - predefineTableModel.addColumn("en_US", usVector); - predefineTableModel.addColumn("zh_CN", cnVector); - predefineTableModel.addColumn("ja_JP", jpVector); - predefineTableModel.addColumn("zh_TW", twVector); - predefineTableModel.addColumn("ko_KR", krVector); + for (Map.Entry> entry : data.entrySet()) { + predefineTableModel.addColumn(entry.getKey().getDisplayName(), entry.getValue()); + } } private void initCustomProperties() throws Exception { From 402d9e98c808f2cc8362163ccf874514549de6e1 Mon Sep 17 00:00:00 2001 From: PanLi320 <854954082@qq.com> Date: Mon, 7 Nov 2016 19:29:04 +0800 Subject: [PATCH 3/5] 1 1 --- designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java index 79ca8b44d5..ddce30d70f 100644 --- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java +++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java @@ -18,6 +18,7 @@ import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.stable.EncodeConstants; +import com.fr.stable.StableUtils; import com.fr.stable.StringUtils; import javax.swing.*; @@ -99,7 +100,9 @@ public class UserInfoLabel extends UILabel{ } }); - //PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); + if (StableUtils.getMajorJavaVersion() == 8) { + PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); + } QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this); UserLoginContext.addLoginContextListener(new LoginContextListener() { From 1ac33db0c254d05ec7a3381a714c89d8677cdf11 Mon Sep 17 00:00:00 2001 From: zhouping Date: Mon, 7 Nov 2016 19:29:49 +0800 Subject: [PATCH 4/5] =?UTF-8?q?REPORT-750=20=E8=A1=A8=E5=8D=95=E5=85=B1?= =?UTF-8?q?=E5=88=9B=E5=86=85=E6=B5=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/designer/creator/XWAbsoluteBodyLayout.java | 10 ++++++++++ .../src/com/fr/design/mainframe/FormArea.java | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java index b9fea0a0bf..e4008df6f1 100644 --- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java +++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java @@ -42,4 +42,14 @@ public class XWAbsoluteBodyLayout extends XWAbsoluteLayout { public void setEditable(boolean isEditable) { super.setEditable(true); } + + /** + * 该组件是否可以拖拽(表单中绝对布局不可以拖拽) + * + * @return 是则返回true + */ + @Override + public boolean isSupportDrag() { + return false; + } } diff --git a/designer_form/src/com/fr/design/mainframe/FormArea.java b/designer_form/src/com/fr/design/mainframe/FormArea.java index 26f3b04903..4f6c86feef 100644 --- a/designer_form/src/com/fr/design/mainframe/FormArea.java +++ b/designer_form/src/com/fr/design/mainframe/FormArea.java @@ -433,17 +433,17 @@ public class FormArea extends JComponent implements ScrollRulerComponent { if (rec.width <= dWidth&&rec.x < getHorizontalValue()) { //在边界内部且x位置小于水平滚动条的值 horScrollBar.setValue(rec.x); - } else if (rec.x+rec.width > dWidth) { + } else if (rec.x + rec.width > dWidth + horizontalValue) { //超出边界宽度 - horScrollBar.setValue(rec.x+rec.width-dWidth); + horScrollBar.setValue(rec.x + rec.width - dWidth); } int dHeight = getDesignerHeight(); if (rec.height < dHeight && rec.y < getVerticalValue()) { //在边界内部且y位置小于竖直滚动条的值 verScrollBar.setValue(rec.y); - } else if (rec.y+rec.height > dHeight) { + } else if (rec.y + rec.height > dHeight + verticalValue) { //超出边界高度 - verScrollBar.setValue(rec.y+rec.height-dHeight); + verScrollBar.setValue(rec.y + rec.height - dHeight); } } From 100bcc4216b76994ca991b89ca1608d1ebbc4ca6 Mon Sep 17 00:00:00 2001 From: eason-skx Date: Tue, 8 Nov 2016 10:29:11 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=88=A0import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/file/HistoryTemplateListPane.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java index 50cdf00cf9..c61a39c431 100644 --- a/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer_base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -9,8 +9,6 @@ import java.util.logging.Level; import javax.swing.*; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.actions.core.ActionFactory; import com.fr.design.constants.UIConstants; import com.fr.design.DesignerEnvManager; import com.fr.design.data.DesignTableDataManager;