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}/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"){ jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){ fileset(dir:"build/classes"){
exclude(name:"*.*") 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}/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"){ jar(jarfile:"build/libs/fr-applet-8.0.jar"){
fileset(dir:"build/classes"){ fileset(dir:"build/classes"){
exclude(name:"*.*") exclude(name:"*.*")

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

@ -1,13 +1,10 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.FRContext;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.editor.editor.IntegerEditor; import com.fr.design.editor.editor.IntegerEditor;
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;
@ -31,7 +28,9 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
import java.io.File; import java.io.File;
import java.util.ArrayList;
import java.util.Locale; 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 String DISPLAY_MINUS = "-";
private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG}; private static final FRLevel[] LOG = {FRLevel.SEVERE, FRLevel.WARNING, FRLevel.INFO, FRLevel.DEBUG};
private static final String[] LANGUAGE = {Inter.getLocText("FR-Designer_Language_Default"), private static java.util.List<String> LANGUAGE = new ArrayList<>();
getLocaledLanguage("Simplified_Chinese_Language", Locale.SIMPLIFIED_CHINESE), static {
getLocaledLanguage("English_Language", Locale.ENGLISH), Map<Locale, String> map = Inter.getSupportLocaleMap();
getLocaledLanguage("Japanese_Language", Locale.JAPAN), LANGUAGE.add(Inter.getLocText("FR-Designer_Language_Default"));
getLocaledLanguage("Traditional_Chinese_Language", Locale.TRADITIONAL_CHINESE), for(Locale locale : map.keySet()){
getLocaledLanguage("Korea_Language",Locale.KOREA), LANGUAGE.add(getLocaledLanguage(map.get(locale), locale));
}
}; };
private static int designerEnvLanguageIndex; // 打开设置对话框时,设计器使用的语言
private boolean languageChanged; // 是否修改了设计器语言设置
//设置是否支持undo //设置是否支持undo
private UICheckBox supportUndoCheckBox; private UICheckBox supportUndoCheckBox;
@ -361,7 +358,7 @@ public class PreferencePane extends BasicPane {
JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language")); JPanel LanguagePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Choose_Language"));
generalPane.add(languageAndDashBoard_pane); generalPane.add(languageAndDashBoard_pane);
languageAndDashBoard_pane.add(LanguagePane); languageAndDashBoard_pane.add(LanguagePane);
languageComboBox = new UIComboBox(LANGUAGE); languageComboBox = new UIComboBox(LANGUAGE.toArray());
languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文 languageComboBox.setFont(FRFont.getInstance("Dialog", Font.PLAIN, 12));//为了在中文系统中显示韩文
ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language")); ActionLabel languageLabel = new ActionLabel(Inter.getLocText("FR-Designer_Designer_Language"));
languageLabel.addActionListener(new ActionListener() { languageLabel.addActionListener(new ActionListener() {
@ -532,8 +529,7 @@ public class PreferencePane extends BasicPane {
this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel())); this.logLevelComboBox.setSelectedItem(FRLevel.getByLevel(designerEnvManager.getLogLevel()));
this.languageComboBox.setSelectedItem(LANGUAGE[designerEnvManager.getLanguage()]); this.languageComboBox.setSelectedItem(LANGUAGE.get(designerEnvManager.getLanguage()));
designerEnvLanguageIndex = designerEnvManager.getLanguage();
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit()); this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit()); this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
@ -620,46 +616,12 @@ public class PreferencePane extends BasicPane {
private int getLanguageInt() { private int getLanguageInt() {
int l = 0; int l = 0;
String lang = (String) this.languageComboBox.getSelectedItem(); String lang = (String) this.languageComboBox.getSelectedItem();
for (int i = 0; i < LANGUAGE.length; i++) { for (int i = 0; i < LANGUAGE.size(); i++) {
if (ComparatorUtils.equals(lang, LANGUAGE[i])) { if (ComparatorUtils.equals(lang, LANGUAGE.get(i))) {
l = i; l = i;
break; break;
} }
} }
return l; 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.ActionEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
@ -276,15 +275,13 @@ public class TableDataTreePane extends BasicTableDataTreePane {
* @param srcName 数据集来源(比如报表块就是报表块的名称) * @param srcName 数据集来源(比如报表块就是报表块的名称)
* @param tableDataSource 数据集 * @param tableDataSource 数据集
*/ */
public Map<String, String> addTableData(String srcName, TableDataSource tableDataSource) { public void addTableData(String srcName, TableDataSource tableDataSource) {
Map<String, String> tdNameMap = new HashMap<>();
allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook()); allDSNames = DesignTableDataManager.getAllDSNames(tc.getBook());
DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER); DesignTableDataManager.setThreadLocal(DesignTableDataManager.NO_PARAMETER);
TableDataSource tds = tc.getBook(); TableDataSource tds = tc.getBook();
Iterator tdIterator = tableDataSource.getTableDataNameIterator(); Iterator tdIterator = tableDataSource.getTableDataNameIterator();
while (tdIterator.hasNext()) { while (tdIterator.hasNext()) {
String tdName = (String) tdIterator.next(); String tdName = (String) tdIterator.next();
String oldName = tdName;
TableData td = tableDataSource.getTableData(tdName); TableData td = tableDataSource.getTableData(tdName);
if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称 if (tds.getTableData(tdName) != null || isDsNameRepeaded(tdName)) {//如果有同名的就拼上来源名称
tdName = srcName + tdName; tdName = srcName + tdName;
@ -295,12 +292,8 @@ public class TableDataTreePane extends BasicTableDataTreePane {
tdName += i; tdName += i;
} }
tds.putTableData(tdName, td); tds.putTableData(tdName, td);
if (!ComparatorUtils.equals(oldName, tdName)) {
tdNameMap.put(oldName, tdName);
}
} }
tc.parameterChanged(); tc.parameterChanged();
dataTree.refresh(); 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); StableUtils.mkdirs(target);
File cacheDir = null; File cacheDir = null;
File zip = null; File zip = null;
OutputStream out = null;
try { try {
HashMap<String, String> para = new HashMap<String, String>(); HashMap<String, String> para = new HashMap<String, String>();
para.put("op", "fr_remote_design"); para.put("op", "fr_remote_design");
@ -2123,15 +2122,16 @@ public class RemoteEnv implements Env {
para.put("currentUsername", this.getUser()); para.put("currentUsername", this.getUser());
HttpClient client = createHttpMethod(para); HttpClient client = createHttpMethod(para);
InputStream input = client.getResponseStream();//拿到服务端传过来的整个共享文件夹的压缩文件的文件流 InputStream input = client.getResponseStream();
zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip"); zip = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), "share.zip");
cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE); cacheDir = new File(StableUtils.pathJoin(CacheManager.getProviderInstance().getCacheDirectory().getAbsolutePath()), ShareConstants.DIR_SHARE_CACHE);
StableUtils.deleteFile(cacheDir); StableUtils.deleteFile(cacheDir);
StableUtils.mkdirs(cacheDir); StableUtils.mkdirs(cacheDir);
StableUtils.makesureFileExist(zip); StableUtils.makesureFileExist(zip);
out = new FileOutputStream(zip); FileOutputStream out = new FileOutputStream(zip);
IOUtils.copyBinaryTo(input, out);//放到本地缓存目录下 IOUtils.copyBinaryTo(input, out);
out.flush();
out.close();
IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录 IOUtils.unzip(zip, cacheDir.getAbsolutePath(), EncodeConstants.ENCODING_GBK);//先解压到临时目录
if (cacheDir.exists() && cacheDir.isDirectory()) { if (cacheDir.exists() && cacheDir.isDirectory()) {
return cacheDir.listFiles(new FilenameFilter() { return cacheDir.listFiles(new FilenameFilter() {
@ -2144,10 +2144,6 @@ public class RemoteEnv implements Env {
} catch (Exception e) { } catch (Exception e) {
FRContext.getLogger().error(e.getMessage()); FRContext.getLogger().error(e.getMessage());
} finally { } finally {
if (out != null) {
out.flush();
out.close();
}
StableUtils.deleteFile(zip); StableUtils.deleteFile(zip);
} }
return new File[0]; return new File[0];
@ -2155,33 +2151,25 @@ public class RemoteEnv implements Env {
@Override @Override
public boolean installREUFile(File reuFile) { public boolean installREUFile(File reuFile) {
if (reuFile == null) { // if (reuFile == null) {
return false; // return false;
} // }
File tempFile = new File(CacheManager.getProviderInstance().getCacheDirectory(), "temp_remote"); // try {
IOUtils.unzip(reuFile, tempFile.getAbsolutePath()); // HashMap<String, String> para = new HashMap<String, String>();
String shareXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_MODULE); // para.put("op", "fr_remote_design");
String helpXMLName = StableUtils.pathJoin(tempFile.getAbsolutePath(), ShareConstants.NAME_XML_HELP); // para.put("cmd", "design_install_reufile");
try { // para.put("current_uid", this.createUserID());
HashMap<String, String> para = new HashMap<String, String>(); // para.put("currentUsername", this.getUser());
para.put("op", "fr_remote_design"); // para.put("reuFileName", reuFile.getName());
para.put("cmd", "design_install_reufile"); //
para.put("current_uid", this.createUserID()); // HttpClient client = createHttpMethod(para);
para.put("currentUsername", this.getUser()); // client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(reuFile)));
para.put("reuFileName", reuFile.getName()); // InputStream input = execute4InputStream(client);
// return ComparatorUtils.equals(stream2String(input), "true");
HttpClient client = createHttpMethod(para); // } catch (Exception e) {
client.setContent(IOUtils.inputStream2Bytes(new FileInputStream(new File(shareXMLName)))); // return false;
InputStream input = execute4InputStream(client); // }
client.release(); return false;
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;
}
} }
@Override @Override

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

@ -97,6 +97,7 @@ public class ComponentTree extends JTree {
scrollPathToVisible(treepath); 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 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;
@ -121,6 +122,8 @@ 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));

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

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

Loading…
Cancel
Save