Draw figure differently depending on state [message #172178] |
Wed, 16 March 2005 21:47 |
Beth Tibbitts Messages: 231 Registered: July 2009 |
Senior Member |
|
|
I know this is going to be obvious once I write it down, but..
I want to draw a figure differently, depending on its state.
Item C can contain one or more of item E.
Specifically, if an item E is "collapsed" inside item C, it will be rawn
as a small figure inside the figure for C. If not collapsed, it will be
a larger figure, with
connections back to the parent figure. Or probably a connection back
to the "collapsed" small figure inside the C. So I guess both the
inside/collapsed and outside/expanded/elaborated figure are shown in
this case.
How does the figure class know its state, to know what to draw?
only the editpart can access this info. The figure can't see its model.
Actually, I may not even want to store this info in the model, it's
purely to know how to visually represent the model, has nothing to
do with the model objects themselves. If I store it in the editpart or
the model,
how does the figure know it in order to know how to paint itself?
I know how to return editpart.getModelChildren() and return children or
not, based on whether or not to draw them, but how do I give info to the
figure on *how* to draw themselves based on state?
Maybe what I draw "inside" the C is not the E figures, but a different
view of the C itself ("mini-E's"). But again, how to I reference the
content in an intelligent manner?
Thanks, I feel like this is obvious, but haven't found the answer yet.
....Beth
|
|
|
Re: Draw figure differently depending on state [message #172186 is a reply to message #172178] |
Wed, 16 March 2005 22:13 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Beth Tibbitts wrote:
> I know this is going to be obvious once I write it down, but..
> I want to draw a figure differently, depending on its state.
> Item C can contain one or more of item E.
> Specifically, if an item E is "collapsed" inside item C, it will be rawn
> as a small figure inside the figure for C. If not collapsed, it will be
> a larger figure, with
> connections back to the parent figure. Or probably a connection back
> to the "collapsed" small figure inside the C. So I guess both the
> inside/collapsed and outside/expanded/elaborated figure are shown in
> this case.
>
> How does the figure class know its state, to know what to draw?
> only the editpart can access this info. The figure can't see its model.
> Actually, I may not even want to store this info in the model, it's
> purely to know how to visually represent the model, has nothing to
> do with the model objects themselves. If I store it in the editpart or
> the model,
> how does the figure know it in order to know how to paint itself?
>
tell the edit part to return a different figure.one that meets the needs
of the current state of the model/view.
Then ask the edit part to be redrawn.
> I know how to return editpart.getModelChildren() and return children or
> not, based on whether or not to draw them, but how do I give info to the
> figure on *how* to draw themselves based on state?
As stated, the editPart controls the way it is displayed based on the
figure it returns. If you want a different look, return a different figure.
>
> Maybe what I draw "inside" the C is not the E figures, but a different
> view of the C itself ("mini-E's"). But again, how to I reference the
> content in an intelligent manner?
>
> Thanks, I feel like this is obvious, but haven't found the answer yet.
> ...Beth
|
|
|
|
Powered by
FUDForum. Page generated in 0.03301 seconds