neil 9 years ago
parent
commit
cdf4bd1f9a
  1. 6
      designer/src/com/fr/design/mainframe/InformationCollector.java
  2. 331
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  3. 7
      designer/src/com/fr/design/webattr/WebSettingPane.java
  4. 23
      designer/src/com/fr/design/widget/WidgetPane.java
  5. 31
      designer_base/.classpath
  6. 14
      designer_base/src/com/fr/design/ExtraDesignClassManager.java
  7. 74
      designer_base/src/com/fr/design/actions/community/BBSAction.java
  8. 72
      designer_base/src/com/fr/design/actions/community/BugAction.java
  9. 70
      designer_base/src/com/fr/design/actions/community/NeedAction.java
  10. 69
      designer_base/src/com/fr/design/actions/community/QuestionAction.java
  11. 70
      designer_base/src/com/fr/design/actions/community/SignAction.java
  12. 70
      designer_base/src/com/fr/design/actions/community/UpAction.java
  13. 70
      designer_base/src/com/fr/design/actions/community/VideoAction.java
  14. 9
      designer_base/src/com/fr/design/actions/help/TutorialAction.java
  15. 2
      designer_base/src/com/fr/design/condition/LiteConditionPane.java
  16. 7
      designer_base/src/com/fr/design/dialog/BasicScrollPane.java
  17. 1
      designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java
  18. 2
      designer_base/src/com/fr/design/extra/PluginWebBridge.java
  19. 4
      designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java
  20. 17
      designer_base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java
  21. 4
      designer_base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java
  22. 1
      designer_base/src/com/fr/design/formula/FormulaPane.java
  23. 4
      designer_base/src/com/fr/design/formula/FormulaPaneWhenReserveFormula.java
  24. 25
      designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java
  25. 22
      designer_base/src/com/fr/design/fun/WidgetDesignHandler.java
  26. 11
      designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java
  27. 4
      designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java
  28. BIN
      designer_base/src/com/fr/design/images/bbs.png
  29. BIN
      designer_base/src/com/fr/design/images/bug.png
  30. BIN
      designer_base/src/com/fr/design/images/help.png
  31. BIN
      designer_base/src/com/fr/design/images/need.png
  32. BIN
      designer_base/src/com/fr/design/images/questions.png
  33. BIN
      designer_base/src/com/fr/design/images/signature.png
  34. BIN
      designer_base/src/com/fr/design/images/update.png
  35. BIN
      designer_base/src/com/fr/design/images/video.png
  36. 40
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  37. 25
      designer_base/src/com/fr/design/mainframe/widget/editors/FormattedEditor.java
  38. 6
      designer_base/src/com/fr/design/mingche.java
  39. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  40. 21
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyFitLayoutAdapter.java
  41. 20
      designer_form/src/com/fr/design/designer/creator/XWBodyFitLayout.java
  42. 7
      designer_form/src/com/fr/design/designer/creator/XWFitLayout.java
  43. 42
      designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java
  44. 83
      designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java
  45. 111
      designer_form/src/com/fr/design/designer/properties/BodyMobileLayoutPropertiesGroupModel.java
  46. 64
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
  47. 30
      designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java
  48. 39
      designer_form/src/com/fr/design/designer/properties/mobile/BooleanRender.java
  49. 25
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  50. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyUI.java
  51. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java
  52. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java
  53. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitRender.java
  54. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitWrapper.java
  55. 88
      designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java
  56. 59
      designer_form/src/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java
  57. 31
      designer_form/src/com/fr/design/mainframe/widget/editors/RefinedDoubleEditor.java

6
designer/src/com/fr/design/mainframe/InformationCollector.java

@ -35,8 +35,8 @@ import java.util.*;
*/ */
public class InformationCollector implements XMLReadable, XMLWriter { public class InformationCollector implements XMLReadable, XMLWriter {
//3天上传一次 // 24小时上传一次
private static final long DELTA = 3 * 24 * 3600 * 1000L; private static final long DELTA = 24 * 3600 * 1000L;
private static final long SEND_DELAY = 30 * 1000L; private static final long SEND_DELAY = 30 * 1000L;
private static final String FILE_NAME = "fr.info"; private static final String FILE_NAME = "fr.info";
private static final String XML_START_STOP_LIST = "StartStopList"; private static final String XML_START_STOP_LIST = "StartStopList";
@ -203,8 +203,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
//服务器返回true, 说明已经获取成功, 清空当前记录的信息 //服务器返回true, 说明已经获取成功, 清空当前记录的信息
if (success) { if (success) {
deleteLogDB(conn, table); deleteLogDB(conn, table);
//收集设计器信息的服务器下线了, 目测还要一段时间, 不在那边一起setLastTime了.
this.lastTime = dateToString();
} }
} }

331
designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java

@ -9,11 +9,9 @@ import com.fr.design.gui.ipasswordfield.UIPassWordField;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.*;
import com.fr.general.FRFont;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -24,8 +22,10 @@ import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.KeyListener; import java.awt.event.KeyListener;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URI; import java.net.URI;
import java.net.URLEncoder;
/** /**
* @author richie * @author richie
@ -36,14 +36,10 @@ public class BBSLoginDialog extends UIDialog {
private static final int DIALOG_WIDTH = 400; private static final int DIALOG_WIDTH = 400;
private static final int DIALOG_HEIGHT = 200; private static final int DIALOG_HEIGHT = 200;
private static final String URL = "http://bbs.finereport.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1";
private static final String PASSWORD_RESET_URL = "http://bbs.finereport.com/portal.php?mod=topic&topicid=2";
private static final String REGISTER_URL = "http://bbs.finereport.com/member.php?mod=register";
private static final String LOGIN_SUCCESS_FLAG = "http://bbs.finereport.com"; private static final String LOGIN_SUCCESS_FLAG = "http://bbs.finereport.com";
private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14); private static final Font DEFAULT_FONT = FRFont.getInstance(FRFont.DEFAULT_FONTNAME, 0, 14);
private static final String TEST_CONNECTION_URL = "http://bbs.finereport.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1&username=test&password=123456";
private static final int TIME_OUT = 10000; private static final int TIME_OUT = 10000;
private static final int BUTTON_WIDTH = 90; private static final int BUTTON_WIDTH = 90;
private static final int V_GAP = 20; private static final int V_GAP = 20;
private static final int BUTTON_H_GAP = 155; private static final int BUTTON_H_GAP = 155;
@ -56,212 +52,213 @@ public class BBSLoginDialog extends UIDialog {
private UILabel userLabel; private UILabel userLabel;
private UILabel passLabel; private UILabel passLabel;
private UITextField nameField; private UITextField nameField;
private UIPassWordField passField; private UIPassWordField passField;
private UIButton loginButton; private UIButton loginButton;
private UILabel tipLabel; private UILabel tipLabel;
private BoxCenterAligmentPane passwordReset; private BoxCenterAligmentPane passwordReset;
private BoxCenterAligmentPane registerLabel; private BoxCenterAligmentPane registerLabel;
private KeyListener keyListener = new KeyAdapter() { private KeyListener keyListener = new KeyAdapter() {
public void keyPressed(KeyEvent e){ public void keyPressed(KeyEvent e) {
int code = e.getKeyCode(); int code = e.getKeyCode();
if(KeyEvent.VK_ESCAPE == code){ if (KeyEvent.VK_ESCAPE == code) {
BBSLoginDialog.this.setVisible(false); BBSLoginDialog.this.setVisible(false);
return; return;
} }
if(KeyEvent.VK_ENTER == code){ if (KeyEvent.VK_ENTER == code) {
login(); login();
} }
} }
}; };
// 用户登录状态label // 用户登录状态label
private UserInfoLabel userInfoLabel; private UserInfoLabel userInfoLabel;
public UILabel getTipLabel() {
return tipLabel;
}
public void setTipLabel(UILabel tipLabel) { public UILabel getTipLabel() {
this.tipLabel = tipLabel; return tipLabel;
} }
public void setTipLabel(UILabel tipLabel) {
this.tipLabel = tipLabel;
}
/** /**
* 构造函数 * 构造函数
* @param parent 父窗口 *
* @param userInfoLabel 登录状态label * @param parent 父窗口
*/ * @param userInfoLabel 登录状态label
public BBSLoginDialog(Frame parent,UserInfoLabel userInfoLabel) { */
public BBSLoginDialog(Frame parent, UserInfoLabel userInfoLabel) {
super(parent); super(parent);
JPanel panel = (JPanel) getContentPane(); JPanel panel = (JPanel) getContentPane();
initComponents(panel); initComponents(panel);
this.userInfoLabel = userInfoLabel; this.userInfoLabel = userInfoLabel;
setSize(new Dimension(DIALOG_WIDTH,DIALOG_HEIGHT)); setSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
} }
private void initComponents(JPanel contentPane) { private void initComponents(JPanel contentPane) {
this.setTitle(Inter.getLocText("FR-Designer-BBSLogin_Login-Title")); this.setTitle(Inter.getLocText("FR-Designer-BBSLogin_Login-Title"));
tipLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip")); tipLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
userLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Account")+":"); userLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Account") + ":");
passLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Password")+":"); passLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Password") + ":");
nameField = new UITextField(); nameField = new UITextField();
passField = new UIPassWordField(); passField = new UIPassWordField();
loginButton = new UIButton(Inter.getLocText("FR-Designer-BBSLogin_Login")); loginButton = new UIButton(Inter.getLocText("FR-Designer-BBSLogin_Login"));
passwordReset = getURLActionLabel(PASSWORD_RESET_URL); passwordReset = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.reset"));
registerLabel = getURLActionLabel(REGISTER_URL); registerLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.register"));
loginButton.addActionListener(new ActionListener() { loginButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent arg0) { public void actionPerformed(ActionEvent arg0) {
login(); login();
} }
}); });
nameField.addKeyListener(keyListener); nameField.addKeyListener(keyListener);
passField.addKeyListener(keyListener); passField.addKeyListener(keyListener);
loginButton.addKeyListener(keyListener); loginButton.addKeyListener(keyListener);
userLabel.setFont(DEFAULT_FONT); userLabel.setFont(DEFAULT_FONT);
passLabel.setFont(DEFAULT_FONT); passLabel.setFont(DEFAULT_FONT);
this.tipLabel.setVisible(false); this.tipLabel.setVisible(false);
contentPane.setLayout(new BorderLayout()); contentPane.setLayout(new BorderLayout());
JPanel mainPane = new JPanel(); JPanel mainPane = new JPanel();
mainPane.setLayout(new BorderLayout(0,V_GAP)); mainPane.setLayout(new BorderLayout(0, V_GAP));
initNorthPane(mainPane); initNorthPane(mainPane);
initCenterPane(mainPane); initCenterPane(mainPane);
initSouthPane(mainPane); initSouthPane(mainPane);
contentPane.add(mainPane,BorderLayout.NORTH); contentPane.add(mainPane, BorderLayout.NORTH);
this.setResizable(false); this.setResizable(false);
} }
private void login(){ private void login() {
if(nameField.getText().isEmpty()){ if (nameField.getText().isEmpty()) {
tipForUsernameEmpty(); tipForUsernameEmpty();
nameField.requestFocus(); nameField.requestFocus();
return; return;
} }
if(String.valueOf(passField.getPassword()).isEmpty()){ if (String.valueOf(passField.getPassword()).isEmpty()) {
tipForPasswordEmpty(); tipForPasswordEmpty();
passField.requestFocus(); passField.requestFocus();
return; return;
} }
if(!testConnection()){ if (!testConnection()) {
connectionFailue(); connectionFailue();
return; return;
} }
if(login(nameField.getText(),String.valueOf(passField.getPassword()))){ if (login(nameField.getText(), String.valueOf(passField.getPassword()))) {
loginSuccess(); loginSuccess();
}else{ } else {
loginFailure(); loginFailure();
} }
} }
private boolean testConnection(){ private boolean testConnection() {
HttpClient client = new HttpClient(TEST_CONNECTION_URL); HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.test"));
return client.isServerAlive(); return client.isServerAlive();
} }
private void initNorthPane(JPanel mainPane){ private void initNorthPane(JPanel mainPane) {
JPanel northPane = new JPanel(); JPanel northPane = new JPanel();
northPane.setPreferredSize(new Dimension(DIALOG_WIDTH,NORTH_PANE_HEIGHT)); northPane.setPreferredSize(new Dimension(DIALOG_WIDTH, NORTH_PANE_HEIGHT));
northPane.add(tipLabel); northPane.add(tipLabel);
mainPane.add(northPane,BorderLayout.NORTH); mainPane.add(northPane, BorderLayout.NORTH);
} }
private void initCenterPane(JPanel mainPane){ private void initCenterPane(JPanel mainPane) {
JPanel loginPane = new JPanel(); JPanel loginPane = new JPanel();
loginPane.setLayout(new GridLayout(2,1,0,V_GAP)); loginPane.setLayout(new GridLayout(2, 1, 0, V_GAP));
JPanel namePane = new JPanel(); JPanel namePane = new JPanel();
namePane.setLayout(new FlowLayout(FlowLayout.RIGHT,FLOWLAYOUT_H_GAP,0)); namePane.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOWLAYOUT_H_GAP, 0));
namePane.add(userLabel); namePane.add(userLabel);
nameField.setPreferredSize(new Dimension(FIELD_WIDTH,FIELD_HEIGHT)); nameField.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
namePane.add(nameField); namePane.add(nameField);
namePane.add(passwordReset); namePane.add(passwordReset);
loginPane.add(namePane); loginPane.add(namePane);
JPanel passPane = new JPanel(); JPanel passPane = new JPanel();
passPane.setLayout(new FlowLayout(FlowLayout.RIGHT,FLOWLAYOUT_H_GAP,0)); passPane.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOWLAYOUT_H_GAP, 0));
passPane.add(passLabel); passPane.add(passLabel);
passPane.add(passField); passPane.add(passField);
passField.setPreferredSize(new Dimension(FIELD_WIDTH,FIELD_HEIGHT)); passField.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
passPane.add(registerLabel); passPane.add(registerLabel);
loginPane.add(passPane); loginPane.add(passPane);
mainPane.add(loginPane,BorderLayout.CENTER); mainPane.add(loginPane, BorderLayout.CENTER);
} }
private void initSouthPane(JPanel mainPane){ private void initSouthPane(JPanel mainPane) {
JPanel southPane = new JPanel(); JPanel southPane = new JPanel();
southPane.setLayout(new FlowLayout(FlowLayout.RIGHT,BUTTON_H_GAP,0)); southPane.setLayout(new FlowLayout(FlowLayout.RIGHT, BUTTON_H_GAP, 0));
loginButton.setPreferredSize(new Dimension(BUTTON_WIDTH,FIELD_HEIGHT)); loginButton.setPreferredSize(new Dimension(BUTTON_WIDTH, FIELD_HEIGHT));
loginButton.setFont(DEFAULT_FONT); loginButton.setFont(DEFAULT_FONT);
southPane.add(loginButton); southPane.add(loginButton);
mainPane.add(southPane,BorderLayout.SOUTH); mainPane.add(southPane, BorderLayout.SOUTH);
} }
// 登录成功 // 登录成功
private void loginSuccess(){ private void loginSuccess() {
DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword())); DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword()));
userInfoLabel.setUserName(nameField.getText()); userInfoLabel.setUserName(nameField.getText());
userInfoLabel.getUserInfoPane().markSignIn(nameField.getText()); userInfoLabel.getUserInfoPane().markSignIn(nameField.getText());
userInfoLabel.getUserInfoPane().getSwitchAccountLabel().setVisible(true); userInfoLabel.getUserInfoPane().getSwitchAccountLabel().setVisible(true);
BBSLoginDialog.this.setVisible(false); BBSLoginDialog.this.setVisible(false);
} }
// 登录失败 // 登录失败
private void loginFailure(){ private void loginFailure() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip")); setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
} }
private void tipForUsernameEmpty(){ private void tipForUsernameEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Username-Empty-Tip")); setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Username-Empty-Tip"));
} }
public void showTipForDownloadPluginWithoutLogin() { public void showTipForDownloadPluginWithoutLogin() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Download-Unlogin-Tip")); setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Download-Unlogin-Tip"));
} }
private void tipForPasswordEmpty(){ private void tipForPasswordEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Password-Empty-Tip")); setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Password-Empty-Tip"));
} }
private void setLoginFailureTxt(String errorTxt){ private void setLoginFailureTxt(String errorTxt) {
tipLabel.setText(errorTxt); tipLabel.setText(errorTxt);
tipLabel.setForeground(Color.RED); tipLabel.setForeground(Color.RED);
tipLabel.repaint(); tipLabel.repaint();
tipLabel.setVisible(true); tipLabel.setVisible(true);
} }
// 连接失败 // 连接失败
private void connectionFailue(){ private void connectionFailue() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Connection-Failure")); setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Connection-Failure"));
} }
/** /**
* 清楚登录信息 * 清楚登录信息
*/ */
public void clearLoginInformation(){ public void clearLoginInformation() {
tipLabel.setText(StringUtils.EMPTY); tipLabel.setText(StringUtils.EMPTY);
nameField.setText(StringUtils.EMPTY); nameField.setText(StringUtils.EMPTY);
passField.setText(StringUtils.EMPTY); passField.setText(StringUtils.EMPTY);
} }
/** /**
* 显示登录窗口 * 显示登录窗口
*/ */
public void showWindow(){ public void showWindow() {
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
setVisible(true); setVisible(true);
} }
@ -273,39 +270,45 @@ public class BBSLoginDialog extends UIDialog {
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
/** /**
* 是否登陆成功 * 是否登陆成功
*
* @param username 用户名 * @param username 用户名
* @param password 密码 * @param password 密码
* @return 同上 * @return 同上
*/ */
public static boolean login(String username,String password){ public static boolean login(String username, String password) {
String url = URL + "&username=" + username + "&password=" + password; try {
HttpClient client = new HttpClient(url); username = URLEncoder.encode(username, EncodeConstants.ENCODING_GBK);
client.setTimeout(TIME_OUT); } catch (UnsupportedEncodingException e) {
if(client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK){ FRLogger.getLogger().error(e.getMessage());
try { }
String res = client.getResponseText("GBK"); String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password;
if(res.contains(LOGIN_SUCCESS_FLAG)){ HttpClient client = new HttpClient(url);
return true; client.setTimeout(TIME_OUT);
} if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) {
} catch (Exception e) { try {
FRLogger.getLogger().error(e.getMessage()); String res = client.getResponseText(EncodeConstants.ENCODING_GBK);
} if (res.contains(LOGIN_SUCCESS_FLAG)) {
} return true;
return false; }
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
return false;
} }
private BoxCenterAligmentPane getURLActionLabel(final String url){ private BoxCenterAligmentPane getURLActionLabel(final String url) {
ActionLabel actionLabel = new ActionLabel(url); ActionLabel actionLabel = new ActionLabel(url);
if(ComparatorUtils.equals(url, PASSWORD_RESET_URL)){ if (ComparatorUtils.equals(url, SiteCenter.getInstance().acquireUrlByKind("bbs.reset"))) {
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Forgot-Password")); actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Forgot-Password"));
}else{ } else {
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account")); actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account"));
} }
actionLabel.addActionListener(new ActionListener() { actionLabel.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
try { try {
@ -315,14 +318,14 @@ public class BBSLoginDialog extends UIDialog {
} }
} }
}); });
return new BoxCenterAligmentPane(actionLabel); return new BoxCenterAligmentPane(actionLabel);
} }
class BoxCenterAligmentPane extends JPanel { class BoxCenterAligmentPane extends JPanel {
private UILabel textLabel; private UILabel textLabel;
public BoxCenterAligmentPane(String text) { public BoxCenterAligmentPane(String text) {
this(new UILabel(text)); this(new UILabel(text));
} }

7
designer/src/com/fr/design/webattr/WebSettingPane.java

@ -4,6 +4,7 @@ import com.fr.base.ConfigManager;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -81,9 +82,9 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
} }
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
allPanel.add(panel,BorderLayout.CENTER); UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(allPanel,BorderLayout.CENTER); this.add(scrollPane, BorderLayout.CENTER);
} }
ItemListener itemListener = new ItemListener() { ItemListener itemListener = new ItemListener() {

23
designer/src/com/fr/design/widget/WidgetPane.java

@ -1,19 +1,20 @@
package com.fr.design.widget; package com.fr.design.widget;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.fun.WidgetDesignHandler;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.dialog.BasicPane; import com.fr.design.widget.btn.ButtonConstants;
import com.fr.form.ui.Button; import com.fr.form.ui.Button;
import com.fr.form.ui.*; import com.fr.form.ui.*;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.design.widget.btn.ButtonConstants;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -61,16 +62,22 @@ public class WidgetPane extends BasicPane implements ItemListener {
/** /**
* 状态改变 * 状态改变
*
* @param e 事件对象 * @param e 事件对象
*/ */
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
Widget oldWidget = update();
Widget selectedItem = editorTypeComboBox.getCellWidget();
WidgetDesignHandler handler = ExtraDesignClassManager.getInstance().getWidgetDesignHandler();
if (handler != null) {
handler.transferWidgetProperties(oldWidget, selectedItem);
}
if (e.getItem() instanceof Item && ((Item) e.getItem()).getValue() instanceof WidgetConfig) { if (e.getItem() instanceof Item && ((Item) e.getItem()).getValue() instanceof WidgetConfig) {
populate(editorTypeComboBox.getCellWidget()); populate(selectedItem);
return; return;
} }
if (shouldFireSelectedEvent) { if (shouldFireSelectedEvent) {
Widget selectedItem = editorTypeComboBox.getCellWidget();
populateWidgetConfig(selectedItem); populateWidgetConfig(selectedItem);
} }
} }
@ -109,9 +116,9 @@ public class WidgetPane extends BasicPane implements ItemListener {
public Widget update() { public Widget update() {
return cellEditorCardPane.update(); return cellEditorCardPane.update();
} }
protected void populateWidgetConfig(Widget widget) { protected void populateWidgetConfig(Widget widget) {
cellEditorCardPane.populate(widget); cellEditorCardPane.populate(widget);
} }
@ -190,12 +197,13 @@ public class WidgetPane extends BasicPane implements ItemListener {
} }
private WidgetOption[] getWidgetOptions() { private WidgetOption[] getWidgetOptions() {
return (WidgetOption[])ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions()); return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions());
} }
} }
/** /**
* 校验 * 校验
*
* @throws Exception 抛出异常 * @throws Exception 抛出异常
*/ */
public void checkValid() throws Exception { public void checkValid() throws Exception {
@ -222,6 +230,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
/** /**
* 转化成字符串形式 * 转化成字符串形式
*
* @return 返回字符串 * @return 返回字符串
*/ */
public String toString() { public String toString() {

31
designer_base/.classpath

@ -1,33 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/> <classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-core-8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/> <classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-third-8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/> <classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="/lib/jetty/activation.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-el.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-logging.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-compiler.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-runtime.jar"/>
<classpathentry kind="lib" path="/lib/jetty/javax.servlet.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jaxrpc.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mail.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-remote.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-tools.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jmx.jar"/>
<classpathentry kind="lib" path="/lib/jetty/saaj.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xml-apis.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xmlParserAPIs.jar"/>
<classpathentry kind="lib" path="/lib/3rd.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/>
<classpathentry kind="lib" path="/lib/junit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<classpathentry kind="lib" path="/lib/olap4j-1.1.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-file"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

14
designer_base/src/com/fr/design/ExtraDesignClassManager.java

@ -130,15 +130,25 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
private Set<ElementUIProvider> elementUIProviders; private Set<ElementUIProvider> elementUIProviders;
private Set<VerifyDefineProvider> verifyDefineProviders;
private Set<WidgetPropertyUIProvider> widgetAttrProviders; private Set<WidgetPropertyUIProvider> widgetAttrProviders;
private Set<ExportAttrTabProvider> exportAttrTabProviders; private Set<ExportAttrTabProvider> exportAttrTabProviders;
private WidgetDesignHandler widgetDesignHandler;
private Set<BackgroundQuickUIProvider> backgroundQuickUIProviders; private Set<BackgroundQuickUIProvider> backgroundQuickUIProviders;
private Set<BackgroundUIProvider> backgroundUIProviders; private Set<BackgroundUIProvider> backgroundUIProviders;
private Set<VerifyDefineProvider> verifyDefineProviders; public WidgetDesignHandler getWidgetDesignHandler() {
return widgetDesignHandler;
}
public void setWidgetDesignHandler(Level level, PluginSimplify simplify) throws Exception {
widgetDesignHandler = (WidgetDesignHandler) level;
}
public TableDataPaneProcessor getTableDataPaneProcessor() { public TableDataPaneProcessor getTableDataPaneProcessor() {
return tableDataPaneProcessor; return tableDataPaneProcessor;
@ -911,6 +921,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addSupportDesignApps(impl, simplify); addSupportDesignApps(impl, simplify);
} else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) { } else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) {
setEnvProcessor(impl, simplify); setEnvProcessor(impl, simplify);
} else if (tagName.equals(WidgetDesignHandler.XML_TAG)) {
setWidgetDesignHandler(impl, simplify);
} else if (tagName.equals(TableDataPaneProcessor.XML_TAG)) { } else if (tagName.equals(TableDataPaneProcessor.XML_TAG)) {
setTableDataPaneProcessor(impl, simplify); setTableDataPaneProcessor(impl, simplify);
} else if (tagName.equals(ElementUIProvider.MARK_STRING)) { } else if (tagName.equals(ElementUIProvider.MARK_STRING)) {

74
designer_base/src/com/fr/design/actions/community/BBSAction.java

@ -0,0 +1,74 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class BBSAction extends UpdateAction
{
public BBSAction()
{
this.setMenuKeySet(BBS);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bbs.png"));
}
/**
* 动作
* @param e 事件
*/
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet BBS = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'B';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_BBS");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

72
designer_base/src/com/fr/design/actions/community/BugAction.java

@ -0,0 +1,72 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class BugAction extends UpdateAction
{
public BugAction()
{ this.setMenuKeySet(BUG);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/bug.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.bugs");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet BUG = new MenuKeySet() {
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_BUG");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
@Override
public char getMnemonic()
{
return 'U';
}
};
}

70
designer_base/src/com/fr/design/actions/community/NeedAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class NeedAction extends UpdateAction
{
public NeedAction()
{
this.setMenuKeySet(NEED);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/need.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.needs");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet NEED = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'N';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_NEED");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

69
designer_base/src/com/fr/design/actions/community/QuestionAction.java

@ -0,0 +1,69 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class QuestionAction extends UpdateAction
{
public QuestionAction()
{ this.setMenuKeySet(QUESTIONS);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/questions.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.questions");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet QUESTIONS = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'Q';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_QUESTIONS");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

70
designer_base/src/com/fr/design/actions/community/SignAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class SignAction extends UpdateAction
{
public SignAction()
{
this.setMenuKeySet(SIGN);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/signature.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.aut");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet SIGN = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'S';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_SIGN");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

70
designer_base/src/com/fr/design/actions/community/UpAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class UpAction extends UpdateAction
{
public UpAction()
{
this.setMenuKeySet(UPDATE);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/update.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.update");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet UPDATE = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'U';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_UPDATE");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

70
designer_base/src/com/fr/design/actions/community/VideoAction.java

@ -0,0 +1,70 @@
package com.fr.design.actions.community;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.stable.StringUtils;
public class VideoAction extends UpdateAction
{
public VideoAction()
{
this.setMenuKeySet(VIDEO);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/video.png"));
}
@Override
public void actionPerformed(ActionEvent arg0)
{
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.video");
if (StringUtils.isEmpty(url)) {
FRContext.getLogger().info("The URL is empty!");
return;
}
try {
Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (Exception exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url);
}
}
public static final MenuKeySet VIDEO = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'V';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_COMMUNITY_VIDEO");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}

9
designer_base/src/com/fr/design/actions/help/TutorialAction.java

@ -17,6 +17,7 @@ import com.fr.design.actions.UpdateAction;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
@ -28,7 +29,7 @@ public class TutorialAction extends UpdateAction {
this.setMenuKeySet(HELP_TUTORIAL); this.setMenuKeySet(HELP_TUTORIAL);
this.setName(getMenuKeySet().getMenuName()); this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic()); this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_help/help.png")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/help.png"));
this.setAccelerator(getMenuKeySet().getKeyStroke()); this.setAccelerator(getMenuKeySet().getKeyStroke());
} }
@ -60,10 +61,10 @@ public class TutorialAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) { public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale(); Locale locale = FRContext.getLocale();
if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)){ if (ComparatorUtils.equals(locale, Locale.CHINA) || ComparatorUtils.equals(locale, Locale.TAIWAN)){
HttpClient client = new HttpClient(ProductConstants.HELP_URL); HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("help"));
if(client.getResponseCode() != -1) { if(client.getResponseCode() != -1) {
try { try {
Desktop.getDesktop().browse(new URI(ProductConstants.HELP_URL)); Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("help")));
return; return;
} catch (Exception e) { } catch (Exception e) {
//出了异常的话, 依然打开本地教程 //出了异常的话, 依然打开本地教程
@ -86,7 +87,7 @@ public class TutorialAction extends UpdateAction {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M_Help-Tutorial"); return Inter.getLocText("FR-Designer_COMMUNITY_HELP");
} }
@Override @Override

2
designer_base/src/com/fr/design/condition/LiteConditionPane.java

@ -517,6 +517,8 @@ public abstract class LiteConditionPane<T extends Condition> extends BasicBeanPa
// formulaPane // formulaPane
JPanel formulaPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel formulaPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 95106 公式区域限定宽高, 显示两行即可, 在新窗口编辑.
formulaPane.setPreferredSize(new Dimension(450, 40));
formulaConditionPane.add(formulaPane, BorderLayout.CENTER); formulaConditionPane.add(formulaPane, BorderLayout.CENTER);
formulaPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 2)); formulaPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 2));
formulaPane.add(GUICoreUtils.createBorderPane(new UILabel(Inter.getLocText("FR-Designer_LiteCondition_Formula") + "="), BorderLayout.NORTH), BorderLayout.WEST); formulaPane.add(GUICoreUtils.createBorderPane(new UILabel(Inter.getLocText("FR-Designer_LiteCondition_Formula") + "="), BorderLayout.NORTH), BorderLayout.WEST);

7
designer_base/src/com/fr/design/dialog/BasicScrollPane.java

@ -154,8 +154,8 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
scrollBar.setVisible(false); scrollBar.setVisible(false);
} else { } else {
boolean show = isShowScrollBar(); boolean show = isShowScrollBar();
scrollBar.setEnabled(show); scrollBar.setEnabled(show);
scrollBar.setVisible(show); scrollBar.setVisible(show);
} }
maxheight = getHeight() - DET_HEIGHT; maxheight = getHeight() - DET_HEIGHT;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) { if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
@ -180,7 +180,8 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
} }
leftcontentPane.validate(); leftcontentPane.validate();
} }
}
}
protected boolean isShowScrollBar() { protected boolean isShowScrollBar() {
return true; return true;

1
designer_base/src/com/fr/design/editor/editor/ColumnSelectedEditor.java

@ -13,7 +13,6 @@ import com.fr.stable.StringUtils;
import java.awt.*; import java.awt.*;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.*;
import java.util.List; import java.util.List;
import java.util.regex.Pattern; import java.util.regex.Pattern;

2
designer_base/src/com/fr/design/extra/PluginWebBridge.java

@ -36,8 +36,6 @@ public class PluginWebBridge {
private UIDialog uiDialog; private UIDialog uiDialog;
public static final String PLUGIN_SHOP = SiteCenter.getInstance().acquireUrlByKind("plugin.plist");
public static PluginWebBridge getHelper() { public static PluginWebBridge getHelper() {
if (helper != null) { if (helper != null) {
return helper; return helper;

4
designer_base/src/com/fr/design/extra/exe/GetPluginFromStoreExecutor.java

@ -1,8 +1,8 @@
package com.fr.design.extra.exe; package com.fr.design.extra.exe;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -38,7 +38,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
StringBuilder url = new StringBuilder(PluginWebBridge.PLUGIN_SHOP); StringBuilder url = new StringBuilder(SiteCenter.getInstance().acquireUrlByKind("plugin.plist"));
if (StringUtils.isNotBlank(category)) { if (StringUtils.isNotBlank(category)) {
url.append("&cid=").append(category.split("-")[1]); url.append("&cid=").append(category.split("-")[1]);
} }

17
designer_base/src/com/fr/design/extra/exe/ReadUpdateOnlineExecutor.java

@ -3,8 +3,11 @@ package com.fr.design.extra.exe;
import com.fr.design.extra.PluginsReaderFromStore; import com.fr.design.extra.PluginsReaderFromStore;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.plugin.Plugin; import com.fr.plugin.Plugin;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
/** /**
* Created by vito on 16/4/19. * Created by vito on 16/4/19.
@ -31,15 +34,13 @@ public class ReadUpdateOnlineExecutor implements Executor {
public void run(Process<String> process) { public void run(Process<String> process) {
try { try {
plugins = PluginsReaderFromStore.readPluginsForUpdate(); plugins = PluginsReaderFromStore.readPluginsForUpdate();
StringBuilder sb = new StringBuilder(); JSONArray jsonArray = new JSONArray();
if (plugins != null) { for (Plugin plugin : plugins) {
sb.append("["); JSONObject jsonObject = new JSONObject();
for (Plugin plugin : plugins) { jsonObject.put("pluginid", plugin.getId());
sb.append("{pluginid:'").append(plugin.getId()).append("'}"); jsonArray.put(jsonObject);
}
sb.append("]");
} }
result = sb.toString(); result = jsonArray.toString();
} catch (Exception e) { } catch (Exception e) {
FRLogger.getLogger().error(e.getMessage()); FRLogger.getLogger().error(e.getMessage());
} }

4
designer_base/src/com/fr/design/extra/exe/SearchOnlineExecutor.java

@ -1,8 +1,8 @@
package com.fr.design.extra.exe; package com.fr.design.extra.exe;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.Process; import com.fr.design.extra.Process;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -34,7 +34,7 @@ public class SearchOnlineExecutor implements Executor {
@Override @Override
public void run(Process<String> process) { public void run(Process<String> process) {
try { try {
HttpClient httpClient = new HttpClient(PluginWebBridge.PLUGIN_SHOP + "&keyword=" + keyword); HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.plist") + "&keyword=" + keyword);
result = httpClient.getResponseText(); result = httpClient.getResponseText();
} catch (Exception e) { } catch (Exception e) {

1
designer_base/src/com/fr/design/formula/FormulaPane.java

@ -166,6 +166,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula{
checkValidButton.addActionListener(checkValidActionListener); checkValidButton.addActionListener(checkValidActionListener);
JPanel checkBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel checkBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
checkBoxPane.setPreferredSize(new Dimension(450, 30));
checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.WEST); checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.WEST);
checkBoxandbuttonPane.add(checkValidButton, BorderLayout.EAST); checkBoxandbuttonPane.add(checkValidButton, BorderLayout.EAST);

4
designer_base/src/com/fr/design/formula/FormulaPaneWhenReserveFormula.java

@ -25,7 +25,7 @@ public class FormulaPaneWhenReserveFormula extends FormulaPane {
@Override @Override
protected void extendCheckBoxPane(JPanel checkBoxPane) { protected void extendCheckBoxPane(JPanel checkBoxPane) {
// peter:添加公式是否兼容Excel的属性 // peter:添加公式是否兼容Excel的属性
reserveCheckBox4Result = new UICheckBox(Inter.getLocText("FormulaD-Reserve_when_export-edit_result")); reserveCheckBox4Result = new UICheckBox(Inter.getLocText("FR-Designer_Export-Save-Formula"));
reserveCheckBox4Result.setSelected(false); reserveCheckBox4Result.setSelected(false);
reserveCheckBox4Result.addChangeListener(new ChangeListener() { reserveCheckBox4Result.addChangeListener(new ChangeListener() {
@ -38,7 +38,7 @@ public class FormulaPaneWhenReserveFormula extends FormulaPane {
} }
} }
}); });
reserveCheckBox4Write = new UICheckBox(Inter.getLocText("FormulaD-Reserve_when_bs-write_or_analy")); reserveCheckBox4Write = new UICheckBox(Inter.getLocText("FR-Designer_Write-Save-Formula"));
reserveCheckBox4Write.setSelected(false); reserveCheckBox4Write.setSelected(false);
checkBoxPane.add(reserveCheckBox4Result, BorderLayout.CENTER); checkBoxPane.add(reserveCheckBox4Result, BorderLayout.CENTER);

25
designer_base/src/com/fr/design/fun/ExportAttrTabProvider.java

@ -8,16 +8,41 @@ import javax.swing.*;
/** /**
* Created by vito on 16/5/5. * Created by vito on 16/5/5.
*/ */
/**
* 导出属性Tab页的接口
*/
public interface ExportAttrTabProvider extends Level{ public interface ExportAttrTabProvider extends Level{
String XML_TAG = "ExportAttrTabProvider"; String XML_TAG = "ExportAttrTabProvider";
int CURRENT_LEVEL = 1; int CURRENT_LEVEL = 1;
/**
* 转换成SwingComponent
*
* @return JComponent
*/
JComponent toSwingComponent(); JComponent toSwingComponent();
/**
* 转换成AbstractExportPane
*
* @return AbstractExportPane
*/
AbstractExportPane toExportPane(); AbstractExportPane toExportPane();
/**
* tab的标题
*
* @return
*/
String title(); String title();
/**
* tag标签
*
* @return tag名称
* @deprecated 将来不使用tag作为区分
*/
String tag(); String tag();
} }

22
designer_base/src/com/fr/design/fun/WidgetDesignHandler.java

@ -0,0 +1,22 @@
package com.fr.design.fun;
import com.fr.form.ui.Widget;
import com.fr.stable.fun.Level;
/**
* Coder: zack
* Date: 2016/5/12
* Time: 10:37
*/
public interface WidgetDesignHandler extends Level {
String XML_TAG = "WidgetDesignHandler";
int CURRENT_LEVEL = 1;
/**
* 传递控件共有属性
*
* @param oldWidget 老控件
* @param newWidget 新控件
*/
void transferWidgetProperties(Widget oldWidget, Widget newWidget);
}

11
designer_base/src/com/fr/design/fun/impl/AbstractWidgetDesignHandler.java

@ -0,0 +1,11 @@
package com.fr.design.fun.impl;
import com.fr.design.fun.WidgetDesignHandler;
/**
* Coder: zack
* Date: 2016/5/12
* Time: 10:41
*/
public abstract class AbstractWidgetDesignHandler implements WidgetDesignHandler {
}

4
designer_base/src/com/fr/design/gui/icontainer/UIResizableContainer.java

@ -175,6 +175,10 @@ public class UIResizableContainer extends JPanel {
@Override @Override
public void layoutContainer(Container parent) { public void layoutContainer(Container parent) {
if (verticalToolPane == null || downPane == null) {
return;
}
if (direction == Constants.RIGHT) { if (direction == Constants.RIGHT) {
if(isDownPaneVisible){ if(isDownPaneVisible){
upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY); upPane.setBounds(0, 0, containerWidth - toolPaneHeight, toolPaneY);

BIN
designer_base/src/com/fr/design/images/bbs.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
designer_base/src/com/fr/design/images/bug.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
designer_base/src/com/fr/design/images/help.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

BIN
designer_base/src/com/fr/design/images/need.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
designer_base/src/com/fr/design/images/questions.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
designer_base/src/com/fr/design/images/signature.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B

BIN
designer_base/src/com/fr/design/images/update.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
designer_base/src/com/fr/design/images/video.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

40
designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -8,6 +8,13 @@ import com.fr.base.FRContext;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.community.BBSAction;
import com.fr.design.actions.community.BugAction;
import com.fr.design.actions.community.NeedAction;
import com.fr.design.actions.community.QuestionAction;
import com.fr.design.actions.community.SignAction;
import com.fr.design.actions.community.UpAction;
import com.fr.design.actions.community.VideoAction;
import com.fr.design.actions.file.CloseCurrentTemplateAction; import com.fr.design.actions.file.CloseCurrentTemplateAction;
import com.fr.design.actions.file.ExitDesignerAction; import com.fr.design.actions.file.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef; import com.fr.design.actions.file.OpenRecentReportMenuDef;
@ -149,6 +156,8 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单 // 添加帮助菜单
menuList.add(createHelpMenuDef()); menuList.add(createHelpMenuDef());
// 添加社区菜单
menuList.add(createCommunityMenuDef());
return menuList.toArray(new MenuDef[menuList.size()]); return menuList.toArray(new MenuDef[menuList.size()]);
} }
@ -306,14 +315,14 @@ public abstract class ToolBarMenuDock {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>(); java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new WebDemoAction()); shortCuts.add(new WebDemoAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new TutorialAction()); //shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) { if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) {
shortCuts.add(new FeedBackAction()); shortCuts.add(new FeedBackAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new SupportQQAction()); shortCuts.add(new SupportQQAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());
} }
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AboutAction()); shortCuts.add(new AboutAction());
@ -321,7 +330,22 @@ public abstract class ToolBarMenuDock {
return shortCuts.toArray(new ShortCut[shortCuts.size()]); return shortCuts.toArray(new ShortCut[shortCuts.size()]);
} }
/**
* 创建社区子菜单
* @return 社区菜单的子菜单
*/
public ShortCut[] createCommunityShortCuts() {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new BBSAction());
shortCuts.add(new VideoAction());
shortCuts.add(new TutorialAction());
shortCuts.add(new QuestionAction());
shortCuts.add(new UpAction());
shortCuts.add(new NeedAction());
shortCuts.add(new BugAction());
shortCuts.add(new SignAction());
return shortCuts.toArray(new ShortCut[shortCuts.size()]);
}
private MenuDef createHelpMenuDef() { private MenuDef createHelpMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H'); MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H');
ShortCut[] otherHelpShortCuts = createHelpShortCuts(); ShortCut[] otherHelpShortCuts = createHelpShortCuts();
@ -331,7 +355,15 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.HELP); insertMenu(menuDef, MenuHandler.HELP);
return menuDef; return menuDef;
} }
private MenuDef createCommunityMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_COMMUNITY"), 'C');
ShortCut[] otherCommunityShortCuts = createCommunityShortCuts();
for (ShortCut shortCut : otherCommunityShortCuts) {
menuDef.addShortCut(shortCut);
}
insertMenu(menuDef, MenuHandler.HELP);
return menuDef;
}
/** /**
* 生成工具栏 * 生成工具栏
* *

25
designer_base/src/com/fr/design/mainframe/widget/editors/FormattedEditor.java

@ -4,6 +4,7 @@ import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.text.Format; import java.text.Format;
import java.text.ParseException; import java.text.ParseException;
@ -32,17 +33,21 @@ public class FormattedEditor extends AbstractPropertyEditor {
textField = new JFormattedTextField(format); textField = new JFormattedTextField(format);
panel.add(textField, BorderLayout.CENTER); panel.add(textField, BorderLayout.CENTER);
textField.setBorder(null); textField.setBorder(null);
textField.addKeyListener(new KeyAdapter() { textField.addKeyListener(createKeyListener());
}
protected KeyListener createKeyListener() {
return new KeyAdapter() {
public void keyReleased(KeyEvent e) { public void keyReleased(KeyEvent e) {
try { try {
textField.commitEdit(); textField.commitEdit();
} catch (ParseException e1) { } catch (ParseException e1) {
return; return;
} }
firePropertyChanged(); firePropertyChanged();
} }
}); };
} }
@Override @Override

6
designer_base/src/com/fr/design/mingche.java

@ -0,0 +1,6 @@
package com.fr.design;
public class mingche
{
}

1
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -199,6 +199,7 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
condition.setColorStyle(ChartConstants.COLOR_DEFAULT); condition.setColorStyle(ChartConstants.COLOR_DEFAULT);
} }
} else { } else {
condition.setCustomFillStyle(true);
if(gradientButton.isSelected()) { if(gradientButton.isSelected()) {
condition.setColorStyle(ChartConstants.COLOR_GRADIENT); condition.setColorStyle(ChartConstants.COLOR_GRADIENT);
Color start = colorGradient.getSelectColorPointBtnP1().getColorInner(); Color start = colorGradient.getSelectColorPointBtnP1().getColorInner();

21
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRBodyFitLayoutAdapter.java

@ -0,0 +1,21 @@
package com.fr.design.designer.beans.adapters.layout;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.properties.BodyMobileLayoutPropertiesGroupModel;
public class FRBodyFitLayoutAdapter extends FRFitLayoutAdapter {
public FRBodyFitLayoutAdapter(XLayoutContainer container) {
super(container);
}
/**
* 返回布局自身属性方便一些特有设置在layout刷新时处理
*/
@Override
public GroupModel getLayoutProperties() {
XWFitLayout xfl = (XWFitLayout) container;
return new BodyMobileLayoutPropertiesGroupModel(xfl);
}
}

20
designer_form/src/com/fr/design/designer/creator/XWBodyFitLayout.java

@ -0,0 +1,20 @@
package com.fr.design.designer.creator;
import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRBodyFitLayoutAdapter;
import com.fr.form.ui.container.WFitLayout;
import java.awt.Dimension;
public class XWBodyFitLayout extends XWFitLayout {
public XWBodyFitLayout() {
this(new WFitLayout(), new Dimension());
}
public XWBodyFitLayout(WFitLayout widget, Dimension initSize) {
super(widget, initSize);
}
@Override
public LayoutAdapter getLayoutAdapter() {
return new FRBodyFitLayoutAdapter(this);
}
}

7
designer_form/src/com/fr/design/designer/creator/XWFitLayout.java

@ -13,7 +13,9 @@ import com.fr.design.designer.beans.LayoutAdapter;
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter;
import com.fr.design.designer.beans.location.Direction; import com.fr.design.designer.beans.location.Direction;
import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout;
import com.fr.design.designer.properties.mobile.BodyMobilePropertyUI;
import com.fr.design.form.layout.FRFitLayout; import com.fr.design.form.layout.FRFitLayout;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormArea;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.PaddingMargin; import com.fr.form.ui.PaddingMargin;
@ -1155,5 +1157,10 @@ public class XWFitLayout extends XLayoutContainer {
public XLayoutContainer findNearestFit() { public XLayoutContainer findNearestFit() {
return this; return this;
} }
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(new XWBodyFitLayout())};
}
} }

42
designer_form/src/com/fr/design/designer/creator/XWTitleLayout.java

@ -1,5 +1,5 @@
/** /**
* *
*/ */
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
@ -25,17 +25,17 @@ import java.awt.event.ContainerEvent;
public class XWTitleLayout extends DedicateLayoutContainer { public class XWTitleLayout extends DedicateLayoutContainer {
/** /**
* *
*/ */
private static final long serialVersionUID = 5274572473978467325L; private static final long serialVersionUID = 5274572473978467325L;
public XWTitleLayout() { public XWTitleLayout() {
super(new WTitleLayout("titlePane"), new Dimension()); super(new WTitleLayout("titlePane"), new Dimension());
} }
/** /**
* 容器构造函数 * 容器构造函数
* *
* @param widget 控件widget * @param widget 控件widget
* @param initSize 尺寸大小 * @param initSize 尺寸大小
*/ */
@ -58,17 +58,17 @@ public class XWTitleLayout extends DedicateLayoutContainer {
public LayoutAdapter getLayoutAdapter() { public LayoutAdapter getLayoutAdapter() {
return new FRTitleLayoutAdapter(this); return new FRTitleLayoutAdapter(this);
} }
/** /**
* 返回容器对应的wlayout * 返回容器对应的wlayout
* *
* @return 同上 * @return 同上
*/ */
@Override @Override
public WTitleLayout toData() { public WTitleLayout toData() {
return (WTitleLayout) data; return (WTitleLayout) data;
} }
/** /**
* 重置组件的名称 * 重置组件的名称
* @param name 名称 * @param name 名称
@ -77,20 +77,20 @@ public class XWTitleLayout extends DedicateLayoutContainer {
super.resetCreatorName(name); super.resetCreatorName(name);
// 有标题的话,标题的名字也要重置下 // 有标题的话,标题的名字也要重置下
if (getXCreatorCount() > 1) { if (getXCreatorCount() > 1) {
getTitleCreator().toData().setWidgetName(WidgetTitle.TITLE_NAME_INDEX + name); getTitleCreator().toData().setWidgetName(WidgetTitle.TITLE_NAME_INDEX + name);
} }
} }
/** /**
* 返回默认组件name * 返回默认组件name
* *
* @return 容器名 * @return 容器名
*/ */
@Override @Override
public String createDefaultName() { public String createDefaultName() {
return "titlePanel"; return "titlePanel";
} }
/** /**
* 返回标题组件 * 返回标题组件
* @return 标题组件 * @return 标题组件
@ -104,7 +104,7 @@ public class XWTitleLayout extends DedicateLayoutContainer {
} }
return null; return null;
} }
/** /**
* 将WLayout转换为XLayoutContainer * 将WLayout转换为XLayoutContainer
*/ */
@ -128,7 +128,7 @@ public class XWTitleLayout extends DedicateLayoutContainer {
/** /**
* 组件增加 * 组件增加
* *
* @param e 容器事件 * @param e 容器事件
*/ */
@Override @Override
@ -139,17 +139,17 @@ public class XWTitleLayout extends DedicateLayoutContainer {
WTitleLayout layout = this.toData(); WTitleLayout layout = this.toData();
XWidgetCreator creator = (XWidgetCreator) e.getChild(); XWidgetCreator creator = (XWidgetCreator) e.getChild();
FRTitleLayout lay = (FRTitleLayout) getLayout(); FRTitleLayout lay = (FRTitleLayout) getLayout();
Object constraints = lay.getConstraints(creator); Object constraints = lay.getConstraints(creator);
if (ComparatorUtils.equals(WTitleLayout.TITLE,constraints)) { if (ComparatorUtils.equals(WTitleLayout.TITLE,constraints)) {
layout.addTitle(creator.toData(), creator.getBounds()); layout.addTitle(creator.toData(), creator.getBounds());
} else if (ComparatorUtils.equals(WTitleLayout.BODY,constraints)) { } else if (ComparatorUtils.equals(WTitleLayout.BODY,constraints)) {
layout.addBody(creator.toData(), creator.getBounds()); layout.addBody(creator.toData(), creator.getBounds());
} }
} }
/** /**
* 组件删除 * 组件删除
* *
* @param e * @param e
* 容器事件 * 容器事件
*/ */

83
designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java

@ -0,0 +1,83 @@
package com.fr.design.designer.properties;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import javax.swing.JTable;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.*;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.gui.itable.PropertyGroup;
import com.fr.design.designer.beans.LayoutAdapter;
public class BodyAppRelayoutTable extends AbstractPropertyTable {
private XWBodyFitLayout xwBodyFitLayout;
public BodyAppRelayoutTable(XWBodyFitLayout xwBodyFitLayout) {
super();
setDesigner(xwBodyFitLayout);
}
public static ArrayList<PropertyGroup> getCreatorPropertyGroup(XCreator source) {
ArrayList<PropertyGroup> groups = new ArrayList<PropertyGroup>();
if (source instanceof XLayoutContainer) {
LayoutAdapter layoutAdapter = ((XLayoutContainer)source).getLayoutAdapter();
if(layoutAdapter != null){
GroupModel m = layoutAdapter.getLayoutProperties();
if (m != null) {
groups.add(new PropertyGroup(m));
}
}
}
return groups;
}
/**
* 初始化属性表组
* @param source 控件
*/
public void initPropertyGroups(Object source) {
groups = getCreatorPropertyGroup(xwBodyFitLayout);
TableModel model = new BeanTableModel();
setModel(model);
this.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
TableColumn tc = this.getColumn(this.getColumnName(0));
tc.setPreferredWidth(30);
this.repaint();
}
private void setDesigner(XWBodyFitLayout xwBodyFitLayout) {
this.xwBodyFitLayout = xwBodyFitLayout;
}
/**
* 单元格tooltip
* 属性名悬浮提示
*
* @param 鼠标点击事件
* @return 单元格tooltip
*/
public String getToolTipText(MouseEvent event) {
int row = BodyAppRelayoutTable.super.rowAtPoint(event.getPoint());
int column = BodyAppRelayoutTable.super.columnAtPoint(event.getPoint());
if(row != -1 && column == 0){
return String.valueOf(this.getValueAt(row, column));
}
return null;
}
/**
* 待说明
*/
public void firePropertyEdit() {
}
}

111
designer_form/src/com/fr/design/designer/properties/BodyMobileLayoutPropertiesGroupModel.java

@ -0,0 +1,111 @@
package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
import com.fr.form.ui.container.WFitLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class BodyMobileLayoutPropertiesGroupModel implements GroupModel {
private PropertyCellEditor reLayoutEditor;
private CheckBoxCellRenderer reLayoutrenderer;
private WFitLayout layout;
private XWFitLayout xfl;
public BodyMobileLayoutPropertiesGroupModel(XWFitLayout xfl) {
this.xfl = xfl;
this.layout = xfl.toData();
reLayoutrenderer = new CheckBoxCellRenderer();
reLayoutEditor = new PropertyCellEditor(new BooleanEditor());
}
@Override
public String getGroupName() {
return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout");
}
@Override
public int getRowCount() {
return 1;
}
@Override
public TableCellRenderer getRenderer(int row) {
return reLayoutrenderer;
}
@Override
public TableCellEditor getEditor(int row) {
return reLayoutEditor;
}
@Override
public Object getValue(int row, int column) {
if (column == 0) {
return Inter.getLocText("FR-Designer-App_ReLayout");
}else {
return layout.getAppRelayout();
}
}
@Override
public boolean setValue(Object value, int row, int column) {
int state = 0;
boolean appRelayoutState = true;
if(value instanceof Integer) {
state = (Integer)value;
}else if (value instanceof Boolean) {
appRelayoutState = (boolean)value;
}
if (column == 0 || state < 0) {
return false;
} else {
layout.setAppRelayout(appRelayoutState);
return true;
}
}
/**
* 是否可编辑
* @param row
* @return
*/
@Override
public boolean isEditable(int row) {
return true;
}
private class CheckBoxCellRenderer extends UICheckBox implements TableCellRenderer {
public CheckBoxCellRenderer() {
super();
setOpaque(true);
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value instanceof Boolean) {
setSelected(((Boolean) value).booleanValue());
setEnabled(table.isCellEditable(row, column));
if (isSelected) {
setBackground(table.getSelectionBackground());
setForeground(table.getSelectionForeground());
} else {
setForeground(table.getForeground());
setBackground(table.getBackground());
}
} else {
return null;
}
return this;
}
}
}

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

@ -5,19 +5,15 @@ package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel; import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.mainframe.widget.editors.BooleanEditor;
import com.fr.design.mainframe.widget.editors.FitLayoutDirectionEditor; import com.fr.design.mainframe.widget.editors.FitLayoutDirectionEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor; import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor; import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor; import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer; import javax.swing.table.TableCellRenderer;
import java.awt.*;
/** /**
* 自适应布局自身的属性表 * 自适应布局自身的属性表
@ -32,8 +28,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
private DefaultTableCellRenderer renderer; private DefaultTableCellRenderer renderer;
private FitLayoutDirectionEditor stateEditor; private FitLayoutDirectionEditor stateEditor;
private FitStateRenderer stateRenderer; private FitStateRenderer stateRenderer;
private PropertyCellEditor reLayoutEditor;
private CheckBoxCellRenderer reLayoutrenderer;
private WFitLayout layout; private WFitLayout layout;
private XWFitLayout xfl; private XWFitLayout xfl;
@ -44,8 +38,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
editor = new PropertyCellEditor(new IntegerPropertyEditor()); editor = new PropertyCellEditor(new IntegerPropertyEditor());
stateEditor = new FitLayoutDirectionEditor(); stateEditor = new FitLayoutDirectionEditor();
stateRenderer = new FitStateRenderer(); stateRenderer = new FitStateRenderer();
reLayoutrenderer = new CheckBoxCellRenderer();
reLayoutEditor = new PropertyCellEditor(new BooleanEditor());
} }
/** /**
@ -58,7 +50,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
@Override @Override
public int getRowCount() { public int getRowCount() {
return 3; return 2;
} }
@Override @Override
@ -66,11 +58,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) { switch (row) {
case 0: case 0:
return renderer; return renderer;
case 1:
return stateRenderer;
default: default:
return reLayoutrenderer; return stateRenderer;
} }
} }
@ -79,10 +68,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) { switch (row) {
case 0: case 0:
return editor; return editor;
case 1:
return stateEditor;
default: default:
return reLayoutEditor; return stateEditor;
} }
} }
@ -92,19 +79,15 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) { switch (row) {
case 0: case 0:
return Inter.getLocText("FR-Designer_Component_Interval"); return Inter.getLocText("FR-Designer_Component_Interval");
case 1 :
return Inter.getLocText("FR-Designer_Component_Scale");
default: default:
return Inter.getLocText("FR-Designer-App_ReLayout"); return Inter.getLocText("FR-Designer_Component_Scale");
} }
} else { } else {
switch (row) { switch (row) {
case 0: case 0:
return layout.getCompInterval(); return layout.getCompInterval();
case 1 :
return layout.getCompState();
default: default:
return layout.getAppRelayout(); return layout.getCompState();
} }
} }
} }
@ -112,11 +95,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
@Override @Override
public boolean setValue(Object value, int row, int column) { public boolean setValue(Object value, int row, int column) {
int state = 0; int state = 0;
boolean appRelayoutState = true;
if(value instanceof Integer) { if(value instanceof Integer) {
state = (Integer)value; state = (Integer)value;
} else if (value instanceof Boolean) {
appRelayoutState = (boolean) value;
} }
if (column == 0 || state < 0) { if (column == 0 || state < 0) {
return false; return false;
@ -128,10 +108,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
}else if (row == 1) { }else if (row == 1) {
layout.setCompState(state); layout.setCompState(state);
return true; return true;
} else if (row == 2) { }
layout.setAppRelayout(appRelayoutState);
return true;
}
return false; return false;
} }
} }
@ -155,33 +132,4 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
public boolean isEditable(int row) { public boolean isEditable(int row) {
return true; return true;
} }
private class CheckBoxCellRenderer extends UICheckBox implements TableCellRenderer {
public CheckBoxCellRenderer() {
super();
setOpaque(true);
}
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value instanceof Boolean) {
setSelected(((Boolean) value).booleanValue());
setEnabled(table.isCellEditable(row, column));
if (isSelected) {
setBackground(table.getSelectionBackground());
setForeground(table.getSelectionForeground());
} else {
setForeground(table.getForeground());
setBackground(table.getBackground());
}
} else {
return null;
}
return this;
}
}
} }

30
designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java

@ -0,0 +1,30 @@
package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWBodyFitLayout;
import com.fr.design.designer.properties.BodyAppRelayoutTable;
import com.fr.design.fun.impl.AbstractWidgetPropertyUIProvider;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.general.Inter;
/**
* Created by Administrator on 2016/5/16/0016.
*/
public class BodyMobilePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator;
public BodyMobilePropertyUI(XWBodyFitLayout xWBodyFitLayout) {
this.xCreator = xWBodyFitLayout;
}
@Override
public AbstractPropertyTable createWidgetAttrTable() {
return new BodyAppRelayoutTable((XWBodyFitLayout) xCreator);
}
@Override
public String tableTitle() {
return Inter.getLocText("FR-Designer_Mobile-Attr");
}
}

39
designer_form/src/com/fr/design/designer/properties/mobile/BooleanRender.java

@ -0,0 +1,39 @@
package com.fr.design.designer.properties.mobile;
import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;
import javax.swing.plaf.UIResource;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class BooleanRender extends JCheckBox implements TableCellRenderer, UIResource {
private static final Border noFocusBorder = new EmptyBorder(1, 0, 0, 0);
public BooleanRender() {
super();
setHorizontalAlignment(JLabel.LEFT);
setBorderPainted(true);
}
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
if (isSelected) {
setForeground(table.getSelectionForeground());
super.setBackground(table.getSelectionBackground());
}
else {
setForeground(table.getForeground());
setBackground(table.getBackground());
}
setSelected((value != null && ((Boolean)value).booleanValue()));
if (hasFocus) {
setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
} else {
setBorder(noFocusBorder);
}
return this;
}
}

25
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java

@ -1,17 +1,18 @@
package com.fr.design.designer.properties.mobile; package com.fr.design.designer.properties.mobile;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.CRPropertyDescriptor; import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.gui.itable.PropertyGroup;
import com.fr.design.gui.xtable.PropertyGroupModel; import com.fr.design.gui.xtable.ReportAppPropertyGroupModel;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;;
import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor;
import com.fr.design.mainframe.widget.editors.RefinedDoubleEditor;
import com.fr.form.ui.ElementCaseEditor; import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -27,17 +28,20 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
private XCreator xCreator; private XCreator xCreator;
private FormDesigner designer; private FormDesigner designer;
private boolean cascade = false;
public ElementCasePropertyTable(XCreator xCreator) { public ElementCasePropertyTable(XCreator xCreator) {
this.xCreator = xCreator; this.xCreator = xCreator;
} }
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr().getState() == 2 && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) { if (((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL && !((ElementCaseEditor ) xCreator.toData()).isHeightRestrict()) {
((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true); ((ElementCaseEditor ) xCreator.toData()).setHeightRestrict(true);
cascade = true;
return revealHeightLimit(); return revealHeightLimit();
} }
CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault(); CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault();
cascade = ((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL;
return crp; return crp;
} }
@ -53,6 +57,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")),
new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class) new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightrestrict")) .setI18NName(Inter.getLocText("Form-EC_heightrestrict"))
.setRendererClass(BooleanRender.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App"))
}; };
List<CRPropertyDescriptor> defaultList = new ArrayList<>(); List<CRPropertyDescriptor> defaultList = new ArrayList<>();
@ -65,7 +70,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException { protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException {
CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.xCreator.toData().getClass()) CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.xCreator.toData().getClass())
.setEditorClass(DoubleEditor.class) .setEditorClass(RefinedDoubleEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightpercent")) .setI18NName(Inter.getLocText("Form-EC_heightpercent"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties(); ArrayList<CRPropertyDescriptor> defaultList = (ArrayList<CRPropertyDescriptor>) createNonListenerProperties();
@ -91,7 +96,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
} }
groups.add(new PropertyGroup(new PropertyGroupModel(Inter.getLocText("FR-Designer_Fit-App"), xCreator, propertyTableEditor, designer))); groups.add(new PropertyGroup(new ReportAppPropertyGroupModel(Inter.getLocText("FR-Designer_Fit-App"), xCreator, propertyTableEditor, designer)));
TableModel model = new BeanTableModel(); TableModel model = new BeanTableModel();
setModel(model); setModel(model);
@ -103,6 +108,14 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_EDITED);
} }
@Override
public boolean isCellEditable(int row, int column) {
if (cascade && row ==3 ) {
return false;
}
return super.isCellEditable(row, column);
}
public void populate(FormDesigner designer) { public void populate(FormDesigner designer) {
this.designer = designer; this.designer = designer;
initPropertyGroups(this.designer.getTarget()); initPropertyGroups(this.designer.getTarget());

2
designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyUI.java

@ -9,7 +9,7 @@ import com.fr.general.Inter;
/** /**
* Created by Administrator on 2016/5/16/0016. * Created by Administrator on 2016/5/16/0016.
*/ */
public class ElementCasePropertyUI extends AbstractWidgetPropertyUIProvider{ public class ElementCasePropertyUI extends AbstractWidgetPropertyUIProvider {
private XCreator xCreator; private XCreator xCreator;

2
designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java

@ -4,7 +4,7 @@ import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.Item;
import com.fr.design.designer.properties.items.ItemProvider; import com.fr.design.designer.properties.items.ItemProvider;
public class MobileFitAlignmentItems implements ItemProvider{ public class MobileFitAlignmentItems implements ItemProvider {
private static Item[] VALUE_ITEMS; private static Item[] VALUE_ITEMS;

2
designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java

@ -6,7 +6,7 @@ import com.fr.design.mainframe.widget.editors.ComboEditor;
import java.util.Vector; import java.util.Vector;
public class MobileFitEditor extends ComboEditor{ public class MobileFitEditor extends ComboEditor {
public MobileFitEditor() { public MobileFitEditor() {
this(new MobileFitAlignmentItems()); this(new MobileFitAlignmentItems());
} }

2
designer_form/src/com/fr/design/designer/properties/mobile/MobileFitRender.java

@ -2,7 +2,7 @@ package com.fr.design.designer.properties.mobile;
import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer; import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
public class MobileFitRender extends EncoderCellRenderer{ public class MobileFitRender extends EncoderCellRenderer {
public MobileFitRender(){ public MobileFitRender(){
super(new MobileFitWrapper()); super(new MobileFitWrapper());

2
designer_form/src/com/fr/design/designer/properties/mobile/MobileFitWrapper.java

@ -2,7 +2,7 @@ package com.fr.design.designer.properties.mobile;
import com.fr.design.designer.properties.ItemWrapper; import com.fr.design.designer.properties.ItemWrapper;
public class MobileFitWrapper extends ItemWrapper{ public class MobileFitWrapper extends ItemWrapper {
public MobileFitWrapper(){ public MobileFitWrapper(){
super(new MobileFitAlignmentItems()); super(new MobileFitAlignmentItems());
} }

88
designer_form/src/com/fr/design/gui/xtable/PropertyGroupModel.java

@ -17,16 +17,16 @@ import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
public class PropertyGroupModel extends AbstractPropertyGroupModel { public class PropertyGroupModel extends AbstractPropertyGroupModel {
private FormDesigner designer; private FormDesigner designer;
public PropertyGroupModel(String name, XCreator creator, CRPropertyDescriptor[] propArray, public PropertyGroupModel(String name, XCreator creator, CRPropertyDescriptor[] propArray,
FormDesigner designer) { FormDesigner designer) {
super(name, creator, propArray); super(name, creator, propArray);
this.designer = designer; this.designer = designer;
} }
@Override @Override
public Object getValue(int row, int column) { public Object getValue(int row, int column) {
if (column == 0) { if (column == 0) {
return properties[row].getDisplayName(); return properties[row].getDisplayName();
@ -49,9 +49,9 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
try { try {
Method m = properties[row].getWriteMethod(); Method m = properties[row].getWriteMethod();
m.invoke(dealCreatorData(), value); m.invoke(dealCreatorData(), value);
//属性名称为控件名时,单独处理下 //属性名称为控件名时,单独处理下
if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){ if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){
creator.resetCreatorName(value.toString()); creator.resetCreatorName(value.toString());
} }
properties[row].firePropertyChanged(); properties[row].firePropertyChanged();
return true; return true;
@ -103,49 +103,49 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
PROPERTIES.add("Properties"); PROPERTIES.add("Properties");
PROPERTIES.add("Others"); PROPERTIES.add("Others");
} }
/** /**
* 控件属性赋值和取值时针对scale和title做下处理 * 控件属性赋值和取值时针对scale和title做下处理
* @return * @return
*/ */
private Object dealCreatorData() { private Object dealCreatorData() {
return creator.getPropertyDescriptorCreator().toData(); return creator.getPropertyDescriptorCreator().toData();
} }
@Override @Override
protected void initEditor(final int row) throws Exception { protected void initEditor(final int row) throws Exception {
ExtendedPropertyEditor editor = (ExtendedPropertyEditor) properties[row].createPropertyEditor(dealCreatorData()); ExtendedPropertyEditor editor = (ExtendedPropertyEditor) properties[row].createPropertyEditor(dealCreatorData());
if (editor == null) { if (editor == null) {
Class propType = properties[row].getPropertyType(); Class propType = properties[row].getPropertyType();
editor = TableUtils.getPropertyEditorClass(propType).newInstance(); editor = TableUtils.getPropertyEditorClass(propType).newInstance();
} }
if (editor != null) { if (editor != null) {
final ExtendedPropertyEditor extendEditor = editor; final ExtendedPropertyEditor extendEditor = editor;
editors[row] = new PropertyCellEditor(editor); editors[row] = new PropertyCellEditor(editor);
extendEditor.addPropertyChangeListener(new PropertyChangeListener() { extendEditor.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if(ComparatorUtils.equals(extendEditor.getValue(),getValue(row,1))) { if(ComparatorUtils.equals(extendEditor.getValue(),getValue(row,1))) {
return; return;
} }
if (extendEditor.refreshInTime()) { if (extendEditor.refreshInTime()) {
editors[row].stopCellEditing(); editors[row].stopCellEditing();
} else { } else {
setValue(extendEditor.getValue(), row, 1); setValue(extendEditor.getValue(), row, 1);
if (designer == null) { if (designer == null) {
return; return;
} }
if ("widgetName".equals(properties[row].getName())) { if ("widgetName".equals(properties[row].getName())) {
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_RENAMED); designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_RENAMED);
} else { } else {
designer.fireTargetModified(); designer.fireTargetModified();
} }
designer.refreshDesignerUI(); designer.refreshDesignerUI();
} }
} }
}); });
} }
} }
} }

59
designer_form/src/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java

@ -0,0 +1,59 @@
package com.fr.design.gui.xtable;
import com.fr.base.FRContext;
import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.mainframe.FormDesigner;
import com.fr.general.Inter;
import java.lang.reflect.Method;
import com.fr.general.ComparatorUtils;
import com.fr.report.stable.FormConstants;
import javax.swing.*;
public class ReportAppPropertyGroupModel extends PropertyGroupModel {
private static final double MAX_HEIGHT = 0.8;
public ReportAppPropertyGroupModel(String name, XCreator creator, CRPropertyDescriptor[] propArray,
FormDesigner designer) {
super(name, creator, propArray, designer);
}
@Override
public boolean setValue(Object value, int row, int column) {
double state = 0;
if (column == 0) {
return false;
}
if (value instanceof Double) {
state = (Double) value;
}
try {
Method m = properties[row].getWriteMethod();
if (state > MAX_HEIGHT) {
//弹窗提示
JOptionPane.showMessageDialog(null,
Inter.getLocText("FR-Designer_Mobile-Warning"),
Inter.getLocText("FR-Designer_Tooltips"),
JOptionPane.PLAIN_MESSAGE);
return false;
}
m.invoke(dealCreatorData(), value);
//属性名称为控件名时,单独处理下
if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){
creator.resetCreatorName(value.toString());
}
properties[row].firePropertyChanged();
return true;
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage(), e);
return false;
}
}
private Object dealCreatorData() {
return creator.getPropertyDescriptorCreator().toData();
}
}

31
designer_form/src/com/fr/design/mainframe/widget/editors/RefinedDoubleEditor.java

@ -0,0 +1,31 @@
package com.fr.design.mainframe.widget.editors;
import javax.swing.*;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.text.ParseException;
public class RefinedDoubleEditor extends DoubleEditor {
private JFormattedTextField textField;
public RefinedDoubleEditor() {
super();
textField = (JFormattedTextField) super.getCustomEditor();
}
@Override
public KeyListener createKeyListener() {
return new KeyAdapter() {
public void keyReleased(KeyEvent e) {
try {
textField.commitEdit();
return;
} catch (ParseException e1) {
}
}
};
}
}
Loading…
Cancel
Save