]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Show components in connected order in outline with debug mode 98/3098/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 13 Aug 2019 15:45:24 +0000 (18:45 +0300)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Tue, 13 Aug 2019 15:45:24 +0000 (18:45 +0300)
gitlab #19

Change-Id: I9a82db4e4a91ea3fb2b3279431c3867e6b0ddd57

org.simantics.plant3d/src/org/simantics/plant3d/editor/P3DContentOutlinePage.java

index 160188e60c64c29303d8a7ecc9fd78d38e9388d7..0c5ab5df39e0cdf842a953694072a13af4864cb2 100644 (file)
@@ -1,5 +1,8 @@
 package org.simantics.plant3d.editor;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.action.MenuManager;
@@ -56,11 +59,16 @@ public class P3DContentOutlinePage extends VTKContentOutlinePage<Resource, Objec
                                if (parentElement instanceof P3DRootNode) {
                                        return ((P3DRootNode)parentElement).getChild().toArray();
                                }
-                               if (!DEBUG) {
-                                       if (parentElement instanceof PipeRun) {
-                                               return ((PipeRun)parentElement).getSortedChild().toArray();
-                                       }
-                               } else {
+                               if (parentElement instanceof PipeRun) {
+                                   if (DEBUG) {
+                                       List<Object> list = new ArrayList<Object>();
+                                       list.addAll(((PipeRun)parentElement).getControlPoints());
+                                       list.addAll(((PipeRun)parentElement).getSortedChild());
+                                       return list.toArray();
+                                   }
+                                   return ((PipeRun)parentElement).getSortedChild().toArray();
+                }
+                               if (DEBUG) {
                                        if (parentElement instanceof PipelineComponent) {
                                                return new Object[]{((PipelineComponent) parentElement).getControlPoint()};
                                        } else if (parentElement instanceof PipeControlPoint) {