Home » Eclipse Projects » GEF » Draw2D
Draw2D [message #132219] |
Fri, 14 May 2004 19:56  |
Eclipse User |
|
|
|
Originally posted by: jsk_lam.hotmail.com
Hi,
I am new to GEF and Draw2D. What I need to do is to render some readonly
images (gif/bmp/jpg) in the view and connect them with lines. Is it
possible to do this with Draw2D alone without using GEF? The images
should be listening to the mouse click events so I can display a context
menu. Also, I would like to be able to hide and show the images base on
some criteria. Does anyone know how to show and hide the graphical images
on the fly? Do I have to use GEF at all? Thanks.
sl.
|
|
|
Re: Draw2D [message #132287 is a reply to message #132219] |
Sun, 16 May 2004 09:36   |
Eclipse User |
|
|
|
Originally posted by: rlemaigr.ulb.ac.be
Hi,
I am +- new to gef and draw2d too so my answer may be wrong or inexact.
To do all you want, I don't think you need gef, draw2d should be enough.=
About images:
There is a class in draw2d that allows you to show images in draw2d =
Figures: ImageFigure.
About connections:
There is classes in draw2d that allow you to make connections between =
other figures in a relatively easy way:
There is an interface for connection in draw2d named Connection. A =
Connection is a figure that has a ConnectionRouter and ConnectionAnchors=
..
- the ConnectionAnchors tell the connection about what the positions of =
=
its endpoints should be, and notify the connection when the positions of=
=
the endpoints have changed and the connection must be revalidated.
- the ConnectionRouter lays out the intermidiate points of the connectio=
n =
between its endpoints.
The implementation of Connection you should use is PolilyneConnection.
They are many implementations of ConnectionRouter provided in draw2d. Yo=
u =
choose the best for your needs.
They are also many implementation of ConnectionAnchors in draw2d. Most o=
f =
them are associated with a Figure and notify their associated connection=
s =
when this figure moves.
So by setting the ConnectionRouter, you specify how the intermidiate =
points are located, and by setting the ConnectionAnchors, you specify ho=
w =
the connection will connect to its source and target Figures and what =
these source and target figures are.
I think connections should be placed in a particular layer to allow them=
=
to stay on top of everything else. If I have good memory, there is a cla=
ss =
for that: ConnectionLayer. Check the javadoc.
About mouse events:
Draw2d support routing of mouse event to figures, so you can add mouse =
listeners to figures to do what you need. About the menu thing, I don't =
=
know. Maybe you should add this menu to the swt control below draw2d, an=
d =
use draw2d to find wich figure is below the mouse pointer, using =
findFigureAt(...). I don't know.
About hiding/showing images:
I think using the setVisible(boolean) method of IFigure is the solution =
to =
that.
You could also take a look at the package "graph" of draw2d.
Hope this will help you,
r=E9gis
On Fri, 14 May 2004 23:56:50 +0000 (UTC), sl <jsk_lam@hotmail.com> wrote=
:
> Hi,
>
> I am new to GEF and Draw2D. What I need to do is to render some readon=
ly
> images (gif/bmp/jpg) in the view and connect them with lines. Is it
> possible to do this with Draw2D alone without using GEF? The images
> should be listening to the mouse click events so I can display a conte=
xt
> menu. Also, I would like to be able to hide and show the images base =
on
> some criteria. Does anyone know how to show and hide the graphical =
> images
> on the fly? Do I have to use GEF at all? Thanks.
>
> sl.
>
|
|
|
Re: Draw2D [message #132878 is a reply to message #132287] |
Wed, 19 May 2004 03:31   |
Eclipse User |
|
|
|
Originally posted by: m.hassenforder.uha.fr
I am also new in GEF, but I can suggest to read the article about
classDiagram in draw2d :
http://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.ht ml
You have an example about : figures, connectors and layout.
bye
rlemaigr@ulb.ac.be wrote:
> Hi,
>
> I am +- new to gef and draw2d too so my answer may be wrong or inexact.
>
> To do all you want, I don't think you need gef, draw2d should be enough.
>
> About images:
>
> There is a class in draw2d that allows you to show images in draw2d
> Figures: ImageFigure.
>
>
> About connections:
>
> There is classes in draw2d that allow you to make connections between
> other figures in a relatively easy way:
>
> There is an interface for connection in draw2d named Connection. A
> Connection is a figure that has a ConnectionRouter and ConnectionAnchors.
> - the ConnectionAnchors tell the connection about what the positions of
> its endpoints should be, and notify the connection when the positions
> of the endpoints have changed and the connection must be revalidated.
> - the ConnectionRouter lays out the intermidiate points of the
> connection between its endpoints.
> The implementation of Connection you should use is PolilyneConnection.
> They are many implementations of ConnectionRouter provided in draw2d.
> You choose the best for your needs.
> They are also many implementation of ConnectionAnchors in draw2d. Most
> of them are associated with a Figure and notify their associated
> connections when this figure moves.
>
> So by setting the ConnectionRouter, you specify how the intermidiate
> points are located, and by setting the ConnectionAnchors, you specify
> how the connection will connect to its source and target Figures and
> what these source and target figures are.
>
> I think connections should be placed in a particular layer to allow
> them to stay on top of everything else. If I have good memory, there is
> a class for that: ConnectionLayer. Check the javadoc.
>
>
> About mouse events:
>
> Draw2d support routing of mouse event to figures, so you can add mouse
> listeners to figures to do what you need. About the menu thing, I don't
> know. Maybe you should add this menu to the swt control below draw2d,
> and use draw2d to find wich figure is below the mouse pointer, using
> findFigureAt(...). I don't know.
>
>
> About hiding/showing images:
>
> I think using the setVisible(boolean) method of IFigure is the solution
> to that.
>
>
> You could also take a look at the package "graph" of draw2d.
>
>
> Hope this will help you,
>
> régis
>
> On Fri, 14 May 2004 23:56:50 +0000 (UTC), sl <jsk_lam@hotmail.com> wrote:
>
>> Hi,
>>
>> I am new to GEF and Draw2D. What I need to do is to render some readonly
>> images (gif/bmp/jpg) in the view and connect them with lines. Is it
>> possible to do this with Draw2D alone without using GEF? The images
>> should be listening to the mouse click events so I can display a context
>> menu. Also, I would like to be able to hide and show the images base on
>> some criteria. Does anyone know how to show and hide the graphical
>> images
>> on the fly? Do I have to use GEF at all? Thanks.
>>
>> sl.
>>
>
|
|
|
Re: Draw2D [message #133713 is a reply to message #132878] |
Sat, 22 May 2004 01:14  |
Eclipse User |
|
|
|
Originally posted by: jsk_lam.hotmail.com
Thanks all for the info:-)
sl.
Hassenforder wrote:
> I am also new in GEF, but I can suggest to read the article about
> classDiagram in draw2d :
> http://eclipse.org/articles/Article-GEF-Draw2d/GEF-Draw2d.ht ml
> You have an example about : figures, connectors and layout.
> bye
> rlemaigr@ulb.ac.be wrote:
> > Hi,
> >
> > I am +- new to gef and draw2d too so my answer may be wrong or inexact.
> >
> > To do all you want, I don't think you need gef, draw2d should be enough.
> >
> > About images:
> >
> > There is a class in draw2d that allows you to show images in draw2d
> > Figures: ImageFigure.
> >
> >
> > About connections:
> >
> > There is classes in draw2d that allow you to make connections between
> > other figures in a relatively easy way:
> >
> > There is an interface for connection in draw2d named Connection. A
> > Connection is a figure that has a ConnectionRouter and ConnectionAnchors.
> > - the ConnectionAnchors tell the connection about what the positions of
> > its endpoints should be, and notify the connection when the positions
> > of the endpoints have changed and the connection must be revalidated.
> > - the ConnectionRouter lays out the intermidiate points of the
> > connection between its endpoints.
> > The implementation of Connection you should use is PolilyneConnection.
> > They are many implementations of ConnectionRouter provided in draw2d.
> > You choose the best for your needs.
> > They are also many implementation of ConnectionAnchors in draw2d. Most
> > of them are associated with a Figure and notify their associated
> > connections when this figure moves.
> >
> > So by setting the ConnectionRouter, you specify how the intermidiate
> > points are located, and by setting the ConnectionAnchors, you specify
> > how the connection will connect to its source and target Figures and
> > what these source and target figures are.
> >
> > I think connections should be placed in a particular layer to allow
> > them to stay on top of everything else. If I have good memory, there is
> > a class for that: ConnectionLayer. Check the javadoc.
> >
> >
> > About mouse events:
> >
> > Draw2d support routing of mouse event to figures, so you can add mouse
> > listeners to figures to do what you need. About the menu thing, I don't
> > know. Maybe you should add this menu to the swt control below draw2d,
> > and use draw2d to find wich figure is below the mouse pointer, using
> > findFigureAt(...). I don't know.
> >
> >
> > About hiding/showing images:
> >
> > I think using the setVisible(boolean) method of IFigure is the solution
> > to that.
> >
> >
> > You could also take a look at the package "graph" of draw2d.
> >
> >
> > Hope this will help you,
> >
> > régis
> >
> > On Fri, 14 May 2004 23:56:50 +0000 (UTC), sl <jsk_lam@hotmail.com> wrote:
> >
> >> Hi,
> >>
> >> I am new to GEF and Draw2D. What I need to do is to render some readonly
> >> images (gif/bmp/jpg) in the view and connect them with lines. Is it
> >> possible to do this with Draw2D alone without using GEF? The images
> >> should be listening to the mouse click events so I can display a context
> >> menu. Also, I would like to be able to hide and show the images base on
> >> some criteria. Does anyone know how to show and hide the graphical
> >> images
> >> on the fly? Do I have to use GEF at all? Thanks.
> >>
> >> sl.
> >>
> >
|
|
|
Goto Forum:
Current Time: Mon May 12 07:47:45 EDT 2025
Powered by FUDForum. Page generated in 0.08559 seconds
|