Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Hidden connections still displayed
Hidden connections still displayed [message #184068] Wed, 23 April 2008 13:51 Go to next message
Youmm P. is currently offline Youmm P.Friend
Messages: 140
Registered: July 2009
Senior Member
Hello,

I want to hide a node and its corresponding source / target connections.
In the command I do something like that:

editPart.getFigure ().setVisible (false);

List sourceConnections = editPart.getSourceConnections ();
Iterator iterator = sourceConnections.iterator ();
while(iterator.hasNext ()) {
ConnectionNodeEditPart graphicalEditPart =
(ConnectionNodeEditPart) iterator.next ();
graphicalEditPart.getFigure ().setVisible (false);
}

List targetConnections = editPart.getTargetConnections ();
Iterator iteratorTarget = targetConnections.iterator ();
while(iteratorTarget.hasNext ()) {
ConnectionNodeEditPart graphicalEditPart =
(ConnectionNodeEditPart) iteratorTarget.next ();
graphicalEditPart.getFigure ().setVisible (false);
}


The node itself is hidden but when I resize the parent node, the node
remains hidden BUT the source / target connections are displayed again!

Any ideas?
Re: Hidden connections still displayed [message #184635 is a reply to message #184068] Tue, 29 April 2008 08:45 Go to previous message
Youmm P. is currently offline Youmm P.Friend
Messages: 140
Registered: July 2009
Senior Member
Problem solved using a code similar to (taken from the Q/A
http://wiki.eclipse.org/GMF_Newsgroup_Q_and_A):

protected CommandResult doExecuteWithResult(
IProgressMonitor progressMonitor, IAdaptable info)
throws ExecutionException {

boolean visible = !this.selectedView.isVisible();
List sources = this.selectedView.getSourceEdges();
List targets = this.selectedView.getTargetEdges();
for (Object o : sources)
{
((Edge)o).setVisible(visible);
}
for (Object o : targets)
{
((Edge)o).setVisible(visible);
}
this.selectedView.setVisible(visible);
return CommandResult.newOKCommandResult();
}
Previous Topic:Select All + Arrange All
Next Topic:Change Document Root and Refresh
Goto Forum:
  


Current Time: Thu Apr 25 23:15:18 GMT 2024

Powered by FUDForum. Page generated in 0.02761 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top