Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Remove model objects or remove visuals?
Remove model objects or remove visuals? [message #202051] Mon, 07 November 2005 11:58 Go to next message
Eclipse UserFriend
Originally posted by: larserka.stud.ntnu.no

My plugin has two models made in EMF, a datamodel and a view model.
There's a 1-to-1 mapping between
my view model and my editparts. My editparts represents a tree with nodes
and links. I need to be able
to "collapse and expand" my tree. If i click on a node I want the child
nodes and child nodes of child nodes and so on to disapear. If i click on
a collapsed node i want the child nodes to show again. How do I do this
the "clean way"?

Should I remove the visuals for the editparts that I dont want to show, or
remove the model object from the view
model?

Lars.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: Remove model objects or remove visuals? [message #202188 is a reply to message #202051] Mon, 07 November 2005 18:18 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
My philosophy is to leave the EditParts and Figures in place as long the
model is there. But sometimes I make Figures invisible depending on flags in
the model. This means that my LayoutManager needs to check if Figures are
invisible and behave accordingly.

"Lars Erik" <larserka@stud.ntnu.no> wrote in message
news:op.szvcv8zxle1400@b222-02.ad.ime.ntnu.no...
>
> My plugin has two models made in EMF, a datamodel and a view model.
> There's a 1-to-1 mapping between
> my view model and my editparts. My editparts represents a tree with nodes
> and links. I need to be able
> to "collapse and expand" my tree. If i click on a node I want the child
> nodes and child nodes of child nodes and so on to disapear. If i click on
> a collapsed node i want the child nodes to show again. How do I do this
> the "clean way"?
>
> Should I remove the visuals for the editparts that I dont want to show, or
> remove the model object from the view
> model?
>
> Lars.
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Re: Remove model objects or remove visuals? [message #202218 is a reply to message #202051] Mon, 07 November 2005 19:09 Go to previous messageGo to next message
venkataramana m is currently offline venkataramana mFriend
Messages: 86
Registered: July 2009
Member
Any tree-node (view-model element) is either in a collapsed or expanded state. Based on that, you can toggle between returning list of children or empty-list. And ofcourse may be to reflect the current state in visuals as well, createFigure may return a figure for the node with different decorations.

So I think it is easy and better to deal with view-model rather than adding/removing child visuals.

Thanks
~Venkat
Re: Remove model objects or remove visuals? [message #202244 is a reply to message #202188] Mon, 07 November 2005 22:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Lamont_Gilbert.rigidsoftware.com

I like making figures invisible too. I had severe problems for
instance, trying to add a label figure and remove it based on a property
of the model. This was because of my funky layout manager I am guessing.

So I dont relayout them. I add figure, and setVisible depending on what
the model wants.

If its only appearance, I wouldnt remove the models. Tree does not
'remove' its nodes from the model when they are hidden.

CL


Felix L J Mayer wrote:
> My philosophy is to leave the EditParts and Figures in place as long the
> model is there. But sometimes I make Figures invisible depending on flags in
> the model. This means that my LayoutManager needs to check if Figures are
> invisible and behave accordingly.
>
> "Lars Erik" <larserka@stud.ntnu.no> wrote in message
> news:op.szvcv8zxle1400@b222-02.ad.ime.ntnu.no...
>
>>My plugin has two models made in EMF, a datamodel and a view model.
>>There's a 1-to-1 mapping between
>>my view model and my editparts. My editparts represents a tree with nodes
>>and links. I need to be able
>>to "collapse and expand" my tree. If i click on a node I want the child
>>nodes and child nodes of child nodes and so on to disapear. If i click on
>>a collapsed node i want the child nodes to show again. How do I do this
>>the "clean way"?
>>
>>Should I remove the visuals for the editparts that I dont want to show, or
>>remove the model object from the view
>>model?
>>
>>Lars.
>>
>>--
>>Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
>
>
>
Re: Remove model objects or remove visuals? [message #202275 is a reply to message #202051] Tue, 08 November 2005 01:39 Go to previous message
Eclipse UserFriend
Originally posted by: ganshuman.126.com

you can use flag to indicate the showmodel in editpart. all in attachment.

"Lars Erik" <larserka@stud.ntnu.no>
??????:op.szvcv8zxle1400@b222-02.ad.ime.ntnu.no...
>
> My plugin has two models made in EMF, a datamodel and a view model.
> There's a 1-to-1 mapping between
> my view model and my editparts. My editparts represents a tree with nodes
> and links. I need to be able
> to "collapse and expand" my tree. If i click on a node I want the child
> nodes and child nodes of child nodes and so on to disapear. If i click on
> a collapsed node i want the child nodes to show again. How do I do this
> the "clean way"?
>
> Should I remove the visuals for the editparts that I dont want to show, or
> remove the model object from the view
> model?
>
> Lars.
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


  • Attachment: subject.zip
    (Size: 83.05KB, Downloaded 113 times)
Previous Topic:Move connection label
Next Topic:Why doesn't the Tool of a CombinedTemplateCreationEntry get used for drag and drop from the palette?
Goto Forum:
  


Current Time: Sun Dec 08 16:56:29 GMT 2024

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

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

Back to the top