[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Draw figure differently depending on state

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