Community
Participate
Working Groups
this is a follow on of Bugzilla Bug 136305. maybe also a duplicate of #112983 (but definitely not specific to logic diagram) the problem is in the tree view of outline.
Created attachment 42136 [details] screenshot of outline in mindmap example
Created attachment 47166 [details] Fix for bug 142957 Compartments - the children of nodes - are now visible in the tree view. Also note, that only visible nodes will appear on the tree view. Hence, making nodes visible/invisible will be adding/removing them from the tree view. Children of compartments are visible too. (Connection nodes are not visible still - don't know if we need them to appear on the tree view... There is still a lot to be done for the tree view I think)
There's some strange behavior in client code where it appears there the children are duplicates of the parent. Perhaps we only want to visualize children of the node that are Shape Nodes? Patch needs to be revisited... Also, when clicking on the children nodes, the properties view doesn't update to reflect the selection. Only works on the root element.
Created attachment 47649 [details] Attempt2 to fix 142957 The duplicates observed on the tree view are not really duplicates. Those are the tree nodes for compartments contained within the node. Since the compartments and their parent node have a reference to the same model object they have the same name and icon. There were no way to get around that, hence after talking to Mohammed it's been decided to skip the compartments, but get to the children of the compartments. If compartments are invisible or collapsed tree view won't show the nodes for compartment children. "Delete" operation is supported from the tree view (on nodes only). The properties view reflects selection made from the tree viewer. Attaching the patch.
+1 Patch looks good to me...
Created attachment 48014 [details] Updated patch Updated the patch. Put necessary comments in the files, tried to do performance testing, some very minor changes. Code has been reviewed - ready to be commited.
Created attachment 48019 [details] final patch Corrected the file header comment.
Created attachment 49433 [details] Resynchronized patch Resynchronized patch
Drops the performance of visualizing the model by 27% needs to be revisited. Since, it's not an important issue, moving this to 2.0
Created attachment 49995 [details] latest patch Code changes: added code to prevent potential memory leaks. Tested performance against the same use case and it appears that performance drop doesn't occur any more. If this needs to be commited for 1.0.1 now is the time to speak up. Note: the fix for the propery view for the selection from the tree view has moved to a separate bug created for this issue.
I definitely want this fix in 1.0.1. One important function in my editor is to represent the parent-children in figures. Some early user feedbacks of my editor already indicated that failing to show children in outline view is a high priority defect. My editor will be shipped with the product I am working on, so please put this fix in if there is no big performance hit.
Please be aware that the only compartment children that show up in the tree view with the current fix are those that have Node view. So, if I'll be able to commit it, before I do commit, it would be nice to get your opinion on the fix. Would you be able to check if the patch does fix the problem for you before 10am tomorrow?
I can give it a quick try. How to get the patch ? Is it in cvs already ?
Never mind. Got patch. Unfortuantely, it does not work for me. The children failed on checking of isCompartment() in TreeNodeEditPart: if (isCompartment(child)) { children.addAll(getNodeChildren(child)); } else if (isCompartment(node) && !((DrawerStyle) node.getStyle(NotationPackage.eINSTANCE.getDrawerStyle())).isCollapsed() ) { children.add(child); } As result, the children are not added. The child editpart in my editor is extended from CompartmentEditPart. the view of child only has shapeStyle installed. Maybe I should install a draw style ?
I don't have compartment figure in parent. The child figure is added directly to parent. Did some hack on code. It works for me if the TreeNodeEditPart.getNodeChildren(Node) can handle one more case, ie, direct non-compartment child: if (element instanceof Node) { Node child = (Node) element; if (isCompartment(child)) { children.addAll(getNodeChildren(child)); } else if (isCompartment(node) && !((DrawerStyle) node.getStyle(NotationPackage.eINSTANCE.getDrawerStyle())).isCollapsed() ) { children.add(child); } else if (!isCompartment(node)) // handle direct non-compartment child children.add(child); }
Created attachment 50065 [details] patch With this patch istead of making the inner outline view class protected, I provide a hook up for a client application to provide appropriate edit part factory. Override #getOutlineViewEditPartFactory() and create your own tree edit parts. Note: tree edit parts classes belong to the internal package, so I get warnings when try to use them in a client application, but nevertheless everything works. In your own edit part factory take everything that we have currently and add an if block for Node model and create a TreeNodeEditPart for it with your change. I'll see if we can move tree edit part classes in a client accessible package
Created attachment 50066 [details] patch Sorry, I had my tree edit parts moved to another package. This patch is with tree edit parts in the internal package.
Created attachment 50067 [details] patch with moved Tree Edit Parts - for testing The test patch with Tree Edit Parts in the client accessible package (including TreeNodeEditPart). Let me know if this patch is sufficient for you
Created attachment 50099 [details] final fix The final patch.
Client was satisfied with the provided hook up for setting up customized edit part factory for the tree viewer. Tree edit parts have been moved to a client application accessible package, so that clients can use them. Patch has been commited for 1.0.1 Marking the bug as fixed
Added contributed keyword for IP log automation. Also, this commit in CVS log made by mmostafa indicates it was bug 153305
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug