daniel 8 years ago
parent
commit
51f0649c13
  1. 86
      build.dev.gradle.bak
  2. 2
      build.master.gradle.bak
  3. 2
      build.release.gradle.bak
  4. 96
      designer/.classpath
  5. 494
      designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
  6. 14
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  7. 55
      designer_base/.classpath
  8. 84
      designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java
  9. 21
      designer_base/src/com/fr/design/extra/PluginTask.java
  10. 24
      designer_base/src/com/fr/design/extra/ShopPaneConfig.java
  11. 2
      designer_base/src/com/fr/design/extra/UserLoginContext.java
  12. 2
      designer_base/src/com/fr/design/formula/FunctionManagerPane.java
  13. 17
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  14. 29
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  15. 5272
      designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/GroovyTokenMaker.java
  16. 49
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
  17. 25
      designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java
  18. 4
      designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java
  19. 34
      designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java
  20. 7
      designer_base/src/com/fr/design/locale/designer.properties
  21. 7
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  22. 8
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  23. 7
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  24. 7
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  25. 7
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  26. 59
      designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java
  27. 27
      designer_base/src/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  28. 50
      designer_base/src/com/fr/design/menu/KeySetUtils.java
  29. 338
      designer_base/src/com/fr/design/style/AbstractPopBox.java
  30. 5
      designer_base/src/com/fr/design/style/color/NewColorSelectPane.java
  31. 49
      designer_chart/.classpath
  32. 18
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  33. 4
      designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java
  34. 13
      designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java
  35. 1
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java
  36. 46
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java
  37. 11
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java
  38. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  39. 44
      designer_form/.classpath
  40. 10
      designer_form/build.master.gradle
  41. 93
      designer_form/build.master.gradle.bak
  42. 35
      designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java
  43. 43
      designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java
  44. 188
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  45. 1
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  46. 186
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  47. 46
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  48. 30
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

86
build.dev.gradle.bak

@ -1,86 +0,0 @@
apply plugin: "java"
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable"
//
FileTree files =fileTree(dir:"./",include:"build.*.gradle")
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ("\\"))
def branchName=buildDir.substring(buildDir.lastIndexOf ("\\")+1)
task appletJar<<{
ant{
mkdir(dir:"${libDir}/tmp-${branchName}")
mkdir(dir:"build/classes/")
copy(todir:"build/classes/"){
fileset(dir:"${basicDir}/finereport-core-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-chart-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-report-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-platform-stable/${branchName}/build/classes/main")
fileset(dir:"${basicDir}/finereport-performance-stable/${branchName}/build/classes/main")
}
unjar(src:"${libDir}/${branchName}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){
exclude(name:"*.*")
exclude(name:"bin/*.*")
exclude(name:"classes/**")
exclude(name:"com/fr/schedule/**")
exclude(name:"com/fr/cell/**")
exclude(name:"com/fr/dialog/**")
exclude(name:"com/fr/view/**")
exclude(name:"com/fr/web/**")
exclude(name:"com/fr/fs/**")
exclude(name:"com/fr/design/**")
exclude(name:"com/fr/start/**")
exclude(name:"com/fr/process/**")
}
fileset(dir:"${libDir}/tmp-${branchName}"){
include(name:"javax/mail/**")
include(name:"javax/servlet/**")
include(name:"org/freehep/**")
include(name:"com/fr/third/JAI/**")
include(name:"com/fr/third/antlr/**")
include(name:"com/fr/third/javax/**")
include(name:"com/sun/xml/**")
include(name:"javax/xml/**")
}
fileset(dir:"build/classes"){
include(name:"com/fr/web/*.class")
include(name:"com/fr/web/attr/*.class")
}
}
delete(dir:"${libDir}/tmp-${branchName}")
def jdk6home= "D:/FineReport/develop/java/jdk1.6u35"
def keystore="frapplet.store"
def keycert="fr.cert"
def keypassword="123456"
def keyalias="fr"
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-genkey -dname &quot;CN=FineReport L=NanJing C=China&quot; -keystore ${keystore} -alias ${keyalias} -validity 3650 -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/keytool"){
arg(line:"-export -keystore ${keystore} -alias ${keyalias} -file ${keycert} -storepass ${keypassword}")
}
exec(executable:"${jdk6home}/bin/jarsigner"){
arg(line:"-keystore ${keystore} -storepass ${keypassword} 'build/libs/fr-applet-8.0.jar' ${keyalias}")
}
delete(file:"${keystore}")
delete(file:"${keycert}")
delete(dir:"build/classes")
}
}

2
build.master.gradle.bak

@ -28,7 +28,7 @@ task appletJar<<{
} }
unjar(src:"${libDir}/${branchName}/3rd.jar",dest:"${libDir}/tmp-${branchName}") unjar(src:"${libDir}/${branchName}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}") unjar(src:"${libDir}/branchName/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){ jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){ fileset(dir:"build/classes"){
exclude(name:"*.*") exclude(name:"*.*")

2
build.release.gradle.bak

@ -27,7 +27,7 @@ task appletJar<<{
} }
unjar(src:"${libDir}/3rd.jar",dest:"${libDir}/tmp-${branchName}") unjar(src:"${libDir}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}") unjar(src:"${libDir}/${branchName}/servlet-api.jar",dest:"${libDir}/tmp-${branchName}")
jar(jarfile:"build/libs/fr-applet-8.0.jar"){ jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){ fileset(dir:"build/classes"){
exclude(name:"*.*") exclude(name:"*.*")

96
designer/.classpath

@ -1,52 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/> <classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/form"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/engine"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<classpathentry kind="lib" path="/lib/3rd.jar"/>
<classpathentry kind="lib" path="/lib/junit.jar"/>
<classpathentry kind="lib" path="/lib/ojdbc14.jar"/>
<classpathentry kind="lib" path="/lib/poi2007_fat.jar"/>
<classpathentry kind="lib" path="/lib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/lib/sqljdbc.jar"/>
<classpathentry kind="lib" path="/lib/jetty/activation.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-el.jar"/>
<classpathentry kind="lib" path="/lib/jetty/commons-logging.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-compiler.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jasper-runtime.jar"/>
<classpathentry kind="lib" path="/lib/jetty/javax.servlet.jar"/>
<classpathentry kind="lib" path="/lib/jetty/jaxrpc.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mail.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-remote.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j-tools.jar"/>
<classpathentry kind="lib" path="/lib/jetty/mx4j.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="/lib/jetty/org.mortbay.jmx.jar"/>
<classpathentry kind="lib" path="/lib/jetty/saaj.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xercesImpl.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xml-apis.jar"/>
<classpathentry kind="lib" path="/lib/jetty/xmlParserAPIs.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-base"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartattr"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartdata"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartglyph"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-web"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-page"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-view"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-write"/>
<classpathentry combineaccessrules="false" kind="src" path="/engine-remote"/>
<classpathentry combineaccessrules="false" kind="src" path="/designer_chart"/> <classpathentry combineaccessrules="false" kind="src" path="/designer_chart"/>
<classpathentry combineaccessrules="false" kind="src" path="/designer_form"/> <classpathentry combineaccessrules="false" kind="src" path="/designer_form"/>
<classpathentry kind="lib" path="/lib/swt.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jetty/activation.jar"/>
<classpathentry kind="lib" path="/lib/sqlite-jdbc.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jetty/commons-el.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/commons-logging.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jasper-compiler.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jasper-runtime.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/javax.servlet.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jaxrpc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mail.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j-remote.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j-tools.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/org.mortbay.jmx.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/saaj.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xercesImpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xml-apis.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xmlParserAPIs.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/3rd.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ant-junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/cglib-nodep-2.2.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/easymock-3.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jamm.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jna.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jts-1.13.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit-4.12.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/mysql-connector-java-5.1.6-bin.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/objenesis-2.1.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ojdbc14.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-xmla-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/quartz.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/servlet-api.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqlite-jdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqljdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swag.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swexpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swt.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/Sybelux.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/xercesImpl.jar"/>
<classpathentry kind="lib" path="D:/code/fr-chart-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-performance-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-platform-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-report-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-third-8.0.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

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

@ -1,5 +1,5 @@
/** /**
* *
*/ */
package com.fr.design.mainframe.bbs; package com.fr.design.mainframe.bbs;
@ -18,6 +18,7 @@ import com.fr.general.Inter;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.OperatingSystem;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -34,62 +35,61 @@ import java.util.HashMap;
/** /**
* @author neil * @author neil
*
* @date: 2015-3-4-上午9:05:52 * @date: 2015-3-4-上午9:05:52
*/ */
public class UserInfoLabel extends UILabel{ public class UserInfoLabel extends UILabel {
//默认查询消息时间, 30s //默认查询消息时间, 30s
private static final long CHECK_MESSAGE_TIME = 30 * 1000L; private static final long CHECK_MESSAGE_TIME = 30 * 1000L;
//默认论坛检测到更新后的弹出延迟时间 //默认论坛检测到更新后的弹出延迟时间
private static final long DELAY_TIME = 2 * 1000L; private static final long DELAY_TIME = 2 * 1000L;
private static final String MESSAGE_KEY = "messageCount"; private static final String MESSAGE_KEY = "messageCount";
private static final int MIN_MESSAGE_COUNT = 1; private static final int MIN_MESSAGE_COUNT = 1;
private static final int MENU_HEIGHT = 20; private static final int MENU_HEIGHT = 20;
private static final int DEFAULT_BBS_UID = 0; private static final int DEFAULT_BBS_UID = 0;
//用户名 //用户名
private String userName; private String userName;
//消息条数 //消息条数
private int messageCount; private int messageCount;
private UserInfoPane userInfoPane; private UserInfoPane userInfoPane;
private BBSLoginDialog bbsLoginDialog; private BBSLoginDialog bbsLoginDialog;
public UserInfoPane getUserInfoPane() { public UserInfoPane getUserInfoPane() {
return userInfoPane; return userInfoPane;
} }
public void setUserInfoPane(UserInfoPane userInfoPane) { public void setUserInfoPane(UserInfoPane userInfoPane) {
this.userInfoPane = userInfoPane; this.userInfoPane = userInfoPane;
} }
public BBSLoginDialog getBbsLoginDialog() { public BBSLoginDialog getBbsLoginDialog() {
return bbsLoginDialog; return bbsLoginDialog;
} }
public void setBbsLoginDialog(BBSLoginDialog bbsLoginDialog) { public void setBbsLoginDialog(BBSLoginDialog bbsLoginDialog) {
this.bbsLoginDialog = bbsLoginDialog; this.bbsLoginDialog = bbsLoginDialog;
} }
public UserInfoLabel(UserInfoPane userInfoPane) { public UserInfoLabel(UserInfoPane userInfoPane) {
this.userInfoPane = userInfoPane; this.userInfoPane = userInfoPane;
String userName = DesignerEnvManager.getEnvManager().getBBSName(); String userName = DesignerEnvManager.getEnvManager().getBBSName();
this.addMouseListener(userInfoAdapter); this.addMouseListener(userInfoAdapter);
this.setHorizontalAlignment(SwingConstants.CENTER); this.setHorizontalAlignment(SwingConstants.CENTER);
this.setText(userName); this.setText(userName);
LoginWebBridge loginWebBridge = new LoginWebBridge(); LoginWebBridge loginWebBridge = new LoginWebBridge();
loginWebBridge.setUserName(userName, UserInfoLabel.this); loginWebBridge.setUserName(userName, UserInfoLabel.this);
LoginCheckContext.addLoginCheckListener(new LoginCheckListener() { LoginCheckContext.addLoginCheckListener(new LoginCheckListener() {
@Override @Override
public void loginChecked() { public void loginChecked() {
/* /*
if (bbsLoginDialog == null) { if (bbsLoginDialog == null) {
bbsLoginDialog = new BBSLoginDialog(DesignerContext.getDesignerFrame(), UserInfoLabel.this); bbsLoginDialog = new BBSLoginDialog(DesignerContext.getDesignerFrame(), UserInfoLabel.this);
} }
bbsLoginDialog.clearLoginInformation(); bbsLoginDialog.clearLoginInformation();
@ -97,144 +97,144 @@ public class UserInfoLabel extends UILabel{
bbsLoginDialog.setModal(true); bbsLoginDialog.setModal(true);
bbsLoginDialog.showWindow(); bbsLoginDialog.showWindow();
*/ */
} }
}); });
if (StableUtils.getMajorJavaVersion() == 8) { if (StableUtils.getMajorJavaVersion() == 8) {
PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this); PluginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
} }
QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this); QQLoginWebBridge.getHelper().setUILabelInPlugin(UserInfoLabel.this);
UserLoginContext.addLoginContextListener(new LoginContextListener() { UserLoginContext.addLoginContextListener(new LoginContextListener() {
@Override @Override
public void showLoginContext() { public void showLoginContext() {
LoginPane managerPane = new LoginPane(); LoginPane managerPane = new LoginPane();
UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(),managerPane); UIDialog qqdlg = new LoginDialog(DesignerContext.getDesignerFrame(), managerPane);
LoginWebBridge.getHelper().setDialogHandle(qqdlg); LoginWebBridge.getHelper().setDialogHandle(qqdlg);
LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this); LoginWebBridge.getHelper().setUILabel(UserInfoLabel.this);
QQLoginWebBridge.getHelper().setLoginlabel(); QQLoginWebBridge.getHelper().setLoginlabel();
qqdlg.setVisible(true); qqdlg.setVisible(true);
clearLoginInformation(); clearLoginInformation();
updateInfoPane(); updateInfoPane();
} }
}); });
} }
private void clearLoginInformation(){ private void clearLoginInformation() {
DesignerEnvManager.getEnvManager().setBBSName(StringUtils.EMPTY); DesignerEnvManager.getEnvManager().setBBSName(StringUtils.EMPTY);
DesignerEnvManager.getEnvManager().setBBSPassword(StringUtils.EMPTY); DesignerEnvManager.getEnvManager().setBBSPassword(StringUtils.EMPTY);
DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY); DesignerEnvManager.getEnvManager().setInShowBBsName(StringUtils.EMPTY);
DesignerEnvManager.getEnvManager().setBbsUid(DEFAULT_BBS_UID); DesignerEnvManager.getEnvManager().setBbsUid(DEFAULT_BBS_UID);
} }
private void updateInfoPane(){ private void updateInfoPane() {
userInfoPane.markUnSignIn(); userInfoPane.markUnSignIn();
} }
/** /**
* showBBSDialog 弹出BBS资讯框 * showBBSDialog 弹出BBS资讯框
*/ */
public static void showBBSDialog(){ public static void showBBSDialog() {
Thread showBBSThread = new Thread(new Runnable() { Thread showBBSThread = new Thread(new Runnable() {
@Override @Override
public void run() { public void run() {
if(!FRContext.isChineseEnv()){ // vito:最新mac10.12和javafx弹出框初始化时会有大几率卡死在native方法,这里先屏蔽一下。
return; if (!FRContext.isChineseEnv() || OperatingSystem.isMacOS()) {
} return;
String lastBBSNewsTime = DesignerEnvManager.getEnvManager().getLastShowBBSNewsTime(); }
try { String lastBBSNewsTime = DesignerEnvManager.getEnvManager().getLastShowBBSNewsTime();
try {
String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
if (ComparatorUtils.equals(lastBBSNewsTime, today)) { if (ComparatorUtils.equals(lastBBSNewsTime, today)) {
return; return;
} }
Thread.sleep(DELAY_TIME); Thread.sleep(DELAY_TIME);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); HttpClient hc = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
if (!hc.isServerAlive()){ if (!hc.isServerAlive()) {
return; return;
} }
String res = hc.getResponseText(); String res = hc.getResponseText();
if (res.indexOf(BBSConstants.UPDATE_KEY) == -1){ if (res.indexOf(BBSConstants.UPDATE_KEY) == -1) {
return; return;
} }
try { try {
BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame()); BBSDialog bbsLabel = new BBSDialog(DesignerContext.getDesignerFrame());
bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup")); bbsLabel.showWindow(SiteCenter.getInstance().acquireUrlByKind("bbs.popup"));
DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date())); DesignerEnvManager.getEnvManager().setLastShowBBSNewsTime(DateUtils.DATEFORMAT2.format(new Date()));
} catch (Throwable e) { } catch (Throwable e) {
} }
} }
}); });
showBBSThread.start(); showBBSThread.start();
} }
private void sleep(long millis){ private void sleep(long millis) {
try { try {
Thread.sleep(millis); Thread.sleep(millis);
} catch (InterruptedException e) { } catch (InterruptedException e) {
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} }
} }
public String getUserName() { public String getUserName() {
return userName; return userName;
} }
/** /**
* 重置当前用户名 * 重置当前用户名
* */
*/ public void resetUserName() {
public void resetUserName(){ this.userName = StringUtils.EMPTY;
this.userName = StringUtils.EMPTY; }
}
public void setUserName(String userName) {
public void setUserName(String userName) { if (StringUtils.isEmpty(userName)) {
if(StringUtils.isEmpty(userName)){ return;
return; }
}
if (StringUtils.isEmpty(this.userName)) {
if(StringUtils.isEmpty(this.userName)){ updateMessageCount();
updateMessageCount(); }
} //往designerenvmanger里写一下
//往designerenvmanger里写一下 DesignerEnvManager.getEnvManager().setBBSName(userName);
DesignerEnvManager.getEnvManager().setBBSName(userName); this.userName = userName;
this.userName = userName; }
}
private void updateMessageCount() {
private void updateMessageCount(){ //启动获取消息更新的线程
//启动获取消息更新的线程 //登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数.
//登陆状态, 根据存起来的用户名密码, 每1分钟发起一次请求, 更新消息条数. Thread updateMessageThread = new Thread(new Runnable() {
Thread updateMessageThread = new Thread(new Runnable() {
@Override
@Override public void run() {
public void run() {
sleep(CHECK_MESSAGE_TIME); sleep(CHECK_MESSAGE_TIME);
//从env中获取username, 因为如果注销的话, env的里username会被清空. //从env中获取username, 因为如果注销的话, env的里username会被清空.
while(StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())){ while (StringUtils.isNotEmpty(DesignerEnvManager.getEnvManager().getBBSName())) {
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("username", encode(encode(userName))); para.put("username", encode(encode(userName)));
HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para); HttpClient getMessage = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("bbs.message"), para);
getMessage.asGet(); getMessage.asGet();
if(getMessage.isServerAlive()){ if (getMessage.isServerAlive()) {
try { try {
String res = getMessage.getResponseText(); String res = getMessage.getResponseText();
if (StringUtils.isNotEmpty(res)) { if (StringUtils.isNotEmpty(res)) {
setMessageCount(Integer.parseInt(res)); setMessageCount(Integer.parseInt(res));
} }
} catch (Exception e) { } catch (Exception e) {
} }
} }
sleep(CHECK_MESSAGE_TIME); sleep(CHECK_MESSAGE_TIME);
} }
} }
}); });
updateMessageThread.start(); updateMessageThread.start();
} }
private String encode(String str){ private String encode(String str) {
try { try {
return URLEncoder.encode(str, EncodeConstants.ENCODING_UTF_8); return URLEncoder.encode(str, EncodeConstants.ENCODING_UTF_8);
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
@ -242,75 +242,75 @@ public class UserInfoLabel extends UILabel{
} }
} }
public int getMessageCount() { public int getMessageCount() {
return messageCount; return messageCount;
} }
public void setMessageCount(int messageCount) { public void setMessageCount(int messageCount) {
// 当只有一条消息时,阅读之后,消息面板重置为只含用户名的状态 // 当只有一条消息时,阅读之后,消息面板重置为只含用户名的状态
if(this.messageCount == MIN_MESSAGE_COUNT && messageCount < MIN_MESSAGE_COUNT){ if (this.messageCount == MIN_MESSAGE_COUNT && messageCount < MIN_MESSAGE_COUNT) {
this.setText(this.userName); this.setText(this.userName);
return; return;
} }
if(this.messageCount == messageCount || messageCount < MIN_MESSAGE_COUNT){ if (this.messageCount == messageCount || messageCount < MIN_MESSAGE_COUNT) {
return; return;
} }
this.messageCount = messageCount; this.messageCount = messageCount;
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//内容eg: aaa(11) //内容eg: aaa(11)
sb.append(StringUtils.BLANK).append(this.userName) sb.append(StringUtils.BLANK).append(this.userName)
.append("(").append(this.messageCount) .append("(").append(this.messageCount)
.append(")").append(StringUtils.BLANK); .append(")").append(StringUtils.BLANK);
//更新面板Text //更新面板Text
this.setText(sb.toString()); this.setText(sb.toString());
} }
private MouseAdapter userInfoAdapter = new MouseAdapter() { private MouseAdapter userInfoAdapter = new MouseAdapter() {
public void mouseEntered(MouseEvent e) { public void mouseEntered(MouseEvent e) {
UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR)); UserInfoLabel.this.setCursor(new Cursor(Cursor.HAND_CURSOR));
}; }
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
userName = DesignerEnvManager.getEnvManager().getBBSName(); userName = DesignerEnvManager.getEnvManager().getBBSName();
if(StringUtils.isNotEmpty(userName)) { if (StringUtils.isNotEmpty(userName)) {
UIPopupMenu menu = new UIPopupMenu(); UIPopupMenu menu = new UIPopupMenu();
menu.setOnlyText(true); menu.setOnlyText(true);
menu.setPopupSize(userInfoPane.getWidth(),userInfoPane.getHeight()*3); menu.setPopupSize(userInfoPane.getWidth(), userInfoPane.getHeight() * 3);
//私人消息 //私人消息
UIMenuItem priviteMessage = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Privite-Message")); UIMenuItem priviteMessage = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Privite-Message"));
priviteMessage.addMouseListener(new MouseAdapter() { priviteMessage.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if(StringUtils.isNotEmpty(userName)){ if (StringUtils.isNotEmpty(userName)) {
try { try {
String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default"); String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl)); Desktop.getDesktop().browse(new URI(loginUrl));
} catch (Exception exp) { } catch (Exception exp) {
FRContext.getLogger().info(exp.getMessage()); FRContext.getLogger().info(exp.getMessage());
} }
return; return;
} }
} }
}); });
//切换账号 //切换账号
UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account")); UIMenuItem closeOther = new UIMenuItem(Inter.getLocText("FR-Designer-BBSLogin_Switch-Account"));
closeOther.addMouseListener(new MouseAdapter() { closeOther.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
UserLoginContext.fireLoginContextListener(); UserLoginContext.fireLoginContextListener();
} }
}); });
menu.add(priviteMessage); menu.add(priviteMessage);
menu.add(closeOther); menu.add(closeOther);
GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT); GUICoreUtils.showPopupMenu(menu, UserInfoLabel.this, 0, MENU_HEIGHT);
} else { } else {
UserLoginContext.fireLoginContextListener(); UserLoginContext.fireLoginContextListener();
} }
} }
}; };
} }

14
designer/src/com/fr/design/parameter/ParameterDefinitePane.java

@ -454,13 +454,13 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
*/ */
public ShortCut[] shortcut4FileMenu() { public ShortCut[] shortcut4FileMenu() {
return (ShortCut[]) ArrayUtils.addAll(BaseUtils.isAuthorityEditing() ? return (ShortCut[]) ArrayUtils.addAll(BaseUtils.isAuthorityEditing() ?
new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())} : new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())} :
new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), new ShortCut[]{new SaveTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new SaveAsTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), new SaveAsTemplateAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()), new UndoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()),
new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())}, new RedoAction(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())},
new ShortCut[0] new ShortCut[0]
); );
} }

55
designer_base/.classpath

@ -3,8 +3,57 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-core-8.0.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jetty/activation.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-third-8.0.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jetty/commons-el.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/jetty/org.mortbay.jetty.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jetty/commons-logging.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jasper-compiler.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jasper-runtime.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/javax.servlet.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/jaxrpc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mail.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j-remote.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/mx4j-tools.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/org.mortbay.jmx.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/saaj.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xercesImpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xml-apis.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/xmlParserAPIs.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/3rd.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ant-junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/cglib-nodep-2.2.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/easymock-3.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jamm.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jna.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jts-1.13.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit-4.12.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/mysql-connector-java-5.1.6-bin.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/objenesis-2.1.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ojdbc14.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-xmla-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/quartz.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/servlet-api.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqlite-jdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqljdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swag.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swexpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swt.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/Sybelux.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/xercesImpl.jar"/>
<classpathentry kind="lib" path="D:/code/fr-chart-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-performance-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-platform-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-report-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-third-8.0.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

84
designer_base/src/com/fr/design/data/datapane/connect/ConnectionTableProcedurePane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.ilist.TableViewList; import com.fr.design.gui.ilist.TableViewList;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -28,7 +29,7 @@ import java.awt.event.*;
*/ */
public class ConnectionTableProcedurePane extends BasicPane { public class ConnectionTableProcedurePane extends BasicPane {
private static int WIDTH = 155; private static int WIDTH = 155;
private ConnectionComboBoxPanel connectionComboBox; private ConnectionComboBoxPanel connectionComboBox;
private UICheckBox tableCheckBox; private UICheckBox tableCheckBox;
private UICheckBox viewCheckBox; private UICheckBox viewCheckBox;
private UITextField searchField; private UITextField searchField;
@ -37,16 +38,16 @@ public class ConnectionTableProcedurePane extends BasicPane {
public ConnectionTableProcedurePane() { public ConnectionTableProcedurePane() {
this.setLayout(new BorderLayout(4, 4)); this.setLayout(new BorderLayout(4, 4));
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class){ connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) {
protected void refreshItems(){ protected void refreshItems() {
super.refreshItems(); super.refreshItems();
if (tableViewList != null) { if (tableViewList != null) {
search(); search();
} }
} }
}; };
tableViewList = new TableViewList(); tableViewList = new TableViewList();
ToolTipManager.sharedInstance().registerComponent(tableViewList); ToolTipManager.sharedInstance().registerComponent(tableViewList);
connectionComboBox.addComboBoxActionListener(filter); connectionComboBox.addComboBoxActionListener(filter);
tableViewList.addMouseListener(new MouseAdapter() { tableViewList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) { public void mouseClicked(MouseEvent evt) {
@ -54,8 +55,8 @@ public class ConnectionTableProcedurePane extends BasicPane {
Object obj = tableViewList.getSelectedValue(); Object obj = tableViewList.getSelectedValue();
TableProcedure tableProcedure = null; TableProcedure tableProcedure = null;
if (obj instanceof TableProcedure) { if (obj instanceof TableProcedure) {
tableProcedure = (TableProcedure)obj; tableProcedure = (TableProcedure) obj;
}else { } else {
return; return;
} }
for (int i = 0; i < ConnectionTableProcedurePane.this.listeners.size(); i++) { for (int i = 0; i < ConnectionTableProcedurePane.this.listeners.size(); i++) {
@ -79,7 +80,7 @@ public class ConnectionTableProcedurePane extends BasicPane {
this.add(connectionComboBox, BorderLayout.NORTH); this.add(connectionComboBox, BorderLayout.NORTH);
this.add(tableViewListPane, BorderLayout.CENTER); this.add(tableViewListPane, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH); this.add(filterPane, BorderLayout.SOUTH);
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height)); this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
} }
protected JPanel createCheckBoxgroupPane() { protected JPanel createCheckBoxgroupPane() {
@ -89,28 +90,42 @@ public class ConnectionTableProcedurePane extends BasicPane {
tableCheckBox.setSelected(true); tableCheckBox.setSelected(true);
tableCheckBox.addActionListener(filter); tableCheckBox.addActionListener(filter);
first.add(tableCheckBox); first.add(tableCheckBox);
first.add(new UILabel(Inter.getLocText("Table"), BaseUtils.readIcon("/com/fr/design/images/data/tables.png"), UILabel.LEADING));
JPanel second = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel second = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
viewCheckBox = new UICheckBox(); viewCheckBox = new UICheckBox();
viewCheckBox.setSelected(true); viewCheckBox.setSelected(true);
viewCheckBox.addActionListener(filter); viewCheckBox.addActionListener(filter);
second.add(viewCheckBox); second.add(viewCheckBox);
second.add(new UILabel(Inter.getLocText("SQL-View"), BaseUtils.readIcon("/com/fr/design/images/data/views.png"), UILabel.LEADING));
// 根据环境是否为中文设置不同的显示
if (GeneralContext.isChineseEnv()) {
first.add(new UILabel(Inter.getLocText("FR-Designer_SQL-Table"),
BaseUtils.readIcon("/com/fr/design/images/data/tables.png"), UILabel.LEADING));
second.add(new UILabel(Inter.getLocText("FR-Designer_SQL-View"),
BaseUtils.readIcon("/com/fr/design/images/data/views.png"), UILabel.LEADING));
} else {
UILabel ui1 = new UILabel(BaseUtils.readIcon("/com/fr/design/images/data/tables.png"), UILabel.LEADING);
UILabel ui2 = new UILabel(BaseUtils.readIcon("/com/fr/design/images/data/views.png"), UILabel.LEADING);
ui1.setToolTipText(Inter.getLocText("FR-Designer_SQL-Table"));
ui2.setToolTipText(Inter.getLocText("FR-Designer_SQL-View"));
first.add(ui1);
second.add(ui2);
}
checkBoxgroupPane.add(first); checkBoxgroupPane.add(first);
checkBoxgroupPane.add(second); checkBoxgroupPane.add(second);
return checkBoxgroupPane; return checkBoxgroupPane;
} }
/** /**
* itemComboBox 加上 itemListener * itemComboBox 加上 itemListener
* @param itemListener *
*/ * @param itemListener
public void addItemListener(ItemListener itemListener) { */
connectionComboBox.itemComboBox.addItemListener(itemListener); public void addItemListener(ItemListener itemListener) {
} connectionComboBox.itemComboBox.addItemListener(itemListener);
}
private DocumentListener searchListener = new DocumentListener() { private DocumentListener searchListener = new DocumentListener() {
@Override @Override
@ -146,13 +161,13 @@ public class ConnectionTableProcedurePane extends BasicPane {
String[] types = ArrayUtils.EMPTY_STRING_ARRAY; String[] types = ArrayUtils.EMPTY_STRING_ARRAY;
if (tableCheckBox != null) { if (tableCheckBox != null) {
if (tableCheckBox.isSelected()) { if (tableCheckBox.isSelected()) {
types = (String[])ArrayUtils.add(types, TableProcedure.TABLE); types = (String[]) ArrayUtils.add(types, TableProcedure.TABLE);
} }
if (viewCheckBox.isSelected()) { if (viewCheckBox.isSelected()) {
types = (String[])ArrayUtils.add(types, TableProcedure.VIEW); types = (String[]) ArrayUtils.add(types, TableProcedure.VIEW);
} }
} else { } else {
types = (String[])ArrayUtils.add(types, TableProcedure.PROCEDURE); types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE);
} }
tableViewList.populate(selectedObj, searchField.getText().trim(), types); tableViewList.populate(selectedObj, searchField.getText().trim(), types);
} }
@ -162,10 +177,10 @@ public class ConnectionTableProcedurePane extends BasicPane {
return "Connection"; return "Connection";
} }
/** /**
* *
* @param l * @param l
*/ */
public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) { public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) {
this.listeners.add(l); this.listeners.add(l);
} }
@ -179,10 +194,11 @@ public class ConnectionTableProcedurePane extends BasicPane {
} }
public static interface DoubleClickSelectedNodeOnTreeListener { public static interface DoubleClickSelectedNodeOnTreeListener {
/** /**
* 处理双击事件 * 处理双击事件
* @param target *
*/ * @param target
public void actionPerformed(TableProcedure target); */
public void actionPerformed(TableProcedure target);
} }
} }

21
designer_base/src/com/fr/design/extra/PluginTask.java

@ -49,7 +49,7 @@ public class PluginTask<T> extends Task<T> {
@Override @Override
public void process(String s) { public void process(String s) {
if (StringUtils.isNotBlank(s)) { if (StringUtils.isNotBlank(s)) {
updateMessage(changText(s)); updateMessage(trimText(s));
} }
} }
}); });
@ -59,20 +59,25 @@ public class PluginTask<T> extends Task<T> {
@Override @Override
protected void done() { protected void done() {
updateMessage(changText(executor.getTaskFinishMessage())); updateMessage(trimText(executor.getTaskFinishMessage()));
} }
/** /**
* 转换掉一些会造成错误的特殊字符 * vito:由于使用webEngine.executeScript("(" + callback + ")(\"" + newValue + "\")")
* 1 ""中的""必须转义 * 执行脚本所以原来规范的json格式也会在拼接字符串后可能抛出参数异常需要转换掉一些会造成错误的特殊字符
* 2 js字符串中的\n会导致js字符串变成多行,而js字符创不支持多行拼接 * 选择在java端替换的原因是异常抛出自executeScript方法的参数.
*
* 1.""中的""必须转义
* 2.js字符串中的\n会导致js字符串变成多行,而js字符串不支持多行拼接
* 3.由JSONObject.toString()得到的字符串中html标签的属性会自动加上\造成替换难度加大
* 这边建议去除所有的html标签
* *
* @param old 原始字符串 * @param old 原始字符串
* @return 处理之后的字符串 * @return 处理之后的字符串
*/ */
private String changText(String old) { private String trimText(String old) {
if(StringUtils.isNotBlank(old)){ if (StringUtils.isNotBlank(old)) {
return old.replaceAll("\"", "\\\\\"").replaceAll("\n", ""); return old.replaceAll("\n", "").replaceAll("\"", "\\\\\"").replaceAll("\'", "\\\\\'");
} }
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }

24
designer_base/src/com/fr/design/extra/ShopPaneConfig.java

@ -11,14 +11,26 @@ public abstract class ShopPaneConfig {
private JFXPanel webPane; private JFXPanel webPane;
public ShopPaneConfig() { public ShopPaneConfig() {
this.mainJS = getMainJS(); this.mainJS = setMainJS();
this.scriptsId = getScriptsId(); this.scriptsId = setScriptsId();
this.webPane = getWebPane(); this.webPane = setWebPane();
} }
abstract String getMainJS(); abstract String setMainJS();
abstract String getScriptsId(); abstract String setScriptsId();
abstract JFXPanel getWebPane(); abstract JFXPanel setWebPane();
public String getMainJS() {
return mainJS;
}
public String getScriptsId() {
return scriptsId;
}
public JFXPanel getWebPane() {
return webPane;
}
} }

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

@ -3,7 +3,7 @@ package com.fr.design.extra;
import java.util.ArrayList; import java.util.ArrayList;
/** /**
* Created by lp on 2016/8/16. * Created by lp on 2016/8/16.
*/ */
public class UserLoginContext { public class UserLoginContext {
private static ArrayList<LoginContextListener> fireLoginContextListener = new ArrayList<LoginContextListener>(); private static ArrayList<LoginContextListener> fireLoginContextListener = new ArrayList<LoginContextListener>();

2
designer_base/src/com/fr/design/formula/FunctionManagerPane.java

@ -132,7 +132,7 @@ public class FunctionManagerPane extends BasicPane {
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane(); JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
JPanel reportletNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel reportletNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(28); classNameTextField = new UITextField(25);
reportletNamePane.add(classNameTextField); reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select")); UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select"));
browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height)); browserButton.setPreferredSize(new Dimension(browserButton.getPreferredSize().width, classNameTextField.getPreferredSize().height));

17
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java

@ -13,12 +13,12 @@ import com.fr.js.JavaScript;
import com.fr.js.NameJavaScript; import com.fr.js.NameJavaScript;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
import com.fr.plugin.PluginManager; import com.fr.plugin.PluginManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeMap;
/** /**
* 超级链接 界面. * 超级链接 界面.
@ -34,23 +34,26 @@ public class HyperlinkGroupPane extends JListControlPane {
* @return 返回Nameable按钮数组. * @return 返回Nameable按钮数组.
*/ */
public NameableCreator[] createNameableCreators() { public NameableCreator[] createNameableCreators() {
Map<String, NameableCreator> nameCreators = new TreeMap<String, NameableCreator>();
NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators(); NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators();
for (NameableCreator creator : creators) {
nameCreators.put(creator.menuName(), creator);
}
PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG); PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG);
ArrayList<UpdateAction> templateArrayLisy = PluginManager.getInstance().getResultList(); ArrayList<UpdateAction> templateArrayLisy = PluginManager.getInstance().getResultList();
// if (templateArrayLisy.isEmpty()) { // if (templateArrayLisy.isEmpty()) {
// return creators; // return creators;
// } // }
NameableCreator[] pluginCreators = new NameableCreator[templateArrayLisy.size()];
for (int i = 0; i < templateArrayLisy.size(); i++) { for (int i = 0; i < templateArrayLisy.size(); i++) {
pluginCreators[i] = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator(); NameableCreator nameableCreator = ((HyperlinkPluginAction) templateArrayLisy.get(i)).getHyperlinkCreator();
nameCreators.put(nameableCreator.menuName(), nameableCreator);
} }
Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG); Set<HyperlinkProvider> providers = ExtraDesignClassManager.getInstance().getArray(HyperlinkProvider.XML_TAG);
List<NameableCreator> creatorList = new ArrayList<NameableCreator>();
for (HyperlinkProvider provider : providers) { for (HyperlinkProvider provider : providers) {
NameableCreator nc = provider.createHyperlinkCreator(); NameableCreator nc = provider.createHyperlinkCreator();
creatorList.add(nc); nameCreators.put(nc.menuName(), nc);
} }
return ArrayUtils.addAll(creatorList.toArray(new NameableCreator[creatorList.size()]), ArrayUtils.addAll(creators, pluginCreators)); return nameCreators.values().toArray(new NameableCreator[nameCreators.size()]);
} }
/** /**

29
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -4,10 +4,10 @@ import com.fr.base.CoreDecimalFormat;
import com.fr.base.GraphHelper; import com.fr.base.GraphHelper;
import com.fr.base.Style; import com.fr.base.Style;
import com.fr.base.TextFormat; import com.fr.base.TextFormat;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.FormatField; import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents; import com.fr.data.core.FormatField.FormatContents;
import com.fr.design.border.UIRoundedBorder; import com.fr.design.border.UIRoundedBorder;
import com.fr.design.constants.UIConstants;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.icombobox.UIComboBoxRenderer;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
@ -81,16 +81,7 @@ public class FormatPane extends AbstractBasicStylePane {
}; };
typeComboBox = new UIComboBox(types); typeComboBox = new UIComboBox(types);
UIComboBoxRenderer render = new UIComboBoxRenderer() { UIComboBoxRenderer render = createComBoxRender();
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Integer) {
label.setText(" " + FormatField.getInstance().getName((Integer) value));
}
return label;
}
};
typeComboBox.setRenderer(render); typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener); typeComboBox.addItemListener(itemListener);
contentPane.add(sampleLabel, BorderLayout.NORTH); contentPane.add(sampleLabel, BorderLayout.NORTH);
@ -114,11 +105,23 @@ public class FormatPane extends AbstractBasicStylePane {
} }
protected UIComboBoxRenderer createComBoxRender(){
return new UIComboBoxRenderer() {
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof Integer) {
label.setText(" " + FormatField.getInstance().getName((Integer) value));
}
return label;
}
};
}
private void iniSampleLable() { private void iniSampleLable() {
Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4); Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
Font tmpFont = null; Font tmpFont = null;
Border border = BorderFactory.createTitledBorder(innterborder, Inter.getLocText("StyleFormat-Sample"), TitledBorder.LEFT, 0, tmpFont, UIConstants.LINE_COLOR); Border border = BorderFactory.createTitledBorder(innterborder, Inter.getLocText("FR-Base_StyleFormat_Sample"), TitledBorder.LEFT, 0, tmpFont, UIConstants.LINE_COLOR);
sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) { sampleLabel = new UILabel(FormatField.getInstance().getFormatValue()) {
@Override @Override
@ -156,7 +159,7 @@ public class FormatPane extends AbstractBasicStylePane {
* @return 标题 * @return 标题
*/ */
public String title4PopupWindow() { public String title4PopupWindow() {
return Inter.getLocText("Format"); return Inter.getLocText("FR-Base_Format");
} }
/** /**

5272
designer_base/src/com/fr/design/gui/syntax/ui/rsyntaxtextarea/modes/GroovyTokenMaker.java

File diff suppressed because it is too large Load Diff

49
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -1,27 +1,19 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListCellRenderer;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JList;
import javax.swing.JPanel;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.Hyperlink; import com.fr.js.Hyperlink;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBeanPane<T> { public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBeanPane<T> {
public static final int NEW_WINDOW = 0; public static final int NEW_WINDOW = 0;
public static final int DIALOG = 1; public static final int DIALOG = 1;
@ -46,7 +38,7 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
headerPane = this.setHeaderPanel(); headerPane = this.setHeaderPanel();
this.add(headerPane, BorderLayout.NORTH); this.add(headerPane, BorderLayout.NORTH);
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
targetFrameComboBox = new UIComboBox(new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")}); targetFrameComboBox = new UIComboBox(getTargetFrames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer() { targetFrameComboBox.setRenderer(new DefaultListCellRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
@ -86,6 +78,9 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
this.add(this.setFootPanel(), BorderLayout.SOUTH); this.add(this.setFootPanel(), BorderLayout.SOUTH);
} }
protected String[] getTargetFrames(){
return new String[]{Inter.getLocText("Hyperlink-New_Window"), Inter.getLocText("FR-Hyperlink_Dialog"), Inter.getLocText("Hyperlink-Self_Window")};
}
protected abstract JPanel setHeaderPanel(); protected abstract JPanel setHeaderPanel();
@ -93,6 +88,30 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
protected abstract void populateSubHyperlinkBean(T link); protected abstract void populateSubHyperlinkBean(T link);
public UIComboBox getTargetFrameComboBox() {
return targetFrameComboBox;
}
public void setTargetFrameComboBox(UIComboBox targetFrameComboBox) {
this.targetFrameComboBox = targetFrameComboBox;
}
public UINumberField getHeightTextFiled() {
return heightTextFiled;
}
public void setHeightTextFiled(UINumberField heightTextFiled) {
this.heightTextFiled = heightTextFiled;
}
public UINumberField getWidthTextFiled() {
return widthTextFiled;
}
public void setWidthTextFiled(UINumberField widthTextFiled) {
this.widthTextFiled = widthTextFiled;
}
@Override @Override
public void populateBean(T link) { public void populateBean(T link) {
String name = link.getTargetFrame(); String name = link.getTargetFrame();

25
designer_base/src/com/fr/design/hyperlink/ReportletHyperlinkPane.java

@ -104,7 +104,7 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
} }
private class HyperlinkParametersAction extends UITableEditAction { protected class HyperlinkParametersAction extends UITableEditAction {
public HyperlinkParametersAction() { public HyperlinkParametersAction() {
this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"})); this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"}));
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif")); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/p.gif"));
@ -207,4 +207,27 @@ public class ReportletHyperlinkPane extends BasicBeanPane<ReportletHyperlink> {
} }
} }
public ReporletHyperNorthPane getNorthPane() {
return northPane;
}
public void setNorthPane(ReporletHyperNorthPane northPane) {
this.northPane = northPane;
}
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox;
}
public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) {
this.extendParametersCheckBox = extendParametersCheckBox;
}
} }

4
designer_base/src/com/fr/design/hyperlink/WebHyperNorthPane.java

@ -51,10 +51,10 @@ public class WebHyperNorthPane extends AbstractHyperlinkPane<WebHyperlink> {
urlPane.add(urlTextField); urlPane.add(urlTextField);
urlTextField.setText(ProductConstants.WEBSITE_URL); urlTextField.setText(ProductConstants.WEBSITE_URL);
UILabel label = new UILabel(Inter.getLocText(new String[]{"Example","Or"}, new String[]{":http://www.baidu.com","/main.jsp"})); //UILabel label = new UILabel(Inter.getLocText(new String[]{"Example","Or"}, new String[]{":http://www.baidu.com","/main.jsp"}));
JPanel urlWithHelp = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2); JPanel urlWithHelp = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(2);
urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:")); urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:"));
urlWithHelp.add(label); //urlWithHelp.add(label);
if(this.needRenamePane){ if(this.needRenamePane){
headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE,LayoutConstants.VGAP_SMALL)); headerPane.setLayout(new BorderLayout(LayoutConstants.VGAP_LARGE,LayoutConstants.VGAP_SMALL));

34
designer_base/src/com/fr/design/hyperlink/WebHyperlinkPane.java

@ -40,7 +40,7 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Parameters"), null)); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Parameters"), null));
useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter")); useCJKCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Use_CJK_to_encode_parameter"));
extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters")); extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters"));
@ -167,4 +167,36 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
return ParameterTableModel.CHART_METER_USE; return ParameterTableModel.CHART_METER_USE;
} }
} }
public WebHyperNorthPane getNorthPane() {
return northPane;
}
public void setNorthPane(WebHyperNorthPane northPane) {
this.northPane = northPane;
}
public ReportletParameterViewPane getParameterViewPane() {
return parameterViewPane;
}
public void setParameterViewPane(ReportletParameterViewPane parameterViewPane) {
this.parameterViewPane = parameterViewPane;
}
public UICheckBox getUseCJKCheckBox() {
return useCJKCheckBox;
}
public void setUseCJKCheckBox(UICheckBox useCJKCheckBox) {
this.useCJKCheckBox = useCJKCheckBox;
}
public UICheckBox getExtendParametersCheckBox() {
return extendParametersCheckBox;
}
public void setExtendParametersCheckBox(UICheckBox extendParametersCheckBox) {
this.extendParametersCheckBox = extendParametersCheckBox;
}
} }

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

@ -480,3 +480,10 @@ FR-Designer_Data_Analysis_Settings=Data Analysis Settings
FR-Designer_Browser_Background=Browser Background FR-Designer_Browser_Background=Browser Background
FR-Designer_Import_Css=Import Css FR-Designer_Import_Css=Import Css
FR-Designer_Import_JavaScript=Import JavaScript FR-Designer_Import_JavaScript=Import JavaScript
FR-Designer-Datasource-Param_DES=<html>&nbsp;you can type "${abc}" as a parameter, here, abc is a parameter name. <br/>&nbsp;for example\: select * from table where id\=${abc}.<br/>&nbsp;select * from table where id\='${abc}'.(if the field id is typeof string)</html>
FR-Designer-DS-Database_Query=
FR-Designer_Is_Share_DBTableData=
FR-Designer-LayerPageReport_PageQuery=
FR-Designer-LayerPageReport_Define_PageQuerySQL=
FR-Designer_Event=
FR-Designer_Properties=

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

@ -479,3 +479,10 @@ FR-Designer_Data_Analysis_Settings=Data Analysis Settings
FR-Designer_Browser_Background=Browser Background FR-Designer_Browser_Background=Browser Background
FR-Designer_Import_Css=Reference Css FR-Designer_Import_Css=Reference Css
FR-Designer_Import_JavaScript=Reference JavaScript FR-Designer_Import_JavaScript=Reference JavaScript
FR-Designer-LayerPageReport_PageQuery=Page Break query
FR-Designer-LayerPageReport_Define_PageQuerySQL=Define sql for page break query
FR-Designer-Datasource-Param_DES=<html>&nbsp;You can type "${abc}" as a parameter, here, abc is a parameter name. <br/>&nbsp;for example\: select * from table where id\=${abc}.<br/>&nbsp;select * from table where id\='${abc}'.(if the type of id is string)</html>
FR-Designer-DS-Database_Query=DB Query
FR-Designer_Is_Share_DBTableData=Shared data set
FR-Designer_Event=Event
FR-Designer_Properties=Properties

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

@ -458,3 +458,11 @@ FR-Designer_Data_Analysis_Settings=\u30C7\u30FC\u30BF\u5206\u6790\u8A2D\u5B9A
FR-Designer_Browser_Background=\u30D6\u30E9\u30A6\u30B6\u80CC\u666F FR-Designer_Browser_Background=\u30D6\u30E9\u30A6\u30B6\u80CC\u666F
FR-Designer_Import_Css=Css\u5F15\u7528 FR-Designer_Import_Css=Css\u5F15\u7528
FR-Designer_Import_JavaScript=JavaScript\u5F15\u7528 FR-Designer_Import_JavaScript=JavaScript\u5F15\u7528
FR-Designer-Datasource-Param_DES=<html>&nbsp; "${abc}"\u3092\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3068\u3057\u3066\u5165\u529B\u3067\u304D\u307E\u3059\u3002\u3053\u3053\u3067abc\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u3002abc\u306F\u30D1\u30E9\u30E1\u30FC\u30BF\u30FC\u306E\u540D\u524D\u3067\u3059\u3002\u4F8B\u3048\u3070<br/>&nbsp;select * from table where id\=${abc}\u3002<br/>&nbsp;select * from table where id\='${abc}'\u3002(\u3082\u3057id\u306F\u6587\u5B57\u5217\u306A\u3089)</html>\uFFFD
FR-Designer-DS-Database_Query=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30AF\u30A8\u30EA\u30FC
FR-Designer-LayerPageReport_PageQuery=\u30DA\u30FC\u30B8\u5225\u30AF\u30A8\u30EA
FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u7FA9\u30DA\u30FC\u30B8\u5225\u30AF\u30A8\u30EAsql
FR-Designer_Is_Share_DBTableData=\u5171\u6709\u30C7\u30FC\u30BF\u30BB\u30C3\u30C8
FR-Designer_Event=\
FR-Designer_Properties=FR-Designer_Properties=\
\

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

@ -454,3 +454,10 @@ FR-Designer_Data_Analysis_Settings=\uB370\uC774\uD130\uBD84\uC11D\uC124\uC815
FR-Designer_Browser_Background=\uC6F9\uBE0C\uB77C\uC6B0\uC800\uBC30\uACBD FR-Designer_Browser_Background=\uC6F9\uBE0C\uB77C\uC6B0\uC800\uBC30\uACBD
FR-Designer_Import_Css=Css\uC778\uC6A9 FR-Designer_Import_Css=Css\uC778\uC6A9
FR-Designer_Import_JavaScript=JavaScript\uC778\uC6A9 FR-Designer_Import_JavaScript=JavaScript\uC778\uC6A9
FR-Designer-Datasource-Param_DES=<html>&nbsp, "${abc}"\uB97C\uB9E4\uAC1C\uBCC0\uC218\uB85C\uC785\uB825\uD560\uC218\uC788\uC73C\uBA70,abc\uB294\uB9E4\uAC1C\uBCC0\uC218\uC758\uBA85\uCE6D\uC785\uB2C8\uB2E4. \uC608\uFF1A<br/>&nbsp;select * from table where id\='${abc}'. (id\uD544\uB4DC\uAC00\uBB38\uC790\uC5F4\uC720\uD615\uC77C\uACBD\uC6B0)</html>
FR-Designer-DS-Database_Query=\uB370\uC774\uD130\uBCA0\uC774\uC2A4\uCC3E\uC544\uBCF4\uAE30
FR-Designer_Is_Share_DBTableData=\uB370\uC774\uD130\uC138\uD2B8\uACF5\uC720
FR-Designer-LayerPageReport_PageQuery=\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30
FR-Designer-LayerPageReport_Define_PageQuerySQL=\uC815\uC758\uD398\uC774\uC9C0\uB098\uB204\uAE30\uCC3E\uC544\uBCF4\uAE30sql
FR-Designer_Event=\
FR-Designer_Properties=\

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

@ -483,3 +483,10 @@ FR-Designer_Data_Analysis_Settings=\u6570\u636E\u5206\u6790\u8BBE\u7F6E
FR-Designer_Browser_Background=\u6D4F\u89C8\u5668\u80CC\u666F FR-Designer_Browser_Background=\u6D4F\u89C8\u5668\u80CC\u666F
FR-Designer_Import_Css=\u5F15\u7528Css FR-Designer_Import_Css=\u5F15\u7528Css
FR-Designer_Import_JavaScript=\u5F15\u7528JavaScript FR-Designer_Import_JavaScript=\u5F15\u7528JavaScript
FR-Designer-Datasource-Param_DES=<html>&nbsp;\u60A8\u53EF\u4EE5\u952E\u5165"${abc}"\u505A\u4E3A\u4E00\u4E2A\u53C2\u6570\uFF0C\u8FD9\u91CCabc\u662F\u53C2\u6570\u7684\u540D\u79F0\u3002\u4F8B\u5982\uFF1A<br/>&nbsp;select * from table where id\=${abc}\u3002<br/>&nbsp;select * from table where id\='${abc}'\u3002(\u5982\u679Cid\u5B57\u6BB5\u4E3A\u5B57\u7B26\u4E32\u7C7B\u578B)</html>
FR-Designer-DS-Database_Query=\u6570\u636E\u5E93\u67E5\u8BE2
FR-Designer-LayerPageReport_PageQuery=\u5206\u9875\u67E5\u8BE2
FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u4E49\u5206\u9875\u67E5\u8BE2sql
FR-Designer_Is_Share_DBTableData=\u5171\u4EAB\u6570\u636E\u96C6
FR-Designer_Event=\u4E8B\u4EF6
FR-Designer_Properties=\u5C5E\u6027

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

@ -471,3 +471,10 @@ FR-Designer_Data_Analysis_Settings=\u8CC7\u6599\u5206\u6790\u8A2D\u5B9A
FR-Designer_Browser_Background=\u700F\u89BD\u5668\u80CC\u666F FR-Designer_Browser_Background=\u700F\u89BD\u5668\u80CC\u666F
FR-Designer_Import_Css=\u5F15\u7528Css FR-Designer_Import_Css=\u5F15\u7528Css
FR-Designer_Import_JavaScript=\u5F15\u7528JavaScript FR-Designer_Import_JavaScript=\u5F15\u7528JavaScript
FR-Designer-Datasource-Param_DES=<html>&nbsp;\u60A8\u53EF\u4EE5\u9375\u5165"${abc}"\u505A\u70BA\u4E00\u500B\u53C3\u6578\uFF0C\u9019\u91CCabc\u662F\u53C3\u6578\u7684\u540D\u7A31\u3002\u4F8B\u5982\uFF1A<br/>&nbsp;select * from table where idDatasource-Procedurewaring\=\u7CFB\u7D71\u4E0D\u80FD\u81EA\u52D5\u7372\u53D6\u8A72\u5B58\u5132\u7A0B\u5E8F\u7684\u53C3\u6578\uFF0C\u8ACB\u624B\u52D5\u65B0\u589E\!
FR-Designer-DS-Database_Query=\u8CC7\u6599\u5EAB\u67E5\u8A62
FR-Designer-LayerPageReport_PageQuery=\u5206\u9801\u67E5\u8A62
FR-Designer-LayerPageReport_Define_PageQuerySQL=\u5B9A\u7FA9\u5206\u9801\u67E5\u8A62sql
FR-Designer_Is_Share_DBTableData=\u662F\u5426\u5171\u4EAB\u8CC7\u6599\u96C6
FR-Designer_Properties=\u5C6C\u6027
FR-Designer_Event=\u4E8B\u4EF6

59
designer_base/src/com/fr/design/mainframe/DesignerFrameFileDealerPane.java

@ -27,6 +27,7 @@ import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -42,6 +43,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.io.File; import java.io.File;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@ -385,25 +387,46 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
oldName = oldName.replaceAll(suffix, ""); oldName = oldName.replaceAll(suffix, "");
jd = new JDialog(); jd = new JDialog();
jd.setLayout(null); jd.setLayout(new GridLayout(2, 2));
jd.setModal(true); jd.setModal(true);
UILabel newNameLable = new UILabel(Inter.getLocText("FR-Designer_Enter-New-FileName")); UILabel newNameLabel = new UILabel(Inter.getLocText("FR-Designer_Enter-New-FileName"));
newNameLable.setBounds(20, 10, 130, 30); newNameLabel.setMinimumSize(new Dimension(150, 27));
newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
jt = new UITextField(oldName); jt = new UITextField(oldName);
jt.getDocument().addDocumentListener(getdoDocumentListener()); jt.getDocument().addDocumentListener(getdoDocumentListener());
jt.selectAll(); jt.selectAll();
jt.setBounds(130, 15, 150, 20); jt.setPreferredSize(new Dimension(150, 20));
jd.add(newNameLable);
jd.add(jt); JPanel newNamePanel = new JPanel();
newNamePanel.setLayout(new BoxLayout(newNamePanel, BoxLayout.X_AXIS));
newNamePanel.add(Box.createHorizontalGlue());
newNamePanel.add(newNameLabel);
newNamePanel.add(Box.createHorizontalStrut(5));
jd.add(newNamePanel);
JPanel jtPanel = new JPanel();
jtPanel.setLayout(new BoxLayout(jtPanel, BoxLayout.Y_AXIS));
JPanel containJt = new JPanel(new BorderLayout());
containJt.add(jt, BorderLayout.WEST);
containJt.setMaximumSize(new Dimension(200, 20));
jtPanel.add(Box.createVerticalGlue());
jtPanel.add(containJt);
jtPanel.add(Box.createVerticalGlue());
jd.add(jtPanel);
addUITextFieldListener(nodeFile, path); addUITextFieldListener(nodeFile, path);
hintsLabel = new UILabel(); hintsLabel = new UILabel();
hintsLabel.setBounds(20, 50, 250, 30); hintsLabel.setBounds(20, 50, 250, 30);
hintsLabel.setMaximumSize(new Dimension(200, 30));
hintsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
hintsLabel.setForeground(Color.RED); hintsLabel.setForeground(Color.RED);
hintsLabel.setVisible(false); hintsLabel.setVisible(false);
confirmButton = new UIButton(Inter.getLocText("FR-Designer_Confirm")); confirmButton = new UIButton(Inter.getLocText("FR-Designer_Confirm"));
confirmButton.setBounds(180, 90, 60, 25); confirmButton.setPreferredSize(new Dimension(80, 25));
confirmButton.setMinimumSize(new Dimension(80, 25));
confirmButton.setMaximumSize(new Dimension(80, 25));
confirmButton.addActionListener(new ActionListener() { confirmButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
confirmClose(nodeFile, path); confirmClose(nodeFile, path);
@ -411,17 +434,31 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
}); });
UIButton cancelButton = new UIButton(Inter.getLocText("FR-Designer_Cancel")); UIButton cancelButton = new UIButton(Inter.getLocText("FR-Designer_Cancel"));
cancelButton.setBounds(250, 90, 60, 25); cancelButton.setPreferredSize(new Dimension(80, 25));
cancelButton.setMinimumSize(new Dimension(80, 25));
cancelButton.setMaximumSize(new Dimension(80, 25));
cancelButton.addActionListener(new ActionListener() { cancelButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
jd.dispose(); jd.dispose();
} }
}); });
jd.add(cancelButton); JPanel hintsPanel = new JPanel();
jd.add(confirmButton); hintsPanel.setLayout(new BorderLayout());
hintsPanel.add(hintsLabel, BorderLayout.EAST);
jd.add(hintsLabel); jd.add(hintsLabel);
jd.setSize(340, 180);
JPanel btPanel = new JPanel(new BorderLayout());
btPanel.setLayout(new BoxLayout(btPanel, BoxLayout.X_AXIS));
btPanel.add(Box.createHorizontalGlue());
btPanel.add(confirmButton);
btPanel.add(Box.createHorizontalStrut(5));
btPanel.add(cancelButton);
btPanel.add(Box.createHorizontalStrut(20));
jd.add(btPanel);
jd.setSize(380, 200);
jd.setTitle(Inter.getLocText("FR-Designer_Rename")); jd.setTitle(Inter.getLocText("FR-Designer_Rename"));
jd.setResizable(false); jd.setResizable(false);
jd.setAlwaysOnTop(true); jd.setAlwaysOnTop(true);

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

@ -140,8 +140,31 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单 // 添加帮助菜单
menuList.add(createHelpMenuDef()); menuList.add(createHelpMenuDef());
// 添加社区菜单
addCommunityMenuDef(menuList);
return menuList.toArray(new MenuDef[menuList.size()]); return menuList.toArray(new MenuDef[menuList.size()]);
} }
public void addCommunityMenuDef(java.util.List<MenuDef> menuList){
Locale locale = FRContext.getLocale();
Locale [] locales =supportCommunityLocales();
for(int i = 0; i < locales.length; i++) {
if(locale.equals(locales[i])){
menuList.add(createCommunityMenuDef());
break;
}
}
}
public Locale[] supportCommunityLocales() {
return new Locale[]{
Locale.CHINA,
Locale.JAPAN,
Locale.TAIWAN,
Locale.US,
};
}
public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) { public void insertTemplateExtendMenu(ToolBarMenuDockPlus plus, MenuDef[] menuDefs) {
// 给菜单加插件入口 // 给菜单加插件入口
@ -295,7 +318,9 @@ public abstract class ToolBarMenuDock {
//shortCuts.add(new TutorialAction()); //shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) { if (ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)) {
shortCuts.add(new FeedBackAction());
// mod by anchore 16/11/17 去掉反馈
//shortCuts.add(new FeedBackAction());
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
// shortCuts.add(new ForumAction()); // shortCuts.add(new ForumAction());

50
designer_base/src/com/fr/design/menu/KeySetUtils.java

@ -4,10 +4,13 @@
package com.fr.design.menu; package com.fr.design.menu;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.util.Locale;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
@ -63,7 +66,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M_Close_Current"); return Inter.getLocText("FR-Designer_Close");
} }
@Override @Override
@ -80,7 +83,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-Save"); return Inter.getLocText("FR-Designer_Save");
} }
@Override @Override
@ -148,7 +151,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Export"); return Inter.getLocText("FR-Designer_Export");
} }
@Override @Override
@ -183,7 +186,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Export-Excel-Page"); return Inter.getLocText("FR-Engine_Export-Excel-Page");
} }
@Override @Override
@ -201,7 +204,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Export-Excel-Simple"); return Inter.getLocText("FR-Engine_Export-Excel-Simple");
} }
@Override @Override
@ -219,7 +222,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Export-Excel-PageToSheet"); return Inter.getLocText("FR-Engine_Export-Excel-PageToSheet");
} }
@Override @Override
@ -362,7 +365,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("ExportAndOutput"); return Inter.getLocText("FR-Designer_ExportAndOutput");
} }
@Override @Override
@ -379,7 +382,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return "EXCEL"+Inter.getLocText("ExportAndOutput"); return "EXCEL"+Inter.getLocText("FR-Designer_ExportAndOutput");
} }
@Override @Override
@ -413,7 +416,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-SwitchWorkspace"); return Inter.getLocText("FR-Designer_M-SwitchWorkspace");
} }
@Override @Override
@ -430,7 +433,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-Exit"); return Inter.getLocText("FR-Designer_M-Exit");
} }
@Override @Override
@ -448,7 +451,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-Template"); return Inter.getLocText("FR-Designer_M-Template");
} }
@Override @Override
@ -639,7 +642,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("ReportColumns-Columns"); return Inter.getLocText("FR-Designer_ReportColumns-Columns");
} }
@Override @Override
@ -657,7 +660,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-Repeat-Freeze"); return Inter.getLocText("FR-Designer_M-Repeat-Freeze");
} }
@Override @Override
@ -675,7 +678,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Frozen"); return Inter.getLocText("FR-Engine_Frozen");
} }
@Override @Override
@ -710,7 +713,14 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText(new String[]{"Allow", "DashBoard-Potence", "Edit"});
// mod by anchore 16/11/16
if (ComparatorUtils.equals(Locale.JAPAN, GeneralContext.getLocale())) {
return Inter.getLocText(new String[]{"FR-Engine_RP_Authority_Edit", "Allow"});
} else {
return Inter.getLocText(new String[]{"Allow", "FR-Engine_RP_Authority_Edit"});
}
//return Inter.getLocText(new String[]{"Allow", "DashBoard-Potence", "Edit"});
} }
@Override @Override
@ -727,7 +737,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("M-Cell"); return Inter.getLocText("FR-Designer_Cell");
} }
@Override @Override
@ -761,7 +771,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Widget-Settings"); return Inter.getLocText("FR-Designer_Widget-Settings");
} }
@Override @Override
@ -795,7 +805,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Condition_Attributes"); return Inter.getLocText("FR-Designer_Condition_Attributes");
} }
@Override @Override
@ -812,7 +822,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Present"); return Inter.getLocText("FR-Chart-Style_Present");
} }
@Override @Override
@ -880,7 +890,7 @@ public class KeySetUtils {
@Override @Override
public String getMenuName() { public String getMenuName() {
return Inter.getLocText("Currency_Line"); return Inter.getLocText("FR-Designer_Currency_Line");
} }
@Override @Override

338
designer_base/src/com/fr/design/style/AbstractPopBox.java

@ -9,6 +9,7 @@ import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.awt.*; import java.awt.*;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,212 +22,211 @@ import java.util.List;
*/ */
public abstract class AbstractPopBox extends JPanel { public abstract class AbstractPopBox extends JPanel {
protected BackgroundJComponent displayComponent; protected BackgroundJComponent displayComponent;
private JWindow selectPopupWindow; private JWindow selectPopupWindow;
private boolean isWindowEventInit = false; private boolean isWindowEventInit = false;
private static int GAP = 2; private static int GAP = 2;
private static int GAP2 = 20; private static int GAP2 = 20;
private List<ChangeListener> changeListenerList = new ArrayList<ChangeListener>(); private List<ChangeListener> changeListenerList = new ArrayList<ChangeListener>();
MouseAdapter mouseListener = new MouseAdapter() { MouseAdapter mouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent evt) { public void mousePressed(MouseEvent evt) {
showPopupMenu(); showPopupMenu();
} }
public void mouseExited(MouseEvent evt) {
int x= evt.getXOnScreen();//mac和widows的计算结果还不一样 };
int y = evt.getYOnScreen();
if (selectPopupWindow != null) { AWTEventListener awt = new AWTEventListener() {
Rectangle rectangle = selectPopupWindow.getBounds(); public void eventDispatched(AWTEvent event) {
boolean b1 = x < rectangle.x - GAP || x > rectangle.x + rectangle.width + GAP; if (event instanceof MouseEvent) {
boolean b2 = y < rectangle.y - GAP || y >rectangle.y + rectangle.height + GAP; MouseEvent evt = (MouseEvent) event;
if(b1 || b2) { if (evt.getClickCount() > 0) {
hidePopupMenu(); mouseClick(evt);
} }
// if (OperatingSystem.isWindows()) { }
// }
// }else{ };
// Point pp = SwingUtilities.convertPoint(evt.getComponent(), evt.getPoint(), selectPopupWindow.getParent());
// Rectangle rectangle = selectPopupWindow.getBounds(); private void showPopupMenu() {
// if (pp.getY() < rectangle.getY() || pp.getY() > rectangle.getY() + rectangle.getHeight()) { if (selectPopupWindow != null && selectPopupWindow.isVisible()) {
// //hidePopupMenu(); hidePopupMenu();
// } return;
// } }
}
} if (!this.isEnabled()) {
}; return;
}
private void showPopupMenu() { Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK);
if (selectPopupWindow != null && selectPopupWindow.isVisible()) {
hidePopupMenu(); selectPopupWindow = this.getControlWindow();
return;
} Point convertPoint = new Point(0, 0);
if (!this.isEnabled()) { // e: 将点(0,0)从ColorSelectionPane的坐标系统转换到屏幕坐标.
return; SwingUtilities.convertPointToScreen(convertPoint, this);
} int y = convertPoint.y + this.getSize().height;
int x = convertPoint.x;
selectPopupWindow = this.getControlWindow(); int h = y + selectPopupWindow.getHeight();
int width = x + selectPopupWindow.getWidth();
Point convertPoint = new Point(0, 0); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
if (h > screenSize.height) {
// e: 将点(0,0)从ColorSelectionPane的坐标系统转换到屏幕坐标. y = y - selectPopupWindow.getHeight() - GAP2;// 超过屏幕高度了
SwingUtilities.convertPointToScreen(convertPoint, this); }
int y = convertPoint.y + this.getSize().height;
int x = convertPoint.x; if (width > screenSize.width) {
int h = y + selectPopupWindow.getHeight(); x = screenSize.width - selectPopupWindow.getWidth();
int width = x + selectPopupWindow.getWidth(); }
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); selectPopupWindow.setLocation(x, y);
if (h > screenSize.height) {
y = y - selectPopupWindow.getHeight() - GAP2;// 超过屏幕高度了 selectPopupWindow.setVisible(true);
}
//wei : 为了点击别的地方下拉颜色窗口消失
if(width > screenSize.width) { MouseAdapter parentMouseListener = new MouseAdapter() {
x = screenSize.width - selectPopupWindow.getWidth(); public void mousePressed(MouseEvent evt) {
} mouseClick(evt);
selectPopupWindow.setLocation(x, y); }
};
selectPopupWindow.setVisible(true); if (!this.isWindowEventInit && SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this) != null) {
SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this).addMouseListener(parentMouseListener);
//wei : 为了点击别的地方下拉颜色窗口消失 this.isWindowEventInit = true;
MouseAdapter parentMouseListener = new MouseAdapter() { }
public void mousePressed(MouseEvent evt) { }
mouseClick(evt);
} private void mouseClick(MouseEvent evt) {
}; Point point = new Point((int) (evt.getLocationOnScreen().getX()), (int) evt.getLocationOnScreen().getY());
if (!this.isWindowEventInit && SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this) != null) { Dimension popBoxD = AbstractPopBox.this.getSize();
SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this).addMouseListener(parentMouseListener); Point popBoxP = AbstractPopBox.this.getLocationOnScreen();
this.isWindowEventInit = true; Dimension popMenuD = this.getControlWindow().getSize();
} Point popMenuP = this.getControlWindow().getLocation();
} Rectangle popBoxRect = new Rectangle(popBoxP, popBoxD);
Rectangle popMenuRect = new Rectangle(popMenuP, popMenuD);
private void mouseClick(MouseEvent evt) { if (!popBoxRect.contains(point) && !popMenuRect.contains(point)) {
int x = evt.getLocationOnScreen().x; this.hidePopupMenu();
int y = evt.getLocationOnScreen().y; }
Rectangle rectangle = this.getControlWindow().getBounds(); }
boolean b1 = x < rectangle.x || x > rectangle.x + rectangle.width;
boolean b2 = y < rectangle.y || y > rectangle.y + rectangle.height; protected void hidePopupMenu() {
if (b1 || b2) { if (selectPopupWindow != null) {
this.hidePopupMenu(); selectPopupWindow.setVisible(false);
} }
}
selectPopupWindow = null;
protected void hidePopupMenu() { Toolkit.getDefaultToolkit().removeAWTEventListener(awt);
if (selectPopupWindow != null) { }
selectPopupWindow.setVisible(false);
} protected JWindow getControlWindow() {
//find parent.
selectPopupWindow = null; if (this.selectPopupWindow == null) {
} Window parentWindow = SwingUtilities.windowForComponent(this);
if (parentWindow != null) {
protected JWindow getControlWindow() { this.selectPopupWindow = new SelectControlWindow(parentWindow);
//find parent. }
if (this.selectPopupWindow == null) {
Window parentWindow = SwingUtilities.windowForComponent(this); selectPopupWindow.addMouseListener(new MouseAdapter() {
if (parentWindow != null) { public void mouseExited(MouseEvent evt) {
this.selectPopupWindow = new SelectControlWindow(parentWindow); int x = evt.getLocationOnScreen().x;
} int y = evt.getLocationOnScreen().y;
selectPopupWindow.addMouseListener(new MouseAdapter() { if (selectPopupWindow != null) {
public void mouseExited(MouseEvent evt) { double desValue = 2;
int x = evt.getLocationOnScreen().x; Rectangle rectangle = selectPopupWindow.getBounds();
int y = evt.getLocationOnScreen().y;
if (selectPopupWindow != null) {
double desValue = 2;
Rectangle rectangle = selectPopupWindow.getBounds();
boolean b1 = x < rectangle.x + desValue || x >= rectangle.x + rectangle.width - desValue; boolean b1 = x < rectangle.x + desValue || x >= rectangle.x + rectangle.width - desValue;
boolean b2 = y > rectangle.y + rectangle.height - desValue;//避免了鼠标下移刚进入selectPopupWindow的过程中弹出框隐藏,上移移出后由AbstractPopBox的mouseListener处理 boolean b2 = y > rectangle.y + rectangle.height - desValue;//避免了鼠标下移刚进入selectPopupWindow的过程中弹出框隐藏,上移移出后由AbstractPopBox的mouseListener处理
if (b1 || b2) { if (b1 || b2) {
hidePopupMenu(); hidePopupMenu();
} }
} }
} }
}); });
} }
return selectPopupWindow; return selectPopupWindow;
} }
/** /**
* 添加事件 * 添加事件
*
* @param changeListener 事件 * @param changeListener 事件
*/ */
public void addSelectChangeListener(ChangeListener changeListener) { public void addSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.add(changeListener); this.changeListenerList.add(changeListener);
} }
/** /**
* 删除事件 * 删除事件
*
* @param changeListener 事件 * @param changeListener 事件
*/ */
public void removeSelectChangeListener(ChangeListener changeListener) { public void removeSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.remove(changeListener); this.changeListenerList.remove(changeListener);
} }
/** /**
* 响应事件 * 响应事件
*/ */
public void fireChangeListener() { public void fireChangeListener() {
if (!changeListenerList.isEmpty()) { if (!changeListenerList.isEmpty()) {
ChangeEvent evt = new ChangeEvent(this); ChangeEvent evt = new ChangeEvent(this);
for (int i = 0; i < changeListenerList.size(); i++) { for (int i = 0; i < changeListenerList.size(); i++) {
this.changeListenerList.get(i).stateChanged(evt); this.changeListenerList.get(i).stateChanged(evt);
} }
} }
} }
/** /**
* 待说明 * 待说明
*
* @param background 背景 * @param background 背景
*/ */
public void fireDisplayComponent(Background background) { public void fireDisplayComponent(Background background) {
if (displayComponent != null) { if (displayComponent != null) {
displayComponent.setSelfBackground(background); displayComponent.setSelfBackground(background);
} }
fireChangeListener(); fireChangeListener();
this.repaint(); this.repaint();
} }
/** /**
* 初始化弹出框的面板 * 初始化弹出框的面板
*
* @param preWidth 宽度 * @param preWidth 宽度
* @return 弹出面板 * @return 弹出面板
*/ */
public abstract JPanel initWindowPane(double preWidth); public abstract JPanel initWindowPane(double preWidth);
private class SelectControlWindow extends JWindow { private class SelectControlWindow extends JWindow {
private static final long serialVersionUID = -5776589767069105911L; private static final long serialVersionUID = -5776589767069105911L;
public SelectControlWindow(Window paranet) { public SelectControlWindow(Window paranet) {
super(paranet); super(paranet);
this.initComponents(); this.initComponents();
} }
public void initComponents() { public void initComponents() {
JPanel defaultPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel defaultPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setContentPane(defaultPane); this.setContentPane(defaultPane);
// defaultPane.setBorder(UIManager.getBorder("PopupMenu.border")); // defaultPane.setBorder(UIManager.getBorder("PopupMenu.border"));
if (displayComponent != null) { if (displayComponent != null) {
defaultPane.add(initWindowPane(displayComponent.getPreferredSize().getWidth())); defaultPane.add(initWindowPane(displayComponent.getPreferredSize().getWidth()));
} else { } else {
defaultPane.add(initWindowPane(20)); defaultPane.add(initWindowPane(20));
} }
this.pack(); this.pack();
} }
@Override @Override
public void setVisible(boolean b) { public void setVisible(boolean b) {
super.setVisible(b); super.setVisible(b);
AbstractPopBox.this.repaint(); AbstractPopBox.this.repaint();
} }
} }
protected boolean isPopupVisible() { protected boolean isPopupVisible() {
return selectPopupWindow == null ? false : selectPopupWindow.isVisible(); return selectPopupWindow == null ? false : selectPopupWindow.isVisible();
} }
} }

5
designer_base/src/com/fr/design/style/color/NewColorSelectPane.java

@ -93,7 +93,10 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable {
} }
centerPane.add(Box.createVerticalStrut(1)); centerPane.add(Box.createVerticalStrut(1));
UIButton customButton = new UIButton(Inter.getLocText(new String[]{"More", "Color"}) + "...");
// mod by anchore 16/11/16
UIButton customButton = new UIButton(Inter.getLocText("FR-Designer-Basic_More_Color"));
//UIButton customButton = new UIButton(Inter.getLocText(new String[]{"More", "Color"}) + "...");
customButton.addMouseListener(new MouseAdapter() { customButton.addMouseListener(new MouseAdapter() {
@Override @Override

49
designer_chart/.classpath

@ -1,20 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/> <classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/> <classpathentry kind="lib" path="D:/code/finedesignlib/3rd.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/> <classpathentry kind="lib" path="D:/code/finedesignlib/ant-junit.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-base"/> <classpathentry kind="lib" path="D:/code/finedesignlib/cglib-nodep-2.2.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartattr"/> <classpathentry kind="lib" path="D:/code/finedesignlib/commons-codec-1.6.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartglyph"/> <classpathentry kind="lib" path="D:/code/finedesignlib/commons-logging-1.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-web"/> <classpathentry kind="lib" path="D:/code/finedesignlib/easymock-3.2.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartdata"/> <classpathentry kind="lib" path="D:/code/finedesignlib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="/lib/3rd.jar" sourcepath="/lookandfeel"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jamm.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jna.jar"/>
<classpathentry kind="lib" path="/lib/poi2007_fat.jar"/> <classpathentry kind="lib" path="D:/code/finedesignlib/jts-1.13.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit-4.12.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/mysql-connector-java-5.1.6-bin.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/objenesis-2.1.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ojdbc14.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-xmla-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/quartz.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/servlet-api.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqlite-jdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqljdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swag.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swexpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swt.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/Sybelux.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/xercesImpl.jar"/>
<classpathentry kind="lib" path="D:/code/fr-chart-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-performance-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-platform-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-report-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-third-8.0.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

18
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -38,7 +38,7 @@ import javax.swing.*;
import java.util.*; import java.util.*;
/** /**
* Created by eason on 14/12/29. * Created by eason on 14/12/29.
*/ */
public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider { public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraChartDesignClassManagerProvider {
@ -163,7 +163,7 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
Map.Entry entry = (Map.Entry) iterator.next(); Map.Entry entry = (Map.Entry) iterator.next();
String priority = (String) entry.getKey(); String priority = (String) entry.getKey();
String imagePath = getIconPath(priority, plotID); String imagePath = getIconPath(priority, plotID);
if (!StringUtils.isEmpty(imagePath)) { if (StringUtils.isNotEmpty(imagePath)) {
return imagePath; return imagePath;
} }
} }
@ -273,10 +273,20 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
*/ */
public String getTitle4PopupWindow(String priority, String plotID){ public String getTitle4PopupWindow(String priority, String plotID){
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)){ if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)){
HashMap<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority);
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID); IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID);
return provider.getPlotTypePane().title4PopupWindow(); return provider.getPlotTypePane().title4PopupWindow();
}
//兼容老的插件
if (chartTypeInterfaces != null) {
Iterator iterator = chartTypeInterfaces.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry entry = (Map.Entry) iterator.next();
String defaultPriority = (String) entry.getKey();
if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) {
return chartTypeInterfaces.get(defaultPriority).get(plotID).getPlotTypePane().title4PopupWindow();
}
}
} }
return new String(); return new String();
} }

4
designer_chart/src/com/fr/design/chart/fun/impl/AbstractIndependentChartUIWithAPILevel.java

@ -15,7 +15,9 @@ import com.fr.general.ComparatorUtils;
* Created by Mitisky on 16/3/7. * Created by Mitisky on 16/3/7.
*/ */
public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider { public abstract class AbstractIndependentChartUIWithAPILevel implements IndependentChartUIProvider {
private static final int OLD_PLUGIN_LEVEL = 3; //这个不能改,是做兼容用的
//2016.10.14-11.24号的8.0jar因为改了这个为3,不会提示5.26号之前的插件更新
private static final int OLD_PLUGIN_LEVEL = -2;
@Override @Override
//以前的插件没有覆写这个方法,所以始终获取到-2,比当前level低,提示更新. //以前的插件没有覆写这个方法,所以始终获取到-2,比当前level低,提示更新.

13
designer_chart/src/com/fr/design/chart/series/SeriesCondition/DataSeriesConditionPane.java

@ -27,13 +27,22 @@ import java.util.Iterator;
* Time : 上午9:16 * Time : 上午9:16
*/ */
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> { public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
protected Plot plot;
public DataSeriesConditionPane(Plot plot) {
public DataSeriesConditionPane() { this.plot = plot;
initAvailableActionList(); initAvailableActionList();
initComponents(); initComponents();
} }
public void setPlot(Plot plot) {
this.plot = plot;
}
public DataSeriesConditionPane() {
this(null);
}
private void initAvailableActionList() { private void initAvailableActionList() {
addBasicAction(); addBasicAction();
addAxisPositionAction(); addAxisPositionAction();

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

@ -114,5 +114,4 @@ public class ChartDataPane extends AbstractChartAttrPane {
public void refreshChartDataPane(ChartCollection collection){ public void refreshChartDataPane(ChartCollection collection){
this.populate(collection); this.populate(collection);
} }
} }

46
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java

@ -61,22 +61,6 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
//所以:stopEditing--选中其他button则响应click之后relayout;普通失焦则直接relayout. //所以:stopEditing--选中其他button则响应click之后relayout;普通失焦则直接relayout.
private boolean pressOtherButtonWhenEditing = false; private boolean pressOtherButtonWhenEditing = false;
// private AWTEventListener awt = new AWTEventListener() {
// public void eventDispatched(AWTEvent event) {
// //没有进行鼠标点击,则返回
// if (event instanceof MouseEvent && ((MouseEvent) event).getClickCount() > 0) {
// if (currentEditingEditor != null && !ComparatorUtils.equals(event.getSource(), currentEditingEditor)) {
// stopEditing();
// if (event.getSource() instanceof ChartChangeButton) {
// ((ChartChangeButton) event.getSource()).mouseClick((MouseEvent) event);
// }
// populateBean(editingCollection);
// }
// }
// }
// };
public ChartTypeButtonPane(ChartTypePane chartTypePane){ public ChartTypeButtonPane(ChartTypePane chartTypePane){
this(); this();
parent = chartTypePane; parent = chartTypePane;
@ -275,8 +259,9 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
break; break;
} }
} }
if (editChartType != null) { //切换时重新更新整个面板
editChartType.populateBean(editingCollection.getSelectedChart()); if (parent != null) {
parent.populate(editingCollection);
} }
} }
} }
@ -439,26 +424,23 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
} }
private void deleteAButton() { private void deleteAButton() {
//先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到indexList中,导致面板无法删除
if (editingCollection != null) {
int count = editingCollection.getChartCount();
for (int i = 0; i < count; i++) {
if (ComparatorUtils.equals(getButtonName(), editingCollection.getChartName(i))) {
editingCollection.removeNameObject(i);
break;
}
}
}
if (indexList.contains(this) && indexList.size() > 1) { if (indexList.contains(this) && indexList.size() > 1) {
indexList.remove(this); indexList.remove(this);
if (this.isSelected()) { if (this.isSelected()) {
indexList.get(0).setSelected(true); indexList.get(0).setSelected(true);
changeCollectionSelected(indexList.get(0).getButtonName()); changeCollectionSelected(indexList.get(0).getButtonName());
} }
if (editingCollection != null) {
int count = editingCollection.getChartCount();
for (int i = 0; i < count; i++) {
if (ComparatorUtils.equals(getButtonName(), editingCollection.getChartName(i))) {
editingCollection.removeNameObject(i);
if (i <= editingCollection.getSelectedIndex()){
editingCollection.setSelectedIndex(editingCollection.getSelectedIndex()-1);
}
break;
}
}
}
} }
//获取图表收集器的状态 //获取图表收集器的状态

11
designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java

@ -291,8 +291,10 @@ public class ChartTypePane extends AbstractChartAttrPane{
paneState.setPaneState(collection.getState()); paneState.setPaneState(collection.getState());
} }
// TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构
private boolean needReactor(ChartCollection collection) { private boolean needReactor(ChartCollection collection) {
return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState(); /*return paneState.getChartID() != collection.getRepresentChartID() || paneState.getPaneState() != collection.getState();*/
return true;
} }
/** /**
@ -300,8 +302,15 @@ public class ChartTypePane extends AbstractChartAttrPane{
*/ */
public void populate(ChartCollection collection) { public void populate(ChartCollection collection) {
Chart chart = collection.getSelectedChart(); Chart chart = collection.getSelectedChart();
this.remove(leftContentPane);
initContentPane();
buttonPane.populateBean(collection); buttonPane.populateBean(collection);
chartTypePane.populateBean(chart); chartTypePane.populateBean(chart);
//remove面板之后,就需要重构下拉框
reactorChartTypePane(collection);
this.initAllListeners();
} }
/** /**

2
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -432,7 +432,7 @@ public class ChartDatapointLabelPane extends BasicPane{
this.percentFormatPane = new FormatPane(); this.percentFormatPane = new FormatPane();
} }
if(this.percentFormat == null){ if(this.percentFormat == null){
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%"); DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%");
percentFormatPane.populateBean(defaultFormat); percentFormatPane.populateBean(defaultFormat);
this.percentFormat = defaultFormat; this.percentFormat = defaultFormat;
} }

44
designer_form/.classpath

@ -1,15 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/> <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" kind="src" path="/form"/>
<classpathentry combineaccessrules="false" kind="src" path="/designer_base"/> <classpathentry combineaccessrules="false" kind="src" path="/designer_base"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/> <classpathentry kind="lib" path="D:/code/fr-chart-8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/> <classpathentry kind="lib" path="D:/code/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="/lib/3rd.jar"/> <classpathentry kind="lib" path="D:/code/fr-performance-8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/> <classpathentry kind="lib" path="D:/code/fr-platform-8.0.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/> <classpathentry kind="lib" path="D:/code/fr-report-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/fr-third-8.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/3rd.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ant-junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/cglib-nodep-2.2.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-codec-1.6.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/easymock-3.2.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/hamcrest-core-1.3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jamm.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jna.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jts-1.13.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/junit-4.12.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/mysql-connector-java-5.1.6-bin.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/objenesis-2.1.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/ojdbc14.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/olap4j-xmla-1.1.0.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/postgresql-8.0-311.jdbc3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/quartz.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sapjco3.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/servlet-api.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqlite-jdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/sqljdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swag.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swexpl.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/swt.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/Sybelux.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/xercesImpl.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

10
designer_form/build.master.gradle

@ -47,6 +47,16 @@ def dataContent ={def dir ->
} }
} }
} }
FileTree f1=fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/build/libs/*.jar")
f1.each{File file->
println "----------${file.path}"
}
FileTree f2=fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
f2.each{File file->
println "----------${file.path}"
}
//.java文件复制到classes文件夹下 //.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){ task copyFile(type:Copy,dependsOn:compileJava){

93
designer_form/build.master.gradle.bak

@ -0,0 +1,93 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.7
//jar包版本
version='8.0'
def srcDir="."
//jar包的名字
jar{
baseName='fr-designer-report'
}
//
sourceSets{
main{
java{
srcDirs=["${srcDir}/src",
"${srcDir}/../designer/src"]
}
}
}
//
FileTree files =fileTree(dir:'./',include:'build.*.gradle')
def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
//
dependencies{
compile fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//
def dataContent ={def dir ->
copySpec{
from ("${dir}"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
}
}
FileTree f1=fileTree(dir:'../../../'include:"finereport-*-stable/${branchName}/build/libs/*.jar")
f1.each{File file->
println "----------${file.path}"
}
FileTree f2=fileTree(dir:"../../../finereport-lib-stable/${branchName}",include:'**/*.jar')
f2.each{File file->
println "----------${file.path}"
}
//.java文件复制到classes文件夹下
task copyFile(type:Copy,dependsOn:compileJava){
copy{
with dataContent.call("${srcDir}/src")
with dataContent.call("${srcDir}/../designer/src")
into ('build/classes/main')
}
}
//js文件
task compressJS{
ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
classpath {
fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
}
}
ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
fileset (dir:"${srcDir}/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
fileset (dir:"${srcDir}/../designer/src"){
include (name:'**/*.js')
include (name:'**/*.css')
}
}
}
jar.dependsOn compressJS

35
designer_form/src/com/fr/design/designer/beans/adapters/layout/FRFitLayoutAdapter.java

@ -42,7 +42,16 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png"; public static final String WIDGETPANEICONPATH = "/com/fr/web/images/form/resources/layout_absolute.png";
private static final int DEPENDING_SCOPE = 3; private static final int DEPENDING_SCOPE = 3;
private HoverPainter painter; private HoverPainter painter;
//区分拖拽和编辑宽高
private boolean isEdit;
public boolean isEdit() {
return isEdit;
}
public void setEdit(boolean edit) {
isEdit = edit;
}
/** /**
* 构造函数 * 构造函数
* *
@ -411,13 +420,15 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
// 根据需要依附的位置调整拖拽的坐标值 // 根据需要依附的位置调整拖拽的坐标值
private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) { private int adjustCoordinateByDependingLine(int coordinate, int[] coordinates) {
for (int i = 0; i < coordinates.length; i++) { if(!isEdit) {
if (coordinate == coordinates[i]) { for (int i = 0; i < coordinates.length; i++) {
continue; if (coordinate == coordinates[i]) {
} continue;
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) { }
coordinate = coordinates[i]; if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) {
break; coordinate = coordinates[i];
break;
}
} }
} }
return coordinate; return coordinate;
@ -425,10 +436,12 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
// 根据需要依附的位置调整拖拽的距离 // 根据需要依附的位置调整拖拽的距离
private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) { private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) {
for (int i = 0; i < coordinates.length; i++) { if(!isEdit) {
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) { for (int i = 0; i < coordinates.length; i++) {
diff = coordinates[i] - coordinate; if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) {
break; diff = coordinates[i] - coordinate;
break;
}
} }
} }
return diff; return diff;

43
designer_form/src/com/fr/design/designer/properties/FRFitLayoutConstraints.java

@ -2,8 +2,6 @@ package com.fr.design.designer.properties;
import com.fr.design.designer.beans.AdapterBus; import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter; import com.fr.design.designer.beans.adapters.layout.FRFitLayoutAdapter;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor; import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
@ -12,8 +10,9 @@ import com.fr.design.designer.beans.ConstraintsGroupModel;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.ComponentUtils;
import com.fr.form.ui.Widget; import com.fr.form.ui.PaddingMargin;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.*;
@ -30,8 +29,8 @@ import java.awt.*;
*/ */
//控件在自适应布局中宽度、高度属性,7.1.1不可编辑 //控件在自适应布局中宽度、高度属性,7.1.1不可编辑
public class FRFitLayoutConstraints implements ConstraintsGroupModel { public class FRFitLayoutConstraints implements ConstraintsGroupModel {
private static final int MINHEIGHT = XCreator.SMALL_PREFERRED_SIZE.height; private static final int MINHEIGHT = WLayout.MIN_HEIGHT;
private static final int MINWIDTH = XCreator.SMALL_PREFERRED_SIZE.width; private static final int MINWIDTH = WLayout.MIN_WIDTH;
private static final int ROWNUM = 2; private static final int ROWNUM = 2;
private DefaultTableCellRenderer renderer; private DefaultTableCellRenderer renderer;
@ -48,7 +47,7 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
@Override @Override
public String getGroupName() { public String getGroupName() {
return Inter.getLocText("Widget-Size"); return Inter.getLocText("FR-Designer-Widget_Size");
} }
@Override @Override
@ -71,9 +70,9 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
if (column == 0) { if (column == 0) {
switch (row) { switch (row) {
case 0: case 0:
return Inter.getLocText("Tree-Width"); return Inter.getLocText("FR-Designer-Tree_Width");
default: default:
return Inter.getLocText("Tree-Height"); return Inter.getLocText("FR-Designer-Tree_Height");
} }
} else { } else {
switch (row) { switch (row) {
@ -91,36 +90,45 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
int v = value == null ? 0 : ((Number) value).intValue(); int v = value == null ? 0 : ((Number) value).intValue();
int difference = 0; int difference = 0;
Rectangle bounds = getBounds(); Rectangle bounds = getBounds();
Rectangle rec = ComponentUtils.getRelativeBounds(parent);
WFitLayout wFitLayout = parent.toData();
int minHeight = (int)(MINHEIGHT * wFitLayout.getResolutionScaling());
int minWidth = (int)(MINWIDTH * wFitLayout.getResolutionScaling());
PaddingMargin margin= wFitLayout.getMargin();
switch (row) { switch (row) {
case 0: case 0:
if(v < MINWIDTH){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Width") + Integer.toString(MINWIDTH));
v = xCreator.getWidth();
}
if (bounds.width == v){ if (bounds.width == v){
return false; return false;
} }
if(bounds.width == rec.width - margin.getLeft() - margin.getRight()){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Beyond_Bounds"));
}else if(v < minWidth){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Min_Width") + Integer.toString(minWidth));
v = xCreator.getWidth();
}
difference = bounds.width - v; difference = bounds.width - v;
bounds.width = v; bounds.width = v;
break; break;
case 1: case 1:
if(v < MINHEIGHT){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Height") + Integer.toString(MINHEIGHT));
v = xCreator.getHeight();
}
if (bounds.height == v){ if (bounds.height == v){
return false; return false;
} }
if(bounds.height == rec.height - margin.getTop() - margin.getBottom()){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Beyond_Bounds"));
}else if(v < minHeight){
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Min_Height") + Integer.toString(minHeight));
v = xCreator.getHeight();
}
difference = bounds.height - v; difference = bounds.height - v;
bounds.height = v; bounds.height = v;
break; break;
} }
WFitLayout wFitLayout = parent.toData();
wFitLayout.setBounds(xCreator.toData(),bounds); wFitLayout.setBounds(xCreator.toData(),bounds);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner(); FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Rectangle backupBounds = getBounds(); Rectangle backupBounds = getBounds();
FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator); FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator);
if (layoutAdapter != null) { if (layoutAdapter != null) {
layoutAdapter.setEdit(true);
layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference); layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference);
} }
return true; return true;
@ -131,7 +139,6 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
public Rectangle getBounds(){ public Rectangle getBounds(){
Rectangle bounds = new Rectangle(xCreator.getBounds()); Rectangle bounds = new Rectangle(xCreator.getBounds());
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator);
if (parent == null) { if (parent == null) {
return bounds; return bounds;
} }

188
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -110,7 +110,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
public void initBeforeUpEdit() { public void initBeforeUpEdit() {
WidgetToolBarPane.getInstance(this); WidgetToolBarPane.getInstance(this);
EastRegionContainerPane.getInstance().replaceDownPane( EastRegionContainerPane.getInstance().replaceDownPane(
FormWidgetDetailPane.getInstance(this)); FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) { if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this)); EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
@ -123,35 +123,35 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
/** /**
* 创建权限编辑面板 * 创建权限编辑面板
* @return 面板 * @return 面板
*/ */
public AuthorityEditPane createAuthorityEditPane() { public AuthorityEditPane createAuthorityEditPane() {
return new FormWidgetAuthorityEditPane(this); return new FormWidgetAuthorityEditPane(this);
} }
/** /**
* 内容属性表面板 * 内容属性表面板
* @return 内容属性表面板 * @return 内容属性表面板
*/ */
public JPanel getEastUpPane() { public JPanel getEastUpPane() {
return WidgetPropertyPane.getInstance(this); return WidgetPropertyPane.getInstance(this);
} }
/** /**
* 参数属性表 * 参数属性表
* @return 参数属性表 * @return 参数属性表
*/ */
public JPanel getEastDownPane() { public JPanel getEastDownPane() {
return FormWidgetDetailPane.getInstance(this); return FormWidgetDetailPane.getInstance(this);
} }
/** /**
* 权限编辑面板 * 权限编辑面板
* @return 权限编辑面板 * @return 权限编辑面板
*/ */
public AuthorityEditPane getAuthorityEditPane() { public AuthorityEditPane getAuthorityEditPane() {
FormWidgetAuthorityEditPane formWidgetAuthorityEditPane = new FormWidgetAuthorityEditPane(this); FormWidgetAuthorityEditPane formWidgetAuthorityEditPane = new FormWidgetAuthorityEditPane(this);
formWidgetAuthorityEditPane.populateDetials(); formWidgetAuthorityEditPane.populateDetials();
@ -248,9 +248,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return xx.isEmpty(); return xx.isEmpty();
} }
protected void setToolbarButtons(boolean flag) { protected void setToolbarButtons(boolean flag) {
DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST); DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST);
} }
/** /**
* 看看参数面板中的控件是否有和模板参数同名的 * 看看参数面板中的控件是否有和模板参数同名的
@ -312,17 +312,17 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return SearchQueryCreators(rootContainer); return SearchQueryCreators(rootContainer);
} }
/** /**
* 返回复制粘贴删除等动作 * 返回复制粘贴删除等动作
* @return 同上 * @return 同上
*/ */
public Action[] getActions() { public Action[] getActions() {
if (designer_actions == null) { if (designer_actions == null) {
designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
new FormDeleteAction(this)}; new FormDeleteAction(this)};
} }
return designer_actions; return designer_actions;
} }
private boolean SearchQueryCreators(XLayoutContainer rootContainer) { private boolean SearchQueryCreators(XLayoutContainer rootContainer) {
boolean b = false; boolean b = false;
@ -354,9 +354,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
ParameterPropertyPane.getInstance().populateBean(p); ParameterPropertyPane.getInstance().populateBean(p);
} }
/** /**
* 初始化 * 初始化
*/ */
public void initWidgetToolbarPane() { public void initWidgetToolbarPane() {
WidgetToolBarPane.getInstance(this); WidgetToolBarPane.getInstance(this);
} }
@ -378,38 +378,38 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
this.refreshRoot(); this.refreshRoot();
} }
/** /**
* 报表直接判断底层是否是绝对布局 * 报表直接判断底层是否是绝对布局
* @return 是则返回true * @return 是则返回true
*/ */
public boolean hasWAbsoluteLayout() { public boolean hasWAbsoluteLayout() {
return this.getTarget().getContainer() instanceof WAbsoluteLayout; return this.getTarget().getContainer() instanceof WAbsoluteLayout;
} }
/** /**
* 刷新底层容器 * 刷新底层容器
*/ */
public void refreshRoot() { public void refreshRoot() {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget() XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget()
.getContainer()); .getContainer());
if (layoutContainer == null) { if (layoutContainer == null) {
layoutContainer = new XWParameterLayout(); layoutContainer = new XWParameterLayout();
} }
layoutContainer.setSize(LARGE_PREFERRED_SIZE); layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer); setRootComponent(layoutContainer);
} }
/** /**
* 是否是报表的参数面板 * 是否是报表的参数面板
* @return * @return
*/ */
public boolean isFormParaDesigner(){ public boolean isFormParaDesigner(){
return true; return true;
} }
public XLayoutContainer getParaComponent() { public XLayoutContainer getParaComponent() {
return getRootComponent(); return getRootComponent();
} }
private void paintLinkParameters(Graphics clipg) { private void paintLinkParameters(Graphics clipg) {
Parameter[] paras = DesignModelAdapter.getCurrentModelAdapter().getParameters(); Parameter[] paras = DesignModelAdapter.getCurrentModelAdapter().getParameters();
@ -494,8 +494,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
public void populateRootSize() { public void populateRootSize() {
((FormParameterUI) getTarget()).setDesignSize(getRootComponent().getSize()); ((FormParameterUI) getTarget()).setDesignSize(getRootComponent().getSize());
if (getParaComponent().acceptType(XWParameterLayout.class)) { if (getParaComponent().acceptType(XWParameterLayout.class)) {
WParameterLayout layout = (WParameterLayout)getParaComponent().toData(); WParameterLayout layout = (WParameterLayout)getParaComponent().toData();
layout.setDesignWidth(getRootComponent().getWidth()); layout.setDesignWidth(getRootComponent().getWidth());
} }
} }
@ -552,12 +552,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return true; return true;
} }
/** /**
* 加入参数 * 加入参数
* @param parameter 参数 c * @param parameter 参数 c
* @param currentIndex 位置 w * @param currentIndex 位置 w
* @return 是否加入 s * @return 是否加入 s
*/ */
public boolean addingParameter2Editor(Parameter parameter, int currentIndex) { public boolean addingParameter2Editor(Parameter parameter, int currentIndex) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label(); com.fr.form.ui.Label label = new com.fr.form.ui.Label();
String name = parameter.getName(); String name = parameter.getName();
@ -578,12 +578,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
} }
/** /**
* 加入参数 * 加入参数
* @param parameter 参数 c * @param parameter 参数 c
* @param currentIndex 位置 w * @param currentIndex 位置 w
* @return 是否加入 s * @return 是否加入 s
*/ */
public boolean addingParameter2EditorWithQueryButton(Parameter parameter, int currentIndex) { public boolean addingParameter2EditorWithQueryButton(Parameter parameter, int currentIndex) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label(); com.fr.form.ui.Label label = new com.fr.form.ui.Label();
String name = parameter.getName(); String name = parameter.getName();
@ -612,12 +612,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return true; return true;
} }
/** /**
* 加入参数 * 加入参数
* @param parameterArray 参数 c * @param parameterArray 参数 c
* @param currentIndex 位置 w * @param currentIndex 位置 w
* @return 是否加入 s * @return 是否加入 s
*/ */
public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) { public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) {
for (int i = 0; i < parameterArray.length; i++) { for (int i = 0; i < parameterArray.length; i++) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label(); com.fr.form.ui.Label label = new com.fr.form.ui.Label();
@ -670,18 +670,18 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return true; return true;
} }
/** /**
* 工具栏 * 工具栏
* @return 工具栏面板 g * @return 工具栏面板 g
*/ */
public JPanel[] toolbarPanes4Form() { public JPanel[] toolbarPanes4Form() {
return new JPanel[]{FormParaPane.getInstance(this)}; return new JPanel[]{FormParaPane.getInstance(this)};
} }
/** /**
* 复制等按钮 * 复制等按钮
* @return 按钮组 a * @return 按钮组 a
*/ */
public JComponent[] toolBarButton4Form() { public JComponent[] toolBarButton4Form() {
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(), return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(this).createToolBarComponent(),
new FormDeleteAction(this).createToolBarComponent()}; new FormDeleteAction(this).createToolBarComponent()};

1
designer_form/src/com/fr/design/mainframe/ComponentTree.java

@ -97,6 +97,7 @@ public class ComponentTree extends JTree {
scrollPathToVisible(treepath); scrollPathToVisible(treepath);
} }
/** /**
* 刷新 * 刷新
*/ */

186
designer_form/src/com/fr/design/mainframe/FormDesigner.java

@ -121,7 +121,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
private static final int H_GAP = 105; private static final int H_GAP = 105;
public FormDesigner(Form form) { public FormDesigner(Form form) {
this(form, null); this(form, null);
} }
public FormDesigner(Form form, Action switchAction) { public FormDesigner(Form form, Action switchAction) {
@ -201,15 +201,15 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height); EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
} }
private void removeSame(Parameter[] parameters, List<String> namelist){ private void removeSame(Parameter[] parameters, List<String> namelist){
for (Parameter parameter : parameters) { for (Parameter parameter : parameters) {
for (String name : namelist) { for (String name : namelist) {
if (name.equalsIgnoreCase(parameter.getName())) { if (name.equalsIgnoreCase(parameter.getName())) {
setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter)); setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter));
} }
} }
} }
} }
/** /**
@ -405,10 +405,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 加入参数面板 * 加入参数面板
*/ */
public void addParaComponent(){ public void addParaComponent(){
if (paraComponent != null) { if (paraComponent != null) {
return ; return ;
} }
paraHeight = WBorderLayout.DEFAULT_SIZE; paraHeight = WBorderLayout.DEFAULT_SIZE;
paraComponent = new XWParameterLayout(); paraComponent = new XWParameterLayout();
paraComponent.toData().setWidgetName("para"); paraComponent.toData().setWidgetName("para");
paraComponent.setSize(paraComponent.initEditorSize()); paraComponent.setSize(paraComponent.initEditorSize());
@ -428,10 +428,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 父容器 * @return 父容器
*/ */
public Component getTopContainer(){ public Component getTopContainer(){
if(rootComponent != null){ if(rootComponent != null){
// 返回root所在的父容器,非designer // 返回root所在的父容器,非designer
return LayoutUtils.getTopContainer(rootComponent); return LayoutUtils.getTopContainer(rootComponent);
} }
return XCreatorUtils.createXCreator(this.getTarget().getContainer()); return XCreatorUtils.createXCreator(this.getTarget().getContainer());
} }
@ -448,9 +448,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param height 高度 * @param height 高度
*/ */
public void setParaHeight(int height){ public void setParaHeight(int height){
XWBorderLayout container = (XWBorderLayout) getTopContainer(); XWBorderLayout container = (XWBorderLayout) getTopContainer();
container.toData().setNorthSize(height); container.toData().setNorthSize(height);
container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight()); container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight());
paraHeight = height; paraHeight = height;
} }
@ -475,39 +475,39 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param elementCaseContainer 容器 * @param elementCaseContainer 容器
*/ */
public void switchTab(FormElementCaseContainerProvider elementCaseContainer){ public void switchTab(FormElementCaseContainerProvider elementCaseContainer){
if(this.switchAction == null){ if(this.switchAction == null){
return; return;
} }
this.elementCaseContainer = elementCaseContainer; this.elementCaseContainer = elementCaseContainer;
this.switchAction.actionPerformed(null); this.switchAction.actionPerformed(null);
} }
public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer){ public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer){
this.elementCaseContainer = elementCaseContainer; this.elementCaseContainer = elementCaseContainer;
} }
public FormElementCaseProvider getElementCase(){ public FormElementCaseProvider getElementCase(){
return this.elementCaseContainer.getElementCase(); return this.elementCaseContainer.getElementCase();
} }
public String getElementCaseContainerName(){ public String getElementCaseContainerName(){
return this.elementCaseContainer.getElementCaseContainerName(); return this.elementCaseContainer.getElementCaseContainerName();
} }
public void setElementCase(FormElementCaseProvider elementCase){ public void setElementCase(FormElementCaseProvider elementCase){
this.elementCaseContainer.setElementCase(elementCase); this.elementCaseContainer.setElementCase(elementCase);
} }
public void setElementCaseBackground(BufferedImage image){ public void setElementCaseBackground(BufferedImage image){
this.elementCaseContainer.setBackground(image); this.elementCaseContainer.setBackground(image);
} }
public Dimension getElementCaseContainerSize(){ public Dimension getElementCaseContainerSize(){
return this.elementCaseContainer.getSize(); return this.elementCaseContainer.getSize();
} }
public FormElementCaseContainerProvider getElementCaseContainer(){ public FormElementCaseContainerProvider getElementCaseContainer(){
return this.elementCaseContainer; return this.elementCaseContainer;
} }
protected FormDesignerModeForSpecial<?> createFormDesignerTargetMode() { protected FormDesignerModeForSpecial<?> createFormDesignerTargetMode() {
@ -604,7 +604,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param width 指定的宽度 * @param width 指定的宽度
*/ */
public void updateWidth(int width) { public void updateWidth(int width) {
//TODO //TODO
} }
/** /**
@ -615,12 +615,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 不返回任何对象 * @return 不返回任何对象
*/ */
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if(rootComponent != null){ if(rootComponent != null){
LayoutUtils.layoutRootContainer(rootComponent); LayoutUtils.layoutRootContainer(rootComponent);
} }
if(paraComponent != null){ if(paraComponent != null){
LayoutUtils.layoutRootContainer(paraComponent); LayoutUtils.layoutRootContainer(paraComponent);
} }
repaint(); repaint();
return null; return null;
} }
@ -640,7 +640,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
// 只有选择组件时不触发模版更新,其他都要触发 // 只有选择组件时不触发模版更新,其他都要触发
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified(); FormDesigner.this.fireTargetModified();
//bug59192 //bug59192
@ -702,7 +702,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 从root组件递归查找x,y所在的组件注意是正在被设计的组件因此其name属性必须不为空 * 从root组件递归查找x,y所在的组件注意是正在被设计的组件因此其name属性必须不为空
*/ */
private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) { private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) {
if (root == null || !root.isVisible()) { if (root == null || !root.isVisible()) {
return null; return null;
} }
x -= root.getX(); x -= root.getX();
@ -758,21 +758,21 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 刷新底层容器 * 刷新底层容器
*/ */
public void refreshRoot() { public void refreshRoot() {
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取 // 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer()); XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer());
// 布局默认都是1,底层的border改为0,不然没意义 // 布局默认都是1,底层的border改为0,不然没意义
this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0)); this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0));
formLayoutContainer.setBorder(null); formLayoutContainer.setBorder(null);
if (formLayoutContainer.acceptType(XWBorderLayout.class)) { if (formLayoutContainer.acceptType(XWBorderLayout.class)) {
WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData(); WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData();
Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH); Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH);
Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER); Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER);
//本身含有,这儿得先清空再加 //本身含有,这儿得先清空再加
formLayoutContainer.removeAll(); formLayoutContainer.removeAll();
refreshNorth(northWidget, formLayoutContainer); refreshNorth(northWidget, formLayoutContainer);
refreshCenter(centerWidget, formLayoutContainer); refreshCenter(centerWidget, formLayoutContainer);
} else { } else {
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE); formLayoutContainer.setSize(LARGE_PREFERRED_SIZE);
@ -781,43 +781,43 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
} }
private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) { private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) {
// 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮 // 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮
if (northWidget == null) { if (northWidget == null) {
paraComponent = null; paraComponent = null;
paraHeight = 0; paraHeight = 0;
FormParaWidgetPane.getInstance(this); FormParaWidgetPane.getInstance(this);
return; return;
} }
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget); XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget);
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize(); paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize();
paraComponent = northContainer; paraComponent = northContainer;
northContainer.setSize(0,paraHeight); northContainer.setSize(0,paraHeight);
formLayoutContainer.add(northContainer, WBorderLayout.NORTH); formLayoutContainer.add(northContainer, WBorderLayout.NORTH);
} }
private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) {
// 不存在center块, 说明是新建的模板 // 不存在center块, 说明是新建的模板
if (centerWidget == null) { if (centerWidget == null) {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body"));
layoutContainer.setSize(LARGE_PREFERRED_SIZE); layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer); setRootComponent(layoutContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
return; return;
}
XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget);
Dimension d = new Dimension();
d.width = ((WFitLayout) centerWidget).getContainerWidth();
d.height = ((WFitLayout) centerWidget).getContainerHeight();
centerContainer.setSize(d);
formLayoutContainer.setSize(d.width, d.height + paraHeight);
setRootComponent(centerContainer);
// 再次打开时,layout下root,有内边距的话组件加上
LayoutUtils.layoutContainer(centerContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
} }
XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget);
Dimension d = new Dimension();
d.width = ((WFitLayout) centerWidget).getContainerWidth();
d.height = ((WFitLayout) centerWidget).getContainerHeight();
centerContainer.setSize(d);
formLayoutContainer.setSize(d.width, d.height + paraHeight);
setRootComponent(centerContainer);
// 再次打开时,layout下root,有内边距的话组件加上
LayoutUtils.layoutContainer(centerContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
}
protected Insets getOutlineInsets() { protected Insets getOutlineInsets() {
return new Insets(10, 10, 10, 10); return new Insets(10, 10, 10, 10);
@ -962,8 +962,8 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public void startDraggingComponent(XCreator xCreator, MouseEvent lastPressEvent, int x, int y) { public void startDraggingComponent(XCreator xCreator, MouseEvent lastPressEvent, int x, int y) {
// 根据所选择的组件的BeanInfo生成相应的AddingModel // 根据所选择的组件的BeanInfo生成相应的AddingModel
// AddingModel和StateModel不一样,适合当前选择的组件相关的 // AddingModel和StateModel不一样,适合当前选择的组件相关的
int creatorWidth = xCreator.getWidth(); int creatorWidth = xCreator.getWidth();
int creatorHeight = xCreator.getHeight(); int creatorHeight = xCreator.getHeight();
this.addingModel = new AddingModel(xCreator, x, y); this.addingModel = new AddingModel(xCreator, x, y);
TransferHandler handler = new DesignerTransferHandler(this, addingModel); TransferHandler handler = new DesignerTransferHandler(this, addingModel);
setTransferHandler(handler); setTransferHandler(handler);
@ -1007,9 +1007,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
} }
} }
/** /**
* 显示权限编辑界面 * 显示权限编辑界面
*/ */
public void showAuthorityEditPane() { public void showAuthorityEditPane() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true);
if (isSupportAuthority()) { if (isSupportAuthority()) {
@ -1023,9 +1023,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
} }
/** /**
* 是否支持权限编辑 * 是否支持权限编辑
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isSupportAuthority() { public boolean isSupportAuthority() {
int size = getSelectionModel().getSelection().size(); int size = getSelectionModel().getSelection().size();
XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection() XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection()
@ -1036,7 +1036,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
protected void setToolbarButtons(boolean flag) { protected void setToolbarButtons(boolean flag) {
//自适应布局和底层都不能删除 //自适应布局和底层都不能删除
DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST); DesignerContext.getDesignerFrame().checkCombineUp(!(isRoot(getSelectionModel().getSelection().getSelectedCreator()) || flag), NAME_ARRAY_LIST);
} }
private void invalidateLayout() { private void invalidateLayout() {
@ -1092,7 +1092,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/ */
public Action[] getActions() { public Action[] getActions() {
if (designer_actions == null) { if (designer_actions == null) {
//先把复制粘贴按钮去掉,只留下删除 //先把复制粘贴按钮去掉,只留下删除
// designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this), // designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
// new FormDeleteAction(this)}; // new FormDeleteAction(this)};
designer_actions = new Action[]{new FormDeleteAction(this)}; designer_actions = new Action[]{new FormDeleteAction(this)};
@ -1236,7 +1236,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
public ToolBarMenuDockPlus getToolBarMenuDockPlus() { public ToolBarMenuDockPlus getToolBarMenuDockPlus() {
return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class); return StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, ToolBarMenuDockPlus.class);
} }
/** /**

46
designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java

@ -10,18 +10,15 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.EventPropertyTable; import com.fr.design.designer.properties.EventPropertyTable;
import com.fr.design.designer.properties.WidgetPropertyTable; import com.fr.design.designer.properties.WidgetPropertyTable;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.fun.WidgetPropertyUIProvider; import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import java.awt.*; import java.awt.*;
@ -114,7 +111,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
@Override @Override
public void refreshDockingView() { public void refreshDockingView() {
designer = this.getEditingFormDesigner(); designer = this.getEditingFormDesigner();
removeAll(); removeAll();
if (designer == null) { if (designer == null) {
@ -132,7 +128,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
eventTable.setBorder(null); eventTable.setBorder(null);
UIScrollPane esp = new UIScrollPane(eventTable); UIScrollPane esp = new UIScrollPane(eventTable);
esp.setBorder(null); esp.setBorder(null);
wsp = FRGUIPaneFactory.createBorderLayout_S_Pane(); wsp = FRGUIPaneFactory.createBorderLayout_S_Pane();
wsp.setBorder(null); wsp.setBorder(null);
mobileWidgetTable = new MobileWidgetTable(designer); mobileWidgetTable = new MobileWidgetTable(designer);
@ -144,7 +139,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
centerPane.add(mobileBodyWidgetTable,BODY); centerPane.add(mobileBodyWidgetTable,BODY);
if(hasSelectParaPane(designer)){ if(hasSelectParaPane(designer)){
cardLayout.show(centerPane,PARA); cardLayout.show(centerPane,PARA);
} else { } else {
cardLayout.show(centerPane,BODY); cardLayout.show(centerPane,BODY);
} }
@ -153,19 +147,23 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
wsp.add(downPanel,BorderLayout.CENTER); wsp.add(downPanel,BorderLayout.CENTER);
UITabbedPane tabbedPane = new UITabbedPane(); UITabbedPane tabbedPane = new UITabbedPane();
initTabPane(psp, esp, tabbedPane);
tabbedPane.setOpaque(true);
tabbedPane.setBorder(null);
tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
tabbedPane.addTab(Inter.getLocText("Form-Properties"), psp);
tabbedPane.addTab(Inter.getLocText("Form-Events"), esp);
tabbedPane.addTab(Inter.getLocText("FR-Widget_Mobile_Terminal"), wsp);
WidgetPropertyUIProvider[] widgetAttrProviders = getExtraPropertyUIProviders(); WidgetPropertyUIProvider[] widgetAttrProviders = getExtraPropertyUIProviders();
addWidgetAttr(widgetAttrProviders);
add(tabbedPane, BorderLayout.CENTER);
propertyTable.initPropertyGroups(null);
eventTable.refresh();
for (AbstractPropertyTable propertyTable : widgetPropertyTables) {
propertyTable.initPropertyGroups(designer);
}
isrefresh = false;
}
private void addWidgetAttr(WidgetPropertyUIProvider[] widgetAttrProviders) {
if (widgetAttrProviders.length == 0) { if (widgetAttrProviders.length == 0) {
UILabel upLabel = new UILabel(Inter.getLocText("FR-Widget_Mobile_Table"),SwingConstants.CENTER); UILabel upLabel = new UILabel(Inter.getLocText("FR-Widget_Mobile_Table"), SwingConstants.CENTER);
upLabel.setBorder(BorderFactory.createEmptyBorder(6,0,6,0)); upLabel.setBorder(BorderFactory.createEmptyBorder(6,0,6,0));
wsp.add(upLabel,BorderLayout.NORTH); wsp.add(upLabel, BorderLayout.NORTH);
} else { } else {
for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) { for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) {
AbstractPropertyTable propertyTable = widgetAttrProvider.createWidgetAttrTable(); AbstractPropertyTable propertyTable = widgetAttrProvider.createWidgetAttrTable();
@ -177,13 +175,15 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
} }
} }
add(tabbedPane, BorderLayout.CENTER); }
propertyTable.initPropertyGroups(null);
eventTable.refresh(); private void initTabPane(UIScrollPane psp, UIScrollPane esp, UITabbedPane tabbedPane) {
for (AbstractPropertyTable propertyTable : widgetPropertyTables) { tabbedPane.setOpaque(true);
propertyTable.initPropertyGroups(designer); tabbedPane.setBorder(null);
} tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
isrefresh = false; tabbedPane.addTab(Inter.getLocText("FR-Designer_Properties"), psp);
tabbedPane.addTab(Inter.getLocText("FR-Designer_Event"), esp);
tabbedPane.addTab(Inter.getLocText("FR-Widget_Mobile_Terminal"), wsp);
} }
// //

30
designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

@ -29,18 +29,18 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private UIButton addAll; private UIButton addAll;
private UILabel label; private UILabel label;
private int breakid; private int breakid;
private static final int GAP_H = 4; private static final int GAP_H = 4;
private static final int GAP_V = 6; private static final int GAP_V = 6;
private static final int GAP_BV = 4; private static final int GAP_BV = 4;
private static final int BUTTON_HEIGHT = 20; private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225; private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
public ParameterToolBarPane() { public ParameterToolBarPane() {
this.setLayout(new FlowParameterPaneLayout()); this.setLayout(new FlowParameterPaneLayout());
label = new UILabel() { label = new UILabel() {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -53,7 +53,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
label.setHorizontalAlignment(SwingConstants.LEFT); label.setHorizontalAlignment(SwingConstants.LEFT);
label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
this.add(label); this.add(label);
addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all")); addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all"));
this.add(addAll); this.add(addAll);
@ -63,7 +63,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
protected String title4PopupWindow() { protected String title4PopupWindow() {
return null; return null;
} }
public Parameter getTargetParameter(UIButton button) { public Parameter getTargetParameter(UIButton button) {
int index = parameterSelectedLabellist.indexOf(button); int index = parameterSelectedLabellist.indexOf(button);
if(index < 0 || index > parameterList.length - 1) { if(index < 0 || index > parameterList.length - 1) {
@ -76,9 +76,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
public void populateBean(Parameter[] parameterArray) { public void populateBean(Parameter[] parameterArray) {
parameterSelectedLabellist.clear(); parameterSelectedLabellist.clear();
this.removeAll(); this.removeAll();
this.add(label); this.add(label);
if (parameterArray.length == 0) { if (parameterArray.length == 0) {
this.setVisible(false); this.setVisible(false);
this.repaint(); this.repaint();
@ -86,14 +86,14 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
} else { } else {
this.setVisible(true); this.setVisible(true);
} }
parameterList = parameterArray; parameterList = parameterArray;
for (int i = 0; i < parameterList.length; i++) { for (int i = 0; i < parameterList.length; i++) {
UIButton parameterSelectedLabel = new UIButton(parameterList[i].getName()); UIButton parameterSelectedLabel = new UIButton(parameterList[i].getName());
parameterSelectedLabellist.add(parameterSelectedLabel); parameterSelectedLabellist.add(parameterSelectedLabel);
this.add(parameterSelectedLabel); this.add(parameterSelectedLabel);
} }
for(UIButton parameterSelectedLabel : parameterSelectedLabellist) { for(UIButton parameterSelectedLabel : parameterSelectedLabellist) {
parameterSelectedLabel.addMouseListener(paraMouseListner); parameterSelectedLabel.addMouseListener(paraMouseListner);
} }
@ -130,9 +130,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
public Dimension preferredLayoutSize(Container parent) { public Dimension preferredLayoutSize(Container parent) {
int w = parent.getWidth(); int w = parent.getWidth();
layoutContainer(parent); layoutContainer(parent);
int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h); return new Dimension(w, h);
} }
@ -145,9 +145,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth(); int width = parent.getWidth() == 0 ? WIDTH : parent.getWidth();
int x = 0; int x = 0;
int y = L_H + GAP_H; int y = L_H + GAP_H;
label.setBounds(0, 0, width, L_H); label.setBounds(0, 0, width, L_H);
breakid = 1; breakid = 1;
for (UIButton tab : parameterSelectedLabellist) { for (UIButton tab : parameterSelectedLabellist) {
Dimension dim = tab.getPreferredSize(); Dimension dim = tab.getPreferredSize();
@ -156,9 +156,9 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
x = 0; x = 0;
y += (dim.height + GAP_V); y += (dim.height + GAP_V);
} }
tab.setBounds(x, y, dim.width, dim.height); tab.setBounds(x, y, dim.width, dim.height);
x += (dim.width + GAP_H); x += (dim.width + GAP_H);
} }
addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height); addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height);

Loading…
Cancel
Save