daniel 8 years ago
parent
commit
d0b55df3c5
  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. 3
      designer/src/com/fr/design/parameter/ParameterDefinitePane.java
  6. 16
      designer/src/com/fr/design/report/mobile/AppFitBrowserPane.java
  7. 70
      designer/src/com/fr/design/report/mobile/MobileToolBarPane.java
  8. 25
      designer/src/com/fr/design/report/mobile/ReportMobileAttrPane.java
  9. 70
      designer_base/build.release.gradle
  10. 13
      designer_base/src/com/fr/design/dialog/mobile/MobileRadioCheckPane.java
  11. 108
      designer_base/src/com/fr/env/RemoteEnv.java
  12. 66
      designer_chart/build.release.gradle
  13. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChartDataPane.java
  14. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  15. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  16. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java
  17. 9
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java
  18. 2
      designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java
  19. 22
      designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java
  20. 83
      designer_form/build.master.gradle
  21. 83
      designer_form/build.release.gradle
  22. 3
      designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java
  23. 55
      designer_form/src/com/fr/design/form/mobile/FormMobileAttrPane.java
  24. 64
      designer_form/src/com/fr/design/form/mobile/MobileToolBarPane.java
  25. 44
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  26. 2
      designer_form/src/com/fr/design/mainframe/CoverReportPane.java
  27. 2
      designer_form/src/com/fr/design/mainframe/FormDesigner.java
  28. 174
      designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java
  29. 8
      designer_form/src/com/fr/design/mainframe/JForm.java
  30. 4
      designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java
  31. 6
      designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java
  32. 3
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  33. 73
      designer_form/src/com/fr/design/mainframe/actions/FormMobileAttrAction.java
  34. 21
      designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
  35. 9
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.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() { private static final MenuKeySet REPORT_APP_ATTR = new MenuKeySet() {
@Override @Override
public char getMnemonic() { public char getMnemonic() { return 'P'; }
return 'P';
}
@Override @Override
public String getMenuName() { 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.base.BaseUtils;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -103,7 +102,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
// 插入菜单 // 插入菜单
private MenuDef createInsertMenuDef() { 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.setAnchor(MenuHandler.INSERT);
// 单元格菜单 // 单元格菜单
menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getCellMenu(this));

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

@ -20,9 +20,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityToolBarPane; import com.fr.design.mainframe.AuthorityToolBarPane;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JWorkBook; import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.*; import com.fr.design.menu.*;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
@ -246,7 +244,6 @@ public class ParameterDefinitePane extends JPanel implements ToolBarMenuDockPlus
isdelayItem.setSelected(reportParameterAttr.isDelayPlaying()); isdelayItem.setSelected(reportParameterAttr.isDelayPlaying());
isshowWindowItem.setSelected(reportParameterAttr.isShowWindow()); isshowWindowItem.setSelected(reportParameterAttr.isShowWindow());
isEditing = true; isEditing = true;
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance().getPreferredSize().height);
ParameterBridge bridge = paraDesignEditor.getParaComponent(); ParameterBridge bridge = paraDesignEditor.getParaComponent();
if (parameterUI != null) { if (parameterUI != null) {
bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying()); bridge.setDelayDisplayContent(reportParameterAttr.isDelayPlaying());

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 horizionPane;
//竖屏设置面板 //竖屏设置面板
private MobileRadioGroupPane verticalPane; private MobileRadioGroupPane verticalPane;
//缩放选项面板
private MobileRadioCheckPane radioCheckPane;
//效果预览面板 //效果预览面板
private AppFitPreviewPane appFitPreviewPane; private AppFitPreviewPane appFitPreviewPane;
@ -36,16 +34,13 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel fitOpsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal")); horizionPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Horizontal"));
verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical")); verticalPane = new MobileRadioGroupPane(Inter.getLocText("FR-Designer_Mobile-Vertical"));
radioCheckPane = new MobileRadioCheckPane(Inter.getLocText("FR-Designer_Mobile-Zoom"));
ActionListener actionListener = getAppPreviewActionListener(); ActionListener actionListener = getAppPreviewActionListener();
horizionPane.addActionListener(actionListener); horizionPane.addActionListener(actionListener);
verticalPane.addActionListener(actionListener); verticalPane.addActionListener(actionListener);
fitOpsPane.add(horizionPane, BorderLayout.NORTH); fitOpsPane.add(horizionPane, BorderLayout.NORTH);
fitOpsPane.add(verticalPane, BorderLayout.CENTER); fitOpsPane.add(verticalPane, BorderLayout.SOUTH);
fitOpsPane.add(radioCheckPane, BorderLayout.SOUTH);
borderPane.add(fitOpsPane); borderPane.add(fitOpsPane);
this.add(borderPane); this.add(borderPane);
} }
public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) { public void setAppFitPreviewPane(AppFitPreviewPane appFitPreviewPane) {
@ -54,7 +49,7 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
//纵向和横向独立设置 //纵向和横向独立设置
public int[] getCurrentFitOptions() { public int[] getCurrentFitOptions() {
return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex(), radioCheckPane.getCurrentState()}; return new int[]{horizionPane.getSelectRadioIndex(), verticalPane.getSelectRadioIndex()};
} }
@Override @Override
@ -64,7 +59,7 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
} }
horizionPane.populateBean(ob.getHorziontalAttr()); horizionPane.populateBean(ob.getHorziontalAttr());
verticalPane.populateBean(ob.getVerticalAttr()); verticalPane.populateBean(ob.getVerticalAttr());
radioCheckPane.populateBean(ob.isZoom()); // radioCheckPane.populateBean(ob.isZoom());
appFitPreviewPane.refreshPreview(getCurrentFitOptions()); appFitPreviewPane.refreshPreview(getCurrentFitOptions());
} }
@ -73,8 +68,9 @@ public class AppFitBrowserPane extends BasicBeanPane<ElementCaseMobileAttr> {
public ElementCaseMobileAttr updateBean() { public ElementCaseMobileAttr updateBean() {
MobileFitAttrState horizonState = horizionPane.updateBean(); MobileFitAttrState horizonState = horizionPane.updateBean();
MobileFitAttrState verticalState = verticalPane.updateBean(); MobileFitAttrState verticalState = verticalPane.updateBean();
boolean isZoom = radioCheckPane.updateBean(); // boolean isZoom = radioCheckPane.updateBean();
return new ElementCaseMobileAttr(horizonState, verticalState, isZoom); // return new ElementCaseMobileAttr(horizonState, verticalState, isZoom);
return new ElementCaseMobileAttr(horizonState, verticalState);
} }
@Override @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; package com.fr.design.report.mobile;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.report.mobile.ElementCaseMobileAttr; import com.fr.report.mobile.ElementCaseMobileAttr;
@ -16,22 +17,30 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
private MobileUseHtmlGroupPane htmlGroupPane; private MobileUseHtmlGroupPane htmlGroupPane;
//工具栏容器
private MobileToolBarPane mobileToolBarPane;
public ReportMobileAttrPane() { public ReportMobileAttrPane() {
initComponents(); initComponents();
} }
private void initComponents() { private void initComponents() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
AppFitPreviewPane appFitPreviewPane = new AppFitPreviewPane(); 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 = new AppFitBrowserPane();
appFitBrowserPane.setAppFitPreviewPane(appFitPreviewPane); 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 @Override
@ -40,7 +49,7 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
ob = new ElementCaseMobileAttr(); ob = new ElementCaseMobileAttr();
} }
appFitBrowserPane.populateBean(ob); appFitBrowserPane.populateBean(ob);
mobileToolBarPane.populateBean(ob);
htmlGroupPane.populateBean(ob); htmlGroupPane.populateBean(ob);
} }
@ -48,7 +57,7 @@ public class ReportMobileAttrPane extends BasicBeanPane<ElementCaseMobileAttr>{
@Override @Override
public ElementCaseMobileAttr updateBean() { public ElementCaseMobileAttr updateBean() {
ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean(); ElementCaseMobileAttr caseMobileAttr = appFitBrowserPane.updateBean();
mobileToolBarPane.updateBean(caseMobileAttr);
htmlGroupPane.updateBean(caseMobileAttr); htmlGroupPane.updateBean(caseMobileAttr);
return 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.beans.BasicBeanPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
@ -13,6 +13,9 @@ import java.awt.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/**
* 这个类要被复用移动到design_base中去
*/
public class MobileRadioCheckPane extends BasicBeanPane<Boolean> { public class MobileRadioCheckPane extends BasicBeanPane<Boolean> {
private List<UICheckBox> checkBoxes = new ArrayList<UICheckBox>(); private List<UICheckBox> checkBoxes = new ArrayList<UICheckBox>();
@ -26,16 +29,16 @@ public class MobileRadioCheckPane extends BasicBeanPane<Boolean> {
double[] rowSize = {p}; double[] rowSize = {p};
double[] columnSize = {p,p}; double[] columnSize = {p,p};
UICheckBox checkBox = new UICheckBox(Inter.getLocText("FR-Designer_Mobile-Open")); UICheckBox checkBox = new UICheckBox(title);
checkBox.setSelected(true); checkBox.setSelected(false);
checkBoxes.add(checkBox); checkBoxes.add(checkBox);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(title), checkBox} new Component[]{checkBox}
}; };
JPanel fitOpsPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); 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); this.add(fitOpsPane);
} }

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

@ -31,8 +31,7 @@ import com.fr.plugin.Plugin;
import com.fr.plugin.PluginLicense; import com.fr.plugin.PluginLicense;
import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginLoader; import com.fr.plugin.PluginLoader;
import com.fr.plugin.dependence.PluginServiceCreator; import com.fr.share.ShareConstants;
import com.fr.plugin.dependence.PluginServiceManager;
import com.fr.stable.*; import com.fr.stable.*;
import com.fr.stable.file.XMLFileManagerProvider; import com.fr.stable.file.XMLFileManagerProvider;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
@ -1539,6 +1538,7 @@ public class RemoteEnv implements Env {
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
para.put("cmd", "design_save_resource"); para.put("cmd", "design_save_resource");
para.put("resource", mgr.fileName()); para.put("resource", mgr.fileName());
para.put("class_name", mgr.getClass().getName());
para.put("current_uid", this.createUserID()); para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser()); para.put("currentUsername", this.getUser());
@ -2107,4 +2107,108 @@ public class RemoteEnv implements Env {
public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception { public void checkAndRegisterLic(FileNode node, Plugin plugin) throws Exception {
} }
@Override
public File[] loadREUFile() throws Exception {
File target = new File(CacheManager.getProviderInstance().getCacheDirectory(),
ShareConstants.DIR_SHARE_CACHE);
StableUtils.deleteFile(target);
StableUtils.mkdirs(target);
File cacheDir = null;
File zip = null;
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_read_reufile");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
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);
StableUtils.deleteFile(cacheDir);
StableUtils.mkdirs(cacheDir);
StableUtils.makesureFileExist(zip);
FileOutputStream out = new FileOutputStream(zip);
IOUtils.copyBinaryTo(input, out);
out.flush();
out.close();
IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录
if (cacheDir.exists() && cacheDir.isDirectory()) {
return cacheDir.listFiles(new FilenameFilter() {
public boolean accept(File file, String s) {
return s.endsWith("reu");
}
});
}
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
} finally {
StableUtils.deleteFile(zip);
}
return new File[0];
}
@Override
public boolean installREUFile(File reuFile) {
// if (reuFile == null) {
// return false;
// }
// try {
// HashMap<String, String> para = new HashMap<String, String>();
// para.put("op", "fr_remote_design");
// para.put("cmd", "design_install_reufile");
// para.put("current_uid", this.createUserID());
// para.put("currentUsername", this.getUser());
// para.put("reuFileName", reuFile.getName());
//
// HttpClient client = createHttpMethod(para);
// client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(reuFile)));
// InputStream input = execute4InputStream(client);
// return ComparatorUtils.equals(stream2String(input), "true");
// } catch (Exception e) {
// return false;
// }
return false;
}
@Override
public boolean removeREUFilesByName(String fileName) {
if (StringUtils.isEmpty(fileName)) {
return true;
}
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_remove_reufile");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
para.put("reuFileName", fileName);
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
return ComparatorUtils.equals(stream2String(input), "true");
} catch (Exception e) {
return false;
}
}
@Override
public String getSharePath() {
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
para.put("cmd", "design_get_share_path");
para.put("current_uid", this.createUserID());
para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para);
InputStream input = execute4InputStream(client);
return stream2String(input);
} catch (Exception e) {
return StringUtils.EMPTY;
}
}
} }

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

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

@ -16,6 +16,9 @@ import java.awt.*;
public class ChartDataPane extends AbstractChartAttrPane { public class ChartDataPane extends AbstractChartAttrPane {
public static final int LABEL_WIDTH = 85;
public static final int LABEL_HEIGHT = 20;
protected DataContentsPane contentsPane; protected DataContentsPane contentsPane;
protected AttributeChangeListener listener; protected AttributeChangeListener listener;

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java

@ -57,7 +57,7 @@ public class NormalChartDataPane extends DataContentsPane {
JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); JPanel northPane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0));
northPane.add(jcb, BorderLayout.CENTER); northPane.add(jcb, BorderLayout.CENTER);
UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT); UILabel label1 = new UILabel(Inter.getLocText("Chart-Data_Resource") + ":", SwingConstants.RIGHT);
label1.setPreferredSize(new Dimension(75,20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null}));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);
this.add(cardPane, BorderLayout.CENTER); this.add(cardPane, BorderLayout.CENTER);

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -32,7 +32,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private void initDataPane() { private void initDataPane() {
UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ; UILabel label = new BoldFontTextLabel(Inter.getLocText("Chart-DS_TableData") + ":", SwingConstants.RIGHT) ;
label.setPreferredSize(new Dimension(75,20)); label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
tableDataPane = new DatabaseTableDataPane(label) { tableDataPane = new DatabaseTableDataPane(label) {
@Override @Override
protected void userEvent() { protected void userEvent() {

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotTableDataContentPane.java

@ -42,7 +42,7 @@ public class CategoryPlotTableDataContentPane extends AbstractTableDataContentPa
JPanel categoryPane = new JPanel(new BorderLayout(4,0)); JPanel categoryPane = new JPanel(new BorderLayout(4,0));
categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground())); categoryPane.setBorder(BorderFactory.createMatteBorder(0, 0, 6, 1, getBackground()));
UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ; UILabel label1 = new BoldFontTextLabel(Inter.getLocText("FR-Chart-Category_Name") + ":", SwingConstants.RIGHT) ;
label1.setPreferredSize(new Dimension(75,20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT));
categoryCombox.setPreferredSize(new Dimension(100,20)); categoryCombox.setPreferredSize(new Dimension(100,20));
categoryCombox.addItem(Inter.getLocText("Chart-Use_None")); categoryCombox.addItem(Inter.getLocText("Chart-Use_None"));

9
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldValuePane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.CalculateComboBox; import com.fr.design.mainframe.chart.gui.data.CalculateComboBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -76,12 +77,12 @@ public class SeriesNameUseFieldValuePane extends FurtherBasicBeanPane<ChartColle
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f}; double[] columnSize = {f};
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
UILabel Label1 = new UILabel(Inter.getLocText("Chart-Series_Name") + ":", SwingConstants.RIGHT); UILabel Label1 = new UILabel(Inter.getLocText("FR-Chart-Series_Name") + ":", SwingConstants.RIGHT);
Label1.setPreferredSize(new Dimension(75, 20)); Label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label2 = new UILabel(Inter.getLocText("Chart-Series_Value") + ":", SwingConstants.RIGHT); UILabel Label2 = new UILabel(Inter.getLocText("Chart-Series_Value") + ":", SwingConstants.RIGHT);
Label2.setPreferredSize(new Dimension(75, 20)); Label2.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
UILabel Label3 = new UILabel(Inter.getLocText("Chart-Summary_Method") + ":", SwingConstants.RIGHT); UILabel Label3 = new UILabel(Inter.getLocText("Chart-Summary_Method") + ":", SwingConstants.RIGHT);
Label3.setPreferredSize(new Dimension(75, 20)); Label3.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
Component[][] components = getUseComponent(Label1, Label2, Label3); Component[][] components = getUseComponent(Label1, Label2, Label3);
centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6); centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 4, 6);

2
designer_chart/src/com/fr/design/mainframe/chart/gui/data/table/SeriesTypeUseComboxPane.java

@ -48,7 +48,7 @@ public class SeriesTypeUseComboxPane extends UIComboBoxPane<ChartCollection> {
this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM)); this.setLayout(new BorderLayout(4, LayoutConstants.VGAP_MEDIUM));
JPanel northPane = new JPanel(new BorderLayout(4, 0)); JPanel northPane = new JPanel(new BorderLayout(4, 0));
UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT); UILabel label1 = new UILabel(Inter.getLocText("ChartF-Series_Name_From") + ":", SwingConstants.RIGHT);
label1.setPreferredSize(new Dimension(75, 20)); label1.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH, ChartDataPane.LABEL_HEIGHT));
northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null})); northPane.add(GUICoreUtils.createBorderLayoutPane(new Component[]{jcb, null, null, label1, null}));
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1)); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
this.add(northPane, BorderLayout.NORTH); this.add(northPane, BorderLayout.NORTH);

22
designer_chart/src/com/fr/design/mainframe/chart/gui/type/ChartTabPane.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe.chart.gui.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.design.dialog.MultiTabPane; import com.fr.design.dialog.MultiTabPane;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane; import com.fr.design.mainframe.chart.gui.style.legend.AutoSelectedPane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -15,6 +16,7 @@ import java.awt.*;
public abstract class ChartTabPane extends MultiTabPane<Chart> { public abstract class ChartTabPane extends MultiTabPane<Chart> {
private static final long serialVersionUID = 8633385688766835240L; private static final long serialVersionUID = 8633385688766835240L;
private boolean setTooltip = true;
@Override @Override
protected void initLayout() { protected void initLayout() {
@ -26,6 +28,26 @@ public abstract class ChartTabPane extends MultiTabPane<Chart> {
this.add(centerPane, BorderLayout.CENTER); this.add(centerPane, BorderLayout.CENTER);
} }
//日文环境下,显示不全的,用tooltip
private void setSomeTooltipText() {
for(int i = 0, size = paneList.size(); i<size; i++){
String tooltip = paneList.get(i).getTitle();
UIToggleButton button = tabPane.getButton(i);
if(button.getPreferredSize().getWidth() > button.getSize().getWidth()) {
button.setToolTipText(tooltip);
}
}
}
@Override
public void paint(Graphics g) {
super.paint(g);
if(setTooltip) {
setSomeTooltipText();
setTooltip = false;
}
}
@Override @Override
public boolean accept(Object ob) { public boolean accept(Object ob) {
return false; return false;

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

3
designer_form/src/com/fr/design/designer/properties/WidgetPropertyTable.java

@ -21,6 +21,7 @@ import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.creator.cardlayout.XWCardLayout; import com.fr.design.designer.creator.cardlayout.XWCardLayout;
import com.fr.general.ComparatorUtils;
public class WidgetPropertyTable extends AbstractPropertyTable { public class WidgetPropertyTable extends AbstractPropertyTable {
@ -71,7 +72,7 @@ public class WidgetPropertyTable extends AbstractPropertyTable {
if (size == 0 || size == 1) { if (size == 0 || size == 1) {
XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection() XCreator creator = size == 0 ? designer.getRootComponent() : designer.getSelectionModel().getSelection()
.getSelectedCreator(); .getSelectedCreator();
if (designer.isRoot(creator)) { if (ComparatorUtils.equals(creator, designer.getRootComponent())) {
groups = designer.getDesignerMode().createRootDesignerPropertyGroup(); groups = designer.getDesignerMode().createRootDesignerPropertyGroup();
} else { } else {
groups = getCreatorPropertyGroup(designer, creator); groups = getCreatorPropertyGroup(designer, creator);

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

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

@ -37,30 +37,6 @@ public class ComponentTree extends JTree {
this.setTransferHandler(new TreeTransferHandler()); this.setTransferHandler(new TreeTransferHandler());
this.refreshTreeRoot(); this.refreshTreeRoot();
addTreeSelectionListener(designer); addTreeSelectionListener(designer);
this.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.isPopupTrigger()) {
popupMenu(e);
}
}
@Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
popupMenu(e);
}
}
@Override
public void mouseReleased(MouseEvent e) {
if (e.isPopupTrigger()) {
popupMenu(e);
}
}
});
setEditable(true); setEditable(true);
} }
@ -121,20 +97,6 @@ public class ComponentTree extends JTree {
scrollPathToVisible(treepath); scrollPathToVisible(treepath);
} }
private void popupMenu(MouseEvent e) {
TreePath path = this.getSelectionPath();
if (path == null) {
return;
}
Component component = (Component) path.getLastPathComponent();
if (!(component instanceof XCreator)) {
return;
}
ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, (XCreator) component);
JPopupMenu menu = adapter.getContextPopupMenu(e);
menu.show(this, e.getX(), e.getY());
}
/** /**
* 刷新 * 刷新
*/ */
@ -241,12 +203,14 @@ public class ComponentTree extends JTree {
creator.notShowInComponentTree(path); creator.notShowInComponentTree(path);
} }
//绝对布局作为body的时候不显示自适应布局父层 //绝对布局作为body的时候不显示自适应布局父层
if (((XCreator) parent).acceptType(XWAbsoluteBodyLayout.class) if (((XCreator) parent).acceptType(XWAbsoluteBodyLayout.class)) {
&& (parent.getParent() != null) if ((parent.getParent() != null)
&& ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)){ && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)){
parent = parent.getParent().getParent(); parent = parent.getParent().getParent();
continue; continue;
} }
}
parent = parent.getParent(); parent = parent.getParent();
} }
Object[] components = path.toArray(); Object[] components = path.toArray();

2
designer_form/src/com/fr/design/mainframe/CoverReportPane.java

@ -3,7 +3,7 @@ package com.fr.design.mainframe;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.icon.IconPathConstants; import com.fr.design.icon.IconPathConstants;
import com.fr.form.share.ShareConstants; import com.fr.share.ShareConstants;
import com.fr.general.FRScreen; import com.fr.general.FRScreen;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;

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

@ -853,7 +853,7 @@ public class FormDesigner extends TargetComponent<Form> implements TreeSelection
* @return 是则返回true * @return 是则返回true
*/ */
public boolean isRoot(XCreator comp) { public boolean isRoot(XCreator comp) {
return comp == rootComponent; return comp == rootComponent || comp.acceptType(XWAbsoluteBodyLayout.class);
} }
// 计算鼠标事件e所发生的位置相对根组件的位置关系 // 计算鼠标事件e所发生的位置相对根组件的位置关系

174
designer_form/src/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -2,11 +2,6 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.UIDialog;
import com.fr.design.extra.PluginWebBridge;
import com.fr.design.extra.ShopDialog;
import com.fr.design.extra.WebManagerPaneFactory;
import com.fr.design.gui.frpane.UITabbedPane; import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -16,11 +11,13 @@ import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.share.ShareConstants;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import com.fr.general.FRLogger;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.share.ShareConstants;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -44,16 +41,20 @@ import java.net.URISyntaxException;
public class FormWidgetDetailPane extends FormDockView{ public class FormWidgetDetailPane extends FormDockView{
private UITabbedPane tabbedPane; private UITabbedPane tabbedPane;
private UIScrollPane downPanel; private UIScrollPane downPane;
private JPanel reuWidgetPanel; private JPanel reuWidgetPanel;
private UIComboBox comboBox; private UIComboBox comboBox;
private ElCaseBindInfo[] elCaseBindInfoList; private ElCaseBindInfo[] elCaseBindInfoList;
private UIButton downloadButton;
private UIButton refreshButton;
private UIButton deleteButton; private UIButton deleteButton;
private UIButton resetButton;
private JPanel editPanel;
private JPanel resetPanel;
private JPanel menutPanel;
private static final int OFFSET_X = 140; private static final int OFFSET_X = 140;
private static final int OFFSET_Y = 26; private static final int OFFSET_Y = 26;
private SwingWorker sw; private SwingWorker sw;
//组件面板是否可以编辑
private boolean isEdit;
public static FormWidgetDetailPane getInstance() { public static FormWidgetDetailPane getInstance() {
if (HOLDER.singleton == null) { if (HOLDER.singleton == null) {
@ -99,7 +100,6 @@ public class FormWidgetDetailPane extends FormDockView{
reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); reuWidgetPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
reuWidgetPanel.setBorder(null); reuWidgetPanel.setBorder(null);
if (elCaseBindInfoList == null) { if (elCaseBindInfoList == null) {
elCaseBindInfoList = new ElCaseBindInfo[0];
if (sw != null) { if (sw != null) {
sw.cancel(true); sw.cancel(true);
} }
@ -114,8 +114,6 @@ public class FormWidgetDetailPane extends FormDockView{
sw.execute(); sw.execute();
} }
initReuWidgetPanel(); initReuWidgetPanel();
createRefreshButton();
createDownloadButton();
initMenuPanel(); initMenuPanel();
tabbedPane = new UITabbedPane(); tabbedPane = new UITabbedPane();
tabbedPane.setOpaque(true); tabbedPane.setOpaque(true);
@ -131,38 +129,74 @@ public class FormWidgetDetailPane extends FormDockView{
* 初始化组件共享和复用面板 * 初始化组件共享和复用面板
*/ */
private void initReuWidgetPanel() { private void initReuWidgetPanel() {
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false)); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
reuWidgetPanel.add(downPanel); downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, false));
reuWidgetPanel.add(downPane);
} }
/** /**
* 初始化菜单栏面板 * 初始化菜单栏面板
*/ */
private void initMenuPanel() { private void initMenuPanel() {
JPanel menutPane = new JPanel(); menutPanel = new JPanel();
menutPane.setLayout(FRGUIPaneFactory.createBorderLayout()); menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
menutPane.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3)); menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 8, 3, 3));
menutPane.setPreferredSize(new Dimension(240, 48)); menutPanel.setPreferredSize(new Dimension(240, 48));
menutPane.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"), menutPanel.add(new UILabel(Inter.getLocText("FR-Designer_LocalWidget"),
SwingConstants.HORIZONTAL), BorderLayout.WEST); SwingConstants.HORIZONTAL), BorderLayout.WEST);
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); menutPanel.add(initEditButtonPane(), BorderLayout.EAST);
buttonPanel.add(refreshButton, BorderLayout.WEST); menutPanel.add(new JPanel(), BorderLayout.CENTER);
buttonPanel.add(downloadButton, BorderLayout.EAST);
menutPane.add(buttonPanel, BorderLayout.EAST);
menutPane.add(new JPanel(), BorderLayout.CENTER);
comboBox = new UIComboBox(getFormCategories()); comboBox = new UIComboBox(getFormCategories());
comboBox.setPreferredSize(new Dimension(240, 30)); comboBox.setPreferredSize(new Dimension(240, 30));
initComboBoxSelectedListener(); initComboBoxSelectedListener();
menutPane.add(comboBox, BorderLayout.SOUTH); menutPanel.add(comboBox, BorderLayout.SOUTH);
reuWidgetPanel.add(menutPane, BorderLayout.NORTH); reuWidgetPanel.add(menutPanel, BorderLayout.NORTH);
}
/**
* 创建菜单栏按钮面板
*/
private JPanel initEditButtonPane() {
editPanel = new JPanel();
editPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
editPanel.add(createRefreshButton(), BorderLayout.WEST);
editPanel.add(createDownloadButton(), BorderLayout.EAST);
return editPanel;
}
/**
* 创建取消删除面板
*/
private JPanel initResetButtonPane() {
resetPanel = new JPanel();
resetButton = new UIButton(Inter.getLocText("FR-Designer_Reset"));
resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
resetButton.set4ToolbarButton();
resetButton.setOpaque(true);
resetButton.setBackground(new Color(184, 220, 242));
resetButton.setForeground(Color.WHITE);
resetButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
refreshDownPanel(false);
replaceButtonPanel(false);
reuWidgetPanel.remove(deleteButton);
}
});
resetPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
resetPanel.add(resetButton, BorderLayout.CENTER);
return resetPanel;
} }
private void initComboBoxSelectedListener() { private void initComboBoxSelectedListener() {
comboBox.addItemListener(new ItemListener() { comboBox.addItemListener(new ItemListener() {
@Override @Override
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
ShareLoader.getLoader().resetRemovedModuleList();
int filterIndex = comboBox.getSelectedIndex(); int filterIndex = comboBox.getSelectedIndex();
if (filterIndex == 0) { if (filterIndex == 0) {
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
@ -170,14 +204,17 @@ public class FormWidgetDetailPane extends FormDockView{
String filterName = comboBox.getSelectedItem().toString(); String filterName = comboBox.getSelectedItem().toString();
elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName); elCaseBindInfoList = ShareLoader.getLoader().getFilterBindInfoList(filterName);
} }
refreshDownPanel(false); refreshDownPanel(isEdit);
} }
}); });
} }
private void createRefreshButton() { /**
refreshButton = new UIButton(); * 创建刷新按钮
*/
private UIButton createRefreshButton() {
UIButton refreshButton = new UIButton();
refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png")); refreshButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/refresh.png"));
refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh")); refreshButton.setToolTipText(Inter.getLocText("FR-Designer_Refresh"));
refreshButton.set4ToolbarButton(); refreshButton.set4ToolbarButton();
@ -192,6 +229,7 @@ public class FormWidgetDetailPane extends FormDockView{
protected Object doInBackground() throws Exception { protected Object doInBackground() throws Exception {
ShareLoader.getLoader().refreshModule(); ShareLoader.getLoader().refreshModule();
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
refreshComboxData();
refreshDownPanel(false); refreshDownPanel(false);
return null; return null;
} }
@ -199,29 +237,43 @@ public class FormWidgetDetailPane extends FormDockView{
sw.execute(); sw.execute();
} }
}); });
return refreshButton;
}
private void refreshComboxData() {
comboBox.setSelectedIndex(0);
comboBox.setModel(new DefaultComboBoxModel(getFormCategories()));
} }
/** /**
* 创建下载模板的按钮 * 创建下载模板的按钮
*/ */
private void createDownloadButton() { private UIButton createDownloadButton() {
downloadButton = new UIButton(); UIButton downloadButton = new UIButton();
downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png")); downloadButton.setIcon(BaseUtils.readIcon("/com/fr/design/form/images/showmenu.png"));
downloadButton.set4ToolbarButton(); downloadButton.set4ToolbarButton();
downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template")); downloadButton.setToolTipText(Inter.getLocText("FR-Designer_Download_Template"));
downloadButton.addActionListener(new ActionListener() { downloadButton.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
initPopMenu();
}
});
return downloadButton;
}
/**
* 初始化下拉面板
*/
private void initPopMenu() {
UIPopupMenu menu = new UIPopupMenu(); UIPopupMenu menu = new UIPopupMenu();
UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png")); UIMenuItem downloadItem = new UIMenuItem(Inter.getLocText("FR-Designer_Download_Template"), BaseUtils.readIcon("/com/fr/design/form/images/download icon.png"));
UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png")); UIMenuItem installItem = new UIMenuItem(Inter.getLocText("FR-Designer_Install_Template"), BaseUtils.readIcon("/com/fr/design/form/images/install icon.png"));
UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png")); UIMenuItem deleteItem = new UIMenuItem(Inter.getLocText("FR-Designer_Delete_Template"), BaseUtils.readIcon("/com/fr/design/form/images/delete icon.png"));
menu.add(downloadItem); menu.add(downloadItem);
menu.add(installItem); menu.add(installItem);
menu.add(deleteItem); menu.add(deleteItem);
downloadItem.addActionListener(new ActionListener() { downloadItem.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -233,7 +285,7 @@ public class FormWidgetDetailPane extends FormDockView{
try { try {
Desktop.getDesktop().browse(new URI(url)); Desktop.getDesktop().browse(new URI(url));
} catch (IOException exp) { } catch (IOException exp) {
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer_Set_default_browser"));
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
} catch (URISyntaxException exp) { } catch (URISyntaxException exp) {
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
@ -241,42 +293,35 @@ public class FormWidgetDetailPane extends FormDockView{
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp);
FRContext.getLogger().error("Can not open the browser for URL: " + url); FRContext.getLogger().error("Can not open the browser for URL: " + url);
} }
} }
}); });
installItem.addActionListener(new ActionListener() { installItem.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
JFileChooser fileChooser = new JFileChooser(); JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu")); fileChooser.setFileFilter(new FileNameExtensionFilter(".reu", "reu"));
int returnValue = fileChooser.showDialog(new JLabel(), Inter.getLocText("FR-Designer_Select")); int returnValue = fileChooser.showDialog(new UILabel(), Inter.getLocText("FR-Designer_Select"));
if (returnValue == JFileChooser.APPROVE_OPTION) { if (returnValue == JFileChooser.APPROVE_OPTION) {
final File chosenFile = fileChooser.getSelectedFile(); final File chosenFile = fileChooser.getSelectedFile();
installFromDiskZipFile(chosenFile); installFromDiskZipFile(chosenFile);
} }
} }
}); });
deleteItem.addActionListener(new ActionListener() { deleteItem.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
replaceButtonPanel(true);
deleteFromDiskZipFile(); deleteFromDiskZipFile();
} }
}); });
GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y); GUICoreUtils.showPopupMenu(menu, tabbedPane, tabbedPane.getX() + OFFSET_X, OFFSET_Y);
}
});
} }
private void deleteFromDiskZipFile() { private void deleteFromDiskZipFile() {
deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove")); deleteButton = new UIButton(Inter.getLocText("FR-Designer-CommitTab_Remove"));
deleteButton.setOpaque(true);
deleteButton.setBackground(Color.red); deleteButton.setBackground(Color.red);
deleteButton.repaint();
deleteButton.setPreferredSize(new Dimension(240, 40)); deleteButton.setPreferredSize(new Dimension(240, 40));
reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH); reuWidgetPanel.add(deleteButton, BorderLayout.SOUTH);
deleteButton.addActionListener(new ActionListener() { deleteButton.addActionListener(new ActionListener() {
@ -288,10 +333,10 @@ public class FormWidgetDetailPane extends FormDockView{
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Successful"));
refreshDownPanel(false); refreshDownPanel(false);
replaceButtonPanel(false);
refreshComboxData();
} else { } else {
reuWidgetPanel.remove(deleteButton);
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Removed_Failed"));
refreshDownPanel(false);
} }
} }
@ -300,25 +345,44 @@ public class FormWidgetDetailPane extends FormDockView{
} }
private void replaceButtonPanel(boolean isEdit) {
this.isEdit = isEdit;
if (isEdit) {
menutPanel.remove(editPanel);
menutPanel.add(initResetButtonPane(), BorderLayout.EAST);
} else {
menutPanel.remove(resetPanel);
menutPanel.add(initEditButtonPane(), BorderLayout.EAST);
ShareLoader.getLoader().resetRemovedModuleList();
}
}
private void installFromDiskZipFile(File chosenFile) { private void installFromDiskZipFile(File chosenFile) {
if (chosenFile != null && chosenFile.getName().endsWith(ShareConstants.SUFFIX_MODULE)) {
try { try {
ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile); if (ShareLoader.getLoader().installModuleFromDiskZipFile(chosenFile)) {
refreshShareMoudule(); refreshShareMoudule();
elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList(); elCaseBindInfoList = ShareLoader.getLoader().getAllBindInfoList();
refreshDownPanel(false); refreshDownPanel(false);
refreshComboxData();
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_OK"));
} else {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error"));
}
} catch (IOException e) { } catch (IOException e) {
JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error")); JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Share_Module_Error"));
e.printStackTrace(); FRLogger.getLogger().error(e.getMessage(), e);
}
} }
} }
private void refreshShareMoudule() { private void refreshShareMoudule() {
try { try {
ShareLoader.getLoader().refreshModule(); ShareLoader.getLoader().refreshModule();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); FRLogger.getLogger().error(e.getMessage(), e);
} }
} }
@ -326,15 +390,15 @@ public class FormWidgetDetailPane extends FormDockView{
* 获取报表块组件分类 * 获取报表块组件分类
*/ */
public String[] getFormCategories() { public String[] getFormCategories() {
return ShareConstants.WIDGET_CATEGORIES; return ArrayUtils.addAll(new String[] {Inter.getLocText("FR-Designer_AllCategories")}, ShareLoader.getLoader().getModuleCategory());
} }
public void refreshDownPanel(boolean isEdit) { public void refreshDownPanel(boolean isEdit) {
reuWidgetPanel.remove(downPanel); reuWidgetPanel.remove(downPane);
downPanel = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit)); downPane = new UIScrollPane(new ShareWidgetPane(elCaseBindInfoList, isEdit));
reuWidgetPanel.add(downPanel); reuWidgetPanel.add(downPane);
repaintContainer(); repaintContainer();
} }

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

4
designer_form/src/com/fr/design/mainframe/ShareWidgetButton.java

@ -1,12 +1,10 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.*; import com.fr.base.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.icon.IconPathConstants; import com.fr.share.ShareConstants;
import com.fr.form.share.ShareConstants;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;

6
designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java

@ -1,8 +1,8 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.form.ui.ElCaseBindInfo; import com.fr.form.ui.ElCaseBindInfo;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -14,6 +14,7 @@ public class ShareWidgetPane extends JPanel {
public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList, boolean isEdit) { public ShareWidgetPane(ElCaseBindInfo[] elCaseBindInfoList, boolean isEdit) {
this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离 this.setBorder(BorderFactory.createEmptyBorder(10, 3, 0, 0));// 设置面板的边框 ,距离上、左、下、右 的距离
if (elCaseBindInfoList != null) {
int rowCount = (elCaseBindInfoList.length + 1) / 2; int rowCount = (elCaseBindInfoList.length + 1) / 2;
this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10)); this.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 10));
for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) { for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) {
@ -22,7 +23,6 @@ public class ShareWidgetPane extends JPanel {
this.add(widgetButton); this.add(widgetButton);
} }
this.setPreferredSize(new Dimension(240, rowCount * 80)); this.setPreferredSize(new Dimension(240, rowCount * 80));
} }
}
} }

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

@ -38,7 +38,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
private EventPropertyTable eventTable; private EventPropertyTable eventTable;
private List<AbstractPropertyTable> widgetPropertyTables; private List<AbstractPropertyTable> widgetPropertyTables;
private FormDesigner designer; private FormDesigner designer;
private ComponentTree componentTree;
private JPanel wsp; private JPanel wsp;
private MobileWidgetTable mobileWidgetTable; private MobileWidgetTable mobileWidgetTable;
private MobileBodyWidgetTable mobileBodyWidgetTable; private MobileBodyWidgetTable mobileBodyWidgetTable;
@ -122,8 +121,6 @@ public class WidgetPropertyPane extends FormDockView implements BaseWidgetProper
clearDockingView(); clearDockingView();
return; return;
} }
componentTree = new ComponentTree(designer);
widgetPropertyTables = new ArrayList<AbstractPropertyTable>(); widgetPropertyTables = new ArrayList<AbstractPropertyTable>();
propertyTable = new WidgetPropertyTable(designer); propertyTable = new WidgetPropertyTable(designer);
designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable)); designer.addDesignerEditListener(new WidgetPropertyDesignerAdapter(propertyTable));

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.getFormMobileAttr();
final FormMobileAttrPane mobileAttrPane = new FormMobileAttrPane();
mobileAttrPane.populateBean(mobileAttr);
BasicDialog dialog = mobileAttrPane.showWindow(DesignerContext.getDesignerFrame(), new DialogActionAdapter() {
@Override
public void doOk() {
formTpl.setFormMobileAttr(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;
}
};
}

21
designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java

@ -15,6 +15,7 @@ import com.fr.design.designer.beans.*;
import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent; import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.mainframe.ComponentTree; import com.fr.design.mainframe.ComponentTree;
import com.sun.java.swing.plaf.motif.*; import com.sun.java.swing.plaf.motif.*;
import com.sun.java.swing.plaf.windows.*; import com.sun.java.swing.plaf.windows.*;
@ -116,7 +117,6 @@ public class UITreeComboBox extends JComboBox{
JLabel lb = (JLabel)r.getTreeCellRendererComponent( JLabel lb = (JLabel)r.getTreeCellRendererComponent(
tree, value, isSelected, false, false, index, tree, value, isSelected, false, false, index,
cellHasFocus); cellHasFocus);
return lb; return lb;
} }
return super.getListCellRendererComponent(list, value, index, return super.getListCellRendererComponent(list, value, index,
@ -129,7 +129,7 @@ public class UITreeComboBox extends JComboBox{
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) { if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
TreePath[] paths = tree.getSelectedTreePath(); TreePath[] paths = tree.getSelectedTreePath();
if (tree != null && paths.length > 0) { if (tree != null && paths.length > 0) {
tree.setAndScrollSelectionPath(paths[0]); tree.setAndScrollSelectionPath(paths[0]);
@ -137,6 +137,18 @@ public class UITreeComboBox extends JComboBox{
MenuSelectionManager.defaultManager().clearSelectedPath(); MenuSelectionManager.defaultManager().clearSelectedPath();
} }
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
tree.refreshUI();
TreePath[] paths = tree.getSelectedTreePath();
if (tree != null && paths.length > 0) {
tree.setAndScrollSelectionPath(paths[0]);
setSelectedItem(paths[0]);
MenuSelectionManager.defaultManager().clearSelectedPath();
}
} else if (evt.getCreatorEventID() == DesignerEvent.CREATOR_CUTED) {
tree.refreshUI();
setSelectedItem(null);
MenuSelectionManager.defaultManager().clearSelectedPath();
} else { } else {
tree.refreshUI(); tree.refreshUI();
repaint(); repaint();
@ -192,13 +204,12 @@ class TreePopup extends JPopupMenu implements ComboPopup{
public TreePopup(JComboBox comboBox){ public TreePopup(JComboBox comboBox){
this.comboBox = (UITreeComboBox)comboBox; this.comboBox = (UITreeComboBox)comboBox;
setBorder(BorderFactory.createLineBorder(Color.black));
setLayout(new BorderLayout()); setLayout(new BorderLayout());
setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled()); setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());
JTree tree = this.comboBox.getTree(); JTree tree = this.comboBox.getTree();
if(tree != null){ if(tree != null){
scrollPane = new JScrollPane(tree); scrollPane = new UIScrollPane(tree);
scrollPane.setBorder(null); scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
add(scrollPane, BorderLayout.CENTER); add(scrollPane, BorderLayout.CENTER);
} }
} }

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

@ -33,6 +33,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
private static final int GAP_H = 4; private static final int GAP_H = 4;
private static final int GAP_V = 6; private static final int GAP_V = 6;
private static final int GAP_BV = 4; private static final int GAP_BV = 4;
private static final int BUTTON_HEIGHT = 20;
private static final int WIDTH = 225; private static final int WIDTH = 225;
private static final int L_H = 18; private static final int L_H = 18;
@ -48,12 +49,12 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
return new Dimension(super.getPreferredSize().width, 18); return new Dimension(super.getPreferredSize().width, 18);
} }
}; };
label.setText(Inter.getLocText("Following_parameters_are_not_generated")+":"); label.setText(Inter.getLocText("FR-Following_parameters_are_not_generated")+":");
label.setHorizontalAlignment(SwingConstants.LEFT); label.setHorizontalAlignment(SwingConstants.LEFT);
label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); label.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
this.add(label); this.add(label);
addAll = new UIButton(Inter.getLocText("Add-all")); addAll = new UIButton(Inter.getLocText("FR-Designer_Add_all"));
this.add(addAll); this.add(addAll);
} }
@ -132,7 +133,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
layoutContainer(parent); layoutContainer(parent);
int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (20 + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height); int h= ((parameterSelectedLabellist.size() == 0) ? L_H : breakid * (BUTTON_HEIGHT + GAP_V) + GAP_BV + L_H + GAP_H + addAll.getPreferredSize().height);
return new Dimension(w, h); return new Dimension(w, h);
} }
@ -160,7 +161,7 @@ public class ParameterToolBarPane extends BasicBeanPane<Parameter[]> {
x += (dim.width + GAP_H); x += (dim.width + GAP_H);
} }
addAll.setBounds(0, y + GAP_V+ 20, width, addAll.getPreferredSize().height); addAll.setBounds(0, y + GAP_V + BUTTON_HEIGHT, width, addAll.getPreferredSize().height);
} }
} }

Loading…
Cancel
Save