Skip to main content



      Home
Home » Eclipse Projects » GEF » Figure hierarchies vs. complex figures
Figure hierarchies vs. complex figures [message #82167] Thu, 05 June 2003 02:25 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
Previous Topic:Launching a Java scrapbook page editor
Next Topic:Coordinate Systems
Goto Forum:
  


Current Time: Mon Nov 10 08:27:48 EST 2025

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

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

Back to the top