Browse Source

冲突

master
neil 8 years ago
parent
commit
1c86462eb8
  1. 86
      build.dev.gradle.bak
  2. 2
      build.master.gradle.bak
  3. 2
      build.release.gradle.bak
  4. 64
      designer_base/src/com/fr/design/actions/file/PreferencePane.java
  5. 9
      designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java
  6. 99
      designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java
  7. 60
      designer_base/src/com/fr/env/RemoteEnv.java
  8. 1
      designer_form/src/com/fr/design/mainframe/ComponentTree.java
  9. 3
      designer_form/src/com/fr/design/mainframe/WidgetPropertyPane.java
  10. 30
      designer_form/src/com/fr/design/parameter/ParameterToolBarPane.java

86
build.dev.gradle.bak

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

2
build.master.gradle.bak

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

2
build.release.gradle.bak

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

64
designer_base/src/com/fr/design/actions/file/PreferencePane.java

@ -1,13 +1,10 @@
package com.fr.design.actions.file;
import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.editor.editor.IntegerEditor;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton;
@ -31,7 +28,9 @@ import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.File;
import java.util.ArrayList;
import java.util.Locale;
import java.util.Map;
/**
* 选项对话框
@ -74,16 +73,14 @@ public class PreferencePane extends BasicPane {
private static final String DISPLAY_MINUS = "-";
private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG};
private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"),
getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE),
getLocaledLanguage("English_Language", Locale.ENGLISH),
getLocaledLanguage("Japanese_Language", Locale.JAPAN),
getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE),
getLocaledLanguage("Korea_Language",Locale.KOREA),
private static java.util.List<String> LANGUAGE = new ArrayList<>();
static {
Map<Locale, String> map = Inter.getSupportLocaleMap();
LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default"));
for(Locale locale : map.keySet()){
LANGUAGE.add(getLocaledLanguage(map.get(locale), locale));
}
};
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private boolean languageChanged; // 是否修改了设计器语言设置
//设置是否支持undo
private UICheckBox supportUndoCheckBox;
@ -361,7 +358,7 @@ public class PreferencePane extends BasicPane {
JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language"));
generalPane.add(languageAndDashBoard_pane);
languageAndDashBoard_pane.add(LanguagePane);
languageComboBox = new UIComboBox(LANGUAGE);
languageComboBox = new UIComboBox(LANGUAGE.toArray());
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文
ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language"));
languageLabel.addActionListener(new ActionListener() {
@ -532,8 +529,7 @@ public class PreferencePane extends BasicPane {
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]);
designerEnvLanguageIndex = designerEnvManager.getLanguage();
this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
@ -620,46 +616,12 @@ public class PreferencePane extends BasicPane {
private int getLanguageInt() {
int l = 0;
String lang = (String) this.languageComboBox.getSelectedItem();
for (int i = 0; i < LANGUAGE.length; i++) {
if (ComparatorUtils.equals(lang, LANGUAGE[i])) {
for (int i = 0; i < LANGUAGE.size(); i++) {
if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) {
l = i;
break;
}
}
return l;
}
// 如果语言设置改变了,则显示重启对话框
public void showRestartDialog() {
if (!languageChanged) {
return;
}
int rv = JOptionPane.showOptionDialog(
null,
Inter.getLocText("FR-Designer_Language_Change_Successful"),
Inter.getLocText("FR-Designer-Plugin_Warning"),
JOptionPane.YES_NO_OPTION,
JOptionPane.INFORMATION_MESSAGE,
null,
new String[]{Inter.getLocText("FR-Designer-Basic_Restart_Designer"), Inter.getLocText("FR-Designer-Basic_Restart_Designer_Later")},
null
);
if (rv == JOptionPane.OK_OPTION) {
RestartHelper.restart();
}
}
@Override
public BasicDialog showWindow(Window window) {
return showWindow(window, new DialogActionAdapter() {
@Override
public void doOk() {
if (languageComboBox.getSelectedIndex() != designerEnvLanguageIndex) {
languageChanged = true;
} else {
languageChanged = false;
}
}
});
}
}

9
designer_base/src/com/fr/design/data/datapane/TableDataTreePane.java

@ -38,7 +38,6 @@ import java.awt.dnd.DnDConstants;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@ -276,15 +275,13 @@ public class TableDataTreePane extends BasicTableDataTreePane {
* @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集
*/
public Map<String, String> addTableData(String srcName, TableDataSource tableDataSource) {
Map<String, String> tdNameMap = new HashMap<>();
public void addTableData(String srcName, TableDataSource tableDataSource) {
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next();
String oldName = tdName;
TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName;
@ -295,12 +292,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
tdName += i;
}
tds.putTableData(tdName, td);
if (!ComparatorUtils.equals(oldName, tdName)) {
tdNameMap.put(oldName, tdName);
}
}
tc.parameterChanged();
dataTree.refresh();
return Collections.unmodifiableMap(tdNameMap);
}
}

99
designer_base/src/com/fr/design/extra/WebManagerPaneFactory.java

@ -0,0 +1,99 @@
package com.fr.design.extra;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.general.Inter;
import com.fr.stable.StableUtils;
import javafx.embed.swing.JFXPanel;
import java.awt.*;
import java.io.File;
import java.net.URL;
/**
* Created by vito on 2016/9/28.
*/
public class WebManagerPaneFactory {
private String installHome;
public WebManagerPaneFactory() {
if (StableUtils.isDebug()) {
URL url = ClassLoader.getSystemResource("");
this.installHome = url.getPath();
} else {
this.installHome = StableUtils.getInstallHome();
}
}
public BasicPane createPluginPane() {
if (StableUtils.getMajorJavaVersion() == 8) {
return new ShopManagerPane(new ShopPaneConfig() {
@Override
String setMainJS() {
String relativePath = "/scripts/store/web/index.html";
return StableUtils.pathJoin(new File(installHome).getAbsolutePath(), relativePath);
}
@Override
String setScriptsId() {
return "shop_scripts";
}
@Override
JFXPanel setWebPane() {
return new PluginWebPane(setMainJS());
}
});
} else {
BasicPane traditionalStorePane = new BasicPane() {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer-Plugin_Manager");
}
};
traditionalStorePane.setLayout(new BorderLayout());
traditionalStorePane.add(initTraditionalStore(), BorderLayout.CENTER);
return traditionalStorePane;
}
}
public BasicPane createReusePane() {
return new ShopManagerPane(new ShopPaneConfig() {
@Override
String setMainJS() {
String relativePath = "/scripts/store/reuse/index.html";
return StableUtils.pathJoin(new File(installHome).getAbsolutePath(), relativePath);
}
@Override
String setScriptsId() {
return "reuse_scripts";
}
@Override
JFXPanel setWebPane() {
return new ReuseWebPane(setMainJS());
}
});
}
/**
* 以关键词打开设计器商店
*
* @param keyword 关键词
*/
public BasicPane createPluginPane(String keyword) {
PluginWebBridge.getHelper().openWithSearch(keyword);
return createPluginPane();
}
private Component initTraditionalStore() {
UITabbedPane tabbedPane = new UITabbedPane();
PluginInstalledPane installedPane = new PluginInstalledPane();
tabbedPane.addTab(installedPane.tabTitle(), installedPane);
tabbedPane.addTab(Inter.getLocText("FR-Designer-Plugin_Update"), new PluginUpdatePane(tabbedPane));
tabbedPane.addTab(Inter.getLocText("FR-Designer-Plugin_All_Plugins"), new PluginFromStorePane(tabbedPane));
return tabbedPane;
}
}

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

@ -2114,7 +2114,6 @@ public class RemoteEnv implements Env {
StableUtils.mkdirs(target);
File cacheDir = null;
File zip = null;
OutputStream out = null;
try {
HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design");
@ -2123,15 +2122,16 @@ public class RemoteEnv implements Env {
para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para);
InputStream input = client.getResponseStream();//拿到服务端传过来的整个共享文件夹的压缩文件的文件流
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);
out = new FileOutputStream(zip);
IOUtils.copyBinaryTo(input, out);//放到本地缓存目录下
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() {
@ -2144,10 +2144,6 @@ public class RemoteEnv implements Env {
} catch (Exception e) {
FRContext.getLogger().error(e.getMessage());
} finally {
if (out != null) {
out.flush();
out.close();
}
StableUtils.deleteFile(zip);
}
return new File[0];
@ -2155,33 +2151,25 @@ public class RemoteEnv implements Env {
@Override
public boolean installREUFile(File reuFile) {
if (reuFile == null) {
return false;
}
File tempFile = new File(CacheManager.getProviderInstance().getCacheDirectory(), "temp_remote");
IOUtils.unzip(reuFile, tempFile.getAbsolutePath());
String shareXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_MODULE);
String helpXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_HELP);
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(new File(shareXMLName))));
InputStream input = execute4InputStream(client);
client.release();
para.put("isComplete", "true");
HttpClient client1 = createHttpMethod(para);
client1.setContent(IOUtils.inputStream2Bytes(new FileInputStream(new File(helpXMLName))));
InputStream input1 = execute4InputStream(client1);
return ComparatorUtils.equals(stream2String(input), "true") && ComparatorUtils.equals(stream2String(input1), "true");
} catch (Exception e) {
return false;
}
// 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

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

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

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

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

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

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

Loading…
Cancel
Save