| Figure hierarchies vs. complex figures [message #82167] |
Thu, 05 June 2003 02:25  |
Eclipse User |
|
|
|
I am facing an issue (described below), which seems to raise a general
question:
When should an EditPart create custom complex Figure and when should it
create a hierarcy of Figures?
In my specific case, I need a rectagle that, if possible (depending on
zoom), draws a textual label at its top left corner. The rectangle may
contain other Figures (depicting children of the associated model).
I am faced with 2 options (at least):
(1) The EditPart can create a RectangleFigure and add a Label to it.
(2) I can write a specic Figure that draws both the rectangle and some
text. I can probably subclass RectangleFigure for this.
I'd appreciate any insight regarding the implications of choosing one
option over the other.
|
|
|
| Re: Figure hierarchies vs. complex figures [message #82279 is a reply to message #82167] |
Thu, 05 June 2003 10:05  |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
I always prefer to write a custom figure that presents a nice easy-to-use
API to the editpart. But only when the feature can be implemented without
knowledge of the EditPart or model.
For example, in the Palette implementation, there is a class DrawerFigure
that decouples the appearance (the figure hierarchy) of a drawer from the
editpart, which just needs to listen to the model and update the figure.
(2)
"Youval" <youval_b@yahoo.com> wrote in message
news:3EDEE247.1060208@yahoo.com...
> I am facing an issue (described below), which seems to raise a general
> question:
>
> When should an EditPart create custom complex Figure and when should it
> create a hierarcy of Figures?
>
> In my specific case, I need a rectagle that, if possible (depending on
> zoom), draws a textual label at its top left corner. The rectangle may
> contain other Figures (depicting children of the associated model).
>
> I am faced with 2 options (at least):
> (1) The EditPart can create a RectangleFigure and add a Label to it.
> (2) I can write a specic Figure that draws both the rectangle and some
> text. I can probably subclass RectangleFigure for this.
>
> I'd appreciate any insight regarding the implications of choosing one
> option over the other.
>
|
|
|
Powered by
FUDForum. Page generated in 0.05486 seconds