fr_shine 8 years ago
parent
commit
44a19d165c
  1. 86
      build.master.gradle
  2. 85
      build.release.gradle
  3. 4
      designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java
  4. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  5. 16
      designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java
  6. 70
      designer/src/com/fr/design/report/mobile/MobileToolBarPane.java
  7. 25
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  8. 70
      designer_base/build.release.gradle
  9. 13
      designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java
  10. 3
      designer_base/src/com/fr/env/RemoteEnv.java
  11. 66
      designer_chart/build.release.gradle
  12. 83
      designer_form/build.master.gradle
  13. 83
      designer_form/build.release.gradle
  14. 55
      designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java
  15. 64
      designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java
  16. 8
      designer_form/src/com/fr/design/mainframe/JForm.java
  17. 73
      designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java

86
build.master.gradle

@ -0,0 +1,86 @@
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")
}
}

85
build.release.gradle

@ -0,0 +1,85 @@
apply plugin: "java"
tasks.withType(JavaCompile){
options.encoding = "UTF-8"
}
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable/master"
//
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}/3rd.jar",dest:"${libDir}/tmp-${branchName}")
unjar(src:"${libDir}/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")
}
}

4
designer/src/com/fr/design/actions/report/ReportMobileAttrAction.java

@ -57,9 +57,7 @@ public class ReportMobileAttrAction extends JWorkBookAction{
private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'P';
}
public char getMnemonic() { return 'P'; }
@Override
public String getMenuName() {

3
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -3,7 +3,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane;
@ -103,7 +102,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
// 插入菜单
private MenuDef createInsertMenuDef() {
MenuDef menuDef = new MenuDef(Inter.getLocText("M-Insert"), 'I');
MenuDef menuDef = new MenuDef(Inter.getLocText("FR-Designer_M-Insert"), 'I');
menuDef.setAnchor(MenuHandler.INSERT);
// 单元格菜单
menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this));

16
designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java

@ -19,8 +19,6 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
private MobileRadioGroupPane horizionPane;
//竖屏设置面板
private MobileRadioGroupPane verticalPane;
//缩放选项面板
private MobileRadioCheckPane radioCheckPane;
//效果预览面板
private AppFitPreviewPane appFitPreviewPane;
@ -36,16 +34,13 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal"));
verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical"));
radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom"));
ActionListener actionListener = getAppPreviewActionListener();
horizionPane.addActionListener(actionListener);
verticalPane.addActionListener(actionListener);
fitOpsPane.add(horizionPane, BorderLayout.NORTH);
fitOpsPane.add(verticalPane, BorderLayout.CENTER);
fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH);
fitOpsPane.add(verticalPane, BorderLayout.SOUTH);
borderPane.add(fitOpsPane);
this.add(borderPane);
}
public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) {
@ -54,7 +49,7 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
//纵向和横向独立设置
public int[] getCurrentFitOptions() {
return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()};
return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()};
}
@Override
@ -64,7 +59,7 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
}
horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr());
radioCheckPane.populateBean(ob.isZoom());
// radioCheckPane.populateBean(ob.isZoom());
appFitPreviewPane.refreshPreview(getCurrentFitOptions());
}
@ -73,8 +68,9 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean();
boolean isZoom = radioCheckPane.updateBean();
return new ElementCaseMobileAttr(horizonState, verticalState, isZoom);
// boolean isZoom = radioCheckPane.updateBean();
// return new ElementCaseMobileAttr(horizonState, verticalState, isZoom);
return new ElementCaseMobileAttr(horizonState, verticalState);
}
@Override

70
designer/src/com/fr/design/report/mobile/MobileToolBarPane.java

@ -0,0 +1,70 @@
package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.general.Inter;
import com.fr.report.mobile.ElementCaseMobileAttr;
import javax.swing.*;
import java.awt.*;
/**
* Created by 方磊 on 2016/11/8.
*/
public class MobileToolBarPane extends BasicBeanPane<ElementCaseMobileAttr> {
//缩放选项面板
private MobileRadioCheckPane zoomCheckPane;
//刷新选项面板
private MobileRadioCheckPane refreshCheckPane;
public MobileToolBarPane() {
this.initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel uiLabel = new UILabel("html5");
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15));
zoomCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom"));
refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh"));
toobarsPane.add(uiLabel, BorderLayout.WEST);
toobarsPane.add(zoomCheckPane, BorderLayout.CENTER);
toobarsPane.add(refreshCheckPane, BorderLayout.EAST);
borderPane.add(toobarsPane);
this.add(borderPane);
}
@Override
public void populateBean(ElementCaseMobileAttr ob) {
if (ob == null) {
ob = new ElementCaseMobileAttr();
}
this.zoomCheckPane.populateBean(ob.isZoom());
this.refreshCheckPane.populateBean(ob.isRefresh());
}
@Override
public ElementCaseMobileAttr updateBean() {
return null;
}
@Override
public void updateBean(ElementCaseMobileAttr mobileAttr) {
if(mobileAttr != null) {
mobileAttr.setZoom(this.zoomCheckPane.updateBean());
mobileAttr.setRefresh(this.refreshCheckPane.updateBean());
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Mobile-Toolbar");
}
}

25
designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java

@ -1,6 +1,7 @@
package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.general.Inter;
import com.fr.report.mobile.ElementCaseMobileAttr;
@ -16,22 +17,30 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
private MobileUseHtmlGroupPane htmlGroupPane;
//工具栏容器
private MobileToolBarPane mobileToolBarPane;
public ReportMobileAttrPane() {
initComponents();
}
private void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane();
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
JPanel jPanel = new JPanel();
jPanel.setLayout(new BoxLayout(jPanel, BoxLayout.Y_AXIS));
jPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
appFitBrowserPane = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane);
this.add(appFitBrowserPane);
jPanel.add(appFitBrowserPane);
this.add(htmlGroupPane = new MobileUseHtmlGroupPane());
jPanel.add(htmlGroupPane = new MobileUseHtmlGroupPane());
this.add(appFitPreviewPane);
jPanel.add(mobileToolBarPane = new MobileToolBarPane());
jPanel.add(appFitPreviewPane);
UIScrollPane scrollPane = new UIScrollPane(jPanel);
this.add(scrollPane);
}
@Override
@ -40,7 +49,7 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
ob = new ElementCaseMobileAttr();
}
appFitBrowserPane.populateBean(ob);
mobileToolBarPane.populateBean(ob);
htmlGroupPane.populateBean(ob);
}
@ -48,7 +57,7 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
@Override
public ElementCaseMobileAttr updateBean() {
ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean();
mobileToolBarPane.updateBean(caseMobileAttr);
htmlGroupPane.updateBean(caseMobileAttr);
return caseMobileAttr;

70
designer_base/build.release.gradle

@ -0,0 +1,70 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.8
//jar包版本
version='8.0'
//jar包重命名
jar{
baseName='fr-designer-core'
}
def srcDir="."
//
sourceSets{
main{
java{
srcDirs=["${srcDir}/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/master',include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//.java文件到classes文件夹下参与打包
task copyFile(type:Copy,dependsOn:compileJava){
copy{
from ("${srcDir}/src"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
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')
}
}
}
jar.dependsOn compressJS

13
designer/src/com/fr/design/report/mobile/MobileRadioCheckPane.java → designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java

@ -1,4 +1,4 @@
package com.fr.design.report.mobile;
package com.fr.design.dialog.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icheckbox.UICheckBox;
@ -13,6 +13,9 @@ import java.awt.*;
import java.util.ArrayList;
import java.util.List;
/**
* 这个类要被复用移动到design_base中去
*/
public class MobileRadioCheckPane extends BasicBeanPane<Boolean> {
private List<UICheckBox> checkBoxes = new ArrayList<UICheckBox>();
@ -26,16 +29,16 @@ public class MobileRadioCheckPane extends BasicBeanPane<Boolean> {
double[] rowSize = {p};
double[] columnSize = {p,p};
UICheckBox checkBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Open"));
checkBox.setSelected(true);
UICheckBox checkBox = new UICheckBox(title);
checkBox.setSelected(false);
checkBoxes.add(checkBox);
Component[][] components = new Component[][]{
new Component[]{new UILabel(title), checkBox}
new Component[]{checkBox}
};
JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
fitOpsPane.setBorder(BorderFactory.createEmptyBorder(10, 13, 10, 10));
fitOpsPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(fitOpsPane);
}

3
designer_base/src/com/fr/env/RemoteEnv.java vendored

@ -22,7 +22,6 @@ import com.fr.file.CacheManager;
import com.fr.file.DatasourceManager;
import com.fr.file.DatasourceManagerProvider;
import com.fr.file.filetree.FileNode;
import com.fr.form.share.ShareConstants;
import com.fr.general.*;
import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray;
@ -2123,7 +2122,7 @@ public class RemoteEnv implements Env {
HttpClient client = createHttpMethod(para);
InputStream input = client.getResponseStream();
zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip");
cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE);
cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "fr_share");
StableUtils.deleteFile(cacheDir);
StableUtils.mkdirs(cacheDir);
StableUtils.makesureFileExist(zip);

66
designer_chart/build.release.gradle

@ -0,0 +1,66 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.8
//jar包的版本
version='8.0'
def srcDir="."
//jar包进行重命名
jar{
baseName='fr-designer-chart'
}
sourceSets{
main{
java{
srcDirs=["${srcDir}/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/master',include:'**/*.jar')
compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
testCompile 'junit:junit:4.12'
}
//.java classes文件夹下参与打包
task copyFile(type:Copy,dependsOn:compileJava){
copy{
from ("${srcDir}/src"){
exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
}
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')
}
}
}
jar.dependsOn compressJS

83
designer_form/build.master.gradle

@ -0,0 +1,83 @@
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'
}
}
}
//.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

83
designer_form/build.release.gradle

@ -0,0 +1,83 @@
apply plugin: 'java'
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
//jdk版本
sourceCompatibility=1.8
//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/master',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'
}
}
}
//.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

55
designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java

@ -0,0 +1,55 @@
package com.fr.design.form.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by fanglei on 2016/11/17.
*/
public class FormMobileAttrPane extends BasicBeanPane<FormMobileAttr>{
//工具栏容器
private MobileToolBarPane mobileToolBarPane;
static final int paddingHeight = 10;
public FormMobileAttrPane() {
this.initComponents();
}
private void initComponents() {
JPanel jPanel = new JPanel();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
jPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
this.mobileToolBarPane = new MobileToolBarPane();
//设置一个JPanel包裹mobileToolBarPane这个Panel,让jPanel的高度等于mobileToolBarPane高度加10,再放入this中
jPanel.setPreferredSize(new Dimension(0, (int)this.mobileToolBarPane.getPreferredSize().getHeight() + paddingHeight));
jPanel.add("North", mobileToolBarPane);
this.add(jPanel);
}
@Override
public void populateBean(FormMobileAttr ob) {
if (ob == null) {
ob = new FormMobileAttr();
}
this.mobileToolBarPane.populateBean(ob);
}
@Override
public FormMobileAttr updateBean() {
FormMobileAttr caseMobileAttr = new FormMobileAttr();
this.mobileToolBarPane.updateBean(caseMobileAttr);
return caseMobileAttr;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Mobile-Attr");
}
}

64
designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java

@ -0,0 +1,64 @@
package com.fr.design.form.mobile;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.mobile.MobileRadioCheckPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
/**
* Created by 方磊 on 2016/11/8.
*/
public class MobileToolBarPane extends BasicBeanPane<FormMobileAttr> {
//刷新选项面板
private MobileRadioCheckPane refreshCheckPane;
public MobileToolBarPane() {
this.initComponents();
}
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel borderPane = FRGUIPaneFactory.createTitledBorderPane(this.title4PopupWindow());
JPanel toobarsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
UILabel uiLabel = new UILabel("html5");
uiLabel.setBorder(BorderFactory.createEmptyBorder(5, 15, 10, 15));
this.refreshCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Refresh"));
toobarsPane.add(uiLabel, BorderLayout.WEST);
toobarsPane.add(refreshCheckPane, BorderLayout.EAST);
borderPane.add(toobarsPane);
this.add(borderPane);
}
@Override
public void populateBean(FormMobileAttr ob) {
if (ob == null) {
ob = new FormMobileAttr();
}
this.refreshCheckPane.populateBean(ob.isRefresh());
}
@Override
public FormMobileAttr updateBean() {
return null;
}
@Override
public void updateBean(FormMobileAttr mobileAttr) {
if(mobileAttr != null) {
mobileAttr.setRefresh(this.refreshCheckPane.updateBean());
}
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Mobile-Toolbar");
}
}

8
designer_form/src/com/fr/design/mainframe/JForm.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.DesignState;
import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.mainframe.actions.FormMobileAttrAction;
import com.fr.design.cell.FloatElementsProvider;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.beans.actions.FormDeleteAction;
@ -71,6 +72,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
private JComponent editingComponent;
private FormECCompositeProvider reportComposite;
//FORM_TAB代表是否点击编辑,用于点击编辑前后菜单的显示
protected int index = FORM_TAB;
public JForm() {
@ -383,11 +385,13 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
public ShortCut[] shortcut4TemplateMenu() {
if (this.index == FORM_TAB) {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{
new TemplateParameterAction(this)
new TemplateParameterAction(this),
new FormMobileAttrAction(this)
}, new ShortCut[0]);
} else {
return (ShortCut[]) ArrayUtils.addAll(new ShortCut[]{
new TemplateParameterAction(this)
new TemplateParameterAction(this),
new FormMobileAttrAction(this)
}, this.elementCaseDesign.shortcut4TemplateMenu());
}
}

73
designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java

@ -0,0 +1,73 @@
package com.fr.design.mainframe.actions;
import com.fr.base.BaseUtils;
import com.fr.design.actions.JTemplateAction;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.form.mobile.FormMobileAttrPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JForm;
import com.fr.design.menu.MenuKeySet;
import com.fr.form.main.Form;
import com.fr.form.main.mobile.FormMobileAttr;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.event.ActionEvent;
/**
* Created by fanglei on 2016/11/14.
*/
public class FormMobileAttrAction extends JTemplateAction<JForm> {
public FormMobileAttrAction(JForm jf) {
super(jf);
this.setMenuKeySet(REPORT_APP_ATTR);
this.setName(getMenuKeySet().getMenuKeySetName() + "...");
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/mobile.png"));
}
/**
* 执行动作
*
* @return 是否执行成功
*/
@Override
public void actionPerformed(ActionEvent e) {
final JForm jf = getEditingComponent();
if (jf == null) {
return;
}
final Form formTpl = jf.getTarget();
FormMobileAttr mobileAttr = formTpl.getReportMobileAttr();
final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr);
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
formTpl.setReportMobileAttr(mobileAttrPane.updateBean());
jf.fireTargetModified();
}
});
dialog.setVisible(true);
}
private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() {
@Override
public char getMnemonic() {
return 'T';
}
@Override
public String getMenuName() {
return Inter.getLocText("FR-Designer_Mobile-Attr");
}
@Override
public KeyStroke getKeyStroke() {
return null;
}
};
}
Loading…
Cancel
Save