From 61624fb8558a26cb2c0a82c53f9516b0774dad06 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Sat, 5 Sep 2020 17:09:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-38821=20=E4=BF=AE=E6=94=B9=E8=8E=B7?= =?UTF-8?q?=E5=BE=97=E6=89=A9=E5=B1=95=E8=B7=AF=E5=BE=84=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ComponentTree.java | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java index 2fdd1f8f1e..4dd84f528b 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ComponentTree.java @@ -4,6 +4,9 @@ import com.fr.design.constants.UIConstants; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; +import com.fr.design.designer.creator.XWAbsoluteBodyLayout; +import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.cardlayout.XCardSwitchButton; import com.fr.design.designer.treeview.ComponentTreeCellRenderer; import com.fr.design.designer.treeview.ComponentTreeModel; import com.fr.design.gui.itree.UITreeUI; @@ -244,12 +247,25 @@ public class ComponentTree extends JTree { } public void getExpandNodes(XLayoutContainer container, List searchList) { - for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { - XCreator creator = container.getXCreator(i); - TreePath treePath=buildTreePath(creator); - if(isExpanded(treePath)) searchList.add(treePath); - if (creator instanceof XLayoutContainer) { - getExpandNodes((XLayoutContainer) creator, searchList); + TreePath treePath = buildTreePath(container); + if (isExpanded(treePath)) { + searchList.add(treePath); + for (int i = 0, size = container.getXCreatorCount(); i < size; i++) { + XCreator creator = container.getXCreator(i); + if (creator.acceptType(XLayoutContainer.class) || creator.acceptType(XCardSwitchButton.class)) { + getExpandNodes((XLayoutContainer) creator.getXCreator(), searchList); + } + } + } + //对绝对布局做特殊处理 + if (container.acceptType(XWFitLayout.class)) { + XWFitLayout bodyFitLayout = (XWFitLayout) container; + for (int j = 0; j < bodyFitLayout.getXCreatorCount(); j++) { + //类型是绝对布局并且还是body + if (bodyFitLayout.getXCreator(j).acceptType(XWAbsoluteBodyLayout.class)) { + container = (XLayoutContainer) bodyFitLayout.getXCreator(j); + getExpandNodes(container, searchList); + } } } }