Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Hiding and unhiding of nodes
Hiding and unhiding of nodes [message #176658] Tue, 11 March 2008 13:34 Go to next message
BG is currently offline BGFriend
Messages: 45
Registered: July 2009
Member
Hello all,

I am new to GMF .We have a requirement where we hide/unhide details for
the domain model elements represented in diagram based on user action i,e

We have rectangle object representing the domain model element it has
input and output model element affixed to the rectangle border where
(input/output details) are represented by small circle. On user action to
see only input details i would like to hide all the output details.(To
hide all the output circle)

Can i know what is the best way to achive this ?

Regards
BG
Re: Hiding and unhiding of nodes [message #176682 is a reply to message #176658] Tue, 11 March 2008 15:37 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello BG,

Try calling View.setVisible(true/false);

-----------------
Alex Shatalin
Re: Hiding and unhiding of nodes [message #176714 is a reply to message #176682] Wed, 12 March 2008 03:48 Go to previous messageGo to next message
byrebg Mising name is currently offline byrebg Mising nameFriend
Messages: 48
Registered: July 2009
Member
Is there any snippet for this to achive as far i believe i need to create
command.
How to access all the port elements from diagram ?

Regards
BG
Re: Hiding and unhiding of nodes [message #176806 is a reply to message #176714] Wed, 12 March 2008 11:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello BG,

> Is there any snippet for this to achive as far i believe i need to
> create command.
I do not know about any snipets for this.

> How to access all the port elements from diagram ?
For exmaple - by traversing whole diagram structure from the top down to
the ports.

-----------------
Alex Shatalin
Re: Hiding and unhiding of nodes [message #178623 is a reply to message #176806] Fri, 21 March 2008 13:52 Go to previous messageGo to next message
byrebg Mising name is currently offline byrebg Mising nameFriend
Messages: 48
Registered: July 2009
Member
I was able to create a command to hide the view based using attribute
CompositeCommand cc = new CompositeCommand("Diagram_settings");

BorderedBorderItemEditPart compShapeEditPart =
(BorderedBorderItemEditPart)object;
View hostView =(View)compShapeEditPart.getModel();
cc.add(new ShowHidePortsCommand(editingDomain,hostView,true));


when i do hide all or unhide all it working fine but when try to hide some
port node in this case let us take to hide all inport port and all unhide
outport then it is not refreshing correctly elements i.e hide is working
fine but unhide ports are not appearing back on editor if debug i can see
the view.setVisible(true) but still it not visible ?

PS :here my port object node is represented by image.
Re: Hiding and unhiding of nodes [message #178704 is a reply to message #178623] Sun, 23 March 2008 08:39 Go to previous message
Eclipse UserFriend
Originally posted by: jan.herriger.gmx.de

I had a similar problem. To solve the problem, inside the
BorderedShapeEditPart (the parent), I overwrote
#handleNotificationEvent(Notification event). Now, it only refreshes the
child EditPart, which visibility has changed:

if (NotationPackage.eINSTANCE.getView_Visible().equals(
event.getFeature())) {
Node node = (Node) event.getNotifier();
refreshChild((GraphicalEditPart)getChildBySemanticHint(
node.getType()));
}
else {
super.handleNotificationEvent(event);
}

BG schrieb:
> I was able to create a command to hide the view based using attribute
> CompositeCommand cc = new CompositeCommand("Diagram_settings");
>
> BorderedBorderItemEditPart compShapeEditPart =
> (BorderedBorderItemEditPart)object;
> View hostView =(View)compShapeEditPart.getModel();
> cc.add(new ShowHidePortsCommand(editingDomain,hostView,true));
>
>
> when i do hide all or unhide all it working fine but when try to hide
> some port node in this case let us take to hide all inport port and all
> unhide outport then it is not refreshing correctly elements i.e hide is
> working fine but unhide ports are not appearing back on editor if debug
> i can see the view.setVisible(true) but still it not visible ?
>
> PS :here my port object node is represented by image.
>
>
Previous Topic:port connection
Next Topic:To change Node figure at runtime
Goto Forum:
  


Current Time: Fri Apr 26 20:06:58 GMT 2024

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

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

Back to the top