| Show/hide edge via notational model [message #677085] |
Tue, 07 June 2011 10:26  |
Ralph Gerbig Messages: 550 Registered: November 2009 |
Senior Member |
|
|
Hi all,
I have an edge which I want to show/hide via the notational mode. I look up the edge in the notational model and set visible to true/false. However, the diagram is only updated after closing and opening it again. How can I force the connections to show hide immediatly?
Ralph
|
|
|
|
| Re: Show/hide edge via notational model [message #725329 is a reply to message #725315] |
Wed, 14 September 2011 10:14   |
 |
Mickael Istria Messages: 612 Registered: July 2009 Location: Grenoble, France |
Senior Member |
|
|
I think if you modify directly the Notation model, you'll need to
refresh your editpart to get it read again the notation model and alter
the figure (visible=false) according to it.
Here is some stuff that sounds good for your use case
* ShowHideRelationshipsRequest
* RequestConstants.REQ_SHOWHIDE_RELATIONSHIPS
In case it does not work, you can mimic the mechanism to hide labels
* HideConnectionLabelsAction
* ToggleConnectionLabelsRequest
* RequestConstants.REQ_TOGGLE_CONNECTION_LABELS
On 14/09/2011 15:54, J.Teutsch wrote:
> Hi Ralph,
>
> I have the problem a little bit different. Connection with notation
> visible=false are not shown.
>
> But you have to make same visible or invisible before the ShapeImpl
>
> // make only edges visible
> for (View edgeView : recursiveFieldInExpressLinks)
> {
> if (edgeView instanceof EdgeImpl)
> {
> SetRequest request = new SetRequest((EObject) edgeView,
> NotationPackage.eINSTANCE.getView_Visible(), visibilize);
>
> SetValueCommand cmd = new SetValueCommand(request);
> linkCommand.add(cmd);
> }
> }
>
> My problem is, when I save a diagram with invisible EdgeImpl and reopen
> it, the Edges are not shown anymore. Maybe you can share your code
>
> Kind regards J. Teutsch
--
http://mickaelistria.wordpress.com
http://twitter.com/#!/mickaelistria
http://www.petalslink.com
|
|
|
|
|
| Re: Show/hide edge via notational model [message #727476 is a reply to message #726730] |
Wed, 21 September 2011 08:07  |
Ralph Gerbig Messages: 550 Registered: November 2009 |
Senior Member |
|
|
Hi,
I have executed the following which does not help further:
EditPart parent = getParent();
while (parent != null && ! (parent instanceof DiagramEditPart)){
parent = parent.getParent();
}
if (parent instanceof DiagramEditPart)
parent.performRequest(new Request(RequestConstants.REQ_REFRESH));
Ralph
|
|
|
Powered by
FUDForum. Page generated in 0.01664 seconds