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. 466
      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

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}/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"){
fileset(dir:"build/classes"){
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}/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"){
fileset(dir:"build/classes"){
exclude(name:"*.*")

96
designer/.classpath

@ -1,52 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/>
<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="/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_form"/>
<classpathentry kind="lib" path="/lib/swt.jar"/>
<classpathentry kind="lib" path="/lib/sqlite-jdbc.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/activation.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"/>
</classpath>

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

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

55
designer_base/.classpath

@ -3,8 +3,57 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-core-8.0.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/report/fr-third-8.0.jar"/>
<classpathentry kind="lib" path="D:/Program Files/Git/finereport/lib/jetty/org.mortbay.jetty.jar"/>
<classpathentry kind="lib" path="D:/code/finedesignlib/jetty/activation.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="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"/>
</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.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicPane;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -28,7 +29,7 @@ import java.awt.event.*;
*/
public class ConnectionTableProcedurePane extends BasicPane {
private static int WIDTH = 155;
private ConnectionComboBoxPanel connectionComboBox;
private ConnectionComboBoxPanel connectionComboBox;
private UICheckBox tableCheckBox;
private UICheckBox viewCheckBox;
private UITextField searchField;
@ -37,16 +38,16 @@ public class ConnectionTableProcedurePane extends BasicPane {
public ConnectionTableProcedurePane() {
this.setLayout(new BorderLayout(4, 4));
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class){
protected void refreshItems(){
super.refreshItems();
if (tableViewList != null) {
search();
}
}
};
connectionComboBox = new ConnectionComboBoxPanel(com.fr.data.impl.Connection.class) {
protected void refreshItems() {
super.refreshItems();
if (tableViewList != null) {
search();
}
}
};
tableViewList = new TableViewList();
ToolTipManager.sharedInstance().registerComponent(tableViewList);
ToolTipManager.sharedInstance().registerComponent(tableViewList);
connectionComboBox.addComboBoxActionListener(filter);
tableViewList.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent evt) {
@ -54,8 +55,8 @@ public class ConnectionTableProcedurePane extends BasicPane {
Object obj = tableViewList.getSelectedValue();
TableProcedure tableProcedure = null;
if (obj instanceof TableProcedure) {
tableProcedure = (TableProcedure)obj;
}else {
tableProcedure = (TableProcedure) obj;
} else {
return;
}
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(tableViewListPane, BorderLayout.CENTER);
this.add(filterPane, BorderLayout.SOUTH);
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
this.setPreferredSize(new Dimension(WIDTH, getPreferredSize().height));
}
protected JPanel createCheckBoxgroupPane() {
@ -89,28 +90,42 @@ public class ConnectionTableProcedurePane extends BasicPane {
tableCheckBox.setSelected(true);
tableCheckBox.addActionListener(filter);
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();
viewCheckBox = new UICheckBox();
viewCheckBox.setSelected(true);
viewCheckBox.addActionListener(filter);
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(second);
return checkBoxgroupPane;
}
/**
* itemComboBox 加上 itemListener
* @param itemListener
*/
public void addItemListener(ItemListener itemListener) {
connectionComboBox.itemComboBox.addItemListener(itemListener);
}
/**
* itemComboBox 加上 itemListener
*
* @param itemListener
*/
public void addItemListener(ItemListener itemListener) {
connectionComboBox.itemComboBox.addItemListener(itemListener);
}
private DocumentListener searchListener = new DocumentListener() {
@Override
@ -146,13 +161,13 @@ public class ConnectionTableProcedurePane extends BasicPane {
String[] types = ArrayUtils.EMPTY_STRING_ARRAY;
if (tableCheckBox != null) {
if (tableCheckBox.isSelected()) {
types = (String[])ArrayUtils.add(types, TableProcedure.TABLE);
types = (String[]) ArrayUtils.add(types, TableProcedure.TABLE);
}
if (viewCheckBox.isSelected()) {
types = (String[])ArrayUtils.add(types, TableProcedure.VIEW);
types = (String[]) ArrayUtils.add(types, TableProcedure.VIEW);
}
} else {
types = (String[])ArrayUtils.add(types, TableProcedure.PROCEDURE);
types = (String[]) ArrayUtils.add(types, TableProcedure.PROCEDURE);
}
tableViewList.populate(selectedObj, searchField.getText().trim(), types);
}
@ -162,10 +177,10 @@ public class ConnectionTableProcedurePane extends BasicPane {
return "Connection";
}
/**
*
* @param l
*/
/**
*
* @param l
*/
public void addDoubleClickListener(DoubleClickSelectedNodeOnTreeListener l) {
this.listeners.add(l);
}
@ -179,10 +194,11 @@ public class ConnectionTableProcedurePane extends BasicPane {
}
public static interface DoubleClickSelectedNodeOnTreeListener {
/**
* 处理双击事件
* @param target
*/
public void actionPerformed(TableProcedure target);
/**
* 处理双击事件
*
* @param 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
public void process(String s) {
if (StringUtils.isNotBlank(s)) {
updateMessage(changText(s));
updateMessage(trimText(s));
}
}
});
@ -59,20 +59,25 @@ public class PluginTask<T> extends Task<T> {
@Override
protected void done() {
updateMessage(changText(executor.getTaskFinishMessage()));
updateMessage(trimText(executor.getTaskFinishMessage()));
}
/**
* 转换掉一些会造成错误的特殊字符
* 1 ""中的""必须转义
* 2 js字符串中的\n会导致js字符串变成多行,而js字符创不支持多行拼接
* vito:由于使用webEngine.executeScript("(" + callback + ")(\"" + newValue + "\")")
* 执行脚本所以原来规范的json格式也会在拼接字符串后可能抛出参数异常需要转换掉一些会造成错误的特殊字符
* 选择在java端替换的原因是异常抛出自executeScript方法的参数.
*
* 1.""中的""必须转义
* 2.js字符串中的\n会导致js字符串变成多行,而js字符串不支持多行拼接
* 3.由JSONObject.toString()得到的字符串中html标签的属性会自动加上\造成替换难度加大
* 这边建议去除所有的html标签
*
* @param old 原始字符串
* @return 处理之后的字符串
*/
private String changText(String old) {
if(StringUtils.isNotBlank(old)){
return old.replaceAll("\"", "\\\\\"").replaceAll("\n", "");
private String trimText(String old) {
if (StringUtils.isNotBlank(old)) {
return old.replaceAll("\n", "").replaceAll("\"", "\\\\\"").replaceAll("\'", "\\\\\'");
}
return StringUtils.EMPTY;
}

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

@ -11,14 +11,26 @@ public abstract class ShopPaneConfig {
private JFXPanel webPane;
public ShopPaneConfig() {
this.mainJS = getMainJS();
this.scriptsId = getScriptsId();
this.webPane = getWebPane();
this.mainJS = setMainJS();
this.scriptsId = setScriptsId();
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;
/**
* Created by lp on 2016/8/16.
* Created by lp on 2016/8/16.
*/
public class UserLoginContext {
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();
this.add(northPane, BorderLayout.NORTH);
JPanel reportletNamePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(28);
classNameTextField = new UITextField(25);
reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select"));
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.NameJavaScriptGroup;
import com.fr.plugin.PluginManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Nameable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
/**
* 超级链接 界面.
@ -34,23 +34,26 @@ public class HyperlinkGroupPane extends JListControlPane {
* @return 返回Nameable按钮数组.
*/
public NameableCreator[] createNameableCreators() {
Map<String, NameableCreator> nameCreators = new TreeMap<String, NameableCreator>();
NameableCreator[] creators = DesignModuleFactory.getHyperlinkGroupType().getHyperlinkCreators();
for (NameableCreator creator : creators) {
nameCreators.put(creator.menuName(), creator);
}
PluginManager.getInstance().setExtensionPoint(HyperlinkPluginAction.XML_TAG);
ArrayList<UpdateAction> templateArrayLisy = PluginManager.getInstance().getResultList();
// if (templateArrayLisy.isEmpty()) {
// return creators;
// }
NameableCreator[] pluginCreators = new NameableCreator[templateArrayLisy.size()];
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);
List<NameableCreator> creatorList = new ArrayList<NameableCreator>();
for (HyperlinkProvider provider : providers) {
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.Style;
import com.fr.base.TextFormat;
import com.fr.design.constants.UIConstants;
import com.fr.data.core.FormatField;
import com.fr.data.core.FormatField.FormatContents;
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.UIComboBoxRenderer;
import com.fr.design.gui.icontainer.UIScrollPane;
@ -81,16 +81,7 @@ public class FormatPane extends AbstractBasicStylePane {
};
typeComboBox = new UIComboBox(types);
UIComboBoxRenderer render = 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;
}
};
UIComboBoxRenderer render = createComBoxRender();
typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener);
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() {
Border innterborder = new UIRoundedBorder(UIConstants.LINE_COLOR, 1, 4);
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()) {
@Override
@ -156,7 +159,7 @@ public class FormatPane extends AbstractBasicStylePane {
* @return 标题
*/
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;
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.design.beans.BasicBeanPane;
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.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
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 static final int NEW_WINDOW = 0;
public static final int DIALOG = 1;
@ -46,7 +38,7 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
headerPane = this.setHeaderPanel();
this.add(headerPane, BorderLayout.NORTH);
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() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean 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);
}
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();
@ -93,6 +88,30 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
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
public void populateBean(T link) {
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() {
this.setName(Inter.getLocText(new String[]{"Reportlet", "Parameter"}));
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);
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);
urlWithHelp.add(GUICoreUtils.createNamedPane(urlPane, "URL:"));
urlWithHelp.add(label);
//urlWithHelp.add(label);
if(this.needRenamePane){
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());
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"));
extendParametersCheckBox = new UICheckBox(Inter.getLocText("Hyperlink-Extends_Report_Parameters"));
@ -167,4 +167,36 @@ public class WebHyperlinkPane extends BasicBeanPane<WebHyperlink> {
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_Import_Css=Import Css
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_Import_Css=Reference Css
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_Import_Css=Css\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_Import_Css=Css\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_Import_Css=\u5F15\u7528Css
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_Import_Css=\u5F15\u7528Css
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.filetree.FileNode;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import com.fr.stable.CoreConstants;
import com.fr.stable.StableUtils;
@ -42,6 +43,7 @@ import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.io.File;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -385,25 +387,46 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
oldName = oldName.replaceAll(suffix, "");
jd = new JDialog();
jd.setLayout(null);
jd.setLayout(new GridLayout(2, 2));
jd.setModal(true);
UILabel newNameLable = new UILabel(Inter.getLocText("FR-Designer_Enter-New-FileName"));
newNameLable.setBounds(20, 10, 130, 30);
UILabel newNameLabel = new UILabel(Inter.getLocText("FR-Designer_Enter-New-FileName"));
newNameLabel.setMinimumSize(new Dimension(150, 27));
newNameLabel.setHorizontalAlignment(SwingConstants.RIGHT);
jt = new UITextField(oldName);
jt.getDocument().addDocumentListener(getdoDocumentListener());
jt.selectAll();
jt.setBounds(130, 15, 150, 20);
jd.add(newNameLable);
jd.add(jt);
jt.setPreferredSize(new Dimension(150, 20));
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);
hintsLabel = new UILabel();
hintsLabel.setBounds(20, 50, 250, 30);
hintsLabel.setMaximumSize(new Dimension(200, 30));
hintsLabel.setHorizontalAlignment(SwingConstants.RIGHT);
hintsLabel.setForeground(Color.RED);
hintsLabel.setVisible(false);
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() {
public void actionPerformed(ActionEvent e) {
confirmClose(nodeFile, path);
@ -411,17 +434,31 @@ public class DesignerFrameFileDealerPane extends JPanel implements FileToolbarSt
});
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() {
public void actionPerformed(ActionEvent e) {
jd.dispose();
}
});
jd.add(cancelButton);
jd.add(confirmButton);
JPanel hintsPanel = new JPanel();
hintsPanel.setLayout(new BorderLayout());
hintsPanel.add(hintsLabel, BorderLayout.EAST);
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.setResizable(false);
jd.setAlwaysOnTop(true);

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

@ -140,9 +140,32 @@ public abstract class ToolBarMenuDock {
// 添加帮助菜单
menuList.add(createHelpMenuDef());
// 添加社区菜单
addCommunityMenuDef(menuList);
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) {
// 给菜单加插件入口
for (MenuDef m : menuDefs) {
@ -295,7 +318,9 @@ public abstract class ToolBarMenuDock {
//shortCuts.add(new TutorialAction());
shortCuts.add(SeparatorDef.DEFAULT);
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(new ForumAction());

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

@ -4,10 +4,13 @@
package com.fr.design.menu;
import com.fr.general.ComparatorUtils;
import com.fr.general.GeneralContext;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.KeyEvent;
import java.util.Locale;
/**
* Created by IntelliJ IDEA.
@ -63,7 +66,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M_Close_Current");
return Inter.getLocText("FR-Designer_Close");
}
@Override
@ -80,7 +83,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-Save");
return Inter.getLocText("FR-Designer_Save");
}
@Override
@ -148,7 +151,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Export");
return Inter.getLocText("FR-Designer_Export");
}
@Override
@ -183,7 +186,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Export-Excel-Page");
return Inter.getLocText("FR-Engine_Export-Excel-Page");
}
@Override
@ -201,7 +204,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Export-Excel-Simple");
return Inter.getLocText("FR-Engine_Export-Excel-Simple");
}
@Override
@ -219,7 +222,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Export-Excel-PageToSheet");
return Inter.getLocText("FR-Engine_Export-Excel-PageToSheet");
}
@Override
@ -362,7 +365,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("ExportAndOutput");
return Inter.getLocText("FR-Designer_ExportAndOutput");
}
@Override
@ -379,7 +382,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return "EXCEL"+Inter.getLocText("ExportAndOutput");
return "EXCEL"+Inter.getLocText("FR-Designer_ExportAndOutput");
}
@Override
@ -413,7 +416,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-SwitchWorkspace");
return Inter.getLocText("FR-Designer_M-SwitchWorkspace");
}
@Override
@ -430,7 +433,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-Exit");
return Inter.getLocText("FR-Designer_M-Exit");
}
@Override
@ -448,7 +451,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-Template");
return Inter.getLocText("FR-Designer_M-Template");
}
@Override
@ -639,7 +642,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("ReportColumns-Columns");
return Inter.getLocText("FR-Designer_ReportColumns-Columns");
}
@Override
@ -657,7 +660,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-Repeat-Freeze");
return Inter.getLocText("FR-Designer_M-Repeat-Freeze");
}
@Override
@ -675,7 +678,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Frozen");
return Inter.getLocText("FR-Engine_Frozen");
}
@Override
@ -710,7 +713,14 @@ public class KeySetUtils {
@Override
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
@ -727,7 +737,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("M-Cell");
return Inter.getLocText("FR-Designer_Cell");
}
@Override
@ -761,7 +771,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Widget-Settings");
return Inter.getLocText("FR-Designer_Widget-Settings");
}
@Override
@ -795,7 +805,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Condition_Attributes");
return Inter.getLocText("FR-Designer_Condition_Attributes");
}
@Override
@ -812,7 +822,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Present");
return Inter.getLocText("FR-Chart-Style_Present");
}
@Override
@ -880,7 +890,7 @@ public class KeySetUtils {
@Override
public String getMenuName() {
return Inter.getLocText("Currency_Line");
return Inter.getLocText("FR-Designer_Currency_Line");
}
@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.ChangeListener;
import java.awt.*;
import java.awt.event.AWTEventListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
@ -21,212 +22,211 @@ import java.util.List;
*/
public abstract class AbstractPopBox extends JPanel {
protected BackgroundJComponent displayComponent;
protected BackgroundJComponent displayComponent;
private JWindow selectPopupWindow;
private boolean isWindowEventInit = false;
private JWindow selectPopupWindow;
private boolean isWindowEventInit = false;
private static int GAP = 2;
private static int GAP2 = 20;
private List<ChangeListener> changeListenerList = new ArrayList<ChangeListener>();
MouseAdapter mouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
showPopupMenu();
}
public void mouseExited(MouseEvent evt) {
int x= evt.getXOnScreen();//mac和widows的计算结果还不一样
int y = evt.getYOnScreen();
if (selectPopupWindow != null) {
Rectangle rectangle = selectPopupWindow.getBounds();
boolean b1 = x < rectangle.x - GAP || x > rectangle.x + rectangle.width + GAP;
boolean b2 = y < rectangle.y - GAP || y >rectangle.y + rectangle.height + GAP;
if(b1 || b2) {
hidePopupMenu();
private List<ChangeListener> changeListenerList = new ArrayList<ChangeListener>();
MouseAdapter mouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
showPopupMenu();
}
};
AWTEventListener awt = new AWTEventListener() {
public void eventDispatched(AWTEvent event) {
if (event instanceof MouseEvent) {
MouseEvent evt = (MouseEvent) event;
if (evt.getClickCount() > 0) {
mouseClick(evt);
}
// if (OperatingSystem.isWindows()) {
//
// }else{
// Point pp = SwingUtilities.convertPoint(evt.getComponent(), evt.getPoint(), selectPopupWindow.getParent());
// Rectangle rectangle = selectPopupWindow.getBounds();
// if (pp.getY() < rectangle.getY() || pp.getY() > rectangle.getY() + rectangle.getHeight()) {
// //hidePopupMenu();
// }
// }
}
}
};
private void showPopupMenu() {
if (selectPopupWindow != null && selectPopupWindow.isVisible()) {
hidePopupMenu();
return;
}
if (!this.isEnabled()) {
return;
}
selectPopupWindow = this.getControlWindow();
Point convertPoint = new Point(0, 0);
// e: 将点(0,0)从ColorSelectionPane的坐标系统转换到屏幕坐标.
SwingUtilities.convertPointToScreen(convertPoint, this);
int y = convertPoint.y + this.getSize().height;
int x = convertPoint.x;
int h = y + selectPopupWindow.getHeight();
int width = x + selectPopupWindow.getWidth();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
if (h > screenSize.height) {
y = y - selectPopupWindow.getHeight() - GAP2;// 超过屏幕高度了
}
if(width > screenSize.width) {
x = screenSize.width - selectPopupWindow.getWidth();
}
selectPopupWindow.setLocation(x, y);
selectPopupWindow.setVisible(true);
//wei : 为了点击别的地方下拉颜色窗口消失
MouseAdapter parentMouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
mouseClick(evt);
}
};
if (!this.isWindowEventInit && SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this) != null) {
SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this).addMouseListener(parentMouseListener);
this.isWindowEventInit = true;
}
}
private void mouseClick(MouseEvent evt) {
int x = evt.getLocationOnScreen().x;
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;
if (b1 || b2) {
this.hidePopupMenu();
}
}
protected void hidePopupMenu() {
if (selectPopupWindow != null) {
selectPopupWindow.setVisible(false);
}
selectPopupWindow = null;
}
protected JWindow getControlWindow() {
//find parent.
if (this.selectPopupWindow == null) {
Window parentWindow = SwingUtilities.windowForComponent(this);
if (parentWindow != null) {
this.selectPopupWindow = new SelectControlWindow(parentWindow);
}
selectPopupWindow.addMouseListener(new MouseAdapter() {
public void mouseExited(MouseEvent evt) {
int x = evt.getLocationOnScreen().x;
int y = evt.getLocationOnScreen().y;
if (selectPopupWindow != null) {
double desValue = 2;
Rectangle rectangle = selectPopupWindow.getBounds();
}
}
};
private void showPopupMenu() {
if (selectPopupWindow != null && selectPopupWindow.isVisible()) {
hidePopupMenu();
return;
}
if (!this.isEnabled()) {
return;
}
Toolkit.getDefaultToolkit().addAWTEventListener(awt, AWTEvent.MOUSE_EVENT_MASK);
selectPopupWindow = this.getControlWindow();
Point convertPoint = new Point(0, 0);
// e: 将点(0,0)从ColorSelectionPane的坐标系统转换到屏幕坐标.
SwingUtilities.convertPointToScreen(convertPoint, this);
int y = convertPoint.y + this.getSize().height;
int x = convertPoint.x;
int h = y + selectPopupWindow.getHeight();
int width = x + selectPopupWindow.getWidth();
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
if (h > screenSize.height) {
y = y - selectPopupWindow.getHeight() - GAP2;// 超过屏幕高度了
}
if (width > screenSize.width) {
x = screenSize.width - selectPopupWindow.getWidth();
}
selectPopupWindow.setLocation(x, y);
selectPopupWindow.setVisible(true);
//wei : 为了点击别的地方下拉颜色窗口消失
MouseAdapter parentMouseListener = new MouseAdapter() {
public void mousePressed(MouseEvent evt) {
mouseClick(evt);
}
};
if (!this.isWindowEventInit && SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this) != null) {
SwingUtilities.getAncestorOfClass(GradientBackgroundPane.class, this).addMouseListener(parentMouseListener);
this.isWindowEventInit = true;
}
}
private void mouseClick(MouseEvent evt) {
Point point = new Point((int) (evt.getLocationOnScreen().getX()), (int) evt.getLocationOnScreen().getY());
Dimension popBoxD = AbstractPopBox.this.getSize();
Point popBoxP = AbstractPopBox.this.getLocationOnScreen();
Dimension popMenuD = this.getControlWindow().getSize();
Point popMenuP = this.getControlWindow().getLocation();
Rectangle popBoxRect = new Rectangle(popBoxP, popBoxD);
Rectangle popMenuRect = new Rectangle(popMenuP, popMenuD);
if (!popBoxRect.contains(point) && !popMenuRect.contains(point)) {
this.hidePopupMenu();
}
}
protected void hidePopupMenu() {
if (selectPopupWindow != null) {
selectPopupWindow.setVisible(false);
}
selectPopupWindow = null;
Toolkit.getDefaultToolkit().removeAWTEventListener(awt);
}
protected JWindow getControlWindow() {
//find parent.
if (this.selectPopupWindow == null) {
Window parentWindow = SwingUtilities.windowForComponent(this);
if (parentWindow != null) {
this.selectPopupWindow = new SelectControlWindow(parentWindow);
}
selectPopupWindow.addMouseListener(new MouseAdapter() {
public void mouseExited(MouseEvent evt) {
int x = evt.getLocationOnScreen().x;
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 b2 = y > rectangle.y + rectangle.height - desValue;//避免了鼠标下移刚进入selectPopupWindow的过程中弹出框隐藏,上移移出后由AbstractPopBox的mouseListener处理
boolean b2 = y > rectangle.y + rectangle.height - desValue;//避免了鼠标下移刚进入selectPopupWindow的过程中弹出框隐藏,上移移出后由AbstractPopBox的mouseListener处理
if (b1 || b2) {
hidePopupMenu();
}
}
}
});
}
hidePopupMenu();
}
}
}
});
}
return selectPopupWindow;
}
return selectPopupWindow;
}
/**
* 添加事件
*
* @param changeListener 事件
*/
public void addSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.add(changeListener);
}
public void addSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.add(changeListener);
}
/**
* 删除事件
*
* @param changeListener 事件
*/
public void removeSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.remove(changeListener);
}
public void removeSelectChangeListener(ChangeListener changeListener) {
this.changeListenerList.remove(changeListener);
}
/**
* 响应事件
*/
public void fireChangeListener() {
if (!changeListenerList.isEmpty()) {
ChangeEvent evt = new ChangeEvent(this);
for (int i = 0; i < changeListenerList.size(); i++) {
this.changeListenerList.get(i).stateChanged(evt);
}
}
}
public void fireChangeListener() {
if (!changeListenerList.isEmpty()) {
ChangeEvent evt = new ChangeEvent(this);
for (int i = 0; i < changeListenerList.size(); i++) {
this.changeListenerList.get(i).stateChanged(evt);
}
}
}
/**
* 待说明
*
* @param background 背景
*/
public void fireDisplayComponent(Background background) {
if (displayComponent != null) {
displayComponent.setSelfBackground(background);
}
fireChangeListener();
this.repaint();
}
public void fireDisplayComponent(Background background) {
if (displayComponent != null) {
displayComponent.setSelfBackground(background);
}
fireChangeListener();
this.repaint();
}
/**
* 初始化弹出框的面板
*
* @param preWidth 宽度
* @return 弹出面板
*/
public abstract JPanel initWindowPane(double preWidth);
public abstract JPanel initWindowPane(double preWidth);
private class SelectControlWindow extends JWindow {
private static final long serialVersionUID = -5776589767069105911L;
private class SelectControlWindow extends JWindow {
private static final long serialVersionUID = -5776589767069105911L;
public SelectControlWindow(Window paranet) {
super(paranet);
this.initComponents();
}
public SelectControlWindow(Window paranet) {
super(paranet);
this.initComponents();
}
public void initComponents() {
JPanel defaultPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setContentPane(defaultPane);
public void initComponents() {
JPanel defaultPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
this.setContentPane(defaultPane);
// defaultPane.setBorder(UIManager.getBorder("PopupMenu.border"));
if (displayComponent != null) {
defaultPane.add(initWindowPane(displayComponent.getPreferredSize().getWidth()));
} else {
defaultPane.add(initWindowPane(20));
}
this.pack();
}
@Override
public void setVisible(boolean b) {
super.setVisible(b);
AbstractPopBox.this.repaint();
}
}
protected boolean isPopupVisible() {
return selectPopupWindow == null ? false : selectPopupWindow.isVisible();
}
if (displayComponent != null) {
defaultPane.add(initWindowPane(displayComponent.getPreferredSize().getWidth()));
} else {
defaultPane.add(initWindowPane(20));
}
this.pack();
}
@Override
public void setVisible(boolean b) {
super.setVisible(b);
AbstractPopBox.this.repaint();
}
}
protected boolean isPopupVisible() {
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));
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() {
@Override

49
designer_chart/.classpath

@ -1,20 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/lib"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/base"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/designer_base"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<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-chartglyph"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-web"/>
<classpathentry combineaccessrules="false" kind="src" path="/chart-chartdata"/>
<classpathentry kind="lib" path="/lib/3rd.jar" sourcepath="/lookandfeel"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<classpathentry kind="lib" path="/lib/poi2007_fat.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"/>
</classpath>

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

@ -38,7 +38,7 @@ import javax.swing.*;
import java.util.*;
/**
* Created by eason on 14/12/29.
* Created by eason on 14/12/29.
*/
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();
String priority = (String) entry.getKey();
String imagePath = getIconPath(priority, plotID);
if (!StringUtils.isEmpty(imagePath)) {
if (StringUtils.isNotEmpty(imagePath)) {
return imagePath;
}
}
@ -273,10 +273,20 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
*/
public String getTitle4PopupWindow(String priority, String 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);
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();
}

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.
*/
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
//以前的插件没有覆写这个方法,所以始终获取到-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
*/
public class DataSeriesConditionPane extends ConditionAttributesPane<ConditionAttr> {
protected Plot plot;
public DataSeriesConditionPane() {
public DataSeriesConditionPane(Plot plot) {
this.plot = plot;
initAvailableActionList();
initComponents();
}
public void setPlot(Plot plot) {
this.plot = plot;
}
public DataSeriesConditionPane() {
this(null);
}
private void initAvailableActionList() {
addBasicAction();
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){
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.
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){
this();
parent = chartTypePane;
@ -275,8 +259,9 @@ public class ChartTypeButtonPane extends BasicBeanPane<ChartCollection> implemen
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() {
//先重构属性,在重构面板,否则面板在重构过程中,会重新将属性中的切换图表加到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) {
indexList.remove(this);
if (this.isSelected()) {
indexList.get(0).setSelected(true);
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());
}
// TODO: 2016/11/17 因为现在populate面板时会重新构造面板,所以每次都需要重构
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) {
Chart chart = collection.getSelectedChart();
this.remove(leftContentPane);
initContentPane();
buttonPane.populateBean(collection);
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();
}
if(this.percentFormat == null){
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat(), "#.##%");
DecimalFormat defaultFormat = new CoreDecimalFormat(new DecimalFormat("#.##%"), "#.##%");
percentFormatPane.populateBean(defaultFormat);
this.percentFormat = defaultFormat;
}

44
designer_form/.classpath

@ -1,15 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.6u35"/>
<classpathentry kind="src" path="src"/>
<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="/base-stable"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-basic"/>
<classpathentry kind="lib" path="/lib/3rd.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-calculate"/>
<classpathentry combineaccessrules="false" kind="src" path="/base-data"/>
<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="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"/>
</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文件夹下
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";
private static final int DEPENDING_SCOPE = 3;
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) {
for (int i = 0; i < coordinates.length; i++) {
if (coordinate == coordinates[i]) {
continue;
}
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) {
coordinate = coordinates[i];
break;
if(!isEdit) {
for (int i = 0; i < coordinates.length; i++) {
if (coordinate == coordinates[i]) {
continue;
}
if (coordinate > coordinates[i] - DEPENDING_SCOPE && coordinate < coordinates[i] + DEPENDING_SCOPE) {
coordinate = coordinates[i];
break;
}
}
}
return coordinate;
@ -425,10 +436,12 @@ public class FRFitLayoutAdapter extends FRBodyLayoutAdapter {
// 根据需要依附的位置调整拖拽的距离
private int adjustDiffByDependingLine(int coordinate, int[] coordinates, int diff) {
for (int i = 0; i < coordinates.length; i++) {
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) {
diff = coordinates[i] - coordinate;
break;
if(!isEdit) {
for (int i = 0; i < coordinates.length; i++) {
if (coordinate + diff > coordinates[i] - DEPENDING_SCOPE && coordinate + diff < coordinates[i] + DEPENDING_SCOPE) {
diff = coordinates[i] - coordinate;
break;
}
}
}
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.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.WidgetPropertyPane;
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.XWFitLayout;
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.WLayout;
import com.fr.general.Inter;
import javax.swing.*;
@ -30,8 +29,8 @@ import java.awt.*;
*/
//控件在自适应布局中宽度、高度属性,7.1.1不可编辑
public class FRFitLayoutConstraints implements ConstraintsGroupModel {
private static final int MINHEIGHT = XCreator.SMALL_PREFERRED_SIZE.height;
private static final int MINWIDTH = XCreator.SMALL_PREFERRED_SIZE.width;
private static final int MINHEIGHT = WLayout.MIN_HEIGHT;
private static final int MINWIDTH = WLayout.MIN_WIDTH;
private static final int ROWNUM = 2;
private DefaultTableCellRenderer renderer;
@ -48,7 +47,7 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
@Override
public String getGroupName() {
return Inter.getLocText("Widget-Size");
return Inter.getLocText("FR-Designer-Widget_Size");
}
@Override
@ -71,9 +70,9 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
if (column == 0) {
switch (row) {
case 0:
return Inter.getLocText("Tree-Width");
return Inter.getLocText("FR-Designer-Tree_Width");
default:
return Inter.getLocText("Tree-Height");
return Inter.getLocText("FR-Designer-Tree_Height");
}
} else {
switch (row) {
@ -91,36 +90,45 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
int v = value == null ? 0 : ((Number) value).intValue();
int difference = 0;
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) {
case 0:
if(v < MINWIDTH){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Width") + Integer.toString(MINWIDTH));
v = xCreator.getWidth();
}
if (bounds.width == v){
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;
bounds.width = v;
break;
case 1:
if(v < MINHEIGHT){
JOptionPane.showMessageDialog(null, Inter.getLocText("Min-Height") + Integer.toString(MINHEIGHT));
v = xCreator.getHeight();
}
if (bounds.height == v){
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;
bounds.height = v;
break;
}
WFitLayout wFitLayout = parent.toData();
wFitLayout.setBounds(xCreator.toData(),bounds);
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
Rectangle backupBounds = getBounds();
FRFitLayoutAdapter layoutAdapter = (FRFitLayoutAdapter) AdapterBus.searchLayoutAdapter(formDesigner, xCreator);
if (layoutAdapter != null) {
layoutAdapter.setEdit(true);
layoutAdapter.calculateBounds(backupBounds, bounds, xCreator, row, difference);
}
return true;
@ -131,7 +139,6 @@ public class FRFitLayoutConstraints implements ConstraintsGroupModel {
public Rectangle getBounds(){
Rectangle bounds = new Rectangle(xCreator.getBounds());
XLayoutContainer parent = XCreatorUtils.getParentXLayoutContainer(xCreator);
if (parent == null) {
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() {
WidgetToolBarPane.getInstance(this);
EastRegionContainerPane.getInstance().replaceDownPane(
FormWidgetDetailPane.getInstance(this));
FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
@ -123,35 +123,35 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
}
/**
* 创建权限编辑面板
* @return 面板
*/
/**
* 创建权限编辑面板
* @return 面板
*/
public AuthorityEditPane createAuthorityEditPane() {
return new FormWidgetAuthorityEditPane(this);
}
/**
* 内容属性表面板
* @return 内容属性表面板
*/
/**
* 内容属性表面板
* @return 内容属性表面板
*/
public JPanel getEastUpPane() {
return WidgetPropertyPane.getInstance(this);
}
/**
* 参数属性表
* @return 参数属性表
*/
/**
* 参数属性表
* @return 参数属性表
*/
public JPanel getEastDownPane() {
return FormWidgetDetailPane.getInstance(this);
}
/**
* 权限编辑面板
* @return 权限编辑面板
*/
/**
* 权限编辑面板
* @return 权限编辑面板
*/
public AuthorityEditPane getAuthorityEditPane() {
FormWidgetAuthorityEditPane formWidgetAuthorityEditPane = new FormWidgetAuthorityEditPane(this);
formWidgetAuthorityEditPane.populateDetials();
@ -248,9 +248,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return xx.isEmpty();
}
protected void setToolbarButtons(boolean flag) {
DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST);
}
protected void setToolbarButtons(boolean flag) {
DesignerContext.getDesignerFrame().checkCombineUp(!flag, NAME_ARRAY_LIST);
}
/**
* 看看参数面板中的控件是否有和模板参数同名的
@ -312,17 +312,17 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return SearchQueryCreators(rootContainer);
}
/**
* 返回复制粘贴删除等动作
* @return 同上
*/
public Action[] getActions() {
if (designer_actions == null) {
designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
new FormDeleteAction(this)};
}
return designer_actions;
}
/**
* 返回复制粘贴删除等动作
* @return 同上
*/
public Action[] getActions() {
if (designer_actions == null) {
designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
new FormDeleteAction(this)};
}
return designer_actions;
}
private boolean SearchQueryCreators(XLayoutContainer rootContainer) {
boolean b = false;
@ -354,9 +354,9 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
ParameterPropertyPane.getInstance().populateBean(p);
}
/**
* 初始化
*/
/**
* 初始化
*/
public void initWidgetToolbarPane() {
WidgetToolBarPane.getInstance(this);
}
@ -378,38 +378,38 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
this.refreshRoot();
}
/**
* 报表直接判断底层是否是绝对布局
* @return 是则返回true
*/
public boolean hasWAbsoluteLayout() {
return this.getTarget().getContainer() instanceof WAbsoluteLayout;
}
/**
* 刷新底层容器
*/
public void refreshRoot() {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget()
.getContainer());
if (layoutContainer == null) {
layoutContainer = new XWParameterLayout();
}
layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer);
}
/**
* 是否是报表的参数面板
* @return
*/
public boolean isFormParaDesigner(){
return true;
}
public XLayoutContainer getParaComponent() {
return getRootComponent();
}
/**
* 报表直接判断底层是否是绝对布局
* @return 是则返回true
*/
public boolean hasWAbsoluteLayout() {
return this.getTarget().getContainer() instanceof WAbsoluteLayout;
}
/**
* 刷新底层容器
*/
public void refreshRoot() {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget()
.getContainer());
if (layoutContainer == null) {
layoutContainer = new XWParameterLayout();
}
layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer);
}
/**
* 是否是报表的参数面板
* @return
*/
public boolean isFormParaDesigner(){
return true;
}
public XLayoutContainer getParaComponent() {
return getRootComponent();
}
private void paintLinkParameters(Graphics clipg) {
Parameter[] paras = DesignModelAdapter.getCurrentModelAdapter().getParameters();
@ -494,8 +494,8 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
public void populateRootSize() {
((FormParameterUI) getTarget()).setDesignSize(getRootComponent().getSize());
if (getParaComponent().acceptType(XWParameterLayout.class)) {
WParameterLayout layout = (WParameterLayout)getParaComponent().toData();
layout.setDesignWidth(getRootComponent().getWidth());
WParameterLayout layout = (WParameterLayout)getParaComponent().toData();
layout.setDesignWidth(getRootComponent().getWidth());
}
}
@ -552,12 +552,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return true;
}
/**
* 加入参数
* @param parameter 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
/**
* 加入参数
* @param parameter 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
public boolean addingParameter2Editor(Parameter parameter, int currentIndex) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label();
String name = parameter.getName();
@ -578,12 +578,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
}
/**
* 加入参数
* @param parameter 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
/**
* 加入参数
* @param parameter 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
public boolean addingParameter2EditorWithQueryButton(Parameter parameter, int currentIndex) {
com.fr.form.ui.Label label = new com.fr.form.ui.Label();
String name = parameter.getName();
@ -612,12 +612,12 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
return true;
}
/**
* 加入参数
* @param parameterArray 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
/**
* 加入参数
* @param parameterArray 参数 c
* @param currentIndex 位置 w
* @return 是否加入 s
*/
public void addingAllParameter2Editor(Parameter[] parameterArray, int currentIndex) {
for (int i = 0; i < parameterArray.length; i++) {
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 工具栏面板 g
*/
/**
* 工具栏
* @return 工具栏面板 g
*/
public JPanel[] toolbarPanes4Form() {
return new JPanel[]{FormParaPane.getInstance(this)};
}
/**
* 复制等按钮
* @return 按钮组 a
*/
/**
* 复制等按钮
* @return 按钮组 a
*/
public JComponent[] toolBarButton4Form() {
return new JComponent[]{new CutAction(this).createToolBarComponent(), new CopyAction(this).createToolBarComponent(), new PasteAction(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);
}
/**
* 刷新
*/

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;
public FormDesigner(Form form) {
this(form, null);
this(form, null);
}
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);
}
private void removeSame(Parameter[] parameters, List<String> namelist){
for (Parameter parameter : parameters) {
for (String name : namelist) {
if (name.equalsIgnoreCase(parameter.getName())) {
setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter));
}
}
}
}
private void removeSame(Parameter[] parameters, List<String> namelist){
for (Parameter parameter : parameters) {
for (String name : namelist) {
if (name.equalsIgnoreCase(parameter.getName())) {
setParameterArray((Parameter[]) ArrayUtils.removeElement(getParameterArray(), parameter));
}
}
}
}
/**
@ -405,10 +405,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 加入参数面板
*/
public void addParaComponent(){
if (paraComponent != null) {
return ;
}
paraHeight = WBorderLayout.DEFAULT_SIZE;
if (paraComponent != null) {
return ;
}
paraHeight = WBorderLayout.DEFAULT_SIZE;
paraComponent = new XWParameterLayout();
paraComponent.toData().setWidgetName("para");
paraComponent.setSize(paraComponent.initEditorSize());
@ -428,10 +428,10 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 父容器
*/
public Component getTopContainer(){
if(rootComponent != null){
// 返回root所在的父容器,非designer
return LayoutUtils.getTopContainer(rootComponent);
}
if(rootComponent != null){
// 返回root所在的父容器,非designer
return LayoutUtils.getTopContainer(rootComponent);
}
return XCreatorUtils.createXCreator(this.getTarget().getContainer());
}
@ -448,9 +448,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param height 高度
*/
public void setParaHeight(int height){
XWBorderLayout container = (XWBorderLayout) getTopContainer();
container.toData().setNorthSize(height);
container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight());
XWBorderLayout container = (XWBorderLayout) getTopContainer();
container.toData().setNorthSize(height);
container.setSize(container.getWidth(), container.getHeight() + height - getParaHeight());
paraHeight = height;
}
@ -475,39 +475,39 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param elementCaseContainer 容器
*/
public void switchTab(FormElementCaseContainerProvider elementCaseContainer){
if(this.switchAction == null){
return;
}
this.elementCaseContainer = elementCaseContainer;
this.switchAction.actionPerformed(null);
if(this.switchAction == null){
return;
}
this.elementCaseContainer = elementCaseContainer;
this.switchAction.actionPerformed(null);
}
public void setElementCaseContainer(FormElementCaseContainerProvider elementCaseContainer){
this.elementCaseContainer = elementCaseContainer;
this.elementCaseContainer = elementCaseContainer;
}
public FormElementCaseProvider getElementCase(){
return this.elementCaseContainer.getElementCase();
return this.elementCaseContainer.getElementCase();
}
public String getElementCaseContainerName(){
return this.elementCaseContainer.getElementCaseContainerName();
return this.elementCaseContainer.getElementCaseContainerName();
}
public void setElementCase(FormElementCaseProvider elementCase){
this.elementCaseContainer.setElementCase(elementCase);
this.elementCaseContainer.setElementCase(elementCase);
}
public void setElementCaseBackground(BufferedImage image){
this.elementCaseContainer.setBackground(image);
this.elementCaseContainer.setBackground(image);
}
public Dimension getElementCaseContainerSize(){
return this.elementCaseContainer.getSize();
return this.elementCaseContainer.getSize();
}
public FormElementCaseContainerProvider getElementCaseContainer(){
return this.elementCaseContainer;
return this.elementCaseContainer;
}
protected FormDesignerModeForSpecial<?> createFormDesignerTargetMode() {
@ -604,7 +604,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @param width 指定的宽度
*/
public void updateWidth(int width) {
//TODO
//TODO
}
/**
@ -615,12 +615,12 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 不返回任何对象
*/
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if(rootComponent != null){
LayoutUtils.layoutRootContainer(rootComponent);
}
if(paraComponent != null){
LayoutUtils.layoutRootContainer(paraComponent);
}
if(rootComponent != null){
LayoutUtils.layoutRootContainer(rootComponent);
}
if(paraComponent != null){
LayoutUtils.layoutRootContainer(paraComponent);
}
repaint();
return null;
}
@ -640,7 +640,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
@Override
public void fireCreatorModified(DesignerEvent evt) {
// 只有选择组件时不触发模版更新,其他都要触发
// 只有选择组件时不触发模版更新,其他都要触发
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
FormDesigner.this.fireTargetModified();
//bug59192
@ -702,7 +702,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 从root组件递归查找x,y所在的组件注意是正在被设计的组件因此其name属性必须不为空
*/
private XCreator xCreatorAt(int x, int y, XCreator root, XCreator[] except) {
if (root == null || !root.isVisible()) {
if (root == null || !root.isVisible()) {
return null;
}
x -= root.getX();
@ -758,21 +758,21 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* 刷新底层容器
*/
public void refreshRoot() {
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer());
// 撤销恢复操作都会refreshRoot,这时候的target.getContainer里的widget会和之前不一样,所以不用root判断来取
XLayoutContainer formLayoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(this.getTarget().getContainer());
// 布局默认都是1,底层的border改为0,不然没意义
this.getTarget().getContainer().setMargin(new PaddingMargin(0,0,0,0));
formLayoutContainer.setBorder(null);
if (formLayoutContainer.acceptType(XWBorderLayout.class)) {
WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData();
WBorderLayout borderLayout = (WBorderLayout) formLayoutContainer.toData();
Widget northWidget = borderLayout.getLayoutWidget(WBorderLayout.NORTH);
Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER);
Widget centerWidget = borderLayout.getLayoutWidget(WBorderLayout.CENTER);
//本身含有,这儿得先清空再加
formLayoutContainer.removeAll();
refreshNorth(northWidget, formLayoutContainer);
refreshCenter(centerWidget, formLayoutContainer);
refreshCenter(centerWidget, formLayoutContainer);
} else {
formLayoutContainer.setSize(LARGE_PREFERRED_SIZE);
@ -781,43 +781,43 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
}
private void refreshNorth(Widget northWidget, XLayoutContainer formLayoutContainer) {
// 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮
if (northWidget == null) {
paraComponent = null;
paraHeight = 0;
FormParaWidgetPane.getInstance(this);
return;
}
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget);
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize();
paraComponent = northContainer;
northContainer.setSize(0,paraHeight);
formLayoutContainer.add(northContainer, WBorderLayout.NORTH);
}
private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) {
// 不存在center块, 说明是新建的模板
if (centerWidget == null) {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body"));
layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
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);
// 如果没有参数界面, 那么就处理下高度以及参数界面的按钮要点亮
if (northWidget == null) {
paraComponent = null;
paraHeight = 0;
FormParaWidgetPane.getInstance(this);
return;
}
XLayoutContainer northContainer = (XLayoutContainer) XCreatorUtils.createXCreator(northWidget);
paraHeight = ((XWBorderLayout)formLayoutContainer).toData().getNorthSize();
paraComponent = northContainer;
northContainer.setSize(0,paraHeight);
formLayoutContainer.add(northContainer, WBorderLayout.NORTH);
}
private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) {
// 不存在center块, 说明是新建的模板
if (centerWidget == null) {
XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body"));
layoutContainer.setSize(LARGE_PREFERRED_SIZE);
setRootComponent(layoutContainer);
formLayoutContainer.add(rootComponent, WBorderLayout.CENTER);
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);
}
protected Insets getOutlineInsets() {
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) {
// 根据所选择的组件的BeanInfo生成相应的AddingModel
// AddingModel和StateModel不一样,适合当前选择的组件相关的
int creatorWidth = xCreator.getWidth();
int creatorHeight = xCreator.getHeight();
int creatorWidth = xCreator.getWidth();
int creatorHeight = xCreator.getHeight();
this.addingModel = new AddingModel(xCreator, x, y);
TransferHandler handler = new DesignerTransferHandler(this, addingModel);
setTransferHandler(handler);
@ -1007,9 +1007,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
}
}
/**
* 显示权限编辑界面
*/
/**
* 显示权限编辑界面
*/
public void showAuthorityEditPane() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setAuthorityMode(true);
if (isSupportAuthority()) {
@ -1023,9 +1023,9 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
}
/**
* 是否支持权限编辑
* @return 是则返回true
*/
* 是否支持权限编辑
* @return 是则返回true
*/
public boolean isSupportAuthority() {
int size = getSelectionModel().getSelection().size();
XCreator creator = size == 0 ? getRootComponent() : getSelectionModel().getSelection()
@ -1036,7 +1036,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
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() {
@ -1092,7 +1092,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
*/
public Action[] getActions() {
if (designer_actions == null) {
//先把复制粘贴按钮去掉,只留下删除
//先把复制粘贴按钮去掉,只留下删除
// designer_actions = new Action[]{new CutAction(this), new CopyAction(this), new PasteAction(this),
// 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() {
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.properties.EventPropertyTable;
import com.fr.design.designer.properties.WidgetPropertyTable;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.design.fun.WidgetPropertyUIProvider;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itable.AbstractPropertyTable;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.*;
@ -114,7 +111,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
@Override
public void refreshDockingView() {
designer = this.getEditingFormDesigner();
removeAll();
if (designer == null) {
@ -132,7 +128,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
eventTable.setBorder(null);
UIScrollPane esp = new UIScrollPane(eventTable);
esp.setBorder(null);
wsp = FRGUIPaneFactory.createBorderLayout_S_Pane();
wsp.setBorder(null);
mobileWidgetTable = new MobileWidgetTable(designer);
@ -144,7 +139,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
centerPane.add(mobileBodyWidgetTable,BODY);
if(hasSelectParaPane(designer)){
cardLayout.show(centerPane,PARA);
} else {
cardLayout.show(centerPane,BODY);
}
@ -153,19 +147,23 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
wsp.add(downPanel,BorderLayout.CENTER);
UITabbedPane tabbedPane = new UITabbedPane();
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);
initTabPane(psp, esp, tabbedPane);
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) {
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));
wsp.add(upLabel,BorderLayout.NORTH);
wsp.add(upLabel, BorderLayout.NORTH);
} else {
for (WidgetPropertyUIProvider widgetAttrProvider : widgetAttrProviders) {
AbstractPropertyTable propertyTable = widgetAttrProvider.createWidgetAttrTable();
@ -177,13 +175,15 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
}
}
add(tabbedPane, BorderLayout.CENTER);
propertyTable.initPropertyGroups(null);
eventTable.refresh();
for (AbstractPropertyTable propertyTable : widgetPropertyTables) {
propertyTable.initPropertyGroups(designer);
}
isrefresh = false;
}
private void initTabPane(UIScrollPane psp, UIScrollPane esp, UITabbedPane tabbedPane) {
tabbedPane.setOpaque(true);
tabbedPane.setBorder(null);
tabbedPane.setTabPlacement(SwingConstants.BOTTOM);
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);
}
//

Loading…
Cancel
Save