neil 9 years ago
parent
commit
cdf4bd1f9a
  1. 6
      designer/src/com/fr/design/mainframe/InformationCollector.java
  2. 117
      designer/src/com/fr/design/mainframe/bbs/BBSLoginDialog.java
  3. 7
      designer/src/com/fr/design/webattr/WebSettingPane.java
  4. 19
      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. 1
      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. 15
      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. 9
      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. 83
      designer_form/src/com/fr/design/designer/properties/BodyAppRelayoutTable.java
  44. 111
      designer_form/src/com/fr/design/designer/properties/BodyMobileLayoutPropertiesGroupModel.java
  45. 62
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
  46. 30
      designer_form/src/com/fr/design/designer/properties/mobile/BodyMobilePropertyUI.java
  47. 39
      designer_form/src/com/fr/design/designer/properties/mobile/BooleanRender.java
  48. 25
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyTable.java
  49. 2
      designer_form/src/com/fr/design/designer/properties/mobile/ElementCasePropertyUI.java
  50. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitAlignmentItems.java
  51. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitEditor.java
  52. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitRender.java
  53. 2
      designer_form/src/com/fr/design/designer/properties/mobile/MobileFitWrapper.java
  54. 59
      designer_form/src/com/fr/design/gui/xtable/ReportAppPropertyGroupModel.java
  55. 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();
}
}

117
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,12 +36,8 @@ 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;
@ -63,14 +59,14 @@ public class BBSLoginDialog extends UIDialog {
private BoxCenterAligmentPane registerLabel;
private KeyListener keyListener = new KeyAdapter() {
public void keyPressed(KeyEvent e){
public void keyPressed(KeyEvent e) {
int code = e.getKeyCode();
if(KeyEvent.VK_ESCAPE == code){
if (KeyEvent.VK_ESCAPE == code) {
BBSLoginDialog.this.setVisible(false);
return;
}
if(KeyEvent.VK_ENTER == code){
if (KeyEvent.VK_ENTER == code) {
login();
}
}
@ -91,27 +87,28 @@ public class BBSLoginDialog extends UIDialog {
/**
* 构造函数
*
* @param parent 父窗口
* @param userInfoLabel 登录状态label
*/
public BBSLoginDialog(Frame parent,UserInfoLabel userInfoLabel) {
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) {
@ -130,7 +127,7 @@ public class BBSLoginDialog extends UIDialog {
contentPane.setLayout(new BorderLayout());
JPanel mainPane = new JPanel();
mainPane.setLayout(new BorderLayout(0,V_GAP));
mainPane.setLayout(new BorderLayout(0, V_GAP));
initNorthPane(mainPane);
@ -138,81 +135,81 @@ public class BBSLoginDialog extends UIDialog {
initSouthPane(mainPane);
contentPane.add(mainPane,BorderLayout.NORTH);
contentPane.add(mainPane, BorderLayout.NORTH);
this.setResizable(false);
}
private void login(){
if(nameField.getText().isEmpty()){
private void login() {
if (nameField.getText().isEmpty()) {
tipForUsernameEmpty();
nameField.requestFocus();
return;
}
if(String.valueOf(passField.getPassword()).isEmpty()){
if (String.valueOf(passField.getPassword()).isEmpty()) {
tipForPasswordEmpty();
passField.requestFocus();
return;
}
if(!testConnection()){
if (!testConnection()) {
connectionFailue();
return;
}
if(login(nameField.getText(),String.valueOf(passField.getPassword()))){
if (login(nameField.getText(), String.valueOf(passField.getPassword()))) {
loginSuccess();
}else{
} else {
loginFailure();
}
}
private boolean testConnection(){
HttpClient client = new HttpClient(TEST_CONNECTION_URL);
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(){
private void loginSuccess() {
DesignerEnvManager.getEnvManager().setBBSPassword(String.valueOf(passField.getPassword()));
userInfoLabel.setUserName(nameField.getText());
userInfoLabel.getUserInfoPane().markSignIn(nameField.getText());
@ -221,11 +218,11 @@ public class BBSLoginDialog extends UIDialog {
}
// 登录失败
private void loginFailure(){
private void loginFailure() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Login-Failure-Tip"));
}
private void tipForUsernameEmpty(){
private void tipForUsernameEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Username-Empty-Tip"));
}
@ -233,11 +230,11 @@ public class BBSLoginDialog extends UIDialog {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Download-Unlogin-Tip"));
}
private void tipForPasswordEmpty(){
private void tipForPasswordEmpty() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Password-Empty-Tip"));
}
private void setLoginFailureTxt(String errorTxt){
private void setLoginFailureTxt(String errorTxt) {
tipLabel.setText(errorTxt);
tipLabel.setForeground(Color.RED);
tipLabel.repaint();
@ -245,14 +242,14 @@ public class BBSLoginDialog extends UIDialog {
}
// 连接失败
private void connectionFailue(){
private void connectionFailue() {
setLoginFailureTxt(Inter.getLocText("FR-Designer-BBSLogin_Connection-Failure"));
}
/**
* 清楚登录信息
*/
public void clearLoginInformation(){
public void clearLoginInformation() {
tipLabel.setText(StringUtils.EMPTY);
nameField.setText(StringUtils.EMPTY);
passField.setText(StringUtils.EMPTY);
@ -261,7 +258,7 @@ public class BBSLoginDialog extends UIDialog {
/**
* 显示登录窗口
*/
public void showWindow(){
public void showWindow() {
GUICoreUtils.centerWindow(this);
setVisible(true);
}
@ -276,18 +273,24 @@ public class BBSLoginDialog extends UIDialog {
/**
* 是否登陆成功
*
* @param username 用户名
* @param password 密码
* @return 同上
*/
public static boolean login(String username,String password){
String url = URL + "&username=" + username + "&password=" + password;
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){
if (client.getResponseCodeNoException() == HttpURLConnection.HTTP_OK) {
try {
String res = client.getResponseText("GBK");
if(res.contains(LOGIN_SUCCESS_FLAG)){
String res = client.getResponseText(EncodeConstants.ENCODING_GBK);
if (res.contains(LOGIN_SUCCESS_FLAG)) {
return true;
}
} catch (Exception e) {
@ -297,11 +300,11 @@ public class BBSLoginDialog extends UIDialog {
return false;
}
private BoxCenterAligmentPane getURLActionLabel(final String url){
private BoxCenterAligmentPane getURLActionLabel(final String 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"));
}else{
} else {
actionLabel.setText(Inter.getLocText("FR-Designer-BBSLogin_Register-Account"));
}

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() {

19
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);
}
}
@ -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);

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

@ -180,6 +180,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
}
leftcontentPane.validate();
}
}
protected boolean isShowScrollBar() {

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]);
}

15
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("[");
JSONArray jsonArray = new JSONArray();
for (Plugin plugin : plugins) {
sb.append("{pluginid:'").append(plugin.getId()).append("'}");
}
sb.append("]");
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;
}
/**
* 生成工具栏
*

9
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,7 +33,11 @@ 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 {
@ -42,7 +47,7 @@ public class FormattedEditor extends AbstractPropertyEditor {
}
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;
@ -1156,4 +1158,9 @@ public class XWFitLayout extends XLayoutContainer {
return this;
}
@Override
public WidgetPropertyUIProvider[] getWidgetPropertyUIProviders() {
return new WidgetPropertyUIProvider[]{ new BodyMobilePropertyUI(new XWBodyFitLayout())};
}
}

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;
}
}
}

62
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,9 +108,6 @@ 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());
}

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