From f9e6d148c7b8bda391bb54dbbcaedc01eb0bb084 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 21 Feb 2017 14:53:05 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=B0=8F=E9=94=99=E8=AF=AF=EF=BC=8CWLayout->WSortLayout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/MobileParaWidgetTable.java | 2 +- .../design/mainframe/MobileWidgetTable.java | 22 ++++++------------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java index 67f47f951..a39d3d94a 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileParaWidgetTable.java @@ -245,7 +245,7 @@ class MobileParaWidgetTable extends JTable { } WParameterLayout para = (WParameterLayout) (paraContainer.toData()); - return para.getWidgetNameTag(); // TODO 从这个函数开始看,可以看到后台如何决定拖动后的控件顺序的 + return para.getWidgetNameTag(); } /** diff --git a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java index bb7ba9918..5044b4f8d 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java @@ -3,7 +3,7 @@ package com.fr.design.mainframe; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.util.ArrayList; +import java.util.List; import javax.swing.BorderFactory; import javax.swing.JLabel; @@ -14,11 +14,8 @@ import javax.swing.table.*; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itable.GroupRenderer; -import com.fr.design.gui.itable.HeaderRenderer; import com.fr.form.ui.Widget; import com.fr.form.ui.container.*; -import com.fr.form.ui.container.cardlayout.WCardMainBorderLayout; -import com.fr.form.ui.container.cardlayout.WCardTitleLayout; import com.fr.general.ComparatorUtils; import com.fr.general.Inter; import com.fr.stable.StringUtils; @@ -67,6 +64,9 @@ public class MobileWidgetTable extends JTable { add(moveComponent); } + /** + * 设置表格属性 + */ private void setTableProperties() { JTableHeader header = getTableHeader(); header.setReorderingAllowed(false); @@ -112,7 +112,7 @@ public class MobileWidgetTable extends JTable { moveComponent.setVisible(false); int toIndex = e.getY() < GAP ? 0 : (int)Math.rint((e.getY() - GAP)/WIDGET_TABLE_ROW_HEIGHT) + 1; //当鼠标放开时,将选中的容器调整至新的顺序 - ((WLayout)designer.getSelectionModel().getSelection().getSelectedCreator().toData()).adjustOrder(selectedRow - 1, toIndex - 1); + ((WSortLayout)designer.getSelectionModel().getSelection().getSelectedCreator().toData()).adjustOrder(selectedRow - 1, toIndex - 1); //拿取排序后表格数据,然后重绘表格 getInstance().refreshData(); getInstance().repaint(); @@ -261,16 +261,8 @@ public class MobileWidgetTable extends JTable { } // 选择的控件有两种类型,一种是WLayout,代表容器,一种是Widget,代表控件 - if (selectedModel.acceptType(WLayout.class)) { - //WCardLayout里面并不是控件,而仍然是容器TabFitLayout,故要向下获取控件 - //WCardTitlelLayout是XWCardLayout的标题容器,里面同样不是控件,不能获取MobileList - //WTitleLayout是标题容器,比如图表的标题,里面是图表控件和Label标题控件,但是不需要获取MobileList - if (selectedModel.acceptType(WCardLayout.class) || selectedModel.acceptType(WCardTitleLayout.class)) { - if (selectedModel.acceptType(WTitleLayout.class) || selectedModel.acceptType(WCardMainBorderLayout.class)) { - return new String[0][0]; - } - } - ArrayList strings = ((WLayout)selectedModel).getMobileWidgetList(); + if (selectedModel.acceptType(WSortLayout.class)) { + List strings = ((WSortLayout)selectedModel).getMobileWidgetList(); String[][] widgetName = new String[strings.size() + 1][1]; widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder"); for (int i = 0; i < strings.size(); i++) { From 8ec71ac73598f1e90ae55bec10a1965901254078 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 21 Feb 2017 14:55:50 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/MobileWidgetTable.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java index 5044b4f8d..7893ddf18 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java @@ -64,9 +64,6 @@ public class MobileWidgetTable extends JTable { add(moveComponent); } - /** - * 设置表格属性 - */ private void setTableProperties() { JTableHeader header = getTableHeader(); header.setReorderingAllowed(false); From 3ddef78aecfd87679785c06434f6f7b2f80f3420 Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 21 Feb 2017 15:15:28 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/MobileWidgetTable.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java index 7893ddf18..683d46455 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java @@ -259,7 +259,7 @@ public class MobileWidgetTable extends JTable { // 选择的控件有两种类型,一种是WLayout,代表容器,一种是Widget,代表控件 if (selectedModel.acceptType(WSortLayout.class)) { - List strings = ((WSortLayout)selectedModel).getMobileWidgetList(); + List strings = ((WSortLayout)selectedModel).getOrderedMobileWidgetList(); String[][] widgetName = new String[strings.size() + 1][1]; widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder"); for (int i = 0; i < strings.size(); i++) { From c7ad29b02f7fa10c4ee6422f11f8fb54adfbabef Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 21 Feb 2017 15:26:46 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/MobileWidgetTable.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java index 683d46455..e3c655c05 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java @@ -259,11 +259,11 @@ public class MobileWidgetTable extends JTable { // 选择的控件有两种类型,一种是WLayout,代表容器,一种是Widget,代表控件 if (selectedModel.acceptType(WSortLayout.class)) { - List strings = ((WSortLayout)selectedModel).getOrderedMobileWidgetList(); - String[][] widgetName = new String[strings.size() + 1][1]; + List mobileWidgetLists = ((WSortLayout)selectedModel).getOrderedMobileWidgetList(); + String[][] widgetName = new String[mobileWidgetLists.size() + 1][1]; widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder"); - for (int i = 0; i < strings.size(); i++) { - widgetName[i + 1][0] = strings.get(i); + for (int i = 0; i < mobileWidgetLists.size(); i++) { + widgetName[i + 1][0] = mobileWidgetLists.get(i); } return widgetName; } else { From 53f31b794e9832b914ba2f6373de8991c323b7ae Mon Sep 17 00:00:00 2001 From: fanglei <294531121> Date: Tue, 21 Feb 2017 15:27:39 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/design/mainframe/MobileWidgetTable.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java index e3c655c05..f79eca1a9 100644 --- a/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java +++ b/designer_form/src/com/fr/design/mainframe/MobileWidgetTable.java @@ -259,11 +259,11 @@ public class MobileWidgetTable extends JTable { // 选择的控件有两种类型,一种是WLayout,代表容器,一种是Widget,代表控件 if (selectedModel.acceptType(WSortLayout.class)) { - List mobileWidgetLists = ((WSortLayout)selectedModel).getOrderedMobileWidgetList(); - String[][] widgetName = new String[mobileWidgetLists.size() + 1][1]; + List mobileWidgetList = ((WSortLayout)selectedModel).getOrderedMobileWidgetList(); + String[][] widgetName = new String[mobileWidgetList.size() + 1][1]; widgetName[0][0] = Inter.getLocText("FR-Designer_WidgetOrder"); - for (int i = 0; i < mobileWidgetLists.size(); i++) { - widgetName[i + 1][0] = mobileWidgetLists.get(i); + for (int i = 0; i < mobileWidgetList.size(); i++) { + widgetName[i + 1][0] = mobileWidgetList.get(i); } return widgetName; } else {