From 5ec25e6264a8e582dffcc36c10fec37ed207a457 Mon Sep 17 00:00:00 2001
From: zack
Date: Thu, 22 Sep 2016 20:19:01 +0800
Subject: [PATCH 01/53] =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=9D=97=E5=85=B1?=
=?UTF-8?q?=E4=BA=AB=E6=8C=89=E9=92=AE=E6=8E=A5=E5=8F=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fun/DesignerFrameUpButtonProvider.java | 24 +++++++++++++++++++
.../AbstractDsinFrameUpButtonProvider.java | 23 ++++++++++++++++++
.../fr/design/mainframe/DesignerFrame.java | 19 +++++++++++++++
.../com/fr/design/mainframe/JTemplate.java | 24 ++++++++++++++++++-
4 files changed, 89 insertions(+), 1 deletion(-)
create mode 100644 designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java
create mode 100644 designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java
diff --git a/designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java b/designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java
new file mode 100644
index 0000000000..b6a86ae81c
--- /dev/null
+++ b/designer_base/src/com/fr/design/fun/DesignerFrameUpButtonProvider.java
@@ -0,0 +1,24 @@
+package com.fr.design.fun;
+
+import com.fr.design.gui.ibutton.UIButton;
+import com.fr.stable.fun.mark.Mutable;
+
+/**
+ * 设计器面板最上方的按钮接口(保存,赋值,撤销同级)
+ * Coder: zack
+ * Date: 2016/9/22
+ * Time: 15:40
+ */
+public interface DesignerFrameUpButtonProvider extends Mutable {
+
+ int CURRENT_LEVEL = 1;
+
+ String XML_TAG = "DesignerFrameUpButtonProvider";
+
+ /**
+ * 根据当前的设计状态返回最上层工具按钮
+ * @param menuState 现在设计器的设计状态
+ * @return 按钮
+ */
+ UIButton[] getUpButtons(int menuState);
+}
diff --git a/designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java b/designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java
new file mode 100644
index 0000000000..bd1f70829b
--- /dev/null
+++ b/designer_base/src/com/fr/design/fun/impl/AbstractDsinFrameUpButtonProvider.java
@@ -0,0 +1,23 @@
+package com.fr.design.fun.impl;
+
+import com.fr.design.fun.DesignerFrameUpButtonProvider;
+import com.fr.design.gui.ibutton.UIButton;
+import com.fr.stable.fun.mark.API;
+
+/**
+ * Coder: zack
+ * Date: 2016/9/22
+ * Time: 15:50
+ */
+@API(level = DesignerFrameUpButtonProvider.CURRENT_LEVEL)
+public abstract class AbstractDsinFrameUpButtonProvider implements DesignerFrameUpButtonProvider {
+ @Override
+ public UIButton[] getUpButtons(int menuState) {
+ return new UIButton[0];
+ }
+
+ @Override
+ public String mark4Provider() {
+ return getClass().getName();
+ }
+}
diff --git a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java
index a1f5f16a4b..329b631552 100644
--- a/designer_base/src/com/fr/design/mainframe/DesignerFrame.java
+++ b/designer_base/src/com/fr/design/mainframe/DesignerFrame.java
@@ -464,9 +464,28 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
//添加分享按钮
addShareButton();
+
+ //添加插件中的按钮
+ addExtraButtons();
return combineUp;
}
+
+ private void addExtraButtons(){
+ JTemplate, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
+ if(jt == null){
+ return;
+ }
+
+
+ UIButton[] extraButtons = jt.createExtraButtons();
+ for (int i = 0; i < extraButtons.length; i++) {
+ combineUp.add(extraButtons[i]);
+ }
+ if (extraButtons.length > 0) {
+ combineUp.addSeparator(new Dimension(2, 16));
+ }
+ }
private void addShareButton(){
JTemplate, ?> jt = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
diff --git a/designer_base/src/com/fr/design/mainframe/JTemplate.java b/designer_base/src/com/fr/design/mainframe/JTemplate.java
index 8478e2500d..58060d91a9 100644
--- a/designer_base/src/com/fr/design/mainframe/JTemplate.java
+++ b/designer_base/src/com/fr/design/mainframe/JTemplate.java
@@ -8,8 +8,8 @@ import com.fr.base.io.IOFile;
import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager;
+import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.TableDataSourceAction;
-import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.edit.RedoAction;
import com.fr.design.actions.edit.UndoAction;
import com.fr.design.actions.file.SaveAsTemplateAction;
@@ -19,6 +19,7 @@ import com.fr.design.designer.TargetComponent;
import com.fr.design.dialog.InformationWarnPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.TemplateTreePane;
+import com.fr.design.fun.DesignerFrameUpButtonProvider;
import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
@@ -37,9 +38,12 @@ import com.fr.file.FILE;
import com.fr.file.FILEChooserPane;
import com.fr.file.FileNodeFILE;
import com.fr.file.MemFILE;
+import com.fr.form.ui.NoneWidget;
+import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
+import com.fr.stable.ArrayUtils;
import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils;
import com.fr.stable.project.ProjectConstants;
@@ -51,6 +55,7 @@ import java.awt.*;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Set;
import java.util.regex.Pattern;
/**
@@ -505,6 +510,9 @@ public abstract class JTemplate> ex
public boolean saveShareFile(){
return true;
}
+ public Widget getSelectElementCase(){
+ return new NoneWidget();
+ }
protected FILEChooserPane getFILEChooserPane(boolean isShowLoc){
return new FILEChooserPane(true, isShowLoc);
@@ -957,4 +965,18 @@ public abstract class JTemplate> ex
public boolean acceptToolbarItem(Class clazz) {
return true;
}
+
+ /**
+ * 加载插件中的按钮
+ * @return 按钮组
+ */
+ public UIButton[] createExtraButtons() {
+ Set providers = ExtraDesignClassManager.getInstance().getArray(DesignerFrameUpButtonProvider.XML_TAG);
+ UIButton[] uiButtons = new UIButton[0];
+ for (DesignerFrameUpButtonProvider provider : providers) {
+ uiButtons = ArrayUtils.addAll(uiButtons, provider.getUpButtons(getMenuState()));
+ }
+
+ return uiButtons;
+ }
}
\ No newline at end of file
From 4fb11bb9f29b1ee5b7b361b6aab9ebed0f7a303f Mon Sep 17 00:00:00 2001
From: fr_shine
Date: Fri, 23 Sep 2016 10:05:50 +0800
Subject: [PATCH 02/53] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=86=85=E5=9B=BE?=
=?UTF-8?q?=E8=A1=A8=E4=B9=9F=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E5=9B=BE?=
=?UTF-8?q?=E8=A1=A8=E8=83=8C=E6=99=AF?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../mainframe/chart/gui/style/area/ChartAreaPane.java | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java
index 673ac0194b..d10cb182b9 100644
--- a/designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java
+++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/style/area/ChartAreaPane.java
@@ -45,13 +45,8 @@ public class ChartAreaPane extends ThirdTabPane implements AutoSelectedPa
if(parent instanceof ChartStylePane) {
plotPane.setParentPane((ChartStylePane)parent);
}
- JTemplate jTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
- if (jTemplate.isJWorkBook() || jTemplate.getEditingReportIndex() == BaseJForm.ELEMENTCASE_TAB) {
- //表单中的图表组件的图表区挪到控件属性表的样式中了
- paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
- }else if(jTemplate.isChartBook()){
- paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
- }
+
+ paneList.add(new NamePane(areaPane.title4PopupWindow(), areaPane));
if(plot.isSupportPlotBackground()) {
paneList.add(new NamePane(plotPane.title4PopupWindow(), plotPane));
From 32046b798f090c98b527481d1d3fe6fe8d9ce838 Mon Sep 17 00:00:00 2001
From: zack
Date: Fri, 23 Sep 2016 11:05:42 +0800
Subject: [PATCH 03/53] =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=85=B1=E4=BA=AB?=
=?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
designer_form/src/com/fr/design/mainframe/JForm.java | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java
index 848f0da4cf..ef18f07135 100644
--- a/designer_form/src/com/fr/design/mainframe/JForm.java
+++ b/designer_form/src/com/fr/design/mainframe/JForm.java
@@ -10,6 +10,7 @@ import com.fr.design.designer.beans.actions.FormDeleteAction;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XComponent;
+import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent;
@@ -35,6 +36,7 @@ import com.fr.file.FILE;
import com.fr.form.FormElementCaseContainerProvider;
import com.fr.form.FormElementCaseProvider;
import com.fr.form.main.Form;
+import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WLayout;
import com.fr.general.ComparatorUtils;
@@ -756,4 +758,10 @@ public class JForm extends JTemplate
+ * Description: 树形结构而来的DefaultListCellRenderer
+ */
+ class UITreeComboBoxRenderer extends DefaultListCellRenderer {
+ public Component getListCellRendererComponent(JList list, Object value,
+ int index, boolean isSelected, boolean cellHasFocus){
+ if(value != null){
+ TreePath path = (TreePath)value;
+ Object node = path.getLastPathComponent();
+ value = node;
+ TreeCellRenderer r = tree.getCellRenderer();
+ JLabel lb = (JLabel)r.getTreeCellRendererComponent(
+ tree, value, isSelected, false, false, index,
+ cellHasFocus);
+ return lb;
+ }
+ return super.getListCellRendererComponent(list, value, index,
+ isSelected, cellHasFocus);
+ }
+ }
+
+
+ public TreePath[] getSelectedTreePath() {
+ XCreator[] creators = tree.getDesigner().getSelectionModel().getSelection().getSelectedCreators();
+ TreePath[] paths = new TreePath[creators.length];
+
+ for (int i = 0; i < paths.length; i++) {
+ paths[i] = tree.buildTreePath(creators[i]);
+ }
+ return paths;
+ }
+
+ private class TreeComboBoxDesignerEditAdapter implements DesignerEditListener {
+
+ @Override
+ public void fireCreatorModified(DesignerEvent evt) {
+ if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
+ TreePath[] paths = getSelectedTreePath();
+
+ if (paths.length == 1) {
+ tree.setAndScrollSelectionPath(paths[0]);
+ } else {
+ tree.setSelectionPaths(paths);
+ }
+ setSelectedItem(paths[0]);
+ MenuSelectionManager.defaultManager().clearSelectedPath();
+ } else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
+ TreePath[] paths = getSelectedTreePath();
+ if (paths.length == 1) {
+ tree.setAndScrollSelectionPath(paths[0]);
+ } else {
+ tree.setSelectionPaths(paths);
+ }
+ setSelectedItem(paths[0]);
+ MenuSelectionManager.defaultManager().clearSelectedPath();
+
+ } else {
+ return;
+ }
+
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return o.getClass() == this.getClass();
+ }
+ }
+
+ /**
+ * 测试
+ */
+// public static void main(String args[]){
+// JFrame frame = new JFrame("UITreeComboBox");
+// final UITreeComboBox box = new UITreeComboBox(new ComponentTree(new FormDesigner()));
+// box.setPreferredSize(new Dimension(300, 28));
+// frame.getContentPane().add(box);
+// frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+// frame.pack();
+// frame.setVisible(true);
+// }
+}
+
+/**
+ * Title: UITreeComboBox
+ * Description: TreePopup
+ */
+class TreePopup extends JPopupMenu implements ComboPopup{
+ protected UITreeComboBox comboBox;
+ protected JScrollPane scrollPane;
+
+ protected MouseMotionListener mouseMotionListener;
+ protected MouseListener mouseListener;
+ private MouseListener treeSelectListener = new MouseAdapter(){
+ public void mouseClicked (MouseEvent e){
+ if (e.isMetaDown()) {
+ popupMenu(e);
+ } else {
+ return;
+ }
+ }
+ };
+
+ public void popupMenu(MouseEvent e) {
+ TreePath path = comboBox.getTree().getSelectionPath();
+ if (path == null) {
+ return;
+ }
+ Component component = (Component) path.getLastPathComponent();
+ if (!(component instanceof XCreator)) {
+ return;
+ }
+ com.fr.design.designer.beans.ComponentAdapter adapter = AdapterBus.getComponentAdapter(comboBox.getTree().getDesigner(), (XCreator) component);
+ JPopupMenu menu = adapter.getContextPopupMenu(e);
+ menu.show(comboBox, e.getX(), e.getY());
+ }
+
+ public TreePopup(JComboBox comboBox){
+ this.comboBox = (UITreeComboBox)comboBox;
+ setBorder(BorderFactory.createLineBorder(Color.black));
+ setLayout(new BorderLayout());
+ setLightWeightPopupEnabled(comboBox.isLightWeightPopupEnabled());
+ JTree tree = this.comboBox.getTree();
+ if(tree != null){
+ scrollPane = new JScrollPane(tree);
+ scrollPane.setBorder(null);
+ add(scrollPane, BorderLayout.CENTER);
+ this.comboBox.addMouseListener(treeSelectListener);
+ }
+ }
+
+ public void show(){
+ updatePopup();
+ show(comboBox, 0, comboBox.getHeight());
+ comboBox.getTree().requestFocus();
+ }
+
+ public void hide(){
+ setVisible(false);
+ comboBox.firePropertyChange("popupVisible", true, false);
+ }
+
+ protected JList list = new JList();
+ public JList getList(){
+ return list;
+ }
+
+ public MouseMotionListener getMouseMotionListener(){
+ if(mouseMotionListener == null){
+ mouseMotionListener = new MouseMotionAdapter(){};
+ }
+ return mouseMotionListener;
+ }
+
+ public KeyListener getKeyListener(){
+ return null;
+ }
+
+ public void uninstallingUI(){}
+
+ /**
+ * Implementation of ComboPopup.getMouseListener().
+ *
+ * @return a MouseListener
or null
+ * @see ComboPopup#getMouseListener
+ */
+ public MouseListener getMouseListener(){
+ if(mouseListener == null){
+ mouseListener = new InvocationMouseHandler();
+ }
+ return mouseListener;
+ }
+
+ protected void togglePopup(){
+ if(isVisible()){
+ hide();
+ } else{
+ show();
+ }
+ }
+ protected void updatePopup(){
+ setPreferredSize(new Dimension(comboBox.getSize().width, 200));
+ Object selectedObj = comboBox.getSelectedItem();
+ if(selectedObj != null){
+ TreePath tp = (TreePath)selectedObj;
+ ((UITreeComboBox)comboBox).getTree().setSelectionPath(tp);
+ }
+ }
+
+ protected class InvocationMouseHandler extends MouseAdapter{
+ public void mousePressed(MouseEvent e){
+ if(!SwingUtilities.isLeftMouseButton(e) || !comboBox.isEnabled()){
+ return;
+ }
+ if(comboBox.isEditable()){
+ Component comp = comboBox.getEditor().getEditorComponent();
+ if((!(comp instanceof JComponent)) ||
+ ((JComponent)comp).isRequestFocusEnabled()){
+ comp.requestFocus();
+ }
+ } else if(comboBox.isRequestFocusEnabled()){
+ comboBox.requestFocus();
+ }
+ togglePopup();
+ }
+ }
+
+
+
+}
From 5e0f82fee2d8d9ae985e2431a6b403bf650b5e91 Mon Sep 17 00:00:00 2001
From: sunmondong
Date: Tue, 11 Oct 2016 22:30:43 +0800
Subject: [PATCH 35/53] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
build.gradle => build.dev.gradle | 2 +-
build.gradle.bak | 86 -------------------
.../{build.gradle => build.dev.gradle} | 2 +-
designer_base/build.gradle.bak | 70 ---------------
.../{build.gradle => build.dev.gradle} | 2 +-
designer_chart/build.gradle.bak | 66 --------------
.../{build.gradle => build.dev.gradle} | 2 +-
designer_form/build.gradle.bak | 83 ------------------
8 files changed, 4 insertions(+), 309 deletions(-)
rename build.gradle => build.dev.gradle (97%)
delete mode 100644 build.gradle.bak
rename designer_base/{build.gradle => build.dev.gradle} (96%)
delete mode 100644 designer_base/build.gradle.bak
rename designer_chart/{build.gradle => build.dev.gradle} (96%)
delete mode 100644 designer_chart/build.gradle.bak
rename designer_form/{build.gradle => build.dev.gradle} (97%)
delete mode 100644 designer_form/build.gradle.bak
diff --git a/build.gradle b/build.dev.gradle
similarity index 97%
rename from build.gradle
rename to build.dev.gradle
index abc9815956..507d77e9f5 100644
--- a/build.gradle
+++ b/build.dev.gradle
@@ -5,7 +5,7 @@ tasks.withType(JavaCompile){
def basicDir="../../"
def libDir="${basicDir}/finereport-lib-stable"
//获取什么分支名
-FileTree files =fileTree(dir:"./",include:"build.gradle")
+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)
diff --git a/build.gradle.bak b/build.gradle.bak
deleted file mode 100644
index 67a8a0e70f..0000000000
--- a/build.gradle.bak
+++ /dev/null
@@ -1,86 +0,0 @@
-apply plugin: "java"
-tasks.withType(JavaCompile){
- options.encoding = "UTF-8"
-}
-sourceCompatibility=1.7
-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}/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")
-
- }
-
-}
\ No newline at end of file
diff --git a/designer_base/build.gradle b/designer_base/build.dev.gradle
similarity index 96%
rename from designer_base/build.gradle
rename to designer_base/build.dev.gradle
index f8cfe57ba4..7b3bea2ba9 100644
--- a/designer_base/build.gradle
+++ b/designer_base/build.dev.gradle
@@ -24,7 +24,7 @@ sourceSets{
}
}
//获取什么分支名
-FileTree files =fileTree(dir:'./',include:'build.gradle')
+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)
diff --git a/designer_base/build.gradle.bak b/designer_base/build.gradle.bak
deleted file mode 100644
index e7c5a8e1ff..0000000000
--- a/designer_base/build.gradle.bak
+++ /dev/null
@@ -1,70 +0,0 @@
-
-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',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
-
-
-
diff --git a/designer_chart/build.gradle b/designer_chart/build.dev.gradle
similarity index 96%
rename from designer_chart/build.gradle
rename to designer_chart/build.dev.gradle
index cc22b7b34b..f980fa135a 100644
--- a/designer_chart/build.gradle
+++ b/designer_chart/build.dev.gradle
@@ -23,7 +23,7 @@ sourceSets{
}
}
}
-FileTree files =fileTree(dir:'./',include:'build.gradle')
+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)
diff --git a/designer_chart/build.gradle.bak b/designer_chart/build.gradle.bak
deleted file mode 100644
index 92f0551624..0000000000
--- a/designer_chart/build.gradle.bak
+++ /dev/null
@@ -1,66 +0,0 @@
-
-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',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
-
diff --git a/designer_form/build.gradle b/designer_form/build.dev.gradle
similarity index 97%
rename from designer_form/build.gradle
rename to designer_form/build.dev.gradle
index b06cabd306..57ebd74c2c 100644
--- a/designer_form/build.gradle
+++ b/designer_form/build.dev.gradle
@@ -26,7 +26,7 @@ sourceSets{
}
//获取什么分支名
-FileTree files =fileTree(dir:'./',include:'build.gradle')
+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)
diff --git a/designer_form/build.gradle.bak b/designer_form/build.gradle.bak
deleted file mode 100644
index 474d4aca95..0000000000
--- a/designer_form/build.gradle.bak
+++ /dev/null
@@ -1,83 +0,0 @@
-
-apply plugin: 'java'
-tasks.withType(JavaCompile){
- options.encoding = 'UTF-8'
-}
-//指定构建的jdk版本
-sourceCompatibility=1.8
-//指定生成的jar包版本
-version='8.0'
-
-def srcDir="."
-
-
-//指明生成jar包的名字
-jar{
- baseName='fr-designer-report'
-}
-//源码所在位置
-sourceSets{
- main{
- java{
- srcDirs=["${srcDir}/src",
-"${srcDir}/../designer/src"]
- }
- }
-}
-
-//获取什么分支名
-FileTree files =fileTree(dir:'./',include:'build.gradle')
-def buildDir=files[0].path.substring(0,files[0].path.lastIndexOf ('\\'))
-buildDir=buildDir.substring(0,buildDir.lastIndexOf ('\\'))
-def branchName=buildDir.substring(buildDir.lastIndexOf ('\\')+1)
-//声明外部依赖
-dependencies{
-compile fileTree(dir:"../../../finereport-lib-stable${branchName}",include:'**/*.jar')
-compile fileTree(dir:'../../../',include:"finereport-*-stable/${branchName}/**/build/libs/*.jar")
-
- testCompile 'junit:junit:4.12'
-}
-
-//指明无法编译文件所在路径
-def dataContent ={def dir ->
- copySpec{
- from ("${dir}"){
- exclude '**/.setting/**','.classpath','.project','**/*.java','**/*.db','**/*.g','**/package.html'
- }
- }
-}
-
-//将非.java文件复制到classes文件夹下 参与打包
-task copyFile(type:Copy,dependsOn:compileJava){
- copy{
- with dataContent.call("${srcDir}/src")
- with dataContent.call("${srcDir}/../designer/src")
- into ('build/classes/main')
- }
-
-}
-
-
-//压缩项目中的js文件
-task compressJS{
- ant.taskdef(name:'yuicompress',classname:'com.yahoo.platform.yui.compressor.YUICompressTask'){
- classpath {
-
- fileset(dir:'../../../finereport-lib4build-stable',includes:'**/*.jar')
- }
- }
- ant.yuicompress(linebreak:"500",warn:"false", munge:"yes",preserveallsemicolons:"false", charset:"utf-8",encoding:"utf-8",outputfolder:'build/classes/main'){
- fileset (dir:"${srcDir}/src"){
- include (name:'**/*.js')
- include (name:'**/*.css')
-
- }
- fileset (dir:"${srcDir}/../designer/src"){
- include (name:'**/*.js')
- include (name:'**/*.css')
- }
-
- }
-}
-jar.dependsOn compressJS
-
From 2325ca73fd6a3a175d4ec0148ef944af38e4096b Mon Sep 17 00:00:00 2001
From: xiaoxia
Date: Wed, 12 Oct 2016 00:17:50 +0800
Subject: [PATCH 36/53] rt
---
.../src/com/fr/design/mainframe/ShareWidgetPane.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java
index 7abfb6900a..79f15b3646 100644
--- a/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java
+++ b/designer_form/src/com/fr/design/mainframe/ShareWidgetPane.java
@@ -13,15 +13,15 @@ import java.util.ArrayList;
* Created by xiaxiang on 2016/10/10.
*/
public class ShareWidgetPane extends JPanel {
- public ShareWidgetPane(ArrayList elCaseBindInfos) {
+ public ShareWidgetPane(ArrayList elCaseBindInfoList) {
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));// 设置面板的边框 ,距离上、左、下、右 的距离
- int rowCount = (elCaseBindInfos.size() + 1)/2;
+ int rowCount = (elCaseBindInfoList.size() + 1)/2;
this.setLayout(new GridLayout(rowCount, 2, 10, 10));
- for (ElCaseBindInfo rbModuleInfo : elCaseBindInfos) {
+ for (ElCaseBindInfo rbModuleInfo : elCaseBindInfoList) {
ShareWidgetButton widgetButton = new ShareWidgetButton(rbModuleInfo);
this.add(widgetButton);
}
- if (elCaseBindInfos.size() == 1) {
+ if (elCaseBindInfoList.size() == 1) {
this.add(new JPanel());
}
From 760aff6304c5c5ccbcf44f0974eb2f45a9dd2ccd Mon Sep 17 00:00:00 2001
From: xiaoxia
Date: Wed, 12 Oct 2016 02:02:18 +0800
Subject: [PATCH 37/53] rt
---
.../com/fr/design/mainframe/widget/UITreeComboBox.java | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
index 4d92ccc264..dd2c8fa897 100644
--- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
+++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
@@ -31,11 +31,11 @@ public class UITreeComboBox extends JComboBox{
public UITreeComboBox(ComponentTree componentTree){
this.setTree(componentTree);
tree.getDesigner().addDesignerEditListener(new TreeComboBoxDesignerEditAdapter());
- for(int i=0; i
Date: Wed, 12 Oct 2016 02:02:51 +0800
Subject: [PATCH 38/53] rt
---
.../src/com/fr/design/mainframe/widget/UITreeComboBox.java | 4 ----
1 file changed, 4 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
index dd2c8fa897..8bb921df4b 100644
--- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
+++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
@@ -31,10 +31,6 @@ public class UITreeComboBox extends JComboBox{
public UITreeComboBox(ComponentTree componentTree){
this.setTree(componentTree);
tree.getDesigner().addDesignerEditListener(new TreeComboBoxDesignerEditAdapter());
-// for(int i=0; i
Date: Wed, 12 Oct 2016 09:20:56 +0800
Subject: [PATCH 39/53] rt
---
.../mainframe/widget/UITreeComboBox.java | 35 ++++++++-----------
1 file changed, 14 insertions(+), 21 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
index 8bb921df4b..81afb7cc8d 100644
--- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
+++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
@@ -31,6 +31,10 @@ public class UITreeComboBox extends JComboBox{
public UITreeComboBox(ComponentTree componentTree){
this.setTree(componentTree);
tree.getDesigner().addDesignerEditListener(new TreeComboBoxDesignerEditAdapter());
+// for(int i=0; i
Date: Wed, 12 Oct 2016 09:31:06 +0800
Subject: [PATCH 40/53] rt
---
.../fr/design/mainframe/widget/UITreeComboBox.java | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
index 81afb7cc8d..7f55ddeafe 100644
--- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
+++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java
@@ -123,22 +123,12 @@ public class UITreeComboBox extends JComboBox{
}
- public TreePath[] getSelectedTreePath() {
- XCreator[] creators = tree.getDesigner().getSelectionModel().getSelection().getSelectedCreators();
- TreePath[] paths = new TreePath[creators.length];
-
- for (int i = 0; i < paths.length; i++) {
- paths[i] = tree.buildTreePath(creators[i]);
- }
- return paths;
- }
-
private class TreeComboBoxDesignerEditAdapter implements DesignerEditListener {
@Override
public void fireCreatorModified(DesignerEvent evt) {
if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED || evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
- TreePath[] paths = getSelectedTreePath();
+ TreePath[] paths = tree.getSelectedTreePath();
if (paths.length == 1) {
tree.setAndScrollSelectionPath(paths[0]);
From 0efb563d4ce847285c6c7fff0fa2fa897888f146 Mon Sep 17 00:00:00 2001
From: xiaoxia
Date: Wed, 12 Oct 2016 09:31:48 +0800
Subject: [PATCH 41/53] =?UTF-8?q?componenttree=E5=90=8E=E9=9D=A2=E8=BF=98?=
=?UTF-8?q?=E8=A6=81=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fr/design/mainframe/ComponentTree.java | 182 +++++++++---------
1 file changed, 93 insertions(+), 89 deletions(-)
diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
index fb0586a693..0a268610ec 100644
--- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java
+++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
@@ -40,7 +40,7 @@ public class ComponentTree extends JTree {
TreePath[] paths = getSelectedTreePath();
addTreeSelectionListener(designer);
setSelectionPaths(paths);
-
+
designer.addDesignerEditListener(new TreeDesignerEditAdapter());
this.addMouseListener(new MouseAdapter() {
@@ -68,15 +68,19 @@ public class ComponentTree extends JTree {
setEditable(true);
}
+ public FormDesigner getDesigner() {
+ return designer;
+ }
+
/**
* 构造函数
- *
+ *
* @param designer 设计界面组件
* @param model 构造JTree的model
*/
public ComponentTree(FormDesigner designer,ComponentTreeModel model) {
- this(designer);
- this.setModel(model);
+ this(designer);
+ this.setModel(model);
}
@@ -96,17 +100,17 @@ public class ComponentTree extends JTree {
return super.isPathEditable(path);
}
- /**
- * 将值转换为文本
- * @param value 值
- * @param selected 是否选中
- * @param expanded 扩展
- * @param leaf 是否叶子
- * @param row 行
- * @param hasFocus 是否焦点
- *
- * @return 返回文本
- */
+ /**
+ * 将值转换为文本
+ * @param value 值
+ * @param selected 是否选中
+ * @param expanded 扩展
+ * @param leaf 是否叶子
+ * @param row 行
+ * @param hasFocus 是否焦点
+ *
+ * @return 返回文本
+ */
@Override
public String convertValueToText(Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
if (value != null && value instanceof XCreator) {
@@ -115,25 +119,25 @@ public class ComponentTree extends JTree {
return super.convertValueToText(value, selected, expanded, leaf, row, hasFocus);
}
}
-
+
public void setAndScrollSelectionPath(TreePath treepath) {
- setSelectionPath(treepath);
- scrollPathToVisible(treepath);
+ setSelectionPath(treepath);
+ scrollPathToVisible(treepath);
+ }
+
+ private void popupMenu(MouseEvent e) {
+ TreePath path = this.getSelectionPath();
+ if (path == null) {
+ return;
+ }
+ Component component = (Component) path.getLastPathComponent();
+ if (!(component instanceof XCreator)) {
+ return;
+ }
+ ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, (XCreator) component);
+ JPopupMenu menu = adapter.getContextPopupMenu(e);
+ menu.show(this, e.getX(), e.getY());
}
-
- private void popupMenu(MouseEvent e) {
- TreePath path = this.getSelectionPath();
- if (path == null) {
- return;
- }
- Component component = (Component) path.getLastPathComponent();
- if (!(component instanceof XCreator)) {
- return;
- }
- ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, (XCreator) component);
- JPopupMenu menu = adapter.getContextPopupMenu(e);
- menu.show(this, e.getX(), e.getY());
- }
/**
* 刷新
@@ -145,51 +149,51 @@ public class ComponentTree extends JTree {
-
- public TreePath[] getSelectedTreePath() {
- XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators();
- TreePath[] paths = new TreePath[creators.length];
-
- for (int i = 0; i < paths.length; i++) {
- paths[i] = buildTreePath(creators[i]);
- }
- return paths;
- }
-
- private class TreeDesignerEditAdapter implements DesignerEditListener {
-
- @Override
- public void fireCreatorModified(DesignerEvent evt) {
- if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
- TreePath[] paths = getSelectedTreePath();
-
- if (paths.length == 1) {
- setAndScrollSelectionPath(paths[0]);
- } else {
- setSelectionPaths(paths);
- }
- } else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
- ComponentTree.this.refreshUI();
- TreePath[] paths = getSelectedTreePath();
-
- if (paths.length == 1) {
- setAndScrollSelectionPath(paths[0]);
- } else {
- setSelectionPaths(paths);
- }
- ComponentTree.this.repaint();
-
- } else {
- ComponentTree.this.refreshUI();
- ComponentTree.this.repaint();
- }
- }
-
- @Override
- public boolean equals(Object o) {
- return o.getClass() == this.getClass();
- }
- }
+
+ public TreePath[] getSelectedTreePath() {
+ XCreator[] creators = designer.getSelectionModel().getSelection().getSelectedCreators();
+ TreePath[] paths = new TreePath[creators.length];
+
+ for (int i = 0; i < paths.length; i++) {
+ paths[i] = buildTreePath(creators[i]);
+ }
+ return paths;
+ }
+
+ private class TreeDesignerEditAdapter implements DesignerEditListener {
+
+ @Override
+ public void fireCreatorModified(DesignerEvent evt) {
+ if (evt.getCreatorEventID() == DesignerEvent.CREATOR_SELECTED) {
+ TreePath[] paths = getSelectedTreePath();
+
+ if (paths.length == 1) {
+ setAndScrollSelectionPath(paths[0]);
+ } else {
+ setSelectionPaths(paths);
+ }
+ } else if(evt.getCreatorEventID() == DesignerEvent.CREATOR_PASTED) {
+ ComponentTree.this.refreshUI();
+ TreePath[] paths = getSelectedTreePath();
+
+ if (paths.length == 1) {
+ setAndScrollSelectionPath(paths[0]);
+ } else {
+ setSelectionPaths(paths);
+ }
+ ComponentTree.this.repaint();
+
+ } else {
+ ComponentTree.this.refreshUI();
+ ComponentTree.this.repaint();
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ return o.getClass() == this.getClass();
+ }
+ }
/**
@@ -211,11 +215,11 @@ public class ComponentTree extends JTree {
paths[i] = buildTreePath(searchList.get(i));
}
if(paths.length > 0) {
- setAndScrollSelectionPath(paths[0]);
+ setAndScrollSelectionPath(paths[0]);
} else {
- setSelectionPath();
+ setSelectionPath();
}
- return paths;
+ return paths;
}
@@ -248,7 +252,7 @@ public class ComponentTree extends JTree {
* 触发
*/
public void fireTreeChanged() {
- designer.refreshDesignerUI();
+ designer.refreshDesignerUI();
}
/**
@@ -267,14 +271,14 @@ public class ComponentTree extends JTree {
ArrayList path = new ArrayList();
Component parent = comp;
- while (parent != null) {
- XCreator creator = (XCreator) parent;
- path.add(0, parent);
- if (creator != comp ) {
- creator.notShowInComponentTree(path);
- }
- parent = parent.getParent();
- }
+ while (parent != null) {
+ XCreator creator = (XCreator) parent;
+ path.add(0, parent);
+ if (creator != comp ) {
+ creator.notShowInComponentTree(path);
+ }
+ parent = parent.getParent();
+ }
Object[] components = path.toArray();
return new TreePath(components);
}
From fc3b700db1da47f99e6178bf27a743cc1d95ad09 Mon Sep 17 00:00:00 2001
From: PanLi320 <854954082@qq.com>
Date: Wed, 12 Oct 2016 10:25:02 +0800
Subject: [PATCH 42/53] =?UTF-8?q?bugfix:QQ=E6=8E=88=E6=9D=83=E6=9C=AA?=
=?UTF-8?q?=E7=BB=91=E5=AE=9A=EF=BC=8C=E8=B6=85=E9=93=BE=E4=B8=A4=E6=AC=A1?=
=?UTF-8?q?=EF=BC=8C=E5=90=8C=E6=AD=A5=E7=9A=84url=EF=BC=8C=E6=9A=82?=
=?UTF-8?q?=E6=97=B6=E5=8E=BB=E6=8E=89=EF=BC=8C=E8=AE=BA=E5=9D=9B=E9=82=A3?=
=?UTF-8?q?=E8=BE=B9=E8=BF=98=E8=A6=81=E5=81=9A=E6=94=AF=E6=8C=81=E5=A4=84?=
=?UTF-8?q?=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../design/mainframe/bbs/UserInfoLabel.java | 5 +----
.../com/fr/design/extra/PluginWebBridge.java | 5 +----
.../com/fr/design/extra/QQLoginWebBridge.java | 19 -------------------
3 files changed, 2 insertions(+), 27 deletions(-)
diff --git a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
index d0fe7dadba..460f758df6 100644
--- a/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
+++ b/designer/src/com/fr/design/mainframe/bbs/UserInfoLabel.java
@@ -284,10 +284,7 @@ public class UserInfoLabel extends UILabel{
public void mousePressed(MouseEvent e) {
if(StringUtils.isNotEmpty(userName)){
try {
- String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default") +
- "&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=" +
- "&username=" + DesignerEnvManager.getEnvManager().getBBSName() +
- "&password=" + DesignerEnvManager.getEnvManager().getBBSPassword();
+ String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl));
} catch (Exception exp) {
FRContext.getLogger().info(exp.getMessage());
diff --git a/designer_base/src/com/fr/design/extra/PluginWebBridge.java b/designer_base/src/com/fr/design/extra/PluginWebBridge.java
index b192873d8c..12c3e85c41 100644
--- a/designer_base/src/com/fr/design/extra/PluginWebBridge.java
+++ b/designer_base/src/com/fr/design/extra/PluginWebBridge.java
@@ -379,10 +379,7 @@ public class PluginWebBridge {
*/
public void getPriviteMessage() {
try {
- String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default") +
- "&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=" +
- "&username=" + DesignerEnvManager.getEnvManager().getBBSName() +
- "&password=" + DesignerEnvManager.getEnvManager().getBBSPassword();
+ String loginUrl = SiteCenter.getInstance().acquireUrlByKind("bbs.default");
Desktop.getDesktop().browse(new URI(loginUrl));
}catch (Exception exp) {
FRContext.getLogger().info(exp.getMessage());
diff --git a/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java b/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java
index 140c89748e..d0bcc27e12 100644
--- a/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java
+++ b/designer_base/src/com/fr/design/extra/QQLoginWebBridge.java
@@ -127,24 +127,5 @@ public class QQLoginWebBridge {
if (url.indexOf("qqLogin.html") > 0) {
return;
}
- if (Desktop.isDesktopSupported()) {
- try {
- //创建一个URI实例,注意不是URL
- URI uri = URI.create(url);
- //获取当前系统桌面扩展
- Desktop desktop = Desktop.getDesktop();
- //判断系统桌面是否支持要执行的功能
- if (desktop.isSupported(Desktop.Action.BROWSE)) {
- //获取系统默认浏览器打开链接
- desktop.browse(uri);
- }
- } catch (NullPointerException e) {
- //此为uri为空时抛出异常
- FRLogger.getLogger().error(e.getMessage());
- } catch (IOException e) {
- //此为无法获取系统默认浏览器
- FRLogger.getLogger().error(e.getMessage());
- }
- }
}
}
From a996143c18697dc0981714ebc53309a5263a1430 Mon Sep 17 00:00:00 2001
From: zhouping
Date: Wed, 12 Oct 2016 11:49:38 +0800
Subject: [PATCH 43/53] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=86=B2=E7=AA=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../layout/FRAbsoluteLayoutAdapter.java | 12 +-
.../designer/creator/XWAbsoluteLayout.java | 19 ++
.../FRAbsoluteLayoutPropertiesGroupModel.java | 184 +++++++++++++++++-
.../FRFitLayoutPropertiesGroupModel.java | 67 +++++--
.../properties/LayoutTypeRenderer.java | 14 ++
.../properties/LayoutTypeWrapper.java | 13 ++
.../items/FRFitConstraintsItems.java | 4 +-
.../properties/items/FRLayoutTypeItems.java | 16 ++
.../designer/treeview/ComponentTreeModel.java | 27 ++-
.../fr/design/gui/core/FormWidgetOption.java | 2 +-
.../fr/design/mainframe/ComponentTree.java | 9 +
.../design/mainframe/FormParaWidgetPane.java | 9 +-
.../widget/editors/LayoutTypeEditor.java | 15 ++
13 files changed, 360 insertions(+), 31 deletions(-)
create mode 100644 designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
create mode 100644 designer_form/src/com/fr/design/designer/properties/LayoutTypeWrapper.java
create mode 100644 designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java
create mode 100644 designer_form/src/com/fr/design/mainframe/widget/editors/LayoutTypeEditor.java
diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
index 3c0f1155c6..8e0a725cd4 100644
--- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
+++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
@@ -12,6 +12,7 @@ import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.design.utils.ComponentUtils;
import com.fr.design.utils.gui.LayoutUtils;
+import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
@@ -330,6 +331,15 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
@Override
public GroupModel getLayoutProperties() {
XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container;
- return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout);
+ if (xwAbsoluteLayout.toData().isAbsoluteLayoutAsBody()){
+ //如果body是绝对布局,那么获取原来自适应body的属性--布局类型
+ WBodyLayoutType layoutType = WBodyLayoutType.FIT;
+ if (container.getParent() != null) {
+ layoutType = ((XWFitLayout)container.getParent()).toData().getBodyLayoutType();
+ }
+ return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout, layoutType);
+ } else {
+ return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout);
+ }
}
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
index a1fc32c402..9ac9addc7f 100644
--- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
+++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
@@ -75,9 +75,17 @@ public class XWAbsoluteLayout extends XLayoutContainer {
xConnectorMap.put(connector, new XConnector(connector, this));
}
+ this.editable = widget.isAbsoluteLayoutAsBody();
+
initPercent();
}
+ public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize, boolean isAbsoluteLayoutAsBody) {
+ this(widget, initSize);
+ widget.setAbsoluteLayoutAsBody(isAbsoluteLayoutAsBody);
+ this.editable = isAbsoluteLayoutAsBody;
+ }
+
/**
* 初始化时默认的组件大小
*
@@ -443,4 +451,15 @@ public class XWAbsoluteLayout extends XLayoutContainer {
}
}
}
+
+ /**
+ * 设置布局是否可编辑,不可则显示编辑蒙层
+ * 假如是body的话,始终要能编辑,不会出现蒙层
+ *
+ * @param isEditable 可否编辑
+ */
+ @Override
+ public void setEditable(boolean isEditable) {
+ super.setEditable(toData().isAbsoluteLayoutAsBody() || isEditable);
+ }
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
index fc9c0985cd..f8b695a333 100644
--- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
+++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
@@ -2,27 +2,40 @@ package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XWAbsoluteLayout;
+import com.fr.design.designer.creator.XWFitLayout;
+import com.fr.design.mainframe.FormDesigner;
+import com.fr.design.mainframe.FormSelectionUtils;
+import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.AbsoluteLayoutDirectionEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
+import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
+import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
+import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.general.Inter;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.util.Arrays;
+import java.util.Comparator;
/**
* Created by zhouping on 2016/8/1.
*/
public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
-
private PropertyCellEditor editor;
private DefaultTableCellRenderer renderer;
private AbsoluteLayoutDirectionEditor stateEditor;
private AbsoluteStateRenderer stateRenderer;
private WAbsoluteLayout layout;
private XWAbsoluteLayout xwAbsoluteLayout;
+ private LayoutTypeEditor layoutTypeEditor;
+ private LayoutTypeRenderer layoutTypeRenderer;
+ //默认body是0,自适应布局;1,绝对布局.
+ private WBodyLayoutType layoutType = WBodyLayoutType.FIT;
public FRAbsoluteLayoutPropertiesGroupModel(XWAbsoluteLayout xwAbsoluteLayout){
this.xwAbsoluteLayout = xwAbsoluteLayout;
@@ -33,31 +46,65 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
stateRenderer = new AbsoluteStateRenderer();
}
+ public FRAbsoluteLayoutPropertiesGroupModel(XWAbsoluteLayout xwAbsoluteLayout, WBodyLayoutType layoutType){
+ this(xwAbsoluteLayout);
+ this.layoutTypeEditor = new LayoutTypeEditor();
+ this.layoutTypeRenderer = new LayoutTypeRenderer();
+ this.layoutType = layoutType;
+ }
+
/**
* 布局管理器自己的属性
*/
@Override
public String getGroupName() {
- return Inter.getLocText("FR-Designer-Widget_Area_Scaling");
+ return Inter.getLocText(layoutType == WBodyLayoutType.ABSOLUTE ? "FR-Designer_Attr_Layout" : "FR-Designer-Widget_Area_Scaling");
}
@Override
public int getRowCount() {
- return 1;
+ return layoutType == WBodyLayoutType.ABSOLUTE ? 2 : 1;
}
@Override
public TableCellRenderer getRenderer(int row) {
- return stateRenderer;
+ if (layoutType == WBodyLayoutType.ABSOLUTE) {
+ return row == 0 ? layoutTypeRenderer : stateRenderer;
+ }
+ else {
+ return stateRenderer;
+ }
}
@Override
public TableCellEditor getEditor(int row) {
- return stateEditor;
+ if (layoutType == WBodyLayoutType.ABSOLUTE) {
+ return row == 0 ? layoutTypeEditor : stateEditor;
+ }
+ else{
+ return stateEditor;
+ }
}
@Override
public Object getValue(int row, int column) {
+ if (layoutType == WBodyLayoutType.ABSOLUTE){
+ if (column == 0) {
+ switch (row) {
+ case 0:
+ return Inter.getLocText("FR-Designer_Attr_Layout_Type");
+ default:
+ return Inter.getLocText("FR-Designer-Widget_Scaling_Mode");
+ }
+ } else {
+ switch (row) {
+ case 0:
+ return layoutType.getTypeValue();
+ default:
+ return layout.getCompState();
+ }
+ }
+ }
if (column == 0) {
return Inter.getLocText("FR-Designer-Widget_Scaling_Mode");
} else {
@@ -67,6 +114,42 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
@Override
public boolean setValue(Object value, int row, int column) {
+ if (layoutType == WBodyLayoutType.ABSOLUTE){
+ int state = 0;
+ if(value instanceof Integer) {
+ state = (Integer)value;
+ }
+ if (column == 0 || state < 0) {
+ return false;
+ } else {
+ if (row == 0) {
+ if (state == WBodyLayoutType.FIT.getTypeValue()) {
+ XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
+ Component[] components = xwAbsoluteLayout.getComponents();
+
+ Arrays.sort(components, new ComparatorComponentLocation());
+
+ xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
+ xfl.remove(xwAbsoluteLayout);
+ xfl.toData().setLayoutType(WBodyLayoutType.FIT);
+
+ for (Component comp : components) {
+ xfl.add(comp);
+ }
+ moveComponents2FitLayout(xfl, components);
+ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
+ formDesigner.getSelectionModel().setSelectedCreators(
+ FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
+ return true;
+ }
+ }
+ if (row == 1) {
+ layout.setCompState(state);
+ return true;
+ }
+ return false;
+ }
+ }
int state = 0;
if(value instanceof Integer) {
state = (Integer)value;
@@ -91,4 +174,95 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
public boolean isEditable(int row) {
return true;
}
+
+ //把绝对布局中的元素按规则移动到自适应布局中
+ private void moveComponents2FitLayout(XWFitLayout xwFitLayout, Component[] components) {
+ int eachRowCount = 4;
+ if (components.length <= 1){
+ return;
+ }
+ int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight();
+ int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom();
+ int leftMargin = xwFitLayout.toData().getMargin().getLeft();
+ int topMargin = xwFitLayout.toData().getMargin().getTop();
+ int row = (components.length / eachRowCount) + (components.length % eachRowCount == 0 ? 0 : 1);
+ //最后一行的列数不定
+ int column = components.length % eachRowCount;
+ int componentWidth = layoutWidth / eachRowCount;
+ int componentHeight = layoutHeight / row;
+ for(int i = 0;i < row - 1;i++){
+ for(int j = 0;j < eachRowCount;j++){
+ components[eachRowCount * i + j].setBounds(
+ leftMargin + componentWidth * j,
+ topMargin + componentHeight * i,
+ j == eachRowCount - 1 ? layoutWidth - componentWidth * (eachRowCount-1) : componentWidth,
+ componentHeight
+ );
+ }
+ }
+ //最后一行列数是特殊的,要单独处理
+ int lastRowWidth = layoutWidth / column;
+ int lastRowHeight = layoutHeight - componentHeight * (row - 1);
+ for (int i = 0;i < column;i++) {
+ components[eachRowCount * (row - 1) + i].setBounds(
+ leftMargin + lastRowWidth * i,
+ topMargin + componentHeight * (row - 1),
+ i == column - 1 ? layoutWidth - lastRowWidth * (column-1) : lastRowWidth,
+ lastRowHeight
+ );
+ }
+ xwFitLayout.updateBoundsWidget();
+ }
+
+ private class ComponentLocationInfo{
+ private Component component;
+ private int horizontalNO;
+ private int verticalNO;
+
+ public ComponentLocationInfo(Component component, int horizontalNO, int verticalNO){
+ this.component = component;
+ this.horizontalNO = horizontalNO;
+ this.verticalNO = verticalNO;
+ }
+
+ public int getHorizontalNO() {
+ return this.horizontalNO;
+ }
+
+ public int getVerticalNO() {
+ return this.verticalNO;
+ }
+
+ public void setHorizontalNO(int horizontalNO){
+ this.horizontalNO = horizontalNO;
+ }
+
+ public void setVerticalNO(int verticalNO){
+ this.verticalNO = verticalNO;
+ }
+ }
+
+ //以组件的位置来确定先后顺序,y小的在前,x小的在前
+ private class ComparatorComponentLocation implements Comparator {
+ @Override
+ public int compare(Object o1, Object o2) {
+ if(((Component)o1).getY() < ((Component)o2).getY()){
+ return -1;
+ }
+ else if (((Component)o1).getY() > ((Component)o2).getY()) {
+ return 1;
+ }
+ else {
+ if (((Component)o1).getX() < ((Component)o2).getX()){
+ return -1;
+ }
+ else if (((Component)o1).getX() > ((Component)o2).getX()) {
+ return 1;
+ }
+ else{
+ return 0;
+ }
+ }
+ }
+ }
}
diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
index 8a2f507936..25680581c0 100644
--- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
+++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
@@ -4,16 +4,25 @@
package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
+import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWFitLayout;
+import com.fr.design.mainframe.FormDesigner;
+import com.fr.design.mainframe.FormSelectionUtils;
+import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.FitLayoutDirectionEditor;
+import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
+import com.fr.form.ui.Widget;
+import com.fr.form.ui.container.WAbsoluteLayout;
+import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
import com.fr.general.Inter;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
+import java.awt.*;
/**
* 自适应布局自身的属性表
@@ -28,6 +37,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
private DefaultTableCellRenderer renderer;
private FitLayoutDirectionEditor stateEditor;
private FitStateRenderer stateRenderer;
+ private LayoutTypeEditor layoutTypeEditor;
+ private LayoutTypeRenderer layoutTypeRenderer;
private WFitLayout layout;
private XWFitLayout xfl;
@@ -38,6 +49,8 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
editor = new PropertyCellEditor(new IntegerPropertyEditor());
stateEditor = new FitLayoutDirectionEditor();
stateRenderer = new FitStateRenderer();
+ layoutTypeEditor = new LayoutTypeEditor();
+ layoutTypeRenderer = new LayoutTypeRenderer();
}
/**
@@ -45,31 +58,35 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
*/
@Override
public String getGroupName() {
- return Inter.getLocText("FR-Designer-Layout_Adaptive_Layout");
+ return Inter.getLocText("FR-Designer_Layout");
}
@Override
public int getRowCount() {
- return 2;
+ return 3;
}
@Override
public TableCellRenderer getRenderer(int row) {
switch (row) {
case 0:
- return renderer;
+ return layoutTypeRenderer;
+ case 1:
+ return stateRenderer;
default:
- return stateRenderer;
+ return renderer;
}
}
@Override
public TableCellEditor getEditor(int row) {
switch (row) {
- case 0:
- return editor;
+ case 0:
+ return layoutTypeEditor;
+ case 1:
+ return stateEditor;
default:
- return stateEditor;
+ return editor;
}
}
@@ -78,16 +95,20 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
if (column == 0) {
switch (row) {
case 0:
- return Inter.getLocText("FR-Designer_Component_Interval");
+ return Inter.getLocText("FR-Designer_Attr_Layout_Type");
+ case 1:
+ return Inter.getLocText("FR-Designer_Component_Scale");
default:
- return Inter.getLocText("FR-Designer_Component_Scale");
+ return Inter.getLocText("FR-Designer_Component_Interval");
}
} else {
switch (row) {
case 0:
- return layout.getCompInterval();
+ return layout.getBodyLayoutType().getTypeValue();
+ case 1:
+ return layout.getCompState();
default:
- return layout.getCompState();
+ return layout.getCompInterval();
}
}
}
@@ -101,13 +122,35 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
if (column == 0 || state < 0) {
return false;
} else {
- if (row ==0 && xfl.canAddInterval(state)) {
+ if (row == 2 && xfl.canAddInterval(state)) {
// 设置完间隔后,要同步处理界面组件,容器刷新后显示出对应效果
setLayoutGap(state);
return true;
}else if (row == 1) {
layout.setCompState(state);
return true;
+ }else if (row == 0) {
+ layout.setLayoutType(WBodyLayoutType.parse(state));
+ if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
+ WAbsoluteLayout wAbsoluteLayout = new WAbsoluteLayout("body");
+ wAbsoluteLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
+ Component[] components = xfl.getComponents();
+ xfl.removeAll();
+ XWAbsoluteLayout xwAbsoluteLayout = new XWAbsoluteLayout(wAbsoluteLayout, new Dimension(0,0), true);
+ xfl.getLayoutAdapter().addBean(xwAbsoluteLayout, 0, 0);
+ for (Component component : components) {
+ xwAbsoluteLayout.add(component);
+ }
+ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
+ formDesigner.getSelectionModel().setSelectedCreators(
+ FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteLayout}));
+ }
+ else {
+ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
+ formDesigner.getSelectionModel().setSelectedCreators(
+ FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
+ }
+ return true;
}
return false;
}
diff --git a/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java b/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
new file mode 100644
index 0000000000..033552028b
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
@@ -0,0 +1,14 @@
+package com.fr.design.designer.properties;
+
+import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
+
+/**
+ * Created by zhouping on 2016/9/18.
+ */
+public class LayoutTypeRenderer extends EncoderCellRenderer {
+
+ public LayoutTypeRenderer() {
+ super(new LayoutTypeWrapper());
+ }
+
+}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/properties/LayoutTypeWrapper.java b/designer_form/src/com/fr/design/designer/properties/LayoutTypeWrapper.java
new file mode 100644
index 0000000000..4630fe784a
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/properties/LayoutTypeWrapper.java
@@ -0,0 +1,13 @@
+package com.fr.design.designer.properties;
+
+import com.fr.design.designer.properties.items.FRLayoutTypeItems;
+
+/**
+ * Created by zhouping on 2016/9/18.
+ */
+public class LayoutTypeWrapper extends ItemWrapper{
+
+ public LayoutTypeWrapper() {
+ super(new FRLayoutTypeItems());
+ }
+}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/properties/items/FRFitConstraintsItems.java b/designer_form/src/com/fr/design/designer/properties/items/FRFitConstraintsItems.java
index 6ae6f22c8c..92e63bf1ad 100644
--- a/designer_form/src/com/fr/design/designer/properties/items/FRFitConstraintsItems.java
+++ b/designer_form/src/com/fr/design/designer/properties/items/FRFitConstraintsItems.java
@@ -13,8 +13,8 @@ import com.fr.general.Inter;
public class FRFitConstraintsItems implements ItemProvider{
public static final Item[] ITEMS = new Item[] {
- new Item(Inter.getLocText("Adaptive_Full_Area"), WFitLayout.STATE_FULL),
- new Item(Inter.getLocText("Adaptive_Original_Scale"), WFitLayout.STATE_ORIGIN)};
+ new Item(Inter.getLocText("FR-Designer_Attr_Bidirectional_Adaptive"), WFitLayout.STATE_FULL),
+ new Item(Inter.getLocText("FR_Designer_Attr_Horizontal_Adaptive"), WFitLayout.STATE_ORIGIN)};
public Item[] getItems() {
return ITEMS;
diff --git a/designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java b/designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java
new file mode 100644
index 0000000000..a19d975170
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/properties/items/FRLayoutTypeItems.java
@@ -0,0 +1,16 @@
+package com.fr.design.designer.properties.items;
+
+import com.fr.form.ui.container.WBodyLayoutType;
+
+/**
+ * Created by zhouping on 2016/9/18.
+ */
+public class FRLayoutTypeItems implements ItemProvider{
+ public static final Item[] ITEMS = new Item[] {
+ new Item(WBodyLayoutType.FIT.description(), WBodyLayoutType.FIT.getTypeValue()),
+ new Item(WBodyLayoutType.ABSOLUTE.description(), WBodyLayoutType.ABSOLUTE.getTypeValue())};
+
+ public Item[] getItems() {
+ return ITEMS;
+ }
+}
diff --git a/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java b/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
index f189bcada2..e94ea1ad05 100644
--- a/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
+++ b/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
@@ -10,11 +10,9 @@ import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import com.fr.base.FRContext;
+import com.fr.design.designer.creator.*;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.designer.beans.events.DesignerEvent;
-import com.fr.design.designer.creator.XCreator;
-import com.fr.design.designer.creator.XLayoutContainer;
-import com.fr.design.designer.creator.XWidgetCreator;
import com.fr.form.ui.Widget;
public class ComponentTreeModel implements TreeModel {
@@ -23,6 +21,8 @@ public class ComponentTreeModel implements TreeModel {
private Component root;
private FormDesigner designer;
+ private final int ABSOLUTE_AS_BODY_NOT_FOUND = -1;
+
public ComponentTreeModel(FormDesigner designer, Component root) {
this.designer = designer;
this.root = root;
@@ -38,6 +38,11 @@ public class ComponentTreeModel implements TreeModel {
if (parent != null && parent instanceof XLayoutContainer) {
XLayoutContainer xlayout = (XLayoutContainer) parent;
XCreator creator = xlayout.getXCreator(index);
+ //绝对布局作为body的时候不显示自适应布局父层
+ int absoluteBodyIndex = getAbsoluteBodyIndex(creator);
+ if (absoluteBodyIndex > ABSOLUTE_AS_BODY_NOT_FOUND){
+ return creator.getComponent(absoluteBodyIndex);
+ }
return creator.getXCreator();
}
return null;
@@ -135,4 +140,20 @@ public class ComponentTreeModel implements TreeModel {
FRContext.getLogger().error(e.getMessage(), e);
}
}
+
+ private int getAbsoluteBodyIndex(XCreator xCreator){
+ //绝对布局作为body,父层是自适应布局,找到绝对布局位于父层的index
+ int index = ABSOLUTE_AS_BODY_NOT_FOUND;
+ if (xCreator.acceptType(XWFitLayout.class)){
+ XWFitLayout bodyFitLayout = (XWFitLayout)xCreator;
+ for (int i = 0;i < bodyFitLayout.getXCreatorCount();i++){
+ //类型是绝对布局并且还是body
+ if (bodyFitLayout.getXCreator(i).acceptType(XWAbsoluteLayout.class)
+ && ((XWAbsoluteLayout)bodyFitLayout.getXCreator(i)).toData().isAbsoluteLayoutAsBody()){
+ index = i;
+ }
+ }
+ }
+ return index;
+ }
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java b/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java
index 214d2cd679..b3fa73a26d 100644
--- a/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java
+++ b/designer_form/src/com/fr/design/gui/core/FormWidgetOption.java
@@ -1 +1 @@
-package com.fr.design.gui.core;
import javax.swing.Icon;
import com.fr.base.BaseUtils;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WHorizontalBoxLayout;
import com.fr.form.ui.container.WParameterLayout;
import com.fr.form.ui.container.WVerticalBoxLayout;
import com.fr.general.Inter;
/**
* Author : Shockway
* Date: 13-6-17
* Time: 上午10:40
*/
public class FormWidgetOption extends WidgetOption {
/**
* 返回名字
* @return 名字
*/
@Override
public String optionName() {
return null;
}
/**
* 返回图标
* @return 图标
*/
@Override
public Icon optionIcon() {
return null;
}
/**
* 组件类
* @return 类
*/
@Override
public Class extends Widget> widgetClass() {
return null;
}
/**
* 返回组件
* @return 控件
*/
@Override
public Widget createWidget() {
return null;
}
/*
* 表单容器
*/
public static WidgetOption[] getFormContainerInstance() {
return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER,
CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER };
}
/**
* 表单工具栏上的布局
* @return 控件
*/
public static WidgetOption[] getFormLayoutInstance() {
return new WidgetOption[] {CARDLAYOUTCONTAINER, ABSOLUTELAYOUTCONTAINER};
}
public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_AbsoluteLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute_new.png"),
WAbsoluteLayout.class);
public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"),
WBorderLayout.class);
public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_CardLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"),
WCardLayout.class);
public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"),
WHorizontalBoxLayout.class);
public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"),
WVerticalBoxLayout.class);
public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"),
BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"),
WFitLayout.class);
public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"),
WParameterLayout.class);
public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"),
ElementCaseEditor.class);
}
\ No newline at end of file
+package com.fr.design.gui.core;
import javax.swing.Icon;
import com.fr.base.BaseUtils;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBorderLayout;
import com.fr.form.ui.container.WCardLayout;
import com.fr.form.ui.container.WFitLayout;
import com.fr.form.ui.container.WHorizontalBoxLayout;
import com.fr.form.ui.container.WParameterLayout;
import com.fr.form.ui.container.WVerticalBoxLayout;
import com.fr.general.Inter;
/**
* Author : Shockway
* Date: 13-6-17
* Time: 上午10:40
*/
public class FormWidgetOption extends WidgetOption {
/**
* 返回名字
* @return 名字
*/
@Override
public String optionName() {
return null;
}
/**
* 返回图标
* @return 图标
*/
@Override
public Icon optionIcon() {
return null;
}
/**
* 组件类
* @return 类
*/
@Override
public Class extends Widget> widgetClass() {
return null;
}
/**
* 返回组件
* @return 控件
*/
@Override
public Widget createWidget() {
return null;
}
/*
* 表单容器
*/
public static WidgetOption[] getFormContainerInstance() {
return new WidgetOption[] { ABSOLUTELAYOUTCONTAINER, BORDERLAYOUTCONTAINER, HORIZONTALBOXLAYOUTCONTAINER, VERTICALBOXLAYOUTCONTAINER,
CARDLAYOUTCONTAINER, FITLAYOUTCONTAINER };
}
/**
* 表单工具栏上的布局
* @return 控件
*/
public static WidgetOption[] getFormLayoutInstance() {
return new WidgetOption[] {CARDLAYOUTCONTAINER, ABSOLUTELAYOUTCONTAINER};
}
public static final WidgetOption ABSOLUTELAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Layout_Block_Absolute"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_absolute_new.png"),
WAbsoluteLayout.class);
public static final WidgetOption BORDERLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_BorderLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_border.png"),
WBorderLayout.class);
public static final WidgetOption CARDLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Layout_Block_Tab"), BaseUtils.readIcon("/com/fr/web/images/form/resources/card_layout_16.png"),
WCardLayout.class);
public static final WidgetOption HORIZONTALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Layout-HBox"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_h_16.png"),
WHorizontalBoxLayout.class);
public static final WidgetOption VERTICALBOXLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_VerticalBoxLayout"), BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"),
WVerticalBoxLayout.class);
public static final WidgetOption FITLAYOUTCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter.getLocText("FR-Designer-Layout_Adaptive_Layout"),
BaseUtils.readIcon("/com/fr/web/images/form/resources/boxlayout_v_16.png"),
WFitLayout.class);
public static final WidgetOption PARAMETERCONTAINER = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Para-Body"), BaseUtils.readIcon("/com/fr/web/images/form/resources/layout_parameter.png"),
WParameterLayout.class);
public static final WidgetOption ELEMENTCASE = WidgetOptionFactory.createByWidgetClass(Inter
.getLocText("FR-Designer_Form-Report"), BaseUtils.readIcon("/com/fr/web/images/form/resources/report_16.png"),
ElementCaseEditor.class);
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
index 0a268610ec..4cf0d2528c 100644
--- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java
+++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
@@ -18,6 +18,8 @@ import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
+import com.fr.design.designer.creator.XWAbsoluteLayout;
+import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.treeview.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.stable.StringUtils;
@@ -277,6 +279,13 @@ public class ComponentTree extends JTree {
if (creator != comp ) {
creator.notShowInComponentTree(path);
}
+ //绝对布局作为body的时候不显示自适应布局父层
+ if (((XCreator) parent).acceptType(XWAbsoluteLayout.class)
+ && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)
+ && ((XWAbsoluteLayout)parent).toData().isAbsoluteLayoutAsBody()){
+ parent = parent.getParent().getParent();
+ continue;
+ }
parent = parent.getParent();
}
Object[] components = path.toArray();
diff --git a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java
index 8118d4da27..cb111bb929 100644
--- a/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java
+++ b/designer_form/src/com/fr/design/mainframe/FormParaWidgetPane.java
@@ -94,12 +94,6 @@ public class FormParaWidgetPane extends JPanel{
private void initFormParaComponent() {
this.removeAll();
// 菜单中的布局先注释掉
-
- JPanel reportPane = new JPanel(new FlowLayout());
- reportPane.add(new ToolBarButton(FormWidgetOption.ELEMENTCASE));
- add(createNormalCombinationPane(reportPane,Inter.getLocText("FR-Designer-Form-ToolBar_Report")));
- add(createJSeparator());
-
JPanel paraPane = new JPanel(new FlowLayout());
ToolBarButton paraButton = new paraButton(FormWidgetOption.PARAMETERCONTAINER);
paraPane.add(paraButton);
@@ -111,7 +105,8 @@ public class FormParaWidgetPane extends JPanel{
for(WidgetOption option : loadLayoutOptions()){
layoutPane.add(new ToolBarButton(option));
}
- add(createNormalCombinationPane(layoutPane,Inter.getLocText("FR-Designer_Layout")));
+ layoutPane.add(new ToolBarButton(FormWidgetOption.ELEMENTCASE));
+ add(createNormalCombinationPane(layoutPane,Inter.getLocText("FR-Designer_Layout_Block_Blank")));
jSeparatorLayout = createJSeparator();
add(jSeparatorLayout);
diff --git a/designer_form/src/com/fr/design/mainframe/widget/editors/LayoutTypeEditor.java b/designer_form/src/com/fr/design/mainframe/widget/editors/LayoutTypeEditor.java
new file mode 100644
index 0000000000..05de57f52c
--- /dev/null
+++ b/designer_form/src/com/fr/design/mainframe/widget/editors/LayoutTypeEditor.java
@@ -0,0 +1,15 @@
+package com.fr.design.mainframe.widget.editors;
+
+import com.fr.design.designer.properties.EnumerationEditor;
+import com.fr.design.designer.properties.items.FRLayoutTypeItems;
+
+/**
+ * Created by zhouping on 2016/9/18.
+ */
+public class LayoutTypeEditor extends EnumerationEditor {
+
+ public LayoutTypeEditor() {
+ super(new FRLayoutTypeItems());
+ }
+
+}
\ No newline at end of file
From 74e8773a81c78181b50a6f9a0ede910c81a7347e Mon Sep 17 00:00:00 2001
From: zack
Date: Thu, 13 Oct 2016 10:07:45 +0800
Subject: [PATCH 44/53] =?UTF-8?q?dev=E6=89=93=E5=8C=85=E5=A4=B1=E8=B4=A5?=
=?UTF-8?q?=EF=BC=8C=E5=85=88=E6=8A=8Axcreator=E4=BC=A0=E4=B8=80=E4=B8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fr/design/designer/creator/XCreator.java | 133 +++++++++++-------
1 file changed, 85 insertions(+), 48 deletions(-)
diff --git a/designer_form/src/com/fr/design/designer/creator/XCreator.java b/designer_form/src/com/fr/design/designer/creator/XCreator.java
index ab08de3fea..552402398a 100644
--- a/designer_form/src/com/fr/design/designer/creator/XCreator.java
+++ b/designer_form/src/com/fr/design/designer/creator/XCreator.java
@@ -15,6 +15,7 @@ import com.fr.design.utils.gui.LayoutUtils;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WTitleLayout;
import com.fr.stable.StableUtils;
+import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.border.Border;
@@ -27,7 +28,7 @@ import java.util.List;
/**
* @author richer
* @since 6.5.3 com.fr.base.listener.OB的设计组件
- *
+ *
*/
public abstract class XCreator extends JPanel implements XComponent, XCreatorTools {
@@ -44,6 +45,8 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
// XCreator加入到某些XLayoutContainer中时,能调整宽度或者高度
private int[] directions;
private Rectangle backupBound;
+ private String shareId = StringUtils.EMPTY;//如果组件是共享的会有这个属性
+ private boolean isHelpBtnOnFocus = false;//焦点是否在帮助按钮上
public XCreator(Widget ob, Dimension initSize) {
this.data = ob;
@@ -83,7 +86,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
setSize(this.backupSize);
}
}
-
+
/**
* 备份当前大小
*/
@@ -113,76 +116,76 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public XLayoutContainer getTopLayout(){
return null;
}
-
+
/**
* 获取当前XCreator的一个封装父容器
- *
+ *
* @param widgetName 当前组件名
- *
+ *
* @return 封装的父容器
- *
+ *
*
* @date 2014-11-25-下午4:47:23
- *
+ *
*/
protected XLayoutContainer getCreatorWrapper(String widgetName){
return new XWTitleLayout();
}
-
+
/**
* 将当前对象添加到父容器中
- *
+ *
* @param parentPanel 父容器组件
- *
+ *
*
* @date 2014-11-25-下午4:57:55
- *
+ *
*/
- protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){
+ protected void addToWrapper(XLayoutContainer parentPanel, int width, int minHeight){
parentPanel.add(this, WTitleLayout.BODY);
}
-
+
/**
* 设置父容器的名字
- *
+ *
* @param parentPanel 当前父容器
* @param widgetName 当前控件名
- *
+ *
*
* @date 2014-11-27-上午9:47:00
- *
+ *
*/
protected void setWrapperName(XLayoutContainer parentPanel, String widgetName){
parentPanel.toData().setWidgetName(widgetName);
}
-
+
/**
* 初始化当前组件的父容器
* 大体分为三种: Scale缩放型, Title标题型, Border自定义标题栏
- *
+ *
* @param minHeight 最小高度
- *
+ *
* @return 父容器
- *
+ *
*
* @date 2014-11-25-下午5:15:23
- *
+ *
*/
public XLayoutContainer initCreatorWrapper(int minHeight){
XLayoutContainer parentPanel;
String widgetName = this.toData().getWidgetName();
parentPanel = this.getCreatorWrapper(widgetName);
-
+
int width = this.getWidth();
int height = this.getHeight();
-
+
parentPanel.setLocation(this.getX(), this.getY());
parentPanel.setSize(width, height);
setWrapperName(parentPanel, widgetName);
this.setLocation(0, 0);
this.addToWrapper(parentPanel, width, minHeight);
LayoutUtils.layoutRootContainer(parentPanel);
-
+
return parentPanel;
}
@@ -291,7 +294,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public Dimension getMinimumSize() {
return new Dimension(0, 0);
}
-
+
/**
* 是否支持切换到报表界面编辑
* @return 是则返回true
@@ -299,7 +302,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean isReport(){
return false;
}
-
+
/**
* 该组件是否可以拖入参数面板
* @return 是则返回true
@@ -359,7 +362,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void setBackupBound(Rectangle rec) {
this.backupBound = rec;
}
-
+
/**
* 控件树不显示此组件
* @param path 控件树list
@@ -367,7 +370,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void notShowInComponentTree(ArrayList path) {
return;
}
-
+
/**
* 重置组件的名称
* @param name 名称
@@ -375,7 +378,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void resetCreatorName(String name) {
toData().setWidgetName(name);
}
-
+
/**
* 返回编辑的子组件,scale为其内部组件
* @return 组件
@@ -383,7 +386,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public XCreator getEditingChildCreator() {
return this;
}
-
+
/**
* 返回对应属性表的组件,scale和title返回其子组件
* @return 组件
@@ -391,7 +394,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public XCreator getPropertyDescriptorCreator() {
return this;
}
-
+
/**
* 更新子组件的Bound; 没有不处理
* @param minHeight 最小高度
@@ -399,7 +402,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void updateChildBound(int minHeight) {
return;
}
-
+
/**
* 是否作为控件树的叶子节点
* @return 是则返回true
@@ -407,7 +410,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean isComponentTreeLeaf() {
return true;
}
-
+
/**
* 是否为sclae和title专属容器
* @return 是则返回true
@@ -415,7 +418,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean isDedicateContainer() {
return false;
}
-
+
/**
* 是否接收这种类型
* @param acceptTypes 接收的类型
@@ -432,13 +435,13 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
/**
* 是否组件要缩放(自适应里部分组件需要, 如数字、文本、下拉框、下拉复选框、密码、下拉树、下拉复选树、日期)
- *
+ *
* @return 是则返回true
*/
public boolean shouldScaleCreator() {
return false;
}
-
+
/**
* 是否支持标题样式
* @return 默认false
@@ -446,10 +449,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean hasTitleStyle() {
return false;
}
-
+
/**
* 响应点击事件
- *
+ *
* @param editingMouseListener 鼠标点击,位置处理器
* @param e 鼠标点击事件
*/
@@ -468,10 +471,10 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
}
}
}
-
+
/**
* 删除相关组件
- *
+ *
* @param creator 当前组件
* @param designer 表单设计器
*
@@ -479,17 +482,17 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void deleteRelatedComponent(XCreator creator,FormDesigner designer){
return;
}
-
+
/**
* 选择相关组件
- *
+ *
* @param creator 当前组件
- *
+ *
*/
public void seleteRelatedComponent(XCreator creator){
return;
}
-
+
/**
* 返回组件
* @return
@@ -498,7 +501,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public XCreator getXCreator(){
return this;
}
-
+
/**
* 按百分比调整组件
* @param percent 百分比
@@ -507,7 +510,7 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public void adjustCompSize(double percent){
return;
}
-
+
/**
* 返回一些需要的子组件
* @return 返回一些需要的子组件
@@ -516,11 +519,11 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public ArrayList> getTargetChildrenList(){
return new ArrayList();
}
-
+
public XLayoutContainer getOuterLayout(){
return this.getBackupParent();
}
-
+
/**
* 重新调整子组件宽度
* @param width 宽度
@@ -553,4 +556,38 @@ public abstract class XCreator extends JPanel implements XComponent, XCreatorToo
public boolean supportRenameInWidgetTree() {
return true;
}
+
+ /**
+ * 组件是否是共享组件
+ * @return 是否是共享组件
+ */
+ public boolean isShared() {
+ return StringUtils.isNotEmpty(shareId);
+ }
+
+ public void setShareId(String shareId) {
+ this.shareId = shareId;
+ }
+
+ public String getShareId() {
+ return shareId;
+ }
+
+ /**
+ * 焦点是否在帮助按钮上
+ * @return 焦点是否在帮助按钮上
+ */
+ public boolean isHelpBtnOnFocus() {
+ return isHelpBtnOnFocus;
+ }
+
+ public void setHelpBtnOnFocus(boolean helpBtnOnFocus) {
+ isHelpBtnOnFocus = helpBtnOnFocus;
+ }
+
+ /**
+ * 设置共享帮助信息
+ * @param msg 帮助信息
+ */
+ public void setSharedMsg(String msg){}
}
\ No newline at end of file
From 07b771326aabd4be5332135501d3b8c1cc25051f Mon Sep 17 00:00:00 2001
From: kerry
Date: Thu, 13 Oct 2016 10:54:10 +0800
Subject: [PATCH 45/53] =?UTF-8?q?REPORT-338=20=20=E6=97=A5=E6=96=87?=
=?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8=EF=BC=8C=E8=B6=85=E9=93=BE=E6=8E=A5?=
=?UTF-8?q?=E5=AF=B9=E8=AF=9D=E6=A1=86=E9=80=89=E9=A1=B9=E6=97=A0=E6=95=88?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../hyperlink/AbstractHyperlinkPane.java | 2 +-
.../hyperlink/HyperlinkTargetFrame.java | 44 +++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)
create mode 100644 designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
index bc54473291..6a236a4e34 100644
--- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
+++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
@@ -127,7 +127,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe
public void updateBean(T link) {
updateSubHyperlinkBean(link);
- link.setTargetFrame((String) targetFrameComboBox.getSelectedItem());
+ link.setTargetFrame(HyperlinkTargetFrame.getName(targetFrameComboBox.getSelectedIndex()));
link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue());
link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue());
}
diff --git a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
new file mode 100644
index 0000000000..56d590f039
--- /dev/null
+++ b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
@@ -0,0 +1,44 @@
+package com.fr.design.hyperlink;
+
+/**
+ * Created by ibm on 2016/10/13.
+ */
+public enum HyperlinkTargetFrame {
+ BLANK_FRAME("_blank", 0), DIALOG_FRAME("_dialog", 1), SELF_FRAME("_self", 2);
+
+ private String name;
+ private int index;
+
+
+ HyperlinkTargetFrame(String name, int index) {
+ this.name = name;
+ this.index = index;
+ }
+
+ public static String getName(int index) {
+ for (HyperlinkTargetFrame hyperlinkTargetFrame : HyperlinkTargetFrame.values()) {
+ if (hyperlinkTargetFrame.getIndex() == index) {
+ return hyperlinkTargetFrame.name;
+ }
+ }
+ return null;
+ }
+
+ public int getIndex() {
+ return index;
+ }
+
+ public void setIndex(int index) {
+ this.index = index;
+ }
+
+ public String getName() {
+ return name;
+
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
+
From e79268436682c6c45114f27157d5b4940e498053 Mon Sep 17 00:00:00 2001
From: kerry
Date: Thu, 13 Oct 2016 11:29:21 +0800
Subject: [PATCH 46/53] =?UTF-8?q?REPORT-338=20=E6=97=A5=E6=96=87=E8=AE=BE?=
=?UTF-8?q?=E8=AE=A1=E5=99=A8=EF=BC=8C=E8=B6=85=E9=93=BE=E6=8E=A5=E5=AF=B9?=
=?UTF-8?q?=E8=AF=9D=E6=A1=86=E9=80=89=E9=A1=B9=E6=97=A0=E6=95=88=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../fr/design/hyperlink/AbstractHyperlinkPane.java | 2 +-
.../fr/design/hyperlink/HyperlinkTargetFrame.java | 12 ++++++++----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
index 6a236a4e34..8a2773f58a 100644
--- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
+++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
@@ -127,7 +127,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe
public void updateBean(T link) {
updateSubHyperlinkBean(link);
- link.setTargetFrame(HyperlinkTargetFrame.getName(targetFrameComboBox.getSelectedIndex()));
+ link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName());
link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue());
link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue());
}
diff --git a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
index 56d590f039..80e9f21a0a 100644
--- a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
+++ b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java
@@ -8,22 +8,26 @@ public enum HyperlinkTargetFrame {
private String name;
private int index;
-
+ private static HyperlinkTargetFrame[] arrayOfValues;
HyperlinkTargetFrame(String name, int index) {
this.name = name;
this.index = index;
}
- public static String getName(int index) {
+ public static HyperlinkTargetFrame parse(int index) {
+ if (arrayOfValues == null) {
+ arrayOfValues = HyperlinkTargetFrame.values();
+ }
for (HyperlinkTargetFrame hyperlinkTargetFrame : HyperlinkTargetFrame.values()) {
if (hyperlinkTargetFrame.getIndex() == index) {
- return hyperlinkTargetFrame.name;
+ return hyperlinkTargetFrame;
}
}
- return null;
+ return BLANK_FRAME;
}
+
public int getIndex() {
return index;
}
From 41a09a060ed5dc0e0a3a86cfc1d986fbcd6eb2ea Mon Sep 17 00:00:00 2001
From: zhouping
Date: Thu, 13 Oct 2016 14:20:26 +0800
Subject: [PATCH 47/53] =?UTF-8?q?REPORT-437=20=E8=A1=A8=E5=8D=95=E6=8A=A5?=
=?UTF-8?q?=E8=A1=A8=E5=9D=97=E7=BC=A9=E7=95=A5=E5=9B=BE,=20=E4=B8=8D?=
=?UTF-8?q?=E5=AD=98xml?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../design/designer/creator/XElementCase.java | 26 +++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/designer_form/src/com/fr/design/designer/creator/XElementCase.java b/designer_form/src/com/fr/design/designer/creator/XElementCase.java
index 474acfbb91..252ec35c78 100644
--- a/designer_form/src/com/fr/design/designer/creator/XElementCase.java
+++ b/designer_form/src/com/fr/design/designer/creator/XElementCase.java
@@ -1,5 +1,6 @@
package com.fr.design.designer.creator;
+import com.fr.base.BaseUtils;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.properties.mobile.ElementCasePropertyUI;
import com.fr.design.form.util.XCreatorConstants;
@@ -20,6 +21,7 @@ import com.fr.form.FormElementCaseProvider;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
+import com.fr.stable.CoreGraphHelper;
import com.fr.stable.core.PropertyChangeAdapter;
import com.fr.stable.fun.FitProvider;
import com.fr.stable.fun.ReportFitAttrProvider;
@@ -35,6 +37,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
private UILabel imageLable;
private JPanel coverPanel;
private FormDesigner designer;
+ //缩略图
+ private BufferedImage thumbnailImage;
+ private static BufferedImage DEFAULT_BACKGROUND;
+
+ static{
+ try{
+ DEFAULT_BACKGROUND = BaseUtils.readImageWithCache("com/fr/base/images/report/elementcase.png");
+ }catch (Throwable e) {
+ //IBM jdk 1.5.0_22 并发下读取图片有时会异常(EOFException), 这个图片反正只有设计器用到, 捕获住
+ DEFAULT_BACKGROUND = CoreGraphHelper.createBufferedImage(0, 0);
+ }
+ }
public XElementCase(ElementCaseEditor widget, Dimension initSize) {
super(widget, initSize);
@@ -145,7 +159,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
*/
private UILabel initImageBackground(){
UILabel imageLable = new UILabel();
- BufferedImage image = toData().getECImage();
+ BufferedImage image = getThumbnailImage();
setLabelBackground(image, imageLable);
return imageLable;
@@ -222,10 +236,18 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
}
public void setBackground(BufferedImage image){
- toData().setECImage(image);
+ setThumbnailImage(image);
setEditorIcon(image);
}
+ private void setThumbnailImage(BufferedImage image) {
+ this.thumbnailImage = image;
+ }
+
+ private BufferedImage getThumbnailImage(){
+ return thumbnailImage == null ? DEFAULT_BACKGROUND : thumbnailImage;
+ }
+
private void setEditorIcon(BufferedImage image){
setLabelBackground(image, imageLable);
}
From d8022b8ad31e20f655de9e60b144e5fba7e0b274 Mon Sep 17 00:00:00 2001
From: zhouping
Date: Thu, 13 Oct 2016 15:29:49 +0800
Subject: [PATCH 48/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80?=
=?UTF-8?q?=E6=94=B9=E5=8A=A8=E9=80=A0=E6=88=90=E7=9A=84npe=E9=97=AE?=
=?UTF-8?q?=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
designer_form/src/com/fr/design/mainframe/ComponentTree.java | 1 +
1 file changed, 1 insertion(+)
diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
index 4cf0d2528c..2b490e8bef 100644
--- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java
+++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
@@ -281,6 +281,7 @@ public class ComponentTree extends JTree {
}
//绝对布局作为body的时候不显示自适应布局父层
if (((XCreator) parent).acceptType(XWAbsoluteLayout.class)
+ && (parent.getParent() != null)
&& ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)
&& ((XWAbsoluteLayout)parent).toData().isAbsoluteLayoutAsBody()){
parent = parent.getParent().getParent();
From 8487130f901a86fadb35a86e903372249776e18d Mon Sep 17 00:00:00 2001
From: zhouping
Date: Fri, 14 Oct 2016 16:18:00 +0800
Subject: [PATCH 49/53] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?=
=?UTF-8?q?=E6=97=A5=E6=96=87=E8=AE=BE=E8=AE=A1=E5=99=A8=E5=AD=97=E4=BD=93?=
=?UTF-8?q?=E4=B8=8D=E7=94=A8=E6=98=8E=E6=9C=9D=E5=AD=97=E4=BD=93=E4=BA=86?=
=?UTF-8?q?=EF=BC=8C=E4=BB=8D=E6=97=A7=E7=94=A8=E5=9B=9E=E4=BB=A5=E5=89=8D?=
=?UTF-8?q?=E7=9A=84=E5=AE=8B=E4=BD=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../src/com/fr/design/utils/DesignUtils.java | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/designer_base/src/com/fr/design/utils/DesignUtils.java b/designer_base/src/com/fr/design/utils/DesignUtils.java
index d6a2ab8a58..8ed8aa6175 100644
--- a/designer_base/src/com/fr/design/utils/DesignUtils.java
+++ b/designer_base/src/com/fr/design/utils/DesignUtils.java
@@ -230,15 +230,12 @@ public class DesignUtils {
private static FRFont getCurrentLocaleFont(){
FRFont guiFRFont;
- Locale defaultLocale = FRContext.getLocale();
+ Locale defaultLocale = Locale.getDefault();
if (isDisplaySimSun(defaultLocale)) {
guiFRFont = getNamedFont("SimSun");
} else if(isDisplayDialog(defaultLocale)) {
guiFRFont = getNamedFont("Dialog");
- } else if(isDisplayJapaneseFont(defaultLocale)){
- //日文设计器默认用MS Mincho字体渲染
- guiFRFont = getNamedFont("MS Mincho");
} else {
guiFRFont = getNamedFont("Tahoma");
}
@@ -270,14 +267,11 @@ public class DesignUtils {
private static boolean isDisplaySimSun(Locale defaultLocale){
return ComparatorUtils.equals(defaultLocale, Locale.SIMPLIFIED_CHINESE);
}
-
- private static boolean isDisplayJapaneseFont(Locale defaultLocale){
- return ComparatorUtils.equals(defaultLocale, Locale.JAPANESE)
- || ComparatorUtils.equals(defaultLocale, Locale.JAPAN);
- }
private static boolean isDisplayDialog(Locale defaultLocale){
- return ComparatorUtils.equals(defaultLocale, Locale.TRADITIONAL_CHINESE)
+ return ComparatorUtils.equals(defaultLocale, Locale.TRADITIONAL_CHINESE)
+ || ComparatorUtils.equals(defaultLocale, Locale.JAPANESE)
+ || ComparatorUtils.equals(defaultLocale, Locale.JAPAN)
|| ComparatorUtils.equals(defaultLocale, Locale.KOREAN)
|| ComparatorUtils.equals(defaultLocale, Locale.KOREA);
}
From facf2abffe6f6e496c012deb2ced988e555145a2 Mon Sep 17 00:00:00 2001
From: zhouping
Date: Fri, 14 Oct 2016 19:09:52 +0800
Subject: [PATCH 50/53] =?UTF-8?q?REPORT-533=20=E8=A1=A8=E5=8D=95=E5=88=9D?=
=?UTF-8?q?=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80=E6=96=B0=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=20bugfix:=201.=E6=8A=BD=E5=87=BA=E4=B8=80=E4=B8=AA=E7=B1=BBext?=
=?UTF-8?q?ends=20absolute=202.=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F=203.?=
=?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=B8=83=E5=B1=80=E7=9A=84=E6=B5=8B?=
=?UTF-8?q?=E8=AF=95bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/fr/design/images/control/combobox.png | Bin 0 -> 239 bytes
.../layout/FRAbsoluteBodyLayoutAdapter.java | 30 +++
.../layout/FRAbsoluteLayoutAdapter.java | 11 +-
.../designer/creator/XCreatorUtils.java | 1 +
.../creator/XWAbsoluteBodyLayout.java | 45 ++++
.../designer/creator/XWAbsoluteLayout.java | 24 +-
.../properties/AbsoluteStateRenderer.java | 5 +-
.../properties/BodyLayoutAttrRenderer.java | 23 ++
...bsoluteBodyLayoutPropertiesGroupModel.java | 239 ++++++++++++++++++
.../FRAbsoluteLayoutPropertiesGroupModel.java | 192 +-------------
.../FRFitLayoutPropertiesGroupModel.java | 15 +-
.../designer/properties/FitStateRenderer.java | 4 +-
.../properties/LayoutTypeRenderer.java | 4 +-
.../designer/treeview/ComponentTreeModel.java | 3 +-
.../fr/design/mainframe/ComponentTree.java | 10 +-
15 files changed, 367 insertions(+), 239 deletions(-)
create mode 100644 designer_base/src/com/fr/design/images/control/combobox.png
create mode 100644 designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteBodyLayoutAdapter.java
create mode 100644 designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
create mode 100644 designer_form/src/com/fr/design/designer/properties/BodyLayoutAttrRenderer.java
create mode 100644 designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
diff --git a/designer_base/src/com/fr/design/images/control/combobox.png b/designer_base/src/com/fr/design/images/control/combobox.png
new file mode 100644
index 0000000000000000000000000000000000000000..6e5be84e739758339f3e4a78284817e69b35eef9
GIT binary patch
literal 239
zcmeAS@N?(olHy`uVBq!ia0vp^q9Dw{1SHi;jSd1S#^NA%Cx&(BWL^R}Ea{HEjtmSN
z`?>!lvI6;>1s;*b3=DjSL74G){)!Z!V2h`VV~BE*UX=K^^j>|LJudX>AEX3y4ZCHHr}1R9|J
f>*#F#3o``eUn}XqJE0v6bPt24tDnm{r-UW|{Fzu!
literal 0
HcmV?d00001
diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteBodyLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteBodyLayoutAdapter.java
new file mode 100644
index 0000000000..e06bb74634
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteBodyLayoutAdapter.java
@@ -0,0 +1,30 @@
+package com.fr.design.designer.beans.adapters.layout;
+
+import com.fr.design.beans.GroupModel;
+import com.fr.design.designer.creator.XLayoutContainer;
+import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
+import com.fr.design.designer.creator.XWAbsoluteLayout;
+import com.fr.design.designer.creator.XWFitLayout;
+import com.fr.design.designer.properties.FRAbsoluteBodyLayoutPropertiesGroupModel;
+import com.fr.design.designer.properties.FRAbsoluteLayoutPropertiesGroupModel;
+import com.fr.form.ui.container.WBodyLayoutType;
+
+/**
+ * Created by zhouping on 2016/10/14.
+ */
+public class FRAbsoluteBodyLayoutAdapter extends FRAbsoluteLayoutAdapter {
+ public FRAbsoluteBodyLayoutAdapter(XLayoutContainer container) {
+ super(container);
+ }
+
+ @Override
+ public GroupModel getLayoutProperties() {
+ XWAbsoluteBodyLayout xwAbsoluteBodyLayout = (XWAbsoluteBodyLayout) container;
+ //如果body是绝对布局,那么获取原来自适应body的属性--布局类型
+ WBodyLayoutType layoutType = WBodyLayoutType.FIT;
+ if (container.getParent() != null) {
+ layoutType = ((XWFitLayout)container.getParent()).toData().getBodyLayoutType();
+ }
+ return new FRAbsoluteBodyLayoutPropertiesGroupModel(xwAbsoluteBodyLayout, layoutType);
+ }
+}
diff --git a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
index 8e0a725cd4..c49ecf0f38 100644
--- a/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
+++ b/designer_form/src/com/fr/design/designer/beans/adapters/layout/FRAbsoluteLayoutAdapter.java
@@ -331,15 +331,6 @@ public class FRAbsoluteLayoutAdapter extends FRBodyLayoutAdapter {
@Override
public GroupModel getLayoutProperties() {
XWAbsoluteLayout xwAbsoluteLayout = (XWAbsoluteLayout) container;
- if (xwAbsoluteLayout.toData().isAbsoluteLayoutAsBody()){
- //如果body是绝对布局,那么获取原来自适应body的属性--布局类型
- WBodyLayoutType layoutType = WBodyLayoutType.FIT;
- if (container.getParent() != null) {
- layoutType = ((XWFitLayout)container.getParent()).toData().getBodyLayoutType();
- }
- return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout, layoutType);
- } else {
- return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout);
- }
+ return new FRAbsoluteLayoutPropertiesGroupModel(xwAbsoluteLayout);
}
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java
index 19cfe2d8d1..e0fc683552 100644
--- a/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java
+++ b/designer_form/src/com/fr/design/designer/creator/XCreatorUtils.java
@@ -77,6 +77,7 @@ public class XCreatorUtils {
xLayoutMap.put(WAbsoluteLayout.class, XWAbsoluteLayout.class);
xLayoutMap.put(WParameterLayout.class, XWParameterLayout.class);
+ xLayoutMap.put(WAbsoluteBodyLayout.class, XWAbsoluteBodyLayout.class);
xLayoutMap.put(WAbsoluteLayout.class, XWAbsoluteLayout.class);
xLayoutMap.put(WHorizontalBoxLayout.class, XWHorizontalBoxLayout.class);
xLayoutMap.put(WBorderLayout.class, XWBorderLayout.class);
diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
new file mode 100644
index 0000000000..b9fea0a0bf
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteBodyLayout.java
@@ -0,0 +1,45 @@
+package com.fr.design.designer.creator;
+
+import com.fr.design.designer.beans.LayoutAdapter;
+import com.fr.design.designer.beans.adapters.layout.FRAbsoluteBodyLayoutAdapter;
+import com.fr.form.ui.container.WAbsoluteBodyLayout;
+
+import java.awt.*;
+
+/**
+ * Created by zhouping on 2016/10/14.
+ * 用作body的绝对布局
+ */
+public class XWAbsoluteBodyLayout extends XWAbsoluteLayout {
+ public XWAbsoluteBodyLayout(WAbsoluteBodyLayout widget, Dimension initSize) {
+ super(widget, initSize);
+ this.editable = true;
+ }
+
+ /**
+ * 返回对应的widget容器
+ *
+ * @return 返回WAbsoluteLayout
+ */
+ @Override
+ public WAbsoluteBodyLayout toData() {
+ return (WAbsoluteBodyLayout)data;
+ }
+
+ @Override
+ public LayoutAdapter getLayoutAdapter() {
+ return new FRAbsoluteBodyLayoutAdapter(this);
+ }
+
+
+
+ /**
+ * 假如是body的话,始终要能编辑,不会出现蒙层
+ *
+ * @param isEditable 可否编辑
+ */
+ @Override
+ public void setEditable(boolean isEditable) {
+ super.setEditable(true);
+ }
+}
diff --git a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
index 9ac9addc7f..210343f8ed 100644
--- a/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
+++ b/designer_form/src/com/fr/design/designer/creator/XWAbsoluteLayout.java
@@ -75,15 +75,7 @@ public class XWAbsoluteLayout extends XLayoutContainer {
xConnectorMap.put(connector, new XConnector(connector, this));
}
- this.editable = widget.isAbsoluteLayoutAsBody();
-
- initPercent();
- }
-
- public XWAbsoluteLayout(WAbsoluteLayout widget, Dimension initSize, boolean isAbsoluteLayoutAsBody) {
- this(widget, initSize);
- widget.setAbsoluteLayoutAsBody(isAbsoluteLayoutAsBody);
- this.editable = isAbsoluteLayoutAsBody;
+ initPercent(widget);
}
/**
@@ -97,13 +89,14 @@ public class XWAbsoluteLayout extends XLayoutContainer {
}
//根据屏幕大小来确定显示的百分比, 1440*900默认100%, 1366*768缩放90%
- private void initPercent(){
+ private void initPercent(WAbsoluteLayout widget){
Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension scrnsize = toolkit.getScreenSize();
double screenValue = FRScreen.getByDimension(scrnsize).getValue();
if(screenValue != FormArea.DEFAULT_SLIDER){
this.setContainerPercent(screenValue / FormArea.DEFAULT_SLIDER);
}
+ widget.setDesigningResolution(scrnsize);
}
/**
@@ -451,15 +444,4 @@ public class XWAbsoluteLayout extends XLayoutContainer {
}
}
}
-
- /**
- * 设置布局是否可编辑,不可则显示编辑蒙层
- * 假如是body的话,始终要能编辑,不会出现蒙层
- *
- * @param isEditable 可否编辑
- */
- @Override
- public void setEditable(boolean isEditable) {
- super.setEditable(toData().isAbsoluteLayoutAsBody() || isEditable);
- }
}
\ No newline at end of file
diff --git a/designer_form/src/com/fr/design/designer/properties/AbsoluteStateRenderer.java b/designer_form/src/com/fr/design/designer/properties/AbsoluteStateRenderer.java
index 4cc770eec8..e58c7f8abd 100644
--- a/designer_form/src/com/fr/design/designer/properties/AbsoluteStateRenderer.java
+++ b/designer_form/src/com/fr/design/designer/properties/AbsoluteStateRenderer.java
@@ -1,11 +1,10 @@
package com.fr.design.designer.properties;
-import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
-
/**
* Created by zhouping on 2016/8/1.
*/
-public class AbsoluteStateRenderer extends EncoderCellRenderer {
+public class AbsoluteStateRenderer extends BodyLayoutAttrRenderer {
+
public AbsoluteStateRenderer() {
super(new AbsoluteStateWrapper());
}
diff --git a/designer_form/src/com/fr/design/designer/properties/BodyLayoutAttrRenderer.java b/designer_form/src/com/fr/design/designer/properties/BodyLayoutAttrRenderer.java
new file mode 100644
index 0000000000..be05e45986
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/properties/BodyLayoutAttrRenderer.java
@@ -0,0 +1,23 @@
+package com.fr.design.designer.properties;
+
+import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
+import com.fr.general.IOUtils;
+
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+/**
+ * Created by zhouping on 2016/10/14.
+ */
+public class BodyLayoutAttrRenderer extends EncoderCellRenderer {
+ public BodyLayoutAttrRenderer(Encoder encoder) {
+ super(encoder);
+ }
+
+ @Override
+ public void paint(Graphics g) {
+ super.paint(g);
+ BufferedImage image = IOUtils.readImage("com/fr/design/images/control/combobox.png");
+ g.drawImage(image, getWidth() - image.getWidth(), 0, image.getWidth(), image.getHeight(), null, this);
+ }
+}
diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
new file mode 100644
index 0000000000..1a7ab03d3f
--- /dev/null
+++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteBodyLayoutPropertiesGroupModel.java
@@ -0,0 +1,239 @@
+package com.fr.design.designer.properties;
+
+import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
+import com.fr.design.designer.creator.XWFitLayout;
+import com.fr.design.mainframe.FormDesigner;
+import com.fr.design.mainframe.FormSelectionUtils;
+import com.fr.design.mainframe.WidgetPropertyPane;
+import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
+import com.fr.design.utils.gui.LayoutUtils;
+import com.fr.form.ui.Widget;
+import com.fr.form.ui.container.WBodyLayoutType;
+import com.fr.general.FRScreen;
+import com.fr.general.Inter;
+
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+import java.awt.*;
+import java.awt.geom.Arc2D;
+import java.util.Arrays;
+import java.util.Comparator;
+
+/**
+ * Created by zhouping on 2016/10/14.
+ */
+public class FRAbsoluteBodyLayoutPropertiesGroupModel extends FRAbsoluteLayoutPropertiesGroupModel {
+ private LayoutTypeEditor layoutTypeEditor;
+ private LayoutTypeRenderer layoutTypeRenderer;
+ //默认body是0,自适应布局;1,绝对布局.
+ private WBodyLayoutType layoutType = WBodyLayoutType.ABSOLUTE;
+ public FRAbsoluteBodyLayoutPropertiesGroupModel(XWAbsoluteBodyLayout xwAbsoluteBodyLayout) {
+ super(xwAbsoluteBodyLayout);
+ }
+
+ public FRAbsoluteBodyLayoutPropertiesGroupModel(XWAbsoluteBodyLayout xwAbsoluteBodyLayout, WBodyLayoutType layoutType){
+ this(xwAbsoluteBodyLayout);
+ this.layoutTypeEditor = new LayoutTypeEditor();
+ this.layoutTypeRenderer = new LayoutTypeRenderer();
+ this.layoutType = layoutType;
+ }
+
+ /**
+ * 布局管理器自己的属性
+ */
+ @Override
+ public String getGroupName() {
+ return Inter.getLocText("FR-Designer_Attr_Layout");
+ }
+
+ @Override
+ public int getRowCount() {
+ return 2;
+ }
+
+ @Override
+ public TableCellRenderer getRenderer(int row) {
+ return row == 0 ? layoutTypeRenderer : stateRenderer;
+ }
+
+ @Override
+ public TableCellEditor getEditor(int row) {
+ return row == 0 ? layoutTypeEditor : stateEditor;
+ }
+
+ @Override
+ public Object getValue(int row, int column) {
+ if (column == 0) {
+ switch (row) {
+ case 0:
+ return Inter.getLocText("FR-Designer_Attr_Layout_Type");
+ default:
+ return Inter.getLocText("FR-Designer-Widget_Scaling_Mode");
+ }
+ } else {
+ switch (row) {
+ case 0:
+ return layoutType.getTypeValue();
+ default:
+ return layout.getCompState();
+ }
+ }
+ }
+
+ @Override
+ public boolean setValue(Object value, int row, int column) {
+ if (layoutType == WBodyLayoutType.ABSOLUTE){
+ int state = 0;
+ if(value instanceof Integer) {
+ state = (Integer)value;
+ }
+ if (column == 0 || state < 0) {
+ return false;
+ } else {
+ if (row == 0) {
+ if (state == WBodyLayoutType.FIT.getTypeValue()) {
+ XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
+ Component[] components = xwAbsoluteLayout.getComponents();
+
+ Arrays.sort(components, new ComparatorComponentLocation());
+
+ xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
+ xfl.remove(xwAbsoluteLayout);
+ xfl.toData().setLayoutType(WBodyLayoutType.FIT);
+
+ for (Component comp : components) {
+ xfl.add(comp);
+ }
+ moveComponents2FitLayout(xfl, components);
+ FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
+ formDesigner.getSelectionModel().setSelectedCreators(
+ FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
+ xfl.convert();
+ LayoutUtils.layoutContainer(xfl);
+ xfl.adjustCreatorsWhileSlide(xfl.getContainerPercent() - 1.0);
+ return true;
+ }
+ }
+ if (row == 1) {
+ layout.setCompState(state);
+ return true;
+ }
+ return false;
+ }
+ }
+ int state = 0;
+ if(value instanceof Integer) {
+ state = (Integer)value;
+ }
+ if (column == 0 || state < 0) {
+ return false;
+ } else {
+ if (row == 0) {
+ layout.setCompState(state);
+ return true;
+ }
+ return false;
+ }
+ }
+
+ /**
+ * 是否可编辑
+ * @param row 行
+ * @return 否
+ */
+ @Override
+ public boolean isEditable(int row) {
+ return true;
+ }
+
+ //把绝对布局中的元素按规则移动到自适应布局中
+ private void moveComponents2FitLayout(XWFitLayout xwFitLayout, Component[] components) {
+ int eachRowCount = 4;
+ if (components.length <= 1){
+ return;
+ }
+ int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight();
+ int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom();
+ int leftMargin = xwFitLayout.toData().getMargin().getLeft();
+ int topMargin = xwFitLayout.toData().getMargin().getTop();
+ int row = (components.length / eachRowCount) + (components.length % eachRowCount == 0 ? 0 : 1);
+ //最后一行的列数不定
+ int column = components.length % eachRowCount == 0 ? eachRowCount : components.length % eachRowCount;
+ int componentWidth = layoutWidth / eachRowCount;
+ int componentHeight = layoutHeight / row;
+ for(int i = 0;i < row - 1;i++){
+ for(int j = 0;j < eachRowCount;j++){
+ components[eachRowCount * i + j].setBounds(
+ leftMargin + componentWidth * j,
+ topMargin + componentHeight * i,
+ j == eachRowCount - 1 ? layoutWidth - componentWidth * (eachRowCount - 1) : componentWidth,
+ componentHeight
+ );
+ }
+ }
+ //最后一行列数是特殊的,要单独处理
+ int lastRowWidth = layoutWidth / column;
+ int lastRowHeight = layoutHeight - componentHeight * (row - 1);
+ for (int i = 0;i < column;i++) {
+ components[eachRowCount * (row - 1) + i].setBounds(
+ leftMargin + lastRowWidth * i,
+ topMargin + componentHeight * (row - 1),
+ i == column - 1 ? layoutWidth - lastRowWidth * (column - 1) : lastRowWidth,
+ lastRowHeight
+ );
+ }
+ xwFitLayout.updateBoundsWidget();
+ }
+
+ private class ComponentLocationInfo{
+ private Component component;
+ private int horizontalNO;
+ private int verticalNO;
+
+ public ComponentLocationInfo(Component component, int horizontalNO, int verticalNO){
+ this.component = component;
+ this.horizontalNO = horizontalNO;
+ this.verticalNO = verticalNO;
+ }
+
+ public int getHorizontalNO() {
+ return this.horizontalNO;
+ }
+
+ public int getVerticalNO() {
+ return this.verticalNO;
+ }
+
+ public void setHorizontalNO(int horizontalNO){
+ this.horizontalNO = horizontalNO;
+ }
+
+ public void setVerticalNO(int verticalNO){
+ this.verticalNO = verticalNO;
+ }
+ }
+
+ //以组件的位置来确定先后顺序,y小的在前,x小的在前
+ private class ComparatorComponentLocation implements Comparator {
+ @Override
+ public int compare(Object o1, Object o2) {
+ if(((Component)o1).getY() < ((Component)o2).getY()){
+ return -1;
+ }
+ else if (((Component)o1).getY() > ((Component)o2).getY()) {
+ return 1;
+ }
+ else {
+ if (((Component)o1).getX() < ((Component)o2).getX()){
+ return -1;
+ }
+ else if (((Component)o1).getX() > ((Component)o2).getX()) {
+ return 1;
+ }
+ else{
+ return 0;
+ }
+ }
+ }
+ }
+}
diff --git a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
index f8b695a333..66540fe068 100644
--- a/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
+++ b/designer_form/src/com/fr/design/designer/properties/FRAbsoluteLayoutPropertiesGroupModel.java
@@ -2,40 +2,27 @@ package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
import com.fr.design.designer.creator.XWAbsoluteLayout;
-import com.fr.design.designer.creator.XWFitLayout;
-import com.fr.design.mainframe.FormDesigner;
-import com.fr.design.mainframe.FormSelectionUtils;
-import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.editors.AbsoluteLayoutDirectionEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
-import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
-import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
-import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.general.Inter;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellEditor;
import javax.swing.table.TableCellRenderer;
-import java.awt.*;
-import java.util.Arrays;
-import java.util.Comparator;
/**
* Created by zhouping on 2016/8/1.
*/
public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
+
private PropertyCellEditor editor;
private DefaultTableCellRenderer renderer;
- private AbsoluteLayoutDirectionEditor stateEditor;
- private AbsoluteStateRenderer stateRenderer;
- private WAbsoluteLayout layout;
- private XWAbsoluteLayout xwAbsoluteLayout;
- private LayoutTypeEditor layoutTypeEditor;
- private LayoutTypeRenderer layoutTypeRenderer;
- //默认body是0,自适应布局;1,绝对布局.
- private WBodyLayoutType layoutType = WBodyLayoutType.FIT;
+ protected AbsoluteLayoutDirectionEditor stateEditor;
+ protected AbsoluteStateRenderer stateRenderer;
+ protected WAbsoluteLayout layout;
+ protected XWAbsoluteLayout xwAbsoluteLayout;
public FRAbsoluteLayoutPropertiesGroupModel(XWAbsoluteLayout xwAbsoluteLayout){
this.xwAbsoluteLayout = xwAbsoluteLayout;
@@ -46,65 +33,31 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
stateRenderer = new AbsoluteStateRenderer();
}
- public FRAbsoluteLayoutPropertiesGroupModel(XWAbsoluteLayout xwAbsoluteLayout, WBodyLayoutType layoutType){
- this(xwAbsoluteLayout);
- this.layoutTypeEditor = new LayoutTypeEditor();
- this.layoutTypeRenderer = new LayoutTypeRenderer();
- this.layoutType = layoutType;
- }
-
/**
* 布局管理器自己的属性
*/
@Override
public String getGroupName() {
- return Inter.getLocText(layoutType == WBodyLayoutType.ABSOLUTE ? "FR-Designer_Attr_Layout" : "FR-Designer-Widget_Area_Scaling");
+ return Inter.getLocText("FR-Designer-Widget_Area_Scaling");
}
@Override
public int getRowCount() {
- return layoutType == WBodyLayoutType.ABSOLUTE ? 2 : 1;
+ return 1;
}
@Override
public TableCellRenderer getRenderer(int row) {
- if (layoutType == WBodyLayoutType.ABSOLUTE) {
- return row == 0 ? layoutTypeRenderer : stateRenderer;
- }
- else {
- return stateRenderer;
- }
+ return stateRenderer;
}
@Override
public TableCellEditor getEditor(int row) {
- if (layoutType == WBodyLayoutType.ABSOLUTE) {
- return row == 0 ? layoutTypeEditor : stateEditor;
- }
- else{
- return stateEditor;
- }
+ return stateEditor;
}
@Override
public Object getValue(int row, int column) {
- if (layoutType == WBodyLayoutType.ABSOLUTE){
- if (column == 0) {
- switch (row) {
- case 0:
- return Inter.getLocText("FR-Designer_Attr_Layout_Type");
- default:
- return Inter.getLocText("FR-Designer-Widget_Scaling_Mode");
- }
- } else {
- switch (row) {
- case 0:
- return layoutType.getTypeValue();
- default:
- return layout.getCompState();
- }
- }
- }
if (column == 0) {
return Inter.getLocText("FR-Designer-Widget_Scaling_Mode");
} else {
@@ -114,42 +67,6 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
@Override
public boolean setValue(Object value, int row, int column) {
- if (layoutType == WBodyLayoutType.ABSOLUTE){
- int state = 0;
- if(value instanceof Integer) {
- state = (Integer)value;
- }
- if (column == 0 || state < 0) {
- return false;
- } else {
- if (row == 0) {
- if (state == WBodyLayoutType.FIT.getTypeValue()) {
- XWFitLayout xfl = (XWFitLayout) xwAbsoluteLayout.getBackupParent();
- Component[] components = xwAbsoluteLayout.getComponents();
-
- Arrays.sort(components, new ComparatorComponentLocation());
-
- xfl.getLayoutAdapter().removeBean(xwAbsoluteLayout, xwAbsoluteLayout.getWidth(), xwAbsoluteLayout.getHeight());
- xfl.remove(xwAbsoluteLayout);
- xfl.toData().setLayoutType(WBodyLayoutType.FIT);
-
- for (Component comp : components) {
- xfl.add(comp);
- }
- moveComponents2FitLayout(xfl, components);
- FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
- formDesigner.getSelectionModel().setSelectedCreators(
- FormSelectionUtils.rebuildSelection(xfl, new Widget[]{xfl.toData()}));
- return true;
- }
- }
- if (row == 1) {
- layout.setCompState(state);
- return true;
- }
- return false;
- }
- }
int state = 0;
if(value instanceof Integer) {
state = (Integer)value;
@@ -174,95 +91,4 @@ public class FRAbsoluteLayoutPropertiesGroupModel implements GroupModel {
public boolean isEditable(int row) {
return true;
}
-
- //把绝对布局中的元素按规则移动到自适应布局中
- private void moveComponents2FitLayout(XWFitLayout xwFitLayout, Component[] components) {
- int eachRowCount = 4;
- if (components.length <= 1){
- return;
- }
- int layoutWidth = xwFitLayout.getWidth() - xwFitLayout.toData().getMargin().getLeft() - xwFitLayout.toData().getMargin().getRight();
- int layoutHeight = xwFitLayout.getHeight() - xwFitLayout.toData().getMargin().getTop() - xwFitLayout.toData().getMargin().getBottom();
- int leftMargin = xwFitLayout.toData().getMargin().getLeft();
- int topMargin = xwFitLayout.toData().getMargin().getTop();
- int row = (components.length / eachRowCount) + (components.length % eachRowCount == 0 ? 0 : 1);
- //最后一行的列数不定
- int column = components.length % eachRowCount;
- int componentWidth = layoutWidth / eachRowCount;
- int componentHeight = layoutHeight / row;
- for(int i = 0;i < row - 1;i++){
- for(int j = 0;j < eachRowCount;j++){
- components[eachRowCount * i + j].setBounds(
- leftMargin + componentWidth * j,
- topMargin + componentHeight * i,
- j == eachRowCount - 1 ? layoutWidth - componentWidth * (eachRowCount-1) : componentWidth,
- componentHeight
- );
- }
- }
- //最后一行列数是特殊的,要单独处理
- int lastRowWidth = layoutWidth / column;
- int lastRowHeight = layoutHeight - componentHeight * (row - 1);
- for (int i = 0;i < column;i++) {
- components[eachRowCount * (row - 1) + i].setBounds(
- leftMargin + lastRowWidth * i,
- topMargin + componentHeight * (row - 1),
- i == column - 1 ? layoutWidth - lastRowWidth * (column-1) : lastRowWidth,
- lastRowHeight
- );
- }
- xwFitLayout.updateBoundsWidget();
- }
-
- private class ComponentLocationInfo{
- private Component component;
- private int horizontalNO;
- private int verticalNO;
-
- public ComponentLocationInfo(Component component, int horizontalNO, int verticalNO){
- this.component = component;
- this.horizontalNO = horizontalNO;
- this.verticalNO = verticalNO;
- }
-
- public int getHorizontalNO() {
- return this.horizontalNO;
- }
-
- public int getVerticalNO() {
- return this.verticalNO;
- }
-
- public void setHorizontalNO(int horizontalNO){
- this.horizontalNO = horizontalNO;
- }
-
- public void setVerticalNO(int verticalNO){
- this.verticalNO = verticalNO;
- }
- }
-
- //以组件的位置来确定先后顺序,y小的在前,x小的在前
- private class ComparatorComponentLocation implements Comparator {
- @Override
- public int compare(Object o1, Object o2) {
- if(((Component)o1).getY() < ((Component)o2).getY()){
- return -1;
- }
- else if (((Component)o1).getY() > ((Component)o2).getY()) {
- return 1;
- }
- else {
- if (((Component)o1).getX() < ((Component)o2).getX()){
- return -1;
- }
- else if (((Component)o1).getX() > ((Component)o2).getX()) {
- return 1;
- }
- else{
- return 0;
- }
- }
- }
- }
}
diff --git a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
index 25680581c0..f6b8ccaf22 100644
--- a/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
+++ b/designer_form/src/com/fr/design/designer/properties/FRFitLayoutPropertiesGroupModel.java
@@ -4,7 +4,7 @@
package com.fr.design.designer.properties;
import com.fr.design.beans.GroupModel;
-import com.fr.design.designer.creator.XWAbsoluteLayout;
+import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormSelectionUtils;
@@ -14,6 +14,7 @@ import com.fr.design.mainframe.widget.editors.LayoutTypeEditor;
import com.fr.design.mainframe.widget.editors.IntegerPropertyEditor;
import com.fr.design.mainframe.widget.editors.PropertyCellEditor;
import com.fr.form.ui.Widget;
+import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout;
@@ -132,18 +133,18 @@ public class FRFitLayoutPropertiesGroupModel implements GroupModel {
}else if (row == 0) {
layout.setLayoutType(WBodyLayoutType.parse(state));
if (state == WBodyLayoutType.ABSOLUTE.getTypeValue()) {
- WAbsoluteLayout wAbsoluteLayout = new WAbsoluteLayout("body");
- wAbsoluteLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
+ WAbsoluteBodyLayout wAbsoluteBodyLayout = new WAbsoluteBodyLayout("body");
+ wAbsoluteBodyLayout.setCompState(WAbsoluteLayout.STATE_FIXED);
Component[] components = xfl.getComponents();
xfl.removeAll();
- XWAbsoluteLayout xwAbsoluteLayout = new XWAbsoluteLayout(wAbsoluteLayout, new Dimension(0,0), true);
- xfl.getLayoutAdapter().addBean(xwAbsoluteLayout, 0, 0);
+ XWAbsoluteBodyLayout xwAbsoluteBodyLayout = new XWAbsoluteBodyLayout(wAbsoluteBodyLayout, new Dimension(0,0));
+ xfl.getLayoutAdapter().addBean(xwAbsoluteBodyLayout, 0, 0);
for (Component component : components) {
- xwAbsoluteLayout.add(component);
+ xwAbsoluteBodyLayout.add(component);
}
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
formDesigner.getSelectionModel().setSelectedCreators(
- FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteLayout}));
+ FormSelectionUtils.rebuildSelection(xfl, new Widget[]{wAbsoluteBodyLayout}));
}
else {
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
diff --git a/designer_form/src/com/fr/design/designer/properties/FitStateRenderer.java b/designer_form/src/com/fr/design/designer/properties/FitStateRenderer.java
index dfaa1939b6..933c0d17ce 100644
--- a/designer_form/src/com/fr/design/designer/properties/FitStateRenderer.java
+++ b/designer_form/src/com/fr/design/designer/properties/FitStateRenderer.java
@@ -3,13 +3,11 @@
*/
package com.fr.design.designer.properties;
-import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
-
/**
* @author jim
* @date 2014-7-31
*/
-public class FitStateRenderer extends EncoderCellRenderer{
+public class FitStateRenderer extends BodyLayoutAttrRenderer{
/**
* @param encoder
diff --git a/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java b/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
index 033552028b..4061245d75 100644
--- a/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
+++ b/designer_form/src/com/fr/design/designer/properties/LayoutTypeRenderer.java
@@ -1,11 +1,9 @@
package com.fr.design.designer.properties;
-import com.fr.design.mainframe.widget.renderer.EncoderCellRenderer;
-
/**
* Created by zhouping on 2016/9/18.
*/
-public class LayoutTypeRenderer extends EncoderCellRenderer {
+public class LayoutTypeRenderer extends BodyLayoutAttrRenderer {
public LayoutTypeRenderer() {
super(new LayoutTypeWrapper());
diff --git a/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java b/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
index e94ea1ad05..c39ea73b51 100644
--- a/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
+++ b/designer_form/src/com/fr/design/designer/treeview/ComponentTreeModel.java
@@ -148,8 +148,7 @@ public class ComponentTreeModel implements TreeModel {
XWFitLayout bodyFitLayout = (XWFitLayout)xCreator;
for (int i = 0;i < bodyFitLayout.getXCreatorCount();i++){
//类型是绝对布局并且还是body
- if (bodyFitLayout.getXCreator(i).acceptType(XWAbsoluteLayout.class)
- && ((XWAbsoluteLayout)bodyFitLayout.getXCreator(i)).toData().isAbsoluteLayoutAsBody()){
+ if (bodyFitLayout.getXCreator(i).acceptType(XWAbsoluteBodyLayout.class)){
index = i;
}
}
diff --git a/designer_form/src/com/fr/design/mainframe/ComponentTree.java b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
index 2b490e8bef..cc242f3695 100644
--- a/designer_form/src/com/fr/design/mainframe/ComponentTree.java
+++ b/designer_form/src/com/fr/design/mainframe/ComponentTree.java
@@ -16,10 +16,7 @@ import com.fr.design.designer.beans.AdapterBus;
import com.fr.design.designer.beans.ComponentAdapter;
import com.fr.design.designer.beans.events.DesignerEditListener;
import com.fr.design.designer.beans.events.DesignerEvent;
-import com.fr.design.designer.creator.XCreator;
-import com.fr.design.designer.creator.XLayoutContainer;
-import com.fr.design.designer.creator.XWAbsoluteLayout;
-import com.fr.design.designer.creator.XWFitLayout;
+import com.fr.design.designer.creator.*;
import com.fr.design.designer.treeview.ComponentTreeCellRenderer;
import com.fr.design.designer.treeview.ComponentTreeModel;
import com.fr.stable.StringUtils;
@@ -280,10 +277,9 @@ public class ComponentTree extends JTree {
creator.notShowInComponentTree(path);
}
//绝对布局作为body的时候不显示自适应布局父层
- if (((XCreator) parent).acceptType(XWAbsoluteLayout.class)
+ if (((XCreator) parent).acceptType(XWAbsoluteBodyLayout.class)
&& (parent.getParent() != null)
- && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)
- && ((XWAbsoluteLayout)parent).toData().isAbsoluteLayoutAsBody()){
+ && ((XCreator)parent.getParent()).acceptType(XWFitLayout.class)){
parent = parent.getParent().getParent();
continue;
}
From b836a64de09f429510c21872df7db1c385447e1f Mon Sep 17 00:00:00 2001
From: juhaoyu <2335173323@qq.com>
Date: Mon, 17 Oct 2016 08:52:10 +0800
Subject: [PATCH 51/53] implements DataCreatorUI
---
.../fr/design/gui/frpane/TreeSettingPane.java | 30 ++++++++-----------
.../layer/config/LayerDataControlPane.java | 3 +-
.../config/LayerDependenceSettingPane.java | 9 +++---
3 files changed, 18 insertions(+), 24 deletions(-)
diff --git a/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java b/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
index 7a60e59a9a..8bf384b313 100644
--- a/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
+++ b/designer_base/src/com/fr/design/gui/frpane/TreeSettingPane.java
@@ -156,15 +156,11 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
te.setAutoBuild(true);
te.setDictionary(dictionary);
te.setNodeOrDict(dictionary);
- } else if (buildBox.getSelectedIndex() == 0) {
- // TODO: 16/9/12
- te.setLayerBuild(true);
-
- } else {
- te.setAutoBuild(false);
- NameObject no = this.controlPane.update();
- if (no != null) {
- TreeEditor editor = (TreeEditor) no.getObject();
+ } else if (buildBox.getSelectedIndex() == 2) {
+ te.setAutoBuild(false);
+ NameObject no = this.controlPane.update();
+ if (no != null) {
+ TreeEditor editor = (TreeEditor) no.getObject();
te.setAllowBlank(editor.isAllowBlank());
te.setEnabled(editor.isEnabled());
te.setDirectEdit(editor.isDirectEdit());
@@ -212,15 +208,13 @@ public class TreeSettingPane extends BasicPane implements DataCreatorUI {
tcb.setAutoBuild(true);
tcb.setDictionary(dictionary);
tcb.setNodeOrDict(dictionary);
- } else if (buildBox.getSelectedIndex() == 0) {
- // TODO: 16/9/12
- } else {
- tcb.setAutoBuild(false);
- NameObject no = this.controlPane.update();
- if (no != null) {
- if (no.getObject() instanceof TreeComboBoxEditor) {
- return (TreeComboBoxEditor) no.getObject();
- }
+ } else if (buildBox.getSelectedIndex() == 2) {
+ tcb.setAutoBuild(false);
+ NameObject no = this.controlPane.update();
+ if (no != null) {
+ if (no.getObject() instanceof TreeComboBoxEditor) {
+ return (TreeComboBoxEditor) no.getObject();
+ }
TreeEditor editor = (TreeEditor) no.getObject();
tcb.setAllowBlank(editor.isAllowBlank());
diff --git a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
index 136588cf98..daba428901 100644
--- a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
+++ b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
@@ -49,10 +49,9 @@ public class LayerDataControlPane extends ControlPane {
JPanel leftPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(Inter.getLocText("FR-Designer_Root"));
defaultTreeModel = new DefaultTreeModel(rootNode);
- DefaultMutableTreeNode firstLayer = new DefaultMutableTreeNode(new NameObject(Inter.getLocText("FR-Designer_Gradation") + 1, new LayerConfig(1)));
tree = new JTree(defaultTreeModel);
+ DefaultMutableTreeNode firstLayer = new DefaultMutableTreeNode(new NameObject(Inter.getLocText("FR-Designer_Gradation") + 1, new LayerConfig(1)));
tree.setRootVisible(false);
- tree.repaint();
((DefaultMutableTreeNode) defaultTreeModel.getRoot()).getLastLeaf().add(firstLayer);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
leftPane.add(new UIScrollPane(tree), BorderLayout.CENTER);
diff --git a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
index 0814ec9422..29560bf47c 100644
--- a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
+++ b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
@@ -1,6 +1,7 @@
package com.fr.design.gui.frpane.tree.layer.config;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
+import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.present.dict.TableDataDictPane;
import com.fr.form.ui.tree.LayerDependence;
import com.fr.general.Inter;
@@ -31,12 +32,12 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
/**
* 添加依赖按钮
*/
- private JButton addButton;
+ private UIButton addButton;
/**
* 删除依赖按钮
*/
- private JButton delButton;
+ private UIButton delButton;
/**
* 依赖关系编辑Table
@@ -66,8 +67,8 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
tableDataDictPane.tableDataNameComboBox.addItemListener(this);
//初始化按钮对象
- addButton = new JButton(Inter.getLocText("add"));
- delButton = new JButton(Inter.getLocText("Delete"));
+ addButton = new UIButton(Inter.getLocText("add"));
+ delButton = new UIButton(Inter.getLocText("Delete"));
//初始化Table对象,并添加renderer和editor
model = new LayerDepenceTableModel();
dependenceTable = new JTable(model);
From 4bf091e613cb08ebfb5596b17caa58f03073c39d Mon Sep 17 00:00:00 2001
From: juhaoyu <2335173323@qq.com>
Date: Mon, 17 Oct 2016 10:00:12 +0800
Subject: [PATCH 52/53] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=B8=8EUITable?=
=?UTF-8?q?=E6=AF=94=E8=BE=83=E9=9A=BE=E5=85=BC=E5=AE=B9,=E5=B0=86Table?=
=?UTF-8?q?=E7=9A=84Renderer=E5=92=8CEditor=E6=94=B9=E4=B8=BAUI***?=
=?UTF-8?q?=E6=9D=A5=E7=BB=9F=E4=B8=80=E9=A3=8E=E6=A0=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../config/LayerDependenceSettingPane.java | 35 ++++++++++++++++---
1 file changed, 31 insertions(+), 4 deletions(-)
diff --git a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
index 29560bf47c..0411afd46c 100644
--- a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
+++ b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDependenceSettingPane.java
@@ -2,6 +2,8 @@ package com.fr.design.gui.frpane.tree.layer.config;
import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.ibutton.UIButton;
+import com.fr.design.gui.icombobox.UIComboBox;
+import com.fr.design.gui.ilable.UILabel;
import com.fr.design.present.dict.TableDataDictPane;
import com.fr.form.ui.tree.LayerDependence;
import com.fr.general.Inter;
@@ -71,12 +73,14 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
delButton = new UIButton(Inter.getLocText("Delete"));
//初始化Table对象,并添加renderer和editor
model = new LayerDepenceTableModel();
- dependenceTable = new JTable(model);
+ dependenceTable = new JTable();
+ dependenceTable.setModel(model);
//初始化辅助组件
fieldEditor = new FiledEditor(tableDataDictPane);
fieldRenderer = new FieldRenderer(tableDictPane);
layerIndexEditor = new LayerIndexEditor(currentLayerIndex);
//添加renderer
+ dependenceTable.getColumnModel().getColumn(0).setCellRenderer(new FirstRenderer());
dependenceTable.getColumnModel().getColumn(1).setCellRenderer(fieldRenderer);
//添加第一列editor
dependenceTable.getColumnModel().getColumn(0).setCellEditor(layerIndexEditor);
@@ -169,11 +173,34 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
}
+ /**
+ * 第一列renderer
+ */
+ private static final class FirstRenderer extends UILabel implements TableCellRenderer {
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+
+ if (value != null) {
+ //value是用户选择的字段索引值,从1开始的
+ this.setText(String.valueOf(value));
+ } else {
+ this.setText("");
+ }
+ if (hasFocus) {
+ this.setBorder(UIManager.getBorder("Table.focusCelHighlightBorder"));
+ } else {
+ this.setBorder(null);
+ }
+ return this;
+ }
+ }
+
/**
* 第二列renderer
* 由于从model中获取的数据是数据集列的索引值,这里要转换为列的名称
*/
- private static final class FieldRenderer extends JLabel implements TableCellRenderer {
+ private static final class FieldRenderer extends UILabel implements TableCellRenderer {
//用于将字段索引转换为字段名;保存改pane,是为了当用户选择其他数据集时,renderer可同步更新
private TableDataDictPane tableDataDictPane;
@@ -214,7 +241,7 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
private int currentLayerIndex;
- private JComboBox layerChoseCombobox = new JComboBox();
+ private UIComboBox layerChoseCombobox = new UIComboBox();
public LayerIndexEditor(int currentLayerIndex) {
@@ -254,7 +281,7 @@ public class LayerDependenceSettingPane extends JPanel implements ItemListener {
*/
private static final class FiledEditor extends AbstractCellEditor implements TableCellEditor {
- private JComboBox layerChoseCombobox = new JComboBox();
+ private UIComboBox layerChoseCombobox = new UIComboBox();
TableDataDictPane tableDataDictPane;
From d96258296f4552569c10fd200855e1a8533fbb26 Mon Sep 17 00:00:00 2001
From: juhaoyu <2335173323@qq.com>
Date: Mon, 17 Oct 2016 10:48:27 +0800
Subject: [PATCH 53/53] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E4=BE=9D=E8=B5=96=E4=B9=8B=E5=90=8E,=E4=BF=9D=E5=AD=98?=
=?UTF-8?q?=E6=8C=89=E9=92=AE=E4=BB=8D=E7=84=B6=E7=BD=AE=E7=81=B0=E7=9A=84?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../gui/frpane/tree/layer/config/LayerDataControlPane.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
index daba428901..0ff6164b67 100644
--- a/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
+++ b/designer_base/src/com/fr/design/gui/frpane/tree/layer/config/LayerDataControlPane.java
@@ -208,7 +208,7 @@ public class LayerDataControlPane extends ControlPane {
for (int i = 0; i < count; i++) {
DefaultMutableTreeNode node4add = new DefaultMutableTreeNode(
- new NameObject(Inter.getLocText("FR-Designer_Gradation") + (i + 1), layerConfigs[i]));
+ new NameObject(Inter.getLocText("FR-Designer_Gradation") + (i + 1), layerConfigs[i].clone()));
node4root.add(node4add);
node4root = node4add;
}