Browse Source

Merging in latest from upstream (ST/design:refs/heads/release/8.0)

* commit 'a915d6506549c08a7a1d8bec1a630238011d03cd':
  提交错误
  无jira任务 SonarQube
  refeat: 增加ThreadFactoryBuilder
  REPORT-5518 [9.0三轮回归]jdk1.7的设计器起不来
  REPORT-5503 表单背景不能铺满=>调整代码
  REPORT-5503 表单背景不能铺满
  CHART-1690  8.0中图表不支持平台内打开插件
  无jira任务 修复8.0 mac下demo无法启动的问题。
  无JIRA任务,国际化
  REPORT-5308 代码规范
  REPORT-5308 代码规范
  REPORT-5308 [9.0三轮回归]【8.0 master 也存在】 修改后第一次预览没有数据,再预览一次就好了
  REPORT-5402 代码规范
  REPORT-5402 修改国际化key
  REPORT-5402 8.0,设计器安装,输入激活码界面,国际化有问题
MoMeak 8 years ago
parent
commit
1d7d7c7399
  1. 68
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  2. 8
      designer/src/com/fr/design/webattr/WriteToolBarPane.java
  3. 33
      designer/src/com/fr/start/CollectUserInformationDialog.java
  4. 202
      designer/src/com/fr/start/Designer.java
  5. 46
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  6. 54
      designer_base/src/com/fr/design/extra/LoginWebBridge.java
  7. 6
      designer_base/src/com/fr/design/extra/ShopManagerPane.java
  8. 54
      designer_base/src/com/fr/design/extra/WebViewDlgHelper.java
  9. 6
      designer_base/src/com/fr/design/locale/designer.properties
  10. 6
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  11. 6
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  12. 6
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  13. 6
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  14. 6
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  15. 178
      designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java
  16. 42
      designer_base/src/com/fr/start/Demo.java
  17. 7
      designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java
  18. 6
      designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
  19. 2
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java

68
designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java

@ -5,11 +5,16 @@ package com.fr.design.mainframe.bbs;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.extra.*;
import com.fr.design.extra.LoginContextListener;
import com.fr.design.extra.LoginWebBridge;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.UserLoginContext;
import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils;
@ -21,15 +26,22 @@ import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.SwingConstants;
import java.awt.Cursor;
import java.awt.Desktop;
import java.awt.Frame;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.UnsupportedEncodingException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.net.URI;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* @author neil
@ -37,6 +49,7 @@ import java.util.Date;
*/
public class UserInfoLabel extends UILabel {
private static final int JRE_VERSION_8 = 8;
//默认查询消息时间, 30s
private static final long CHECK_MESSAGE_TIME = 30 * 1000L;
//默认论坛检测到更新后的弹出延迟时间
@ -73,6 +86,10 @@ public class UserInfoLabel extends UILabel {
}
public UserInfoLabel(UserInfoPane userInfoPane) {
init(userInfoPane);
}
private void init(UserInfoPane userInfoPane) {
this.userInfoPane = userInfoPane;
String userName = DesignerEnvManager.getEnvManager().getBBSName();
@ -83,22 +100,7 @@ public class UserInfoLabel extends UILabel {
LoginWebBridge loginWebBridge = new LoginWebBridge();
loginWebBridge.setUserName(userName, UserInfoLabel.this);
LoginCheckContext.addLoginCheckListener(new LoginCheckListener() {
@Override
public void loginChecked() {
/*
if (bbsLoginDialog == null) {
bbsLoginDialog = new BBSLoginDialog(DesignerContext.getDesignerFrame(), UserInfoLabel.this);
}
bbsLoginDialog.clearLoginInformation();
bbsLoginDialog.showTipForDownloadPluginWithoutLogin();
bbsLoginDialog.setModal(true);
bbsLoginDialog.showWindow();
*/
}
});
if (StableUtils.getMajorJavaVersion() == 8) {
if (StableUtils.getMajorJavaVersion() == JRE_VERSION_8) {
PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
}
LoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this);
@ -125,12 +127,13 @@ public class UserInfoLabel extends UILabel {
userInfoPane.markUnSignIn();
}
/**
* showBBSDialog 弹出BBS资讯框
*/
public static void showBBSDialog() {
Thread showBBSThread = new Thread(new Runnable() {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1),
new ThreadFactoryBuilder().setNameFormat("bbs-dlg-thread-%s").build());
threadPoolExecutor.execute(new Runnable() {
@Override
public void run() {
// vito:最新mac10.12和javafx弹出框初始化时会有大几率卡死在native方法,这里先屏蔽一下。
@ -152,18 +155,22 @@ public class UserInfoLabel extends UILabel {
return;
}
String res = hc.getResponseText();
if (res.indexOf(BBSConstants.UPDATE_KEY) == -1) {
if (!res.contains(BBSConstants.UPDATE_KEY)) {
return;
}
try {
BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame());
bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
Class<?> clazz = Class.forName("com.fr.design.mainframe.bbs.BBSDialog");
Constructor constructor = clazz.getConstructor(Frame.class);
Object instance = constructor.newInstance(DesignerContext.getDesignerFrame());
Method showWindow = clazz.getMethod("showWindow", String.class);
showWindow.invoke(instance, SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date()));
} catch (Throwable e) {
} catch (Throwable ignored) {
// ignored
}
}
});
showBBSThread.start();
}
private void sleep(long millis) {
@ -230,6 +237,7 @@ public class UserInfoLabel extends UILabel {
private MouseAdapter userInfoAdapter = new MouseAdapter() {
@Override
public void mouseEntered(MouseEvent e) {
UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}
@ -245,6 +253,7 @@ public class UserInfoLabel extends UILabel {
//私人消息
UIMenuItem priviteMessage = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Privite-Message"));
priviteMessage.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (StringUtils.isNotEmpty(userName)) {
try {
@ -261,6 +270,7 @@ public class UserInfoLabel extends UILabel {
//切换账号
UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account"));
closeOther.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
UserLoginContext.fireLoginContextListener();
}

8
designer/src/com/fr/design/webattr/WriteToolBarPane.java

@ -38,7 +38,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private DragToolBarPane dragToolbarPane;
private UIRadioButton topRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Top"));
private UIRadioButton bottomRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Bottom"));
private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "Display position"}) + ":");
private UILabel sheetShowLocationLabel = new UILabel("sheet" + Inter.getLocText(new String[]{"Label", "Page_Number", "FR-Designer_Display_Position"}) + ":");
private UIRadioButton centerRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Center_Display"));
private UIRadioButton leftRadioButton = new UIRadioButton(Inter.getLocText("FR-Designer_Left_Display"));
private UILabel rptShowLocationLabel = new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.LEFT);
@ -50,6 +50,10 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
private UICheckBox isAutoStash;//自动暂存
public WriteToolBarPane() {
init();
}
private void init() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(allPanel, BorderLayout.CENTER);
@ -106,7 +110,7 @@ public class WriteToolBarPane extends AbstractEditToolBarPane {
toolBarManager.setToolBarLocation(Location.createTopEmbedLocation());
this.toolBarManagers = new ToolBarManager[]{toolBarManager};
}
private ActionListener editBtnListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {

33
designer/src/com/fr/start/CollectUserInformationDialog.java

@ -33,6 +33,15 @@ public class CollectUserInformationDialog extends UIDialog {
private static final String TW_LOGIN_HTML = "http://www.finereport.com/tw/products/frlogin";
private static final String JP_LOGIN_HTML = "http://www.finereport.com/jp/products/frlogin";
private static final int ONLINE_VERIFY_TIMEOUT = 30 * 1000;
private static final int DIALOG_WIDTH = 480;
private static final int DIALOG_HEIGHT = 300;
private static final int DESCRIPTION_ROWS = 5;
private static final int KEYPANE_PADDING_TOP = 32;
private static final int KEYPANE_PADDING_LEFT = 2;
private static final int KEYPANE_PADDING_DOWN = 32;
private static final int KEYPANE_PADDING_RIGHT = 2;
private static final int DEFAULTPANE_PADDING_TOP = 2;
private static final int DEFAULTPANE_PADDING = 4;
private UITextField keyTextField;
private DescriptionTextArea descriptionTextArea;
@ -47,7 +56,7 @@ public class CollectUserInformationDialog extends UIDialog {
protected void initComponents() {
JPanel defaultPane = (JPanel) this.getContentPane();
defaultPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());
defaultPane.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
defaultPane.setBorder(BorderFactory.createEmptyBorder(DEFAULTPANE_PADDING_TOP, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING, DEFAULTPANE_PADDING));
this.applyClosingAction();
//this.applyEscapeAction();
JPanel centPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -60,7 +69,7 @@ public class CollectUserInformationDialog extends UIDialog {
Inter.getLocText("Collect-Enter_your_user_information_code(It's_free_to_get_from_product's_official_website)"),
TitledBorder.LEADING, TitledBorder.TOP));
JPanel keyPane = new JPanel(new BorderLayout(4, 4));
keyPane.setBorder(BorderFactory.createEmptyBorder(32, 2, 32, 2));
keyPane.setBorder(BorderFactory.createEmptyBorder(KEYPANE_PADDING_TOP, KEYPANE_PADDING_LEFT, KEYPANE_PADDING_DOWN, KEYPANE_PADDING_RIGHT));
topPane.add(keyPane);
UILabel avctivenumberLabel = new UILabel();
@ -72,13 +81,13 @@ public class CollectUserInformationDialog extends UIDialog {
macSystemHit(keyPane);
UIButton getKeyButton = new UIButton(
Inter.getLocText("Collect-Click!_Get_user_information_code"));
Inter.getLocText("FR-Designer_Get_Activation_Code"));
getKeyButton.setMnemonic('F');
keyPane.add(getKeyButton, BorderLayout.EAST);
getKeyButton.addActionListener(actionListener);
descriptionTextArea = new DescriptionTextArea();
descriptionTextArea.setRows(5);
descriptionTextArea.setRows(DESCRIPTION_ROWS);
descriptionTextArea.setBorder(
BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer-Collect_Information_Description")));
descriptionTextArea.setText(Inter.getLocText("Collect-User_Information_DES"));
@ -88,13 +97,13 @@ public class CollectUserInformationDialog extends UIDialog {
defaultPane.add(this.createControlButtonPane(), BorderLayout.SOUTH);
this.setTitle(Inter.getLocText("Collect-Collect_User_Information"));
this.setSize(480, 300);
this.setSize(DIALOG_WIDTH, DIALOG_HEIGHT);
this.setModal(true);
GUICoreUtils.centerWindow(this);
}
private void macSystemHit(JPanel keyPane) {
if(OperatingSystem.isMacOS()) {
if (OperatingSystem.isMacOS()) {
UITextArea macHit = new UITextArea();
macHit.setText(Inter.getLocText("FR-Designer-Collect_OSXTips"));
macHit.setEditable(false);
@ -119,22 +128,19 @@ public class CollectUserInformationDialog extends UIDialog {
private void getKeyAction(){
Locale locale = FRContext.getLocale();
String url = EN_LOGIN_HTML;
if (ComparatorUtils.equals(locale, Locale.TAIWAN))
{
if (ComparatorUtils.equals(locale, Locale.TAIWAN)) {
url = TW_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.CHINA))
{
if (ComparatorUtils.equals(locale, Locale.CHINA)) {
url = CN_LOGIN_HTML;
}
if (ComparatorUtils.equals(locale, Locale.JAPAN))
{
if (ComparatorUtils.equals(locale, Locale.JAPAN)) {
url = JP_LOGIN_HTML;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (Exception ioe) {
// do nothing
}
};
@ -189,5 +195,6 @@ public class CollectUserInformationDialog extends UIDialog {
*
*/
public void checkValid() throws Exception {
// do nothing
}
}

202
designer/src/com/fr/start/Designer.java

@ -20,7 +20,12 @@ import com.fr.design.gui.ibutton.UIPreviewButton;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.itoolbar.UILargeToolbar;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.mainframe.BaseJForm;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.InformationCollector;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.bbs.UserInfoLabel;
import com.fr.design.mainframe.bbs.UserInfoPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
@ -30,6 +35,7 @@ import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
import com.fr.design.module.DesignModuleFactory;
import com.fr.design.module.DesignerModule;
import com.fr.design.utils.concurrent.ThreadFactoryBuilder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
@ -38,29 +44,36 @@ import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLTools;
import javax.swing.*;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.border.MatteBorder;
import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
public class Designer extends BaseDesigner {
private static final int TOOLBARPANEVGAP = -4;
private static final int PREVIEW_DOWN_X_GAP = 92;
private static final int GAP = 7;
private static final String OLD_ENV_FOLDER_71 = ".FineReport71";
private static final String OLD_ENV_FOLDER_70 = ".FineReport70";
private UserInfoPane userInfoPane;
private UIButton saveButton;
private UIButton undo;
private UIButton redo;
private UIPreviewButton run;
/**
* 设计器启动的Main方法
@ -132,6 +145,7 @@ public class Designer extends BaseDesigner {
UILargeToolbar largeToolbar = super.createLargeToolbar();
largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4));
largeToolbar.add(new JPanel() {
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = 1;
@ -141,6 +155,7 @@ public class Designer extends BaseDesigner {
createRunButton(largeToolbar);
largeToolbar.add(run);
largeToolbar.add(new JPanel() {
@Override
public Dimension getPreferredSize() {
Dimension dim = super.getPreferredSize();
dim.width = GAP;
@ -154,8 +169,10 @@ public class Designer extends BaseDesigner {
/**
* 创建上面一排的工具栏按钮
*
* @return 按钮
*/
@Override
public UIButton[] createUp() {
return new UIButton[]{createSaveButton(), createUndoButton(), createRedoButton()};
}
@ -176,7 +193,7 @@ public class Designer extends BaseDesigner {
});
return saveButton;
}
private UIButton createUndoButton() {
undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png"));
undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName());
@ -211,10 +228,12 @@ public class Designer extends BaseDesigner {
private void createRunButton(UILargeToolbar largeToolbar) {
run = new UIPreviewButton(new UIButton(UIConstants.PAGE_BIG_ICON) {
@Override
public Dimension getPreferredSize() {
return new Dimension(34, 34);
}
}, new UIButton(UIConstants.PREVIEW_DOWN) {
@Override
public Dimension getPreferredSize() {
return new Dimension(34, 10);
}
@ -284,10 +303,12 @@ public class Designer extends BaseDesigner {
/**
* 生成工具栏
*
* @param toolbarComponent 工具栏
* @param plus 对象
* @return 更新后的toolbar
* @return 更新后的toolbar
*/
@Override
public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) {
//如果是处于权限编辑状态
if (BaseUtils.isAuthorityEditing()) {
@ -325,85 +346,90 @@ public class Designer extends BaseDesigner {
public JTemplate<?, ?> createNewTemplate() {
return new JWorkBook();
}
/**
* 创建论坛登录面板, chart那边不需要
*
* @return 面板组件
*
*/
public Component createBBSLoginPane(){
if (userInfoPane == null){
userInfoPane = new UserInfoPane();
* 创建论坛登录面板, chart那边不需要
*
* @return 面板组件
*/
@Override
public Component createBBSLoginPane() {
if (userInfoPane == null) {
userInfoPane = new UserInfoPane();
}
return userInfoPane;
}
@Override
protected SplashPane createSplashPane() {
return new ReportSplashPane();
}
/**
* 收集用户信息吗
*
*/
* 收集用户信息吗
*/
@Override
protected void collectUserInformation() {
//定制的就不弹出来了
if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APPNAME)) {
return;
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
final String key = envManager.getActivationKey();
//本地验证通过
if(ActiveKeyGenerator.localVerify(key)){
onLineVerify(envManager, key);
UserInfoLabel.showBBSDialog();
return;
}
if(StableUtils.checkDesignerActive(readOldKey())){
//只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行.
String newKey = ActiveKeyGenerator.generateActiveKey();
envManager.setActivationKey(newKey);
UserInfoLabel.showBBSDialog();
return;
}
//定制的就不弹出来了
if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APPNAME)) {
return;
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
final String key = envManager.getActivationKey();
//本地验证通过
if (ActiveKeyGenerator.localVerify(key)) {
onLineVerify(envManager, key);
UserInfoLabel.showBBSDialog();
return;
}
if (StableUtils.checkDesignerActive(readOldKey())) {
//只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行.
String newKey = ActiveKeyGenerator.generateActiveKey();
envManager.setActivationKey(newKey);
UserInfoLabel.showBBSDialog();
return;
}
CollectUserInformationDialog activeDialog = new CollectUserInformationDialog(
DesignerContext.getDesignerFrame());
DesignerContext.getDesignerFrame());
activeDialog.setVisible(true);
}
private void onLineVerify(DesignerEnvManager envManager, final String key){
int status = envManager.getActiveKeyStatus();
//没有联网验证过
if (status != 0) {
Thread authThread = new Thread(new Runnable() {
@Override
public void run() {
ActiveKeyGenerator.onLineVerify(key);
}
});
authThread.start();
}
private void onLineVerify(DesignerEnvManager envManager, final String key) {
int status = envManager.getActiveKeyStatus();
//没有联网验证过
if (status != 0) {
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
1, 1,
0L, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(1),
new ThreadFactoryBuilder().setNameFormat("net-verify-thread-%s").build());
threadPoolExecutor.execute(new Runnable() {
@Override
public void run() {
ActiveKeyGenerator.onLineVerify(key);
}
});
}
}
private File getOldEnvFile(String folderName){
String userHome = System.getProperty("user.home");
if (userHome == null) {
userHome = System.getProperty("userHome");
}
String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml");
private File getOldEnvFile(String folderName) {
String userHome = System.getProperty("user.home");
if (userHome == null) {
userHome = System.getProperty("userHome");
}
String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml");
return new File(filePath);
}
private String getOldActiveKeyFromFile(File envFile){
private String getOldActiveKeyFromFile(File envFile) {
if (!envFile.exists()) {
return StringUtils.EMPTY;
}
return StringUtils.EMPTY;
}
DesignerEnvManager temp = new DesignerEnvManager();
try {
XMLTools.readFileXML(temp, envFile);
@ -412,26 +438,26 @@ public class Designer extends BaseDesigner {
}
return temp.getActivationKey();
}
//默认只从7.0和711的设计器里读取key
private String readOldKey(){
File file71 = getOldEnvFile(OLD_ENV_FOLDER_71);
if (!file71.exists()) {
File file70 = getOldEnvFile(OLD_ENV_FOLDER_70);
return getOldActiveKeyFromFile(file70);
}
return getOldActiveKeyFromFile(file71);
private String readOldKey() {
File file71 = getOldEnvFile(OLD_ENV_FOLDER_71);
if (!file71.exists()) {
File file70 = getOldEnvFile(OLD_ENV_FOLDER_70);
return getOldActiveKeyFromFile(file70);
}
return getOldActiveKeyFromFile(file71);
}
/**
* 设计器退出时, 做的一些操作.
*
*/
public void shutDown(){
InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime();
collector.saveXMLFile();
* 设计器退出时, 做的一些操作.
*/
@Override
public void shutDown() {
InformationCollector collector = InformationCollector.getInstance();
collector.collectStopTime();
collector.saveXMLFile();
Env currentEnv = FRContext.getCurrentEnv();
currentEnv.doWhenServerShutDown();
}

46
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -3,6 +3,7 @@ package com.fr.design.data.datapane;
import com.fr.base.BaseUtils;
import com.fr.base.TableData;
import com.fr.data.TableDataSource;
import com.fr.data.impl.TableDataSourceDependent;
import com.fr.design.DesignModelAdapter;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction;
@ -45,6 +46,7 @@ import java.util.Map;
public class TableDataTreePane extends BasicTableDataTreePane {
private static TableDataTreePane singleton = new TableDataTreePane();
private static final int TIP_DISMISS_DELAY = 3000;
public synchronized static BasicTableDataTreePane getInstance(DesignModelAdapter<?, ?> tc) {
@ -71,25 +73,21 @@ public class TableDataTreePane extends BasicTableDataTreePane {
private PreviewTableDataAction previewTableDataAction;
private TableDataTreePane() {
init();
}
private void init() {
this.setLayout(new BorderLayout(4, 0));
this.setBorder(null);
dataTree = new TableDataTree();
ToolTipManager.sharedInstance().registerComponent(dataTree);
ToolTipManager.sharedInstance().setDismissDelay(3000);
ToolTipManager.sharedInstance().setDismissDelay(TIP_DISMISS_DELAY);
ToolTipManager.sharedInstance().setInitialDelay(0);
addMenuDef = new MenuDef(Inter.getLocText("FR-Action_Add"));
addMenuDef.setIconPath(IconPathConstants.ADD_POPMENU_ICON_PATH);
createAddMenuDef();
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success(Status status) {
addMenuDef.clearShortCuts();
createAddMenuDef();
}
});
editAction = new EditAction();
removeAction = new RemoveAction();
previewTableDataAction = new PreviewTableDataAction(dataTree);
@ -112,13 +110,9 @@ public class TableDataTreePane extends BasicTableDataTreePane {
jPanel.add(buttonPane, BorderLayout.NORTH);
jPanel.add(scrollPane, BorderLayout.CENTER);
this.add(jPanel, BorderLayout.CENTER);
dataTree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
checkButtonEnabled();
}
});
dataTree.addKeyListener(getTableTreeNodeListener(editAction, previewTableDataAction, removeAction, op, dataTree));
initListeners();
// TreeCellEditor
dataTree.setEditable(true);
TableDataTreeCellEditor treeCellEditor = new TableDataTreeCellEditor(new UITextField(), dataTree, this);
@ -128,6 +122,23 @@ public class TableDataTreePane extends BasicTableDataTreePane {
checkButtonEnabled();
}
private void initListeners() {
GeneralContext.addPluginReadListener(new PluginReadListener() {
@Override
public void success(Status status) {
addMenuDef.clearShortCuts();
createAddMenuDef();
}
});
dataTree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
checkButtonEnabled();
}
});
dataTree.addKeyListener(getTableTreeNodeListener(editAction, previewTableDataAction, removeAction, op, dataTree));
}
protected void checkButtonEnabled() {
super.checkButtonEnabled(editAction, previewTableDataAction, removeAction, op, dataTree);
@ -187,6 +198,9 @@ public class TableDataTreePane extends BasicTableDataTreePane {
tc.renameTableData(oldName, nPanel.getObjectName(), false);
TableDataSource tds = tc.getBook();
TableData td = uPanel.updateBean();
if (td instanceof TableDataSourceDependent) {
((TableDataSourceDependent) td).setTableDataSource(tds);
}
String tdName = nPanel.getObjectName();
tds.putTableData(tdName, td);
Map<String, String> map = new HashMap<String, String>();

54
designer_base/src/com/fr/design/extra/LoginWebBridge.java

@ -6,14 +6,16 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.ucenter.Client;
import com.fr.design.extra.ucenter.XMLHelper;
import com.fr.design.gui.ilable.UILabel;
import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import javafx.scene.web.WebEngine;
import javax.swing.*;
import java.awt.*;
import javax.swing.JDialog;
import javax.swing.SwingUtilities;
import java.awt.Desktop;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
@ -55,6 +57,10 @@ public class LoginWebBridge {
private String userName;
public LoginWebBridge() {
init();
}
private void init() {
String username = DesignerEnvManager.getEnvManager().getBBSName();
setUserName(username, uiLabel);
}
@ -79,7 +85,7 @@ public class LoginWebBridge {
this.pluginuiLabel = uiLabel;
}
public void setQqDialog(UIDialog qqDialog) {
public void setQQDialog(UIDialog qqDialog) {
closeQQWindow();
this.qqDialog = qqDialog;
}
@ -216,7 +222,7 @@ public class LoginWebBridge {
return NET_FAILED;
}
String loginResult = login(username, password);
if (loginResult.equals(LOGININ)) {
if (ComparatorUtils.equals(loginResult, LOGININ)) {
updateUserInfo(username);
loginSuccess(username, uiLabel);
setUserName(username, uiLabel);
@ -271,24 +277,23 @@ public class LoginWebBridge {
String result = uc.uc_user_login(username, password);
result = new String(result.getBytes("iso-8859-1"), "gbk");
LinkedList<String> list = XMLHelper.uc_unserialize(result);
if (list.size() > 0) {
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
} else if ($uid == -2) {
return PASSWORD_ERROR;//密码错误,-2
} else {
return UNKNOWN_ERROR;//未知错误,-3
}
} else {
if (list.size() == 0) {
return NET_FAILED;
}
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
} else if (uid == -2) {
return PASSWORD_ERROR;//密码错误,-2
} else {
return UNKNOWN_ERROR;//未知错误,-3
}
} catch (Exception e) {
FRContext.getLogger().info(e.getMessage());
}
@ -313,21 +318,22 @@ public class LoginWebBridge {
public void getLoginInfo(String userInfo) {
org.json.JSONObject jo = new org.json.JSONObject(userInfo);
String status = jo.get("status").toString();
if (status.equals(LOGIN_SUCCESS)) {
if (ComparatorUtils.equals(status, LOGIN_SUCCESS)) {
String username = jo.get("username").toString();
int uid = Integer.parseInt(jo.get("uid") == null ? "" : jo.get("uid").toString());
int uid = Integer.parseInt(jo.get("uid") == null ? StringUtils.EMPTY : jo.get("uid").toString());
closeWindow();
closeQQWindow();
pluginuiLabel.setText(username);
DesignerEnvManager.getEnvManager().setBBSName(username);
DesignerEnvManager.getEnvManager().setBbsUid(uid);
DesignerEnvManager.getEnvManager().setInShowBBsName(username);
} else if (status.equals(LOGIN_FAILED)) {
} else if (ComparatorUtils.equals(status, LOGIN_FAILED)) {
//账号没有QQ授权
closeQQWindow();
try {
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("QQ_binding")));
} catch (Exception exp) {
} catch (Exception ignore) {
// ignored
}
}
}

6
designer_base/src/com/fr/design/extra/ShopManagerPane.java

@ -2,9 +2,9 @@ package com.fr.design.extra;
import com.fr.design.dialog.BasicPane;
import com.fr.general.Inter;
import javafx.embed.swing.JFXPanel;
import java.awt.*;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* @author richie
@ -19,7 +19,7 @@ import java.awt.*;
*/
public class ShopManagerPane extends BasicPane {
public ShopManagerPane(JFXPanel webPane) {
public ShopManagerPane(Component webPane) {
setLayout(new BorderLayout());
add(webPane, BorderLayout.CENTER);
}

54
designer_base/src/com/fr/design/extra/WebViewDlgHelper.java

@ -15,9 +15,12 @@ import com.fr.general.http.HttpClient;
import com.fr.plugin.PluginVerifyException;
import com.fr.stable.StableUtils;
import javax.swing.*;
import java.awt.*;
import javax.swing.JOptionPane;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.Component;
import java.io.File;
import java.lang.reflect.Constructor;
import java.net.HttpURLConnection;
import java.util.concurrent.ExecutionException;
@ -97,24 +100,46 @@ public class WebViewDlgHelper {
}
public static void createQQLoginDialog() {
QQLoginWebPane webPane = new QQLoginWebPane(new File(installHome).getAbsolutePath());
UIDialog qqlog = new QQLoginDialog(DesignerContext.getDesignerFrame(), webPane);
LoginWebBridge.getHelper().setQqDialog(qqlog);
qqlog.setVisible(true);
try {
Class<?> clazz = Class.forName("com.fr.design.extra.QQLoginWebPane");
Constructor constructor = clazz.getConstructor(String.class);
Component webPane = (Component) constructor.newInstance(new File(installHome).getAbsolutePath());
UIDialog qqLoginDialog = new QQLoginDialog(DesignerContext.getDesignerFrame(), webPane);
LoginWebBridge.getHelper().setQQDialog(qqLoginDialog);
qqLoginDialog.setVisible(true);
} catch (Throwable ignored) {
// ignored
}
}
private static void showPluginDlg(String mainJsPath) {
BasicPane managerPane = new ShopManagerPane(new PluginWebPane(mainJsPath));
UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane);
PluginWebBridge.getHelper().setDialogHandle(dlg);
dlg.setVisible(true);
try {
Class<?> clazz = Class.forName("com.fr.design.extra.PluginWebPane");
Constructor constructor = clazz.getConstructor(String.class);
Component webPane = (Component) constructor.newInstance(mainJsPath);
BasicPane managerPane = new ShopManagerPane(webPane);
UIDialog dlg = new ShopDialog(DesignerContext.getDesignerFrame(), managerPane);
PluginWebBridge.getHelper().setDialogHandle(dlg);
dlg.setVisible(true);
} catch (Throwable ignored) {
// ignored
}
}
private static void showLoginDlg() {
LoginWebPane webPane = new LoginWebPane(new File(installHome).getAbsolutePath());
UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane);
LoginWebBridge.getHelper().setDialogHandle(qqdlg);
qqdlg.setVisible(true);
try {
Class<?> clazz = Class.forName("com.fr.design.extra.LoginWebPane");
Constructor constructor = clazz.getConstructor(String.class);
Component webPane = (Component) constructor.newInstance(new File(installHome).getAbsolutePath());
UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), webPane);
LoginWebBridge.getHelper().setDialogHandle(qqdlg);
qqdlg.setVisible(true);
} catch (Throwable ignored) {
// ignored
}
}
private static Component initTraditionalStore() {
@ -136,6 +161,7 @@ public class WebViewDlgHelper {
PluginHelper.downloadPluginFile(scriptsId, username, password, new Process<Double>() {
@Override
public void process(Double integer) {
// ignored
}
});
} catch (PluginVerifyException e) {

6
designer_base/src/com/fr/design/locale/designer.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=
FR-Designer-BBSLogin_Connection-Failure=
FR-Designer-BBSLogin_Forgot-Password=
@ -1943,4 +1943,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load resource file
FR-Designer_Get_Activation_Code=Click\! Get user information code
FR-Designer_Display_Position=Display position
FR-Designer_Template-Version-Warning="Your template file is currently open by a later production designer, will continue to open the original template properties mistakes or risk losing Make sure your design template designer version lower than the deployment server version."

6
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=User name
FR-Designer-BBSLogin_Connection-Failure=Connection failure, check your network status
FR-Designer-BBSLogin_Forgot-Password=Forget Password
@ -1944,4 +1944,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet tab display location:
FR-Designer_Provide_Choose_All=Provide Select All
FR-Designer_Decimal_Places=Decimal Places:
FR-Base-Load_Resource_File=Load Configuration File
FR-Designer_Get_Activation_Code=Get Activation Code
FR-Designer_Display_Position=Position
FR-Designer_Template-Version-Warning=The current template file is designed by higher vision designer. Open it may result in losing original attributes or error. Please upgrade your designer. Make sure your designer version lower than the deployment server version.

6
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=\u30E6\u30FC\u30B6\u30FC\u540D
FR-Designer-BBSLogin_Connection-Failure=\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u63A5\u7D9A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\u73FE\u5728\u306E\u30CD\u30C3\u30C8\u30EF\u30FC\u30AF\u72B6\u614B\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044
FR-Designer-BBSLogin_Forgot-Password=\u30D1\u30B9\u30EF\u30FC\u30C9\u3092\u5FD8\u308C\u305F
@ -1944,4 +1944,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=Sheet\u30E9\u30D9\u30EB\u30DA\u30F
FR-Designer_Provide_Choose_All=\u5168\u9078\u629E\u53EF\u80FD
FR-Designer_Decimal_Places=\u5C0F\u6570\u67A0\u6570:
FR-Base-Load_Resource_File=\u8A2D\u5B9A\u30D5\u30A1\u30A4\u30EB\u30ED\u30FC\u30C9
FR-Designer_Get_Activation_Code=\u30AF\u30EA\u30C3\u30AF\u3057\u3066\!\u30A2\u30AF\u30C6\u30A3\u30D9\u30FC\u30C8\u30B3\u30FC\u30C9\u3092\u53D6\u5F97
FR-Designer_Display_Position=\u8868\u793A\u4F4D\u7F6E
FR-Designer_Template-Version-Warning=\u958B\u3044\u305F\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u30D5\u30A1\u30A4\u30EB\u306F\u3001\u4E0A\u4F4D\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u3067\u4F5C\u6210\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u4E0A\u4F4D\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3067\u4F5C\u6210\u3055\u308C\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304F\u3068\u30A8\u30E9\u30FC\u306E\u767A\u751F\u539F\u56E0\u3068\u306A\u308B\u307B\u304B\u3001\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306E\u6A5F\u80FD\u3084\u5C5E\u6027\u306E\u4E00\u90E8\u3092\u5931\u3046\u6050\u308C\u304C\u3042\u308A\u307E\u3059\u3002\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u4F5C\u6210\u7528\u306E\u30C7\u30B6\u30A4\u30CA\u30FC\u306E\u30D0\u30FC\u30B8\u30E7\u30F3\u304C\u3001\u914D\u5099\u3055\u308C\u308B\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3088\u308A\u3082\u4E0B\u4F4D\u306E\u30A8\u30C7\u30A3\u30B7\u30E7\u30F3\u3067\u3042\u308B\u3053\u3068\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002

6
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=\u7528\u6237\u540D
FR-Designer-BBSLogin_Connection-Failure=\uB124\uD2B8\uC6CC\uD06C\uB9C1\uD06C\uC2E4\uD328.\uD604\uC7AC\uB124\uD2B8\uC6CC\uD06C\uC0C1\uD0DC\uB97C\uAC80\uC0AC\uD574\uC8FC\uC2ED\uC2DC\uC624.
FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8BB0\u5BC6\u7801
@ -1943,4 +1943,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=
FR-Designer_Provide_Choose_All=\uC81C\uACF5\uBAA8\uB450\uC120\uD0DD
FR-Designer_Decimal_Places=\uC18C\uC218\uC218\uB7C9:
FR-Base-Load_Resource_File=\uB85C\uB529\uAD6C\uC131\uD30C\uC77C
FR-Designer_Get_Activation_Code=\!\uB97C\uD074\uB9AD\uD558\uC5EC\uD65C\uC131\uCF54\uB4DC\uB97C\uC5BB\uC2B5\uB2C8\uB2E4.
FR-Designer_Display_Position=\uC704\uCE58\uBCF4\uC774\uAE30
FR-Designer_Template-Version-Warning=\uD604\uC7AC\uC5F0\uD15C\uD50C\uB9BF\uD30C\uC77C\uC740\uB354\uB192\uC740\uBC84\uC804\uC758\uC124\uACC4\uAE30\uB85C\uC791\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\uC5F4\uACBD\uC6B0\uAE30\uC874\uD15C\uD50C\uB9BF\uC18D\uC131\uC774\uC624\uB958\uAC00\uB098\uAC70\uB098\uC190\uC0C1\uB420\uC704\uD5D8\uC774\uC788\uC2B5\uB2C8\uB2E4. \uC124\uACC4\uD55C\uD15C\uD50C\uB9BF\uC758\uC124\uACC4\uAE30\uBC84\uC804\uC774\uC124\uCE58\uB41C\uC11C\uBC84\uBC84\uC804\uBCF4\uB2E4\uB0AE\uC9C0\uC54A\uB3C4\uB85D\uD558\uC2ED\uC2DC\uC624.

6
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=\u7528\u6237\u540D
FR-Designer-BBSLogin_Connection-Failure=\u7F51\u7EDC\u8FDE\u63A5\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u5F53\u524D\u7F51\u7EDC\u72B6\u6001
FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8BB0\u5BC6\u7801
@ -1943,4 +1943,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6807\u7B7E\u9875\u663E\u793
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9009
FR-Designer_Decimal_Places=\u5C0F\u6570\u6570\u76EE\uFF1A
FR-Base-Load_Resource_File=\u52A0\u8F7D\u914D\u7F6E\u6587\u4EF6
FR-Designer_Get_Activation_Code=\u70B9\u51FB\!\u83B7\u53D6\u6FC0\u6D3B\u7801
FR-Designer_Display_Position=\u663E\u793A\u4F4D\u7F6E
FR-Designer_Template-Version-Warning="\u60A8\u5F53\u524D\u6253\u5F00\u7684\u6A21\u677F\u6587\u4EF6\u662F\u7531\u66F4\u9AD8\u7248\u672C\u7684\u8BBE\u8BA1\u5668\u5236\u4F5C\u7684\uFF0C\u7EE7\u7EED\u6253\u5F00\u4F1A\u6709\u51FA\u9519\u6216\u8005\u4E22\u5931\u539F\u6709\u6A21\u677F\u5C5E\u6027\u7684\u98CE\u9669\u3002 \u8BF7\u786E\u4FDD\u60A8\u8BBE\u8BA1\u7684\u6A21\u677F\u7684\u8BBE\u8BA1\u5668\u7248\u672C\u4F4E\u4E8E\u90E8\u7F72\u7684\u670D\u52A1\u5668\u7248\u672C\u3002"

6
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -1,4 +1,4 @@
# generated time: 星期二 十月 24 16:58:25 CST 2017
# generated time: \u661F\u671F\u4E8C \u5341\u6708 24 16:58:25 CST 2017
FR-Designer-BBSLogin_Account=\u767B\u5165\u5E33\u865F
FR-Designer-BBSLogin_Connection-Failure=\u767B\u5165\u9023\u63A5\u5931\u6557\uFF0C\u8ACB\u6AA2\u67E5\u7576\u524D\u7DB2\u8DEF\u72C0\u614B
FR-Designer-BBSLogin_Forgot-Password=\u5FD8\u8A18\u5BC6\u78BC
@ -1944,4 +1944,6 @@ FR-Designer_Sheet_Label_Page_Display_Position=sheet\u6A19\u7C64\u9801\u986F\u793
FR-Designer_Provide_Choose_All=\u63D0\u4F9B\u5168\u9078
FR-Designer_Decimal_Places=\u5C0F\u6578\u6578\u76EE\uFF1A
FR-Base-Load_Resource_File=\u52A0\u8F09\u914D\u7F6E\u6A94\u6848
FR-Designer_Get_Activation_Code=\u9EDE\u64CA\!\u7372\u53D6\u7528\u6236\u8A0A\u606F\u78BC
FR-Designer_Display_Position=\u986F\u793A\u4F4D\u7F6E
FR-Designer_Template-Version-Warning="\u60A8\u7576\u524D\u6253\u958B\u7684\u6A21\u677F\u6A94\u6848\u662F\u7531\u66F4\u9AD8\u7248\u672C\u7684\u8A2D\u8A08\u5668\u88FD\u4F5C\u7684\uFF0C\u7E7C\u7E8C\u6253\u958B\u6703\u6709\u51FA\u932F\u6216\u8005\u4E1F\u5931\u539F\u6709\u6A21\u677F\u5C6C\u6027\u7684\u98A8\u96AA\u3002 \u8ACB\u78BA\u4FDD\u60A8\u8A2D\u8A08\u7684\u6A21\u677F\u7684\u8A2D\u8A08\u5668\u7248\u672C\u4F4E\u65BC\u90E8\u7F72\u7684\u4F3A\u670D\u5668\u7248\u672C\u3002"

178
designer_base/src/com/fr/design/utils/concurrent/ThreadFactoryBuilder.java

@ -0,0 +1,178 @@
/*
* Copyright (C) 2010 The Guava Authors
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.fr.design.utils.concurrent;
import java.lang.Thread.UncaughtExceptionHandler;
import java.util.Locale;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicLong;
/**
* A ThreadFactory builder, providing any combination of these features:
* <ul>
* <li>whether threads should be marked as {@linkplain Thread#setDaemon daemon} threads
* <li>a {@linkplain ThreadFactoryBuilder#setNameFormat naming format}
* <li>a {@linkplain Thread#setPriority thread priority}
* <li>an {@linkplain Thread#setUncaughtExceptionHandler uncaught exception handler}
* <li>a {@linkplain ThreadFactory#newThread backing thread factory}
* </ul>
* <p>If no backing thread factory is provided, a default backing thread factory is used as if by
* calling {@code setThreadFactory(}{@link Executors#defaultThreadFactory()}{@code )}.
*
* @author Kurt Alfred Kluever
* @since 4.0
*/
public final class ThreadFactoryBuilder {
private String nameFormat = null;
private Boolean daemon = null;
private Integer priority = null;
private UncaughtExceptionHandler uncaughtExceptionHandler = null;
private ThreadFactory backingThreadFactory = null;
/**
* Creates a new {@link ThreadFactory} builder.
*/
public ThreadFactoryBuilder() {
// 这个注释毫无意义,就是为了通过SonarQube
}
/**
* Sets the naming format to use when naming threads ({@link Thread#setName}) which are created
* with this ThreadFactory.
*
* @param nameFormat a {@link String#format(String, Object...)}-compatible format String, to which
* a unique integer (0, 1, etc.) will be supplied as the single parameter. This integer will
* be unique to the built instance of the ThreadFactory and will be assigned sequentially. For
* example, {@code "rpc-pool-%d"} will generate thread names like {@code "rpc-pool-0"},
* {@code "rpc-pool-1"}, {@code "rpc-pool-2"}, etc.
* @return this for the builder pattern
*/
public ThreadFactoryBuilder setNameFormat(String nameFormat) {
String unused = format(nameFormat, 0); // fail fast if the format is bad or null
this.nameFormat = nameFormat;
return this;
}
/**
* Sets daemon or not for new threads created with this ThreadFactory.
*
* @param daemon whether or not new Threads created with this ThreadFactory will be daemon threads
* @return this for the builder pattern
*/
public ThreadFactoryBuilder setDaemon(boolean daemon) {
this.daemon = daemon;
return this;
}
/**
* Sets the priority for new threads created with this ThreadFactory.
*
* @param priority the priority for new Threads created with this ThreadFactory
* @return this for the builder pattern
*/
public ThreadFactoryBuilder setPriority(int priority) {
// Thread#setPriority() already checks for validity. These error messages
// are nicer though and will fail-fast.
if (priority < Thread.MIN_PRIORITY) {
throw new IllegalArgumentException(format("Thread priority (%s) must be >= %s", priority, Thread.MIN_PRIORITY));
}
if (priority > Thread.MAX_PRIORITY) {
throw new IllegalArgumentException(format("Thread priority (%s) must be <= %s", priority, Thread.MAX_PRIORITY));
}
this.priority = priority;
return this;
}
/**
* Sets the {@link UncaughtExceptionHandler} for new threads created with this ThreadFactory.
*
* @param uncaughtExceptionHandler the uncaught exception handler for new Threads created with
* this ThreadFactory
* @return this for the builder pattern
*/
public ThreadFactoryBuilder setUncaughtExceptionHandler(
UncaughtExceptionHandler uncaughtExceptionHandler) {
if (uncaughtExceptionHandler == null) {
throw new NullPointerException();
}
this.uncaughtExceptionHandler = uncaughtExceptionHandler;
return this;
}
/**
* Sets the backing {@link ThreadFactory} for new threads created with this ThreadFactory. Threads
* will be created by invoking #newThread(Runnable) on this backing {@link ThreadFactory}.
*
* @param backingThreadFactory the backing {@link ThreadFactory} which will be delegated to during
* thread creation.
* @return this for the builder pattern
*/
public ThreadFactoryBuilder setThreadFactory(ThreadFactory backingThreadFactory) {
if (backingThreadFactory == null) {
throw new NullPointerException();
}
this.backingThreadFactory = backingThreadFactory;
return this;
}
/**
* Returns a new thread factory using the options supplied during the building process. After
* building, it is still possible to change the options used to build the ThreadFactory and/or
* build again. State is not shared amongst built instances.
*
* @return the fully constructed {@link ThreadFactory}
*/
public ThreadFactory build() {
return doBuild(this);
}
// Split out so that the anonymous ThreadFactory can't contain a reference back to the builder.
// At least, I assume that's why. TODO(cpovirk): Check, and maybe add a test for this.
private static ThreadFactory doBuild(ThreadFactoryBuilder builder) {
final String nameFormat = builder.nameFormat;
final Boolean daemon = builder.daemon;
final Integer priority = builder.priority;
final UncaughtExceptionHandler uncaughtExceptionHandler = builder.uncaughtExceptionHandler;
final ThreadFactory backingThreadFactory =
(builder.backingThreadFactory != null)
? builder.backingThreadFactory
: Executors.defaultThreadFactory();
final AtomicLong count = (nameFormat != null) ? new AtomicLong(0) : null;
return new ThreadFactory() {
@Override
public Thread newThread(Runnable runnable) {
Thread thread = backingThreadFactory.newThread(runnable);
if (nameFormat != null) {
thread.setName(format(nameFormat, count.getAndIncrement()));
}
if (daemon != null) {
thread.setDaemon(daemon);
}
if (priority != null) {
thread.setPriority(priority);
}
if (uncaughtExceptionHandler != null) {
thread.setUncaughtExceptionHandler(uncaughtExceptionHandler);
}
return thread;
}
};
}
private static String format(String format, Object... args) {
return String.format(Locale.ROOT, format, args);
}
}

42
designer_base/src/com/fr/start/Demo.java

@ -8,42 +8,42 @@ import com.fr.stable.StableUtils;
import java.io.IOException;
public class Demo {
public static void main(String[] args) {
String installHome = StableUtils.getInstallHome();
if (installHome == null) {
FRContext.getLogger().error("Can not find the install home, please check it.");
return;
}
public static void main(String[] args) {
String installHome = StableUtils.getInstallHome();
if (installHome == null) {
FRContext.getLogger().error("Can not find the install home, please check it.");
return;
}
String executorPath;
if (OperatingSystem.isMacOS()) {
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app --args demo");
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.app");
} else {
executorPath = StableUtils.pathJoin(installHome, "bin", "designer.exe demo");
}
if (!new java.io.File(executorPath).exists()) {
FRContext.getLogger().error(executorPath + " can not be found.");
}
if (!new java.io.File(executorPath).exists()) {
FRContext.getLogger().error(executorPath + " can not be found.");
}
if (OperatingSystem.isMacOS()) {
ProcessBuilder builder = new ProcessBuilder();
builder.command("open -a", executorPath);
ProcessBuilder builder = new ProcessBuilder();
builder.command("open", "-a", executorPath, "--args", "demo");
try {
builder.start();
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
} else {
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
Runtime rt = Runtime.getRuntime();
try {
rt.exec(executorPath);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
// ProcessBuilder这种方式在window下报错:系统找不到指定文件
Runtime rt = Runtime.getRuntime();
try {
rt.exec(executorPath);
} catch (IOException e) {
FRContext.getLogger().error(e.getMessage(), e);
}
}
System.exit(0);
}
System.exit(0);
}
}

7
designer_chart/src/com/fr/design/mainframe/chart/gui/other/ChartInteractivePane.java

@ -659,13 +659,6 @@ public class ChartInteractivePane extends BasicScrollPane<Chart> implements UIOb
private void populateHyperlink(Plot plot) {
HashMap paneMap = renewMapWithPlot(plot);
//安装平台内打开插件时,添加相应按钮
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator();
paneMap.put(nc.getHyperlink(), nc.getUpdatePane());
}
List<UIMenuNameableCreator> list = refreshList(paneMap);
superLink.refreshMenuAndAddMenuAction(list);

6
designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java

@ -2,6 +2,7 @@ package com.fr.design.designer.properties;
import com.fr.design.designer.creator.*;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane;
@ -97,6 +98,11 @@ public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPr
if (row == 0) {
if (state == WBodyLayoutType.FIT.getTypeValue()) {
return switch2FitBodyLayout();
} else {
XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
if (xfl.toData().removeMargin()) {
DesignerContext.getDesignerFrame().getSelectedJTemplate().fireTargetModified();
}
}
}
if (row == 1) {

2
designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java

@ -12,6 +12,7 @@ import com.fr.design.mainframe.widget.editors.FitLayoutDirectionEditor;
import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
@ -152,6 +153,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xfl.getComponents();
xfl.removeAll();
xfl.toData().removeMargin();
XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0, 0));
xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {

Loading…
Cancel
Save