Browse Source

Merge pull request #159 in BA/design from ~NEIL/design:release to dev

* commit 'bc36de71e74ee794eaef650b7f265f5f51f0ad2f': (62 commits)
  冲突
  rt
  冲突修正
  冲突
  冲突
  1
  1
  冲突
  rt
  代码质量
  灰化已实现~效果还不错哈~
  1
  1
  韩文设计器按钮撑开.
  提示框简化,更简洁了
  1. 重写了自己的model来在set属性值之前进行判断并给出弹窗提示; 2. 继承DoubleEditor来实现兼容弹窗显示效果的控件,复原之前基础控件的所有更改。
  dev->master
  基础控件类抽取需要的代码单独作一个方法,在子类中重写
  重载输入框的光标事件方法,不管是光标移出还是按下回车(enter),会立即触发表单移动端高度属性的setter方法,并给出弹窗提示。
  class重命名
  ...
master
superman 9 years ago
parent
commit
aede8ca34b
  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 {
//3天上传一次
private static final long DELTA = 3 * 24 * 3600 * 1000L;
// 24小时上传一次
private static final long DELTA = 24 * 3600 * 1000L;
private static final long SEND_DELAY = 30 * 1000L;
private static final String FILE_NAME = "fr.info";
private static final String XML_START_STOP_LIST = "StartStopList";
@ -203,8 +203,6 @@ public class InformationCollector implements XMLReadable, XMLWriter {
//服务器返回true, 说明已经获取成功, 清空当前记录的信息
if (success) {
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.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -24,8 +22,10 @@ import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URLEncoder;
/**
* @author richie
@ -36,14 +36,10 @@ public class BBSLoginDialog extends UIDialog {
private static final int DIALOG_WIDTH = 400;
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 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 BUTTON_WIDTH = 90;
private static final int V_GAP = 20;
private static final int BUTTON_H_GAP = 155;
@ -56,212 +52,213 @@ public class BBSLoginDialog extends UIDialog {
private UILabel userLabel;
private UILabel passLabel;
private UITextField nameField;
private UIPassWordField passField;
private UIPassWordField passField;
private UIButton loginButton;
private UILabel tipLabel;
private BoxCenterAligmentPane passwordReset;
private BoxCenterAligmentPane registerLabel;
private KeyListener keyListener = new KeyAdapter() {
public void keyPressed(KeyEvent e){
int code = e.getKeyCode();
if(KeyEvent.VK_ESCAPE == code){
BBSLoginDialog.this.setVisible(false);
return;
}
if(KeyEvent.VK_ENTER == code){
login();
}
}
};
public void keyPressed(KeyEvent e) {
int code = e.getKeyCode();
if (KeyEvent.VK_ESCAPE == code) {
BBSLoginDialog.this.setVisible(false);
return;
}
if (KeyEvent.VK_ENTER == code) {
login();
}
}
};
// 用户登录状态label
private UserInfoLabel userInfoLabel;
public UILabel getTipLabel() {
return tipLabel;
}
public void setTipLabel(UILabel tipLabel) {
this.tipLabel = tipLabel;
}
public UILabel getTipLabel() {
return tipLabel;
}
public void setTipLabel(UILabel tipLabel) {
this.tipLabel = tipLabel;
}
/**
* 构造函数
* @param parent 父窗口
* @param userInfoLabel 登录状态label
*/
public BBSLoginDialog(Frame parent,UserInfoLabel userInfoLabel) {
/**
* 构造函数
*
* @param parent 父窗口
* @param userInfoLabel 登录状态label
*/
public BBSLoginDialog(Frame parent, UserInfoLabel userInfoLabel) {
super(parent);
JPanel panel = (JPanel) getContentPane();
initComponents(panel);
this.userInfoLabel = userInfoLabel;
setSize(new Dimension(DIALOG_WIDTH,DIALOG_HEIGHT));
setSize(new Dimension(DIALOG_WIDTH, DIALOG_HEIGHT));
}
private void initComponents(JPanel contentPane) {
this.setTitle(Inter.getLocText("FR-Designer-BBSLogin_Login-Title"));
tipLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
userLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Account")+":");
passLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Password")+":");
userLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Account") + ":");
passLabel = new UILabel(Inter.getLocText("FR-Designer-BBSLogin_Password") + ":");
nameField = new UITextField();
passField = new UIPassWordField();
loginButton = new UIButton(Inter.getLocText("FR-Designer-BBSLogin_Login"));
passwordReset = getURLActionLabel(PASSWORD_RESET_URL);
registerLabel = getURLActionLabel(REGISTER_URL);
passwordReset = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.reset"));
registerLabel = getURLActionLabel(SiteCenter.getInstance().acquireUrlByKind("bbs.register"));
loginButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
login();
}
});
@Override
public void actionPerformed(ActionEvent arg0) {
login();
}
});
nameField.addKeyListener(keyListener);
passField.addKeyListener(keyListener);
loginButton.addKeyListener(keyListener);
userLabel.setFont(DEFAULT_FONT);
passLabel.setFont(DEFAULT_FONT);
this.tipLabel.setVisible(false);
contentPane.setLayout(new BorderLayout());
JPanel mainPane = new JPanel();
mainPane.setLayout(new BorderLayout(0,V_GAP));
mainPane.setLayout(new BorderLayout(0, V_GAP));
initNorthPane(mainPane);
initCenterPane(mainPane);
initSouthPane(mainPane);
contentPane.add(mainPane,BorderLayout.NORTH);
contentPane.add(mainPane, BorderLayout.NORTH);
this.setResizable(false);
}
private void login(){
if(nameField.getText().isEmpty()){
tipForUsernameEmpty();
nameField.requestFocus();
return;
}
if(String.valueOf(passField.getPassword()).isEmpty()){
tipForPasswordEmpty();
passField.requestFocus();
return;
}
if(!testConnection()){
connectionFailue();
return;
}
if(login(nameField.getText(),String.valueOf(passField.getPassword()))){
loginSuccess();
}else{
loginFailure();
}
private void login() {
if (nameField.getText().isEmpty()) {
tipForUsernameEmpty();
nameField.requestFocus();
return;
}
if (String.valueOf(passField.getPassword()).isEmpty()) {
tipForPasswordEmpty();
passField.requestFocus();
return;
}
if (!testConnection()) {
connectionFailue();
return;
}
if (login(nameField.getText(), String.valueOf(passField.getPassword()))) {
loginSuccess();
} else {
loginFailure();
}
}
private boolean testConnection(){
HttpClient client = new HttpClient(TEST_CONNECTION_URL);
return client.isServerAlive();
private boolean testConnection() {
HttpClient client = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.test"));
return client.isServerAlive();
}
private void initNorthPane(JPanel mainPane){
private void initNorthPane(JPanel mainPane) {
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);
mainPane.add(northPane,BorderLayout.NORTH);
mainPane.add(northPane, BorderLayout.NORTH);
}
private void initCenterPane(JPanel mainPane){
private void initCenterPane(JPanel mainPane) {
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();
namePane.setLayout(new FlowLayout(FlowLayout.RIGHT,FLOWLAYOUT_H_GAP,0));
namePane.setLayout(new FlowLayout(FlowLayout.RIGHT, FLOWLAYOUT_H_GAP, 0));
namePane.add(userLabel);
nameField.setPreferredSize(new Dimension(FIELD_WIDTH,FIELD_HEIGHT));
nameField.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
namePane.add(nameField);
namePane.add(passwordReset);
loginPane.add(namePane);
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(passField);
passField.setPreferredSize(new Dimension(FIELD_WIDTH,FIELD_HEIGHT));
passField.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
passPane.add(registerLabel);
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();
southPane.setLayout(new FlowLayout(FlowLayout.RIGHT,BUTTON_H_GAP,0));
loginButton.setPreferredSize(new Dimension(BUTTON_WIDTH,FIELD_HEIGHT));
southPane.setLayout(new FlowLayout(FlowLayout.RIGHT, BUTTON_H_GAP, 0));
loginButton.setPreferredSize(new Dimension(BUTTON_WIDTH, FIELD_HEIGHT));
loginButton.setFont(DEFAULT_FONT);
southPane.add(loginButton);
mainPane.add(southPane,BorderLayout.SOUTH);
mainPane.add(southPane, BorderLayout.SOUTH);
}
// 登录成功
private void loginSuccess(){
DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword()));
userInfoLabel.setUserName(nameField.getText());
userInfoLabel.getUserInfoPane().markSignIn(nameField.getText());
userInfoLabel.getUserInfoPane().getSwitchAccountLabel().setVisible(true);
BBSLoginDialog.this.setVisible(false);
private void loginSuccess() {
DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword()));
userInfoLabel.setUserName(nameField.getText());
userInfoLabel.getUserInfoPane().markSignIn(nameField.getText());
userInfoLabel.getUserInfoPane().getSwitchAccountLabel().setVisible(true);
BBSLoginDialog.this.setVisible(false);
}
// 登录失败
private void loginFailure(){
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
private void loginFailure() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
}
private void tipForUsernameEmpty(){
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Username-Empty-Tip"));
private void tipForUsernameEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Username-Empty-Tip"));
}
public void showTipForDownloadPluginWithoutLogin() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Download-Unlogin-Tip"));
}
private void tipForPasswordEmpty(){
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Password-Empty-Tip"));
private void tipForPasswordEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Password-Empty-Tip"));
}
private void setLoginFailureTxt(String errorTxt){
tipLabel.setText(errorTxt);
tipLabel.setForeground(Color.RED);
tipLabel.repaint();
tipLabel.setVisible(true);
private void setLoginFailureTxt(String errorTxt) {
tipLabel.setText(errorTxt);
tipLabel.setForeground(Color.RED);
tipLabel.repaint();
tipLabel.setVisible(true);
}
// 连接失败
private void connectionFailue(){
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Connection-Failure"));
private void connectionFailue() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Connection-Failure"));
}
/**
* 清楚登录信息
*/
public void clearLoginInformation(){
tipLabel.setText(StringUtils.EMPTY);
nameField.setText(StringUtils.EMPTY);
passField.setText(StringUtils.EMPTY);
public void clearLoginInformation() {
tipLabel.setText(StringUtils.EMPTY);
nameField.setText(StringUtils.EMPTY);
passField.setText(StringUtils.EMPTY);
}
/**
/**
* 显示登录窗口
*/
public void showWindow(){
public void showWindow() {
GUICoreUtils.centerWindow(this);
setVisible(true);
}
@ -273,39 +270,45 @@ public class BBSLoginDialog extends UIDialog {
public void checkValid() throws Exception {
}
/**
* 是否登陆成功
*
* @param username 用户名
* @param password 密码
* @return 同上
*/
public static boolean login(String username,String password){
String url = URL + "&username=" + username + "&password=" + password;
HttpClient client = new HttpClient(url);
client.setTimeout(TIME_OUT);
if(client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK){
try {
String res = client.getResponseText("GBK");
if(res.contains(LOGIN_SUCCESS_FLAG)){
return true;
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
return false;
public static boolean login(String username, String password) {
try {
username = URLEncoder.encode(username, EncodeConstants.ENCODING_GBK);
} catch (UnsupportedEncodingException e) {
FRLogger.getLogger().error(e.getMessage());
}
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.login") + "&username=" + username + "&password=" + password;
HttpClient client = new HttpClient(url);
client.setTimeout(TIME_OUT);
if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) {
try {
String res = client.getResponseText(EncodeConstants.ENCODING_GBK);
if (res.contains(LOGIN_SUCCESS_FLAG)) {
return true;
}
} catch (Exception e) {
FRLogger.getLogger().error(e.getMessage());
}
}
return false;
}
private BoxCenterAligmentPane getURLActionLabel(final String url){
ActionLabel actionLabel = new ActionLabel(url);
if(ComparatorUtils.equals(url, PASSWORD_RESET_URL)){
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Forgot-Password"));
}else{
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account"));
}
actionLabel.addActionListener(new ActionListener() {
private BoxCenterAligmentPane getURLActionLabel(final String url) {
ActionLabel actionLabel = new ActionLabel(url);
if (ComparatorUtils.equals(url, SiteCenter.getInstance().acquireUrlByKind("bbs.reset"))) {
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Forgot-Password"));
} else {
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account"));
}
actionLabel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
try {
@ -315,14 +318,14 @@ public class BBSLoginDialog extends UIDialog {
}
}
});
return new BoxCenterAligmentPane(actionLabel);
}
class BoxCenterAligmentPane extends JPanel {
private UILabel textLabel;
public BoxCenterAligmentPane(String 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.gui.core.WidgetOption;
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.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
@ -81,9 +82,9 @@ public abstract class WebSettingPane<T extends WebContent> extends BasicBeanPane
}
this.setLayout(new BorderLayout());
JPanel allPanel = FRGUIPaneFactory.createBorderLayout_L_Pane();
allPanel.add(panel,BorderLayout.CENTER);
this.add(allPanel,BorderLayout.CENTER);
UIScrollPane scrollPane = new UIScrollPane(panel);
this.add(scrollPane, BorderLayout.CENTER);
}
ItemListener itemListener = new ItemListener() {

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

@ -1,19 +1,20 @@
package com.fr.design.widget;
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.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
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.*;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.design.widget.btn.ButtonConstants;
import javax.swing.*;
import java.awt.*;
@ -61,16 +62,22 @@ public class WidgetPane extends BasicPane implements ItemListener {
/**
* 状态改变
*
* @param e 事件对象
*/
public void itemStateChanged(ItemEvent e) {
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) {
populate(editorTypeComboBox.getCellWidget());
populate(selectedItem);
return;
}
if (shouldFireSelectedEvent) {
Widget selectedItem = editorTypeComboBox.getCellWidget();
populateWidgetConfig(selectedItem);
}
}
@ -109,9 +116,9 @@ public class WidgetPane extends BasicPane implements ItemListener {
public Widget update() {
return cellEditorCardPane.update();
}
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() {
return (WidgetOption[])ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions());
return (WidgetOption[]) ArrayUtils.addAll(WidgetOption.getReportWidgetInstance(), ExtraDesignClassManager.getInstance().getCellWidgetOptions());
}
}
/**
* 校验
*
* @throws Exception 抛出异常
*/
public void checkValid() throws Exception {
@ -222,6 +230,7 @@ public class WidgetPane extends BasicPane implements ItemListener {
/**
* 转化成字符串形式
*
* @return 返回字符串
*/
public String toString() {

31
designer_base/.classpath

@ -1,33 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<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="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<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="lib" path="D:/Program Files/Git/finereport/lib/report/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-third-8.0.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="output" path="bin"/>
</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<VerifyDefineProvider> verifyDefineProviders;
private Set<WidgetPropertyUIProvider> widgetAttrProviders;
private Set<ExportAttrTabProvider> exportAttrTabProviders;
private WidgetDesignHandler widgetDesignHandler;
private Set<BackgroundQuickUIProvider> backgroundQuickUIProviders;
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() {
return tableDataPaneProcessor;
@ -911,6 +921,8 @@ public class ExtraDesignClassManager extends XMLFileManager implements ExtraDesi
addSupportDesignApps(impl, simplify);
} else if (tagName.equals(DesignerEnvProcessor.XML_TAG)) {
setEnvProcessor(impl, simplify);
} else if (tagName.equals(WidgetDesignHandler.XML_TAG)) {
setWidgetDesignHandler(impl, simplify);
} else if (tagName.equals(TableDataPaneProcessor.XML_TAG)) {
setTableDataPaneProcessor(impl, simplify);
} 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.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants;
@ -28,7 +29,7 @@ public class TutorialAction extends UpdateAction {
this.setMenuKeySet(HELP_TUTORIAL);
this.setName(getMenuKeySet().getMenuName());
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());
}
@ -60,10 +61,10 @@ public class TutorialAction extends UpdateAction {
public void actionPerformed(ActionEvent evt) {
Locale locale = FRContext.getLocale();
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) {
try {
Desktop.getDesktop().browse(new URI(ProductConstants.HELP_URL));
Desktop.getDesktop().browse(new URI(SiteCenter.getInstance().acquireUrlByKind("help")));
return;
} catch (Exception e) {
//出了异常的话, 依然打开本地教程
@ -86,7 +87,7 @@ public class TutorialAction extends UpdateAction {
@Override
public String getMenuName() {
return Inter.getLocText("M_Help-Tutorial");
return Inter.getLocText("FR-Designer_COMMUNITY_HELP");
}
@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
JPanel formulaPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 95106 公式区域限定宽高, 显示两行即可, 在新窗口编辑.
formulaPane.setPreferredSize(new Dimension(450, 40));
formulaConditionPane.add(formulaPane, BorderLayout.CENTER);
formulaPane.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 2));
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);
} else {
boolean show = isShowScrollBar();
scrollBar.setEnabled(show);
scrollBar.setVisible(show);
scrollBar.setEnabled(show);
scrollBar.setVisible(show);
}
maxheight = getHeight() - DET_HEIGHT;
if ((MAXVALUE - scrollBar.getVisibleAmount()) == 0) {
@ -180,7 +180,8 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
}
leftcontentPane.validate();
}
}
}
protected boolean isShowScrollBar() {
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.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.*;
import java.util.List;
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;
public static final String PLUGIN_SHOP = SiteCenter.getInstance().acquireUrlByKind("plugin.plist");
public static PluginWebBridge getHelper() {
if (helper != null) {
return helper;

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

@ -1,8 +1,8 @@
package com.fr.design.extra.exe;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.Process;
import com.fr.general.FRLogger;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
@ -38,7 +38,7 @@ public class GetPluginFromStoreExecutor implements Executor {
@Override
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)) {
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.Process;
import com.fr.general.FRLogger;
import com.fr.plugin.Plugin;
import com.fr.stable.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* Created by vito on 16/4/19.
@ -31,15 +34,13 @@ public class ReadUpdateOnlineExecutor implements Executor {
public void run(Process<String> process) {
try {
plugins = PluginsReaderFromStore.readPluginsForUpdate();
StringBuilder sb = new StringBuilder();
if (plugins != null) {
sb.append("[");
for (Plugin plugin : plugins) {
sb.append("{pluginid:'").append(plugin.getId()).append("'}");
}
sb.append("]");
JSONArray jsonArray = new JSONArray();
for (Plugin plugin : plugins) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("pluginid", plugin.getId());
jsonArray.put(jsonObject);
}
result = sb.toString();
result = jsonArray.toString();
} catch (Exception e) {
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;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.Process;
import com.fr.general.FRLogger;
import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient;
import com.fr.stable.StringUtils;
@ -34,7 +34,7 @@ public class SearchOnlineExecutor implements Executor {
@Override
public void run(Process<String> process) {
try {
HttpClient httpClient = new HttpClient(PluginWebBridge.PLUGIN_SHOP + "&keyword=" + keyword);
HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("plugin.plist") + "&keyword=" + keyword);
result = httpClient.getResponseText();
} 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);
JPanel checkBoxPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
checkBoxPane.setPreferredSize(new Dimension(450, 30));
checkBoxandbuttonPane.add(checkBoxPane, BorderLayout.WEST);
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
protected void extendCheckBoxPane(JPanel checkBoxPane) {
// 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.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);
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.
*/
/**
* 导出属性Tab页的接口
*/
public interface ExportAttrTabProvider extends Level{
String XML_TAG = "ExportAttrTabProvider";
int CURRENT_LEVEL = 1;
/**
* 转换成SwingComponent
*
* @return JComponent
*/
JComponent toSwingComponent();
/**
* 转换成AbstractExportPane
*
* @return AbstractExportPane
*/
AbstractExportPane toExportPane();
/**
* tab的标题
*
* @return
*/
String title();
/**
* tag标签
*
* @return tag名称
* @deprecated 将来不使用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
public void layoutContainer(Container parent) {
if (verticalToolPane == null || downPane == null) {
return;
}
if (direction == Constants.RIGHT) {
if(isDownPaneVisible){
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.ExtraDesignClassManager;
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.ExitDesignerAction;
import com.fr.design.actions.file.OpenRecentReportMenuDef;
@ -149,6 +156,8 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单
menuList.add(createHelpMenuDef());
// 添加社区菜单
menuList.add(createCommunityMenuDef());
return menuList.toArray(new MenuDef[menuList.size()]);
}
@ -306,14 +315,14 @@ public abstract class ToolBarMenuDock {
java.util.List<ShortCut> shortCuts = new ArrayList<ShortCut>();
shortCuts.add(new WebDemoAction());
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new TutorialAction());
//shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT);
if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) {
shortCuts.add(new FeedBackAction());
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new SupportQQAction());
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new ForumAction());
// shortCuts.add(new ForumAction());
}
shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(new AboutAction());
@ -321,7 +330,22 @@ public abstract class ToolBarMenuDock {
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() {
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_Help"), 'H');
ShortCut[] otherHelpShortCuts = createHelpShortCuts();
@ -331,7 +355,15 @@ public abstract class ToolBarMenuDock {
insertMenu(menuDef, MenuHandler.HELP);
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.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.text.Format;
import java.text.ParseException;
@ -32,17 +33,21 @@ public class FormattedEditor extends AbstractPropertyEditor {
textField = new JFormattedTextField(format);
panel.add(textField, BorderLayout.CENTER);
textField.setBorder(null);
textField.addKeyListener(new KeyAdapter() {
textField.addKeyListener(createKeyListener());
}
protected KeyListener createKeyListener() {
return new KeyAdapter() {
public void keyReleased(KeyEvent e) {
try {
textField.commitEdit();
} catch (ParseException e1) {
return;
}
firePropertyChanged();
}
});
public void keyReleased(KeyEvent e) {
try {
textField.commitEdit();
} catch (ParseException e1) {
return;
}
firePropertyChanged();
}
};
}
@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);
}
} else {
condition.setCustomFillStyle(true);
if(gradientButton.isSelected()) {
condition.setColorStyle(ChartConstants.COLOR_GRADIENT);
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.location.Direction;
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.fun.WidgetPropertyUIProvider;
import com.fr.design.mainframe.FormArea;
import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.PaddingMargin;
@ -1155,5 +1157,10 @@ public class XWFitLayout extends XLayoutContainer {
public XLayoutContainer findNearestFit() {
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;
@ -25,17 +25,17 @@ import java.awt.event.ContainerEvent;
public class XWTitleLayout extends DedicateLayoutContainer {
/**
*
*
*/
private static final long serialVersionUID = 5274572473978467325L;
public XWTitleLayout() {
super(new WTitleLayout("titlePane"), new Dimension());
}
/**
* 容器构造函数
*
*
* @param widget 控件widget
* @param initSize 尺寸大小
*/
@ -58,17 +58,17 @@ public class XWTitleLayout extends DedicateLayoutContainer {
public LayoutAdapter getLayoutAdapter() {
return new FRTitleLayoutAdapter(this);
}
/**
* 返回容器对应的wlayout
*
*
* @return 同上
*/
@Override
public WTitleLayout toData() {
return (WTitleLayout) data;
}
/**
* 重置组件的名称
* @param name 名称
@ -77,20 +77,20 @@ public class XWTitleLayout extends DedicateLayoutContainer {
super.resetCreatorName(name);
// 有标题的话,标题的名字也要重置下
if (getXCreatorCount() > 1) {
getTitleCreator().toData().setWidgetName(WidgetTitle.TITLE_NAME_INDEX + name);
}
getTitleCreator().toData().setWidgetName(WidgetTitle.TITLE_NAME_INDEX + name);
}
}
/**
* 返回默认组件name
*
*
* @return 容器名
*/
@Override
public String createDefaultName() {
return "titlePanel";
}
/**
* 返回标题组件
* @return 标题组件
@ -104,7 +104,7 @@ public class XWTitleLayout extends DedicateLayoutContainer {
}
return null;
}
/**
* 将WLayout转换为XLayoutContainer
*/
@ -128,7 +128,7 @@ public class XWTitleLayout extends DedicateLayoutContainer {
/**
* 组件增加
*
*
* @param e 容器事件
*/
@Override
@ -139,17 +139,17 @@ public class XWTitleLayout extends DedicateLayoutContainer {
WTitleLayout layout = this.toData();
XWidgetCreator creator = (XWidgetCreator) e.getChild();
FRTitleLayout lay = (FRTitleLayout) getLayout();
Object constraints = lay.getConstraints(creator);
if (ComparatorUtils.equals(WTitleLayout.TITLE,constraints)) {
layout.addTitle(creator.toData(), creator.getBounds());
} else if (ComparatorUtils.equals(WTitleLayout.BODY,constraints)) {
layout.addBody(creator.toData(), creator.getBounds());
}
Object constraints = lay.getConstraints(creator);
if (ComparatorUtils.equals(WTitleLayout.TITLE,constraints)) {
layout.addTitle(creator.toData(), creator.getBounds());
} else if (ComparatorUtils.equals(WTitleLayout.BODY,constraints)) {
layout.addBody(creator.toData(), creator.getBounds());
}
}
/**
* 组件删除
*
*
* @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.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.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.Inter;
import javax.swing.*;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
/**
* 自适应布局自身的属性表
@ -32,8 +28,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
private DefaultTableCellRenderer renderer;
private FitLayoutDirectionEditor stateEditor;
private FitStateRenderer stateRenderer;
private PropertyCellEditor reLayoutEditor;
private CheckBoxCellRenderer reLayoutrenderer;
private WFitLayout layout;
private XWFitLayout xfl;
@ -44,8 +38,6 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
editor = new PropertyCellEditor(new IntegerPropertyEditor());
stateEditor = new FitLayoutDirectionEditor();
stateRenderer = new FitStateRenderer();
reLayoutrenderer = new CheckBoxCellRenderer();
reLayoutEditor = new PropertyCellEditor(new BooleanEditor());
}
/**
@ -58,7 +50,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
@Override
public int getRowCount() {
return 3;
return 2;
}
@Override
@ -66,11 +58,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) {
case 0:
return renderer;
case 1:
return stateRenderer;
default:
return reLayoutrenderer;
return stateRenderer;
}
}
@ -79,10 +68,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) {
case 0:
return editor;
case 1:
return stateEditor;
default:
return reLayoutEditor;
return stateEditor;
}
}
@ -92,19 +79,15 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
switch (row) {
case 0:
return Inter.getLocText("FR-Designer_Component_Interval");
case 1 :
return Inter.getLocText("FR-Designer_Component_Scale");
default:
return Inter.getLocText("FR-Designer-App_ReLayout");
return Inter.getLocText("FR-Designer_Component_Scale");
}
} else {
switch (row) {
case 0:
return layout.getCompInterval();
case 1 :
return layout.getCompState();
default:
return layout.getAppRelayout();
return layout.getCompState();
}
}
}
@ -112,11 +95,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
@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;
@ -128,10 +108,7 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
}else if (row == 1) {
layout.setCompState(state);
return true;
} else if (row == 2) {
layout.setAppRelayout(appRelayoutState);
return true;
}
}
return false;
}
}
@ -155,33 +132,4 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
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;
}
}
}

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;
import com.fr.base.FRContext;
import com.fr.base.mobile.MobileFitAttrState;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.CRPropertyDescriptor;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.itable.AbstractPropertyTable;
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.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.DoubleEditor;
import com.fr.design.mainframe.WidgetPropertyPane;;
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.general.Inter;
@ -27,17 +28,20 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
private XCreator xCreator;
private FormDesigner designer;
private boolean cascade = false;
public ElementCasePropertyTable(XCreator xCreator) {
this.xCreator = xCreator;
}
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);
cascade = true;
return revealHeightLimit();
}
CRPropertyDescriptor[] crp = ((ElementCaseEditor) xCreator.toData()).isHeightRestrict() ? revealHeightLimit() : getDefault();
cascade = ((ElementCaseEditor ) xCreator.toData()).getVerticalAttr() == MobileFitAttrState.VERTICAL;
return crp;
}
@ -53,6 +57,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App")),
new CRPropertyDescriptor("heightRestrict", this.xCreator.toData().getClass()).setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightrestrict"))
.setRendererClass(BooleanRender.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_Fit-App"))
};
List<CRPropertyDescriptor> defaultList = new ArrayList<>();
@ -65,7 +70,7 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
protected CRPropertyDescriptor[] revealHeightLimit() throws IntrospectionException {
CRPropertyDescriptor heightLimitProperty = new CRPropertyDescriptor("heightPercent", this.xCreator.toData().getClass())
.setEditorClass(DoubleEditor.class)
.setEditorClass(RefinedDoubleEditor.class)
.setI18NName(Inter.getLocText("Form-EC_heightpercent"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
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();
setModel(model);
@ -103,6 +108,14 @@ public class ElementCasePropertyTable extends AbstractPropertyTable{
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) {
this.designer = designer;
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.
*/
public class ElementCasePropertyUI extends AbstractWidgetPropertyUIProvider{
public class ElementCasePropertyUI extends AbstractWidgetPropertyUIProvider {
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.ItemProvider;
public class MobileFitAlignmentItems implements ItemProvider{
public class MobileFitAlignmentItems implements ItemProvider {
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;
public class MobileFitEditor extends ComboEditor{
public class MobileFitEditor extends ComboEditor {
public MobileFitEditor() {
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;
public class MobileFitRender extends EncoderCellRenderer{
public class MobileFitRender extends EncoderCellRenderer {
public MobileFitRender(){
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;
public class MobileFitWrapper extends ItemWrapper{
public class MobileFitWrapper extends ItemWrapper {
public MobileFitWrapper(){
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;
public class PropertyGroupModel extends AbstractPropertyGroupModel {
private FormDesigner designer;
private FormDesigner designer;
public PropertyGroupModel(String name, XCreator creator, CRPropertyDescriptor[] propArray,
FormDesigner designer) {
super(name, creator, propArray);
this.designer = designer;
}
FormDesigner designer) {
super(name, creator, propArray);
this.designer = designer;
}
@Override
@Override
public Object getValue(int row, int column) {
if (column == 0) {
return properties[row].getDisplayName();
@ -49,9 +49,9 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
try {
Method m = properties[row].getWriteMethod();
m.invoke(dealCreatorData(), value);
//属性名称为控件名时,单独处理下
//属性名称为控件名时,单独处理下
if(ComparatorUtils.equals(FormConstants.NAME, properties[row].getName())){
creator.resetCreatorName(value.toString());
creator.resetCreatorName(value.toString());
}
properties[row].firePropertyChanged();
return true;
@ -103,49 +103,49 @@ public class PropertyGroupModel extends AbstractPropertyGroupModel {
PROPERTIES.add("Properties");
PROPERTIES.add("Others");
}
/**
* 控件属性赋值和取值时针对scale和title做下处理
* @return
*/
private Object dealCreatorData() {
return creator.getPropertyDescriptorCreator().toData();
return creator.getPropertyDescriptorCreator().toData();
}
@Override
protected void initEditor(final int row) throws Exception {
ExtendedPropertyEditor editor = (ExtendedPropertyEditor) properties[row].createPropertyEditor(dealCreatorData());
if (editor == null) {
Class propType = properties[row].getPropertyType();
editor = TableUtils.getPropertyEditorClass(propType).newInstance();
}
if (editor != null) {
final ExtendedPropertyEditor extendEditor = editor;
editors[row] = new PropertyCellEditor(editor);
extendEditor.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if(ComparatorUtils.equals(extendEditor.getValue(),getValue(row,1))) {
return;
}
if (extendEditor.refreshInTime()) {
editors[row].stopCellEditing();
} else {
setValue(extendEditor.getValue(), row, 1);
@Override
protected void initEditor(final int row) throws Exception {
ExtendedPropertyEditor editor = (ExtendedPropertyEditor) properties[row].createPropertyEditor(dealCreatorData());
if (editor == null) {
Class propType = properties[row].getPropertyType();
editor = TableUtils.getPropertyEditorClass(propType).newInstance();
}
if (editor != null) {
final ExtendedPropertyEditor extendEditor = editor;
editors[row] = new PropertyCellEditor(editor);
extendEditor.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if(ComparatorUtils.equals(extendEditor.getValue(),getValue(row,1))) {
return;
}
if (extendEditor.refreshInTime()) {
editors[row].stopCellEditing();
} else {
setValue(extendEditor.getValue(), row, 1);
if (designer == null) {
return;
}
if ("widgetName".equals(properties[row].getName())) {
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_RENAMED);
} else {
designer.fireTargetModified();
}
designer.refreshDesignerUI();
}
}
});
}
}
if ("widgetName".equals(properties[row].getName())) {
designer.getEditListenerTable().fireCreatorModified(creator, DesignerEvent.CREATOR_RENAMED);
} else {
designer.fireTargetModified();
}
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