Fangjie Hu
8 years ago
173 changed files with 5370 additions and 4668 deletions
@ -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 "CN=FineReport L=NanJing C=China" -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") |
||||
|
||||
} |
||||
|
||||
} |
@ -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}/${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 "CN=FineReport L=NanJing C=China" -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") |
||||
|
||||
} |
||||
|
||||
} |
@ -0,0 +1,70 @@
|
||||
|
||||
apply plugin: 'java' |
||||
tasks.withType(JavaCompile){ |
||||
options.encoding = 'UTF-8' |
||||
} |
||||
//指定构建的jdk版本 |
||||
sourceCompatibility=1.7 |
||||
//指定生成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/${branchName}",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 |
||||
|
||||
|
||||
|
@ -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 |
||||
|
||||
|
||||
|
@ -1 +1 @@
|
||||
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
/**
* Author : daisy
* Date: 13-8-30
* Time: 上午10:12
*/
public class AllowAuthorityEditAction extends TemplateComponentAction {
public AllowAuthorityEditAction(TargetComponent t) {
super(t);
this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png"));
}
/**
* 撤销
*/
public void prepare4Undo() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState();
}
/**
* 执行动作
*
* @return 是否执行成功
*/
public boolean executeActionReturnUndoRecordNeeded() {
TargetComponent tc = getEditingComponent();
if (tc == null) {
return false;
}
cleanAuthorityCondition();
//进入时是格式刷则取消格式刷
if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) {
tc.cancelFormat();
}
BaseUtils.setAuthorityEditing(true);
ReportAndFSManagePane.getInstance().refreshDockingView();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance());
DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY);
DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus());
DesignerContext.getDesignerFrame().needToAddAuhtorityPaint();
EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane());
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
//画虚线
return true;
}
/**
* 进入权限编辑之前将权限编辑界面重置一下工具栏
*/
private void cleanAuthorityCondition() {
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList();
for (int i = 0; i < opendedTemplate.size(); i++) {
opendedTemplate.get(i).cleanAuthorityUndo();
}
}
} |
||||
package com.fr.design.actions;
import com.fr.base.BaseUtils;
import com.fr.design.constants.UIConstants;
import com.fr.design.menu.KeySetUtils;
import com.fr.design.roleAuthority.ReportAndFSManagePane;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.*;
/**
* Author : daisy
* Date: 13-8-30
* Time: 上午10:12
*/
public class AllowAuthorityEditAction extends TemplateComponentAction {
public AllowAuthorityEditAction(TargetComponent t) {
super(t);
this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT);
this.setName(getMenuKeySet().getMenuName());
this.setMnemonic(getMenuKeySet().getMnemonic());
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png"));
}
/**
* 撤销
*/
public void prepare4Undo() {
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState();
}
/**
* 执行动作
*
* @return 是否执行成功
*/
public boolean executeActionReturnUndoRecordNeeded() {
TargetComponent tc = getEditingComponent();
if (tc == null) {
return false;
}
cleanAuthorityCondition();
//进入时是格式刷则取消格式刷
if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) {
tc.cancelFormat();
}
BaseUtils.setAuthorityEditing(true);
ReportAndFSManagePane.getInstance().refreshDockingView();
RolesAlreadyEditedPane.getInstance().refreshDockingView();
WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance());
DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY);
DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus());
DesignerContext.getDesignerFrame().needToAddAuhtorityPaint();
EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane());
DesignerContext.getDesignerFrame().refreshDottedLine();
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().removeParameterPane();
//画虚线
return true;
}
/**
* 进入权限编辑之前将权限编辑界面重置一下工具栏
*/
private void cleanAuthorityCondition() {
java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList();
for (int i = 0; i < opendedTemplate.size(); i++) {
opendedTemplate.get(i).cleanAuthorityUndo();
}
}
} |
@ -1,37 +0,0 @@
|
||||
package com.fr.design.event; |
||||
|
||||
import com.fr.design.gui.itree.filetree.TemplateFileTree; |
||||
import com.fr.design.mainframe.dnd.ArrayTransferable; |
||||
import com.fr.design.mainframe.dnd.SerializableTransferable; |
||||
import com.fr.general.web.ParameterConsts; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.dnd.DragGestureEvent; |
||||
import java.awt.dnd.DragGestureListener; |
||||
import java.awt.dnd.DragSource; |
||||
import java.awt.dnd.DragSourceAdapter; |
||||
|
||||
/** |
||||
* Created with IntelliJ IDEA. |
||||
* User: richie |
||||
* Date: 13-11-4 |
||||
* Time: 下午2:17 |
||||
*/ |
||||
public class TemplateTreeDragSource extends DragSourceAdapter implements DragGestureListener { |
||||
private DragSource source; |
||||
|
||||
public TemplateTreeDragSource(JTree tree, int actions) { |
||||
source = new DragSource(); |
||||
source.createDefaultDragGestureRecognizer(tree, actions, this); |
||||
|
||||
} |
||||
public void dragGestureRecognized(DragGestureEvent dge) { |
||||
Component comp = dge.getComponent(); |
||||
if (comp instanceof TemplateFileTree) { |
||||
String selectedPath = ((TemplateFileTree)comp).getSelectedTemplatePath(); |
||||
source.startDrag(dge, DragSource.DefaultLinkDrop, new SerializableTransferable(selectedPath), this); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,49 @@
|
||||
package com.fr.design.extra.exe; |
||||
|
||||
import com.fr.design.extra.LoginWebBridge; |
||||
import com.fr.design.extra.Process; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
|
||||
/** |
||||
* Created by Slpire on 2016/11/7. |
||||
*/ |
||||
public class PluginLoginExecutor implements Executor { |
||||
|
||||
private String result = "[]"; |
||||
|
||||
private String username; |
||||
private String password; |
||||
private UILabel uiLabel; |
||||
|
||||
public PluginLoginExecutor(String username, String password, UILabel uiLabel) { |
||||
this.username = username; |
||||
this.password = password; |
||||
this.uiLabel = uiLabel; |
||||
} |
||||
|
||||
@Override |
||||
public String getTaskFinishMessage() { |
||||
return result; |
||||
} |
||||
|
||||
@Override |
||||
public Command[] getCommands() { |
||||
return new Command[] { |
||||
new Command() { |
||||
@Override |
||||
public String getExecuteMessage() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void run(Process<String> process) { |
||||
String loginResult = LoginWebBridge.getHelper().login(username, password, uiLabel); |
||||
if (Integer.valueOf(loginResult) == 0) { |
||||
LoginWebBridge.getHelper().updateMessageCount(); |
||||
} |
||||
result = loginResult; |
||||
} |
||||
} |
||||
}; |
||||
} |
||||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,35 @@
|
||||
package com.fr.design.fun; |
||||
|
||||
import com.fr.form.FormProvider; |
||||
import com.fr.form.ui.ElementCaseEditorProvider; |
||||
import com.fr.stable.fun.ReportFitAttrProvider; |
||||
import com.fr.stable.fun.mark.Mutable; |
||||
|
||||
import java.beans.PropertyDescriptor; |
||||
|
||||
/** |
||||
* Created by zhouping on 2015/9/10. |
||||
*/ |
||||
public interface FormElementCaseEditorProvider extends Mutable { |
||||
|
||||
String MARK_STRING = "PropertyEditor"; |
||||
|
||||
int CURRENT_LEVEL = 1; |
||||
|
||||
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, FormProvider formProvider, ElementCaseEditorProvider editor); |
||||
|
||||
/** |
||||
* 生成属性表 |
||||
* @param temp 传入当前操作的class |
||||
* @param reportFitAttr 传入的自适应属性 |
||||
* @return 返回属性表 |
||||
*/ |
||||
PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr); |
||||
|
||||
/** |
||||
* 返回pc自适应属性值 |
||||
* @param fitAttrProvider 传入的自适应属性 |
||||
* @return 返回pc自适应属性值 |
||||
*/ |
||||
int getFitStateInPC(ReportFitAttrProvider fitAttrProvider); |
||||
} |
@ -0,0 +1,51 @@
|
||||
package com.fr.design.fun.impl; |
||||
|
||||
import com.fr.design.fun.FormElementCaseEditorProvider; |
||||
import com.fr.form.FormProvider; |
||||
import com.fr.form.ui.ElementCaseEditorProvider; |
||||
import com.fr.stable.fun.ReportFitAttrProvider; |
||||
import com.fr.stable.fun.mark.API; |
||||
|
||||
import java.beans.PropertyDescriptor; |
||||
|
||||
/** |
||||
* Created by zhouping on 2015/9/10. |
||||
*/ |
||||
@API(level = FormElementCaseEditorProvider.CURRENT_LEVEL) |
||||
public abstract class AbstractFormElementCaseEditorProvider implements FormElementCaseEditorProvider { |
||||
|
||||
public int currentAPILevel() { |
||||
return CURRENT_LEVEL; |
||||
} |
||||
|
||||
@Override |
||||
public String mark4Provider() { |
||||
return this.getClass().getName(); |
||||
} |
||||
|
||||
@Override |
||||
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, FormProvider reportAttr, ElementCaseEditorProvider editor) { |
||||
return new PropertyDescriptor[0]; |
||||
} |
||||
|
||||
/** |
||||
* 生成属性表 |
||||
* @param temp 传入当前操作的class |
||||
* @param reportFitAttr 传入的自适应属性 |
||||
* @return 返回属性表 |
||||
*/ |
||||
@Override |
||||
public PropertyDescriptor[] createPropertyDescriptor(Class<?> temp, ReportFitAttrProvider reportFitAttr) { |
||||
return new PropertyDescriptor[0]; |
||||
} |
||||
|
||||
/** |
||||
* 返回pc自适应属性值 |
||||
* @param fitAttrProvider 传入的自适应属性 |
||||
* @return 返回pc自适应属性值 |
||||
*/ |
||||
@Override |
||||
public int getFitStateInPC(ReportFitAttrProvider fitAttrProvider) { |
||||
return 0; |
||||
} |
||||
} |
@ -0,0 +1,13 @@
|
||||
package com.fr.design.gui.chart; |
||||
|
||||
/** |
||||
* Created by daniel on 2016/11/2. |
||||
*/ |
||||
public interface ChartEditPaneProvider { |
||||
|
||||
|
||||
void gotoPane(String... id); |
||||
|
||||
void fire(); |
||||
|
||||
} |
@ -1 +1 @@
|
||||
package com.fr.design.icon;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date: 12-12-18
* Time: 上午9:42
* 用于保存所有图标路径的类
*/
public class IconPathConstants {
private IconPathConstants() {
}
public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png";
public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png";
public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png";
public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png";
public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png";
public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png";
public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png";
public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png";
public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png";
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png";
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png";
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png";
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png";
public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png";
public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png";
} |
||||
package com.fr.design.icon;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 6.5.6
* Date: 12-12-18
* Time: 上午9:42
* 用于保存所有图标路径的类
*/
public class IconPathConstants {
private IconPathConstants() {
}
public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png";
public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png";
public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png";
public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png";
public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png";
public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png";
public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png";
public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png";
public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png";
public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png";
public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png";
public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png";
public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png";
public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png";
public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png";
public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png";
public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png";
public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png";
} |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 801 B |
After Width: | Height: | Size: 895 B |
@ -0,0 +1,3 @@
|
||||
表单名字 |
||||
假如访问:http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm, |
||||
formName就是Form1.frm |
@ -0,0 +1,3 @@
|
||||
form name |
||||
http://localhost:8080/WebReport/ReportServer?formlet=Form1.frm£¬ |
||||
formName is Form1.frm |
@ -0,0 +1,13 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
/** |
||||
* Coder: zack |
||||
* Date: 2016/11/3 |
||||
* Time: 10:43 |
||||
*/ |
||||
public interface HelpDialogHandler { |
||||
/** |
||||
* 销毁 |
||||
*/ |
||||
void destroyHelpDialog(); |
||||
} |
@ -0,0 +1,38 @@
|
||||
package com.fr.design.mainframe; |
||||
|
||||
/** |
||||
* 帮助信息的面板由于需要滚动条所以采用了很挫的dialog做,dialog很多情况下不能主动关闭,这边控制一下 |
||||
* Coder: zack |
||||
* Date: 2016/11/2 |
||||
* Time: 16:34 |
||||
*/ |
||||
public class HelpDialogManager { |
||||
private static HelpDialogManager THIS; |
||||
private HelpDialogHandler handler; |
||||
|
||||
private HelpDialogManager() { |
||||
|
||||
} |
||||
|
||||
public HelpDialogHandler getPane() { |
||||
return handler; |
||||
} |
||||
|
||||
public void setPane(HelpDialogHandler dialog) { |
||||
if (dialog == this.handler) { |
||||
return; |
||||
} |
||||
//只允许一个dialog存在
|
||||
if (this.handler != null) { |
||||
handler.destroyHelpDialog(); |
||||
} |
||||
this.handler = dialog; |
||||
} |
||||
|
||||
public static HelpDialogManager getInstance() { |
||||
if (THIS == null) { |
||||
THIS = new HelpDialogManager(); |
||||
} |
||||
return THIS; |
||||
} |
||||
} |
File diff suppressed because one or more lines are too long
@ -0,0 +1,66 @@
|
||||
|
||||
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-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/${branchName}",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 |
||||
|
@ -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 |
||||
|
@ -0,0 +1,13 @@
|
||||
package com.fr.design.chart.series.SeriesCondition.dlp; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/11/9. |
||||
*/ |
||||
public class FunnelDataLabelPane extends DataLabelPane { |
||||
@Override |
||||
protected Component[] createComponents4ShowCategoryName() { |
||||
return new Component[0]; |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.fr.design.chart.series.SeriesCondition.impl; |
||||
|
||||
import com.fr.chart.chartattr.FunnelPlot; |
||||
import com.fr.chart.chartattr.Plot; |
||||
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane; |
||||
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane; |
||||
import com.fr.design.chart.series.SeriesCondition.PiePlotChartConditionPane; |
||||
|
||||
/** |
||||
* Created by Mitisky on 16/11/9. |
||||
*/ |
||||
public class FunnelPlotDataSeriesConditionPane extends DataSeriesConditionPane { |
||||
|
||||
@Override |
||||
protected ChartConditionPane createListConditionPane() { |
||||
return new PiePlotChartConditionPane(); |
||||
} |
||||
|
||||
/** |
||||
* 返回class对象 |
||||
* @return class对象 |
||||
*/ |
||||
@Override |
||||
public Class<? extends Plot> class4Correspond() { |
||||
return FunnelPlot.class; |
||||
} |
||||
|
||||
} |
@ -1,143 +0,0 @@
|
||||
/* |
||||
* Copyright(c) 2001-2011, FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
package com.fr.design.mainframe; |
||||
|
||||
import java.awt.BorderLayout; |
||||
import java.awt.Component; |
||||
|
||||
import javax.swing.BorderFactory; |
||||
import javax.swing.JComponent; |
||||
import javax.swing.JPanel; |
||||
import javax.swing.SwingConstants; |
||||
import javax.swing.event.ChangeEvent; |
||||
import javax.swing.event.ChangeListener; |
||||
|
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.design.constants.UIConstants; |
||||
import com.fr.design.designer.TargetComponent; |
||||
import com.fr.design.gui.ibutton.UIToggleButton; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.itabpane.TitleChangeListener; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.module.DesignModuleFactory; |
||||
import com.fr.general.Inter; |
||||
|
||||
public class ChartAndWidgetPropertyPane extends MiddleChartPropertyPane { |
||||
|
||||
public synchronized static ChartAndWidgetPropertyPane getInstance(BaseFormDesigner formEditor) { |
||||
if(singleton == null) { |
||||
singleton = new ChartAndWidgetPropertyPane(formEditor); |
||||
} |
||||
|
||||
singleton.setWidgetPropertyPane(DesignModuleFactory.getWidgetPropertyPane(formEditor)); |
||||
singleton.setSureProperty(); |
||||
return singleton; |
||||
} |
||||
|
||||
public static ChartAndWidgetPropertyPane getInstance() { |
||||
if(singleton == null) { |
||||
singleton = new ChartAndWidgetPropertyPane(); |
||||
} |
||||
return singleton; |
||||
} |
||||
|
||||
private static ChartAndWidgetPropertyPane singleton; |
||||
|
||||
private BaseWidgetPropertyPane widgetpane = null; |
||||
|
||||
private UIToggleButton hisButton; |
||||
|
||||
public ChartAndWidgetPropertyPane() { |
||||
|
||||
} |
||||
|
||||
public ChartAndWidgetPropertyPane(BaseFormDesigner formEditor) { |
||||
super(); |
||||
this.widgetpane = DesignModuleFactory.getWidgetPropertyPane(formEditor); |
||||
} |
||||
|
||||
public void setWidgetPropertyPane(BaseWidgetPropertyPane pane) { |
||||
this.widgetpane = pane; |
||||
} |
||||
|
||||
@Override |
||||
protected void createMainPane() { |
||||
this.add(chartEditPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
@Override |
||||
protected void createNameLabel() { |
||||
nameLabel = new UILabel(); |
||||
nameLabel.setHorizontalAlignment(SwingConstants.LEFT); |
||||
nameLabel.setBorder(BorderFactory.createEmptyBorder(-2, 6, 2, 0)); |
||||
} |
||||
|
||||
@Override |
||||
protected JComponent createNorthComponent() { |
||||
JPanel toolPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
|
||||
JPanel hisPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
hisPane.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); |
||||
hisButton = new UIToggleButton(Inter.getLocText(new String[]{"Widget", "Attribute"}), UIConstants.HISTORY_ICON); |
||||
hisButton.setNormalPainted(false); |
||||
hisButton.setBorderPaintedOnlyWhenPressed(true); |
||||
hisPane.add(hisButton, BorderLayout.CENTER); |
||||
|
||||
hisButton.addChangeListener(new ChangeListener() { |
||||
|
||||
@Override |
||||
public void stateChanged(ChangeEvent e) { |
||||
cardChange(); |
||||
} |
||||
}); |
||||
|
||||
toolPane.add(nameLabel, BorderLayout.CENTER); |
||||
toolPane.add(hisPane, BorderLayout.EAST); |
||||
|
||||
titleListener = new TitleChangeListener() { |
||||
|
||||
@Override |
||||
public void fireTitleChange(String addName) { |
||||
if(hisButton.isSelected()) { |
||||
nameLabel.setText(Inter.getLocText(new String[]{"Widget", "Form-Widget_Property_Table"})); |
||||
}else { |
||||
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName); |
||||
} |
||||
} |
||||
}; |
||||
|
||||
return toolPane; |
||||
} |
||||
|
||||
/** |
||||
* 感觉ChartCollection加载图表属性界面. |
||||
* @param collection 收集图表 |
||||
* @param ePane 面板 |
||||
*/ |
||||
public void populateChartPropertyPane(ChartCollection collection, TargetComponent<?> ePane) { |
||||
super.populateChartPropertyPane(collection, ePane); |
||||
//表单中的图表切换界面上得更新
|
||||
resetChartEditPane(); |
||||
} |
||||
|
||||
protected void resetChartEditPane() { |
||||
cardChange(); |
||||
} |
||||
|
||||
private void cardChange() { |
||||
remove(chartEditPane); |
||||
remove((Component)widgetpane); |
||||
if(hisButton.isSelected()) { |
||||
nameLabel.setText(Inter.getLocText(new String[]{"Widget", "Form-Widget_Property_Table"})); |
||||
add((Component)widgetpane, BorderLayout.CENTER); |
||||
} else { |
||||
String tabname = chartEditPane.getSelectedTabName(); |
||||
nameLabel.setText(Inter.getLocText(new String[]{"Utils-The-Chart", "Form-Widget_Property_Table"}) + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : "")); |
||||
add(chartEditPane, BorderLayout.CENTER); |
||||
} |
||||
validate(); |
||||
repaint(); |
||||
revalidate(); |
||||
} |
||||
} |
@ -1,134 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.chart.BaseChartCollection; |
||||
import com.fr.chart.chartattr.ChartCollection; |
||||
import com.fr.design.designer.TargetComponent; |
||||
import com.fr.design.gui.chart.BaseChartPropertyPane; |
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.gui.itabpane.TitleChangeListener; |
||||
import com.fr.design.mainframe.chart.ChartDesignEditPane; |
||||
import com.fr.design.mainframe.chart.ChartEditPane; |
||||
import com.fr.general.Inter; |
||||
|
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 下午12:43 |
||||
*/ |
||||
public class ChartDesignerPropertyPane extends BaseChartPropertyPane { |
||||
private static ChartDesignerPropertyPane instance; |
||||
private TargetComponentContainer container = new TargetComponentContainer(); |
||||
private ChartEditPane chartEditPane; |
||||
private UILabel nameLabel; |
||||
private TitleChangeListener titleListener = new TitleChangeListener() { |
||||
|
||||
@Override |
||||
public void fireTitleChange(String addName) { |
||||
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + '-' + addName); |
||||
} |
||||
}; |
||||
|
||||
public synchronized static ChartDesignerPropertyPane getInstance() { |
||||
if (instance == null) { |
||||
instance = new ChartDesignerPropertyPane(); |
||||
} |
||||
instance.setSureProperty(); |
||||
return instance; |
||||
} |
||||
|
||||
public ChartDesignerPropertyPane() { |
||||
this.setLayout(new BorderLayout()); |
||||
this.setBorder(null); |
||||
|
||||
createNameLabel(); |
||||
this.add(nameLabel, BorderLayout.NORTH); |
||||
chartEditPane = ChartDesignEditPane.getInstance(); |
||||
this.add(chartEditPane, BorderLayout.CENTER); |
||||
} |
||||
|
||||
private void createNameLabel() { |
||||
nameLabel = new UILabel() { |
||||
@Override |
||||
public Dimension getPreferredSize() { |
||||
return new Dimension(super.getPreferredSize().width, 18); |
||||
} |
||||
}; |
||||
nameLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 1, 0)); |
||||
nameLabel.setHorizontalAlignment(SwingConstants.CENTER); |
||||
} |
||||
|
||||
@Override |
||||
public void setSureProperty() { |
||||
chartEditPane.setContainer(container); |
||||
chartEditPane.addTitleChangeListener(titleListener); |
||||
String tabname = chartEditPane.getSelectedTabName(); |
||||
nameLabel.setText(Inter.getLocText("Chart-Property_Table") + (tabname != null ? ('-' + chartEditPane.getSelectedTabName()) : "")); |
||||
resetChartEditPane(); |
||||
|
||||
} |
||||
|
||||
protected void resetChartEditPane() { |
||||
remove(chartEditPane); |
||||
add(chartEditPane, BorderLayout.CENTER); |
||||
validate(); |
||||
repaint(); |
||||
revalidate(); |
||||
} |
||||
|
||||
@Override |
||||
public void setSupportCellData(boolean supportCellData){ |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 感觉ChartCollection加载图表属性界面. |
||||
* @param collection 收集图表 |
||||
* @param chartDesigner 图表设计 |
||||
*/ |
||||
public void populateChartPropertyPane(BaseChartCollection collection, TargetComponent<?> chartDesigner) { |
||||
if (collection instanceof ChartCollection) { |
||||
this.container.setEPane(chartDesigner); |
||||
chartEditPane.populate((ChartCollection) collection); |
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public void setWidgetPropertyPane(BaseWidgetPropertyPane pane) { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 刷新 |
||||
*/ |
||||
public void refreshDockingView() { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public String getViewTitle() { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public Icon getViewIcon() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 位置 |
||||
* @return 位置 |
||||
*/ |
||||
public Location preferredLocation() { |
||||
return null; |
||||
} |
||||
} |
@ -1,47 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.form.ui.ChartBook; |
||||
|
||||
import java.awt.*; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-13 |
||||
* Time: 下午2:32 |
||||
*/ |
||||
public class ChartUndoState extends BaseUndoState<JChart> { |
||||
private ChartBook chartBook; |
||||
private Dimension designerSize; |
||||
private double widthValue; |
||||
private double heightValue; |
||||
|
||||
public ChartUndoState(JChart t,ChartArea area) { |
||||
super(t); |
||||
try { |
||||
this.chartBook = (ChartBook) t.getTarget().clone(); |
||||
} catch (CloneNotSupportedException e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
this.widthValue =area.getCustomWidth(); |
||||
this.heightValue = area.getCustomHeight(); |
||||
} |
||||
|
||||
|
||||
public ChartBook getChartBook(){ |
||||
return this.chartBook; |
||||
} |
||||
|
||||
/** |
||||
* 应用状态 |
||||
*/ |
||||
public void applyState() { |
||||
this.getApplyTarget().applyUndoState(this); |
||||
|
||||
} |
||||
} |
@ -1,376 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
* 图表类型文件 |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.FRContext; |
||||
import com.fr.file.FILEChooserPane; |
||||
import com.fr.file.FILEChooserPane4Chart; |
||||
import com.fr.form.ui.ChartBook; |
||||
import com.fr.design.DesignModelAdapter; |
||||
import com.fr.design.event.TargetModifiedEvent; |
||||
import com.fr.design.event.TargetModifiedListener; |
||||
import com.fr.design.gui.imenu.UIMenuItem; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
import com.fr.design.mainframe.actions.ExcelExportAction4Chart; |
||||
import com.fr.design.mainframe.actions.PDFExportAction4Chart; |
||||
import com.fr.design.mainframe.actions.PNGExportAction4Chart; |
||||
import com.fr.design.mainframe.form.FormECCompositeProvider; |
||||
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; |
||||
import com.fr.design.menu.ShortCut; |
||||
import com.fr.design.menu.ToolBarDef; |
||||
import com.fr.file.FILE; |
||||
import com.fr.general.Inter; |
||||
import com.fr.json.JSONArray; |
||||
import com.fr.json.JSONException; |
||||
import com.fr.json.JSONObject; |
||||
import com.fr.stable.StringUtils; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.*; |
||||
import java.awt.datatransfer.StringSelection; |
||||
|
||||
/** |
||||
* 图表crt文件 |
||||
* <p/> |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-13 |
||||
* Time: 下午2:28 |
||||
*/ |
||||
public class JChart extends JTemplate<ChartBook, ChartUndoState> { |
||||
public static final String XML_TAG = "JChart"; |
||||
private static final String CHART_CARD = "FORM"; |
||||
private static final String ELEMENTCASE_CARD = "ELEMENTCASE"; |
||||
|
||||
private static final String[] CARDNAME = new String[]{CHART_CARD, ELEMENTCASE_CARD}; |
||||
private static final int TOOLBARPANEDIMHEIGHT_FORM = 60; |
||||
//图表设计器
|
||||
ChartDesigner chartDesigner; |
||||
|
||||
//中间编辑区域, carllayout布局
|
||||
private JPanel tabCenterPane; |
||||
private CardLayout cardLayout; |
||||
//当前编辑的组件对象
|
||||
private JComponent editingComponent; |
||||
private FormECCompositeProvider reportComposite; |
||||
|
||||
public JChart() { |
||||
super(new ChartBook(), "Chart"); |
||||
} |
||||
|
||||
public JChart(ChartBook chartFile, FILE file) { |
||||
super(chartFile, file); |
||||
} |
||||
|
||||
@Override |
||||
protected JPanel createCenterPane() { |
||||
tabCenterPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
||||
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
centerPane.setBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, new Color(85, 85, 85))); |
||||
chartDesigner = new ChartDesigner(this.getTarget()); |
||||
ChartArea area = new ChartArea(chartDesigner); |
||||
centerPane.add(area, BorderLayout.CENTER); |
||||
tabCenterPane.add(centerPane, CHART_CARD, 0); |
||||
chartDesigner.addTargetModifiedListener(new TargetModifiedListener() { |
||||
public void targetModified(TargetModifiedEvent e) { |
||||
JChart.this.fireTargetModified();// 调用保存*, 调用刷新界面, 刷新工具栏按钮
|
||||
} |
||||
}); |
||||
|
||||
this.add(tabCenterPane, BorderLayout.CENTER); |
||||
return tabCenterPane; |
||||
} |
||||
|
||||
/** |
||||
* 移除选择 |
||||
*/ |
||||
public void removeTemplateSelection() { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 刷新容器 |
||||
*/ |
||||
public void refreshContainer() { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 移除参数面板选择 |
||||
*/ |
||||
public void removeParameterPaneSelection() { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 创建设计模式 |
||||
* |
||||
* @return 返回模式 |
||||
*/ |
||||
protected DesignModelAdapter<ChartBook, ?> createDesignModel() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 创建预览得菜单 |
||||
* |
||||
* @return 菜单 |
||||
*/ |
||||
public UIMenuItem[] createMenuItem4Preview() { |
||||
return new UIMenuItem[0]; |
||||
} |
||||
|
||||
/** |
||||
* 创建撤销状态 |
||||
* |
||||
* @return 状态 |
||||
*/ |
||||
protected ChartUndoState createUndoState() { |
||||
return new ChartUndoState(this,chartDesigner.getArea()); |
||||
} |
||||
|
||||
/** |
||||
* 应用撤销状态 |
||||
* |
||||
* @param chartUndoState 撤销状态 |
||||
*/ |
||||
protected void applyUndoState(ChartUndoState chartUndoState) { |
||||
try { |
||||
this.setTarget((ChartBook)chartUndoState.getChartBook().clone()); |
||||
chartDesigner.setTarget(this.getTarget()); |
||||
chartDesigner.populate(); |
||||
}catch (CloneNotSupportedException e) { |
||||
throw new RuntimeException(e); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 后缀 |
||||
* |
||||
* @return 后缀 |
||||
*/ |
||||
public String suffix() { |
||||
return ".crt"; |
||||
} |
||||
|
||||
/** |
||||
* 复制 |
||||
*/ |
||||
public void copy() { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 黏贴 |
||||
* |
||||
* @return 是否鸟贴成功 |
||||
*/ |
||||
public boolean paste() { |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 是否剪切 |
||||
* |
||||
* @return 剪切成功 |
||||
*/ |
||||
public boolean cut() { |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 创建权限编辑面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
public AuthorityEditPane createAuthorityEditPane() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 工具栏 |
||||
* |
||||
* @return 工具栏 |
||||
*/ |
||||
public ToolBarMenuDockPlus getToolBarMenuDockPlus() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 东上面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
public JPanel getEastUpPane() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 东下面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
public JPanel getEastDownPane() { |
||||
return null; |
||||
} |
||||
|
||||
/** |
||||
* 工具栏菜单 |
||||
* |
||||
* @return 菜单 |
||||
*/ |
||||
public ToolBarDef[] toolbars4Target() { |
||||
return new ToolBarDef[0]; |
||||
} |
||||
|
||||
/** |
||||
* 表单面板 |
||||
* |
||||
* @return 面板 |
||||
*/ |
||||
public JPanel[] toolbarPanes4Form() { |
||||
return new JPanel[0]; |
||||
} |
||||
|
||||
/** |
||||
* 模版菜单 |
||||
* |
||||
* @return 模版菜单 |
||||
*/ |
||||
public ShortCut[] shortcut4TemplateMenu() { |
||||
return new ShortCut[0]; |
||||
} |
||||
|
||||
/** |
||||
* 权限编辑菜单 |
||||
* |
||||
* @return 菜单 |
||||
*/ |
||||
public ShortCut[] shortCuts4Authority() { |
||||
return new ShortCut[0]; |
||||
} |
||||
|
||||
/** |
||||
* 工具条表单 |
||||
* |
||||
* @return 表单 |
||||
*/ |
||||
public JComponent[] toolBarButton4Form() { |
||||
return new JComponent[0]; |
||||
} |
||||
|
||||
/** |
||||
* 权限编辑工具栏,但是图表设计器里面用于正常工具栏不是全县编辑 |
||||
* |
||||
* @return 工具条 |
||||
*/ |
||||
public JComponent toolBar4Authority() { |
||||
return chartDesigner.getChartToolBarPane(); |
||||
} |
||||
|
||||
/** |
||||
* 工具条高度 |
||||
* |
||||
* @return 工具条高度 |
||||
*/ |
||||
public int getToolBarHeight() { |
||||
return 0; |
||||
} |
||||
|
||||
/** |
||||
* 是否是报表 |
||||
* |
||||
* @return 不是 |
||||
*/ |
||||
public boolean isJWorkBook() { |
||||
return false; |
||||
} |
||||
|
||||
/** |
||||
* 是否是图表 |
||||
* |
||||
* @return 是则返回true |
||||
*/ |
||||
public boolean isChartBook() { |
||||
return true; |
||||
} |
||||
|
||||
/** |
||||
* 设置权限编辑模式 |
||||
* |
||||
* @param isUpMode 没有权限编辑 |
||||
*/ |
||||
public void setAuthorityMode(boolean isUpMode) { |
||||
|
||||
} |
||||
|
||||
/** |
||||
* 刷新工具区域 |
||||
*/ |
||||
public void refreshToolArea() { |
||||
DesignerContext.getDesignerFrame().resetToolkitByPlus(JChart.this); |
||||
chartDesigner.populate(); |
||||
ChartDesignerPropertyPane.getInstance().populateChartPropertyPane(getTarget().getChartCollection(), chartDesigner); |
||||
EastRegionContainerPane.getInstance().replaceUpPane(ChartDesignerPropertyPane.getInstance()); |
||||
} |
||||
|
||||
/** |
||||
* 导出菜单的子菜单 ,目前用于图表设计器 |
||||
* |
||||
* @return 子菜单 |
||||
*/ |
||||
public ShortCut[] shortcut4ExportMenu() { |
||||
return new ShortCut[]{new PNGExportAction4Chart(this), new ExcelExportAction4Chart(this), new PDFExportAction4Chart(this)}; |
||||
} |
||||
|
||||
public Icon getIcon() { |
||||
return BaseUtils.readIcon("/com/fr/design/images/chart.png"); |
||||
} |
||||
|
||||
public ChartDesigner getChartDesigner(){ |
||||
return chartDesigner; |
||||
} |
||||
|
||||
/** |
||||
* 复制JS代码 |
||||
*/ |
||||
public void copyJS(){ |
||||
JSONObject jsonObject =this.getTarget().createExportConfig(); |
||||
String jsonString = StringUtils.EMPTY; |
||||
if(jsonObject != null){ |
||||
try{ |
||||
if(jsonObject.has("charts")){ |
||||
JSONArray charts = jsonObject.getJSONArray("charts"); |
||||
jsonString = charts.toString(2); |
||||
}else{ |
||||
jsonString = jsonObject.toString(2); |
||||
} |
||||
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Message"), Inter.getLocText("FR-Chart-Action_Copy")+"JS", JOptionPane.INFORMATION_MESSAGE); |
||||
}catch (JSONException ex){ |
||||
FRContext.getLogger().error(ex.getMessage()); |
||||
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Failed")+"!", Inter.getLocText("Error"), JOptionPane.ERROR_MESSAGE); |
||||
} |
||||
}else{ |
||||
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("FR-Chart-CopyJS_Failed")+"!", Inter.getLocText("Error"), JOptionPane.ERROR_MESSAGE); |
||||
} |
||||
StringSelection stringSelection = new StringSelection(jsonString); |
||||
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(stringSelection, null); |
||||
}; |
||||
|
||||
/** |
||||
* 系列风格改动 |
||||
*/ |
||||
public void styleChange(){ |
||||
chartDesigner.clearToolBarStyleChoose(); |
||||
} |
||||
|
||||
protected FILEChooserPane getFILEChooserPane(boolean isShowLoc){ |
||||
return new FILEChooserPane4Chart(true, isShowLoc); |
||||
} |
||||
|
||||
} |
@ -1,132 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.FRContext; |
||||
import com.fr.design.gui.iprogressbar.FRProgressBar; |
||||
import com.fr.form.ui.ChartBook; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.DesignerFrame; |
||||
import com.fr.design.mainframe.JChart; |
||||
import com.fr.design.mainframe.exporter.Exporter4Chart; |
||||
import com.fr.file.FILE; |
||||
import com.fr.file.FILEChooserPane; |
||||
import com.fr.file.filter.ChooseFileFilter; |
||||
import com.fr.general.FRLogger; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.ActionEvent; |
||||
import java.io.FileOutputStream; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 上午9:48 |
||||
*/ |
||||
public abstract class AbstractExportAction4JChart extends JChartAction { |
||||
protected AbstractExportAction4JChart(JChart chart){ |
||||
super(chart); |
||||
} |
||||
|
||||
private FRProgressBar progressbar; |
||||
|
||||
protected ChartBook getChartBook(){ |
||||
return this.getEditingComponent().getTarget(); |
||||
} |
||||
|
||||
/** |
||||
* 执行方法 |
||||
* @param e 事件 |
||||
*/ |
||||
public void actionPerformed(ActionEvent e) { |
||||
JChart chart = this.getEditingComponent(); |
||||
FILE editingFILE = chart.getEditingFILE(); |
||||
DesignerFrame designerFrame = DesignerContext.getDesignerFrame(); |
||||
|
||||
// 弹出参数
|
||||
final java.util.Map parameterMap = new java.util.HashMap(); |
||||
final ChartBook chartBook = getChartBook(); |
||||
|
||||
// Choose a file name....
|
||||
FILEChooserPane fileChooserPane = FILEChooserPane.getInstance(false, true); |
||||
fileChooserPane.setFILEFilter(this.getChooseFileFilter()); |
||||
|
||||
// 打开文件后输出文件名修改,eg:w.cpt.doc / w.svg.doc,去掉中间的后缀名~~ w.doc
|
||||
String filenName = editingFILE.getName(); |
||||
if (filenName.indexOf('.') != -1) { |
||||
filenName = filenName.substring(0, editingFILE.getName().lastIndexOf('.')); |
||||
} |
||||
fileChooserPane.setFileNameTextField(filenName, "." + this.getDefaultExtension()); |
||||
int saveValue = fileChooserPane.showSaveDialog(designerFrame, "." + this.getDefaultExtension()); |
||||
if (saveValue == FILEChooserPane.CANCEL_OPTION || saveValue == FILEChooserPane.JOPTIONPANE_CANCEL_OPTION) { |
||||
fileChooserPane = null; |
||||
return; |
||||
} else if (saveValue == FILEChooserPane.JOPTIONPANE_OK_OPTION || saveValue == FILEChooserPane.OK_OPTION) { |
||||
FILE file = fileChooserPane.getSelectedFILE(); |
||||
try { |
||||
file.mkfile(); |
||||
} catch (Exception e1) { |
||||
FRLogger.getLogger().error("Error In Make New File"); |
||||
} |
||||
fileChooserPane = null; |
||||
FRContext.getLogger().info("\"" + file.getName() + "\"" + Inter.getLocText("Prepare_Export") + "!"); |
||||
|
||||
(progressbar = new FRProgressBar(createExportWork(file, chartBook), designerFrame, |
||||
Inter.getLocText("Exporting"), "", 0, 100)).start(); |
||||
} |
||||
|
||||
} |
||||
|
||||
private SwingWorker createExportWork(FILE file, final ChartBook chartBook) { |
||||
final String filePath = file.getPath(); |
||||
final String fileGetName = file.getName(); |
||||
|
||||
SwingWorker exportWorker = new SwingWorker<Void, Void>() { |
||||
protected Void doInBackground() throws Exception { |
||||
Thread.sleep(100); //bug 10516
|
||||
try { |
||||
final FileOutputStream fileOutputStream = new FileOutputStream(filePath); |
||||
|
||||
this.setProgress(10); |
||||
dealExporter(fileOutputStream,chartBook); |
||||
this.setProgress(80); |
||||
fileOutputStream.close(); |
||||
this.setProgress(100); |
||||
|
||||
FRContext.getLogger().info("\"" + fileGetName + "\"" + Inter.getLocText("Finish_Export") + "!"); |
||||
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
||||
Inter.getLocText("Exported_successfully") + "\n" + filePath); |
||||
} catch (Exception exp) { |
||||
this.setProgress(100); |
||||
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
||||
JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), Inter.getLocText("Export_failed") + "\n" + filePath); |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public void done() { |
||||
progressbar.close(); |
||||
} |
||||
}; |
||||
return exportWorker; |
||||
} |
||||
|
||||
private void dealExporter(FileOutputStream fileOutputStream, final ChartBook chartBook) throws Exception { |
||||
final Exporter4Chart exporter = AbstractExportAction4JChart.this.getExporter(); |
||||
exporter.export(fileOutputStream,this.getEditingComponent()); |
||||
} |
||||
|
||||
|
||||
|
||||
protected abstract ChooseFileFilter getChooseFileFilter(); |
||||
|
||||
protected abstract String getDefaultExtension(); |
||||
|
||||
protected abstract Exporter4Chart getExporter(); |
||||
|
||||
} |
@ -1,68 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.base.ExcelUtils; |
||||
import com.fr.design.mainframe.JChart; |
||||
import com.fr.design.mainframe.exporter.ExcelExporter4Chart; |
||||
import com.fr.design.mainframe.exporter.Exporter4Chart; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.file.filter.ChooseFileFilter; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.KeyEvent; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 上午9:52 |
||||
*/ |
||||
public class ExcelExportAction4Chart extends AbstractExportAction4JChart { |
||||
|
||||
private MenuKeySet excel= new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'E'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Chart-Format_Excel"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK); |
||||
} |
||||
}; |
||||
|
||||
public ExcelExportAction4Chart(JChart chart) { |
||||
super(chart); |
||||
this.setMenuKeySet(excel); |
||||
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/excel.png")); |
||||
} |
||||
|
||||
|
||||
@Override |
||||
protected ChooseFileFilter getChooseFileFilter() { |
||||
return new ChooseFileFilter(new String[]{"xls", "xlsx"}, Inter.getLocText("Export-Excel")); |
||||
} |
||||
|
||||
@Override |
||||
protected String getDefaultExtension() { |
||||
return ExcelUtils.checkThirdJarSupportPOI() ? "xlsx" : "xls"; |
||||
} |
||||
|
||||
@Override |
||||
protected Exporter4Chart getExporter() { |
||||
return new ExcelExporter4Chart(); |
||||
} |
||||
} |
@ -1,21 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.design.actions.JTemplateAction; |
||||
import com.fr.design.mainframe.JChart; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 上午9:47 |
||||
*/ |
||||
public abstract class JChartAction extends JTemplateAction<JChart> { |
||||
public JChartAction(JChart jChart) { |
||||
super(jChart); |
||||
} |
||||
} |
@ -1,61 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.actions.UpdateAction; |
||||
import com.fr.design.mainframe.DesignerContext; |
||||
import com.fr.design.mainframe.JChart; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.ActionEvent; |
||||
import java.awt.event.InputEvent; |
||||
import java.awt.event.KeyEvent; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-13 |
||||
* Time: 下午3:22 |
||||
*/ |
||||
public class NewChartAction extends UpdateAction{ |
||||
|
||||
public NewChartAction(){ |
||||
this.setMenuKeySet(NEW_CHART); |
||||
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("com/fr/design/images/newchart_normal.png")); |
||||
this.setAccelerator(getMenuKeySet().getKeyStroke()); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 执行事件 |
||||
* @param e 事件 |
||||
*/ |
||||
public void actionPerformed(ActionEvent e) { |
||||
DesignerContext.getDesignerFrame().addAndActivateJTemplate(new JChart()); |
||||
} |
||||
|
||||
public static final MenuKeySet NEW_CHART = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'F'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("M-New_ChartBook"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return KeyStroke.getKeyStroke(KeyEvent.VK_F, InputEvent.CTRL_MASK); |
||||
} |
||||
}; |
||||
} |
@ -1,65 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.mainframe.JChart; |
||||
import com.fr.design.mainframe.exporter.Exporter4Chart; |
||||
import com.fr.design.mainframe.exporter.PdfExporter4Chart; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.file.filter.ChooseFileFilter; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 上午10:16 |
||||
*/ |
||||
public class PDFExportAction4Chart extends AbstractExportAction4JChart { |
||||
|
||||
private MenuKeySet pdf = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'P'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Chart-Format_PDF"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return null; |
||||
} |
||||
}; |
||||
|
||||
public PDFExportAction4Chart(JChart chart) { |
||||
super(chart); |
||||
this.setMenuKeySet(pdf); |
||||
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_file/pdf.png")); |
||||
} |
||||
|
||||
@Override |
||||
protected ChooseFileFilter getChooseFileFilter() { |
||||
return new ChooseFileFilter(new String[]{"pdf"}, Inter.getLocText("Export-PDF")); |
||||
} |
||||
|
||||
@Override |
||||
protected String getDefaultExtension() { |
||||
return "pdf"; |
||||
} |
||||
|
||||
@Override |
||||
protected Exporter4Chart getExporter() { |
||||
return new PdfExporter4Chart(); |
||||
} |
||||
} |
@ -1,66 +0,0 @@
|
||||
/* |
||||
* Copyright (c) 2001-2014,FineReport Inc, All Rights Reserved. |
||||
*/ |
||||
|
||||
package com.fr.design.mainframe.actions; |
||||
|
||||
import com.fr.base.BaseUtils; |
||||
import com.fr.design.mainframe.JChart; |
||||
import com.fr.design.mainframe.exporter.Exporter4Chart; |
||||
import com.fr.design.mainframe.exporter.ImageExporter4Chart; |
||||
import com.fr.design.menu.MenuKeySet; |
||||
import com.fr.file.filter.ChooseFileFilter; |
||||
import com.fr.general.Inter; |
||||
|
||||
import javax.swing.*; |
||||
import java.awt.event.KeyEvent; |
||||
|
||||
/** |
||||
* Created by IntelliJ IDEA. |
||||
* Author : daisy |
||||
* Version: 6.5.6 |
||||
* Date: 14-10-15 |
||||
* Time: 上午10:18 |
||||
*/ |
||||
public class PNGExportAction4Chart extends AbstractExportAction4JChart { |
||||
|
||||
private MenuKeySet menuSet = new MenuKeySet() { |
||||
@Override |
||||
public char getMnemonic() { |
||||
return 'M'; |
||||
} |
||||
|
||||
@Override |
||||
public String getMenuName() { |
||||
return Inter.getLocText("FR-Chart-Format_Image"); |
||||
} |
||||
|
||||
@Override |
||||
public KeyStroke getKeyStroke() { |
||||
return KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK); |
||||
} |
||||
}; |
||||
|
||||
public PNGExportAction4Chart(JChart chart) { |
||||
super(chart); |
||||
this.setMenuKeySet(menuSet); |
||||
this.setName(getMenuKeySet().getMenuKeySetName()); |
||||
this.setMnemonic(getMenuKeySet().getMnemonic()); |
||||
this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/exportimg.png")); |
||||
} |
||||
|
||||
@Override |
||||
protected ChooseFileFilter getChooseFileFilter() { |
||||
return new ChooseFileFilter(new String[]{"png"}, Inter.getLocText("Image")); |
||||
} |
||||
|
||||
@Override |
||||
protected String getDefaultExtension() { |
||||
return "png"; |
||||
} |
||||
|
||||
@Override |
||||
protected Exporter4Chart getExporter() { |
||||
return new ImageExporter4Chart(); |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue