Skip to main content



      Home
Home » Eclipse Projects » GEF » editable figure
editable figure [message #109811] Mon, 22 December 2003 02:06 Go to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Hi Friends,
I want to create a Figures, Connections with some name. the
name should be editable. is it possible?.

thanks
David.
Re: editable figure [message #109818 is a reply to message #109811] Mon, 22 December 2003 02:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

David Danie wrote:
> Hi Friends,
> I want to create a Figures, Connections with some name. the
> name should be editable. is it possible?.
>
> thanks
> David.
>
Note: i don't want to use Labels with separate Editparts.
Re: editable figure [message #109825 is a reply to message #109811] Mon, 22 December 2003 06:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi David,
"David Danie" <david_danie@hotmail.com> wrote in message
news:bs654n$qqf$1@eclipse.org...
> Hi Friends,
> I want to create a Figures, Connections with some name. the
> name should be editable. is it possible?.

A name is just like any other property that a model possesses - using a
property view, it is quite simple to edit and modify their value.

Do you intend to display the name along with the figure of the EditPart ? If
so, do you intend to edit the name in place (my clicking on the name in the
editor itself)? Or will it be okay if you edit the name in a property view
and have it updated in the editor ?

Brian.
Re: editable figure [message #109832 is a reply to message #109825] Mon, 22 December 2003 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Brian Fernandes wrote:
> Hi David,
> "David Danie" <david_danie@hotmail.com> wrote in message
> news:bs654n$qqf$1@eclipse.org...
>
>>Hi Friends,
>> I want to create a Figures, Connections with some name. the
>>name should be editable. is it possible?.
>
>
> A name is just like any other property that a model possesses - using a
> property view, it is quite simple to edit and modify their value.
>
> Do you intend to display the name along with the figure of the EditPart ? If
> so, do you intend to edit the name in place (my clicking on the name in the
> editor itself)? Or will it be okay if you edit the name in a property view
> and have it updated in the editor ?
>
> Brian.
>
>
>
>
Brain,
I want to edit the name in place(editor itself), not in a
property view.

thanks
David.
Re: editable figure [message #109839 is a reply to message #109832] Mon, 22 December 2003 10:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

David,

If you follow my recent post: "Labelling EditParts", you will see that I've
implemented this using a separate model and editpart for the label. This is
precicely becuase I want to be able to edit the label in place... ie. in the
editor itself; which is what you want to do.

The figure I used for the label extended Label and implemented
AncestorListener so that it moved along with the figure it labels. I'm
unsure of wheter DirectEditing is possible without an EditPart and another
point to consider is; editing the label leads to changes in the model.

Randy would be able to comment on whether all this is possible within Draw2D
itself.

All the best,
Brian.
Re: editable figure [message #109846 is a reply to message #109818] Mon, 22 December 2003 10:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"David Danie" <david_danie@hotmail.com> wrote in message
news:bs65eo$qqf$2@eclipse.org...
> David Danie wrote:
> > Hi Friends,
> > I want to create a Figures, Connections with some name. the
> > name should be editable. is it possible?.
> >
> > thanks
> > David.
> >
> Note: i don't want to use Labels with separate Editparts.

So, can you instead use labels, but *without* separated editparts? So,
basically, its just a property of the connection which happens to be
displayed visually by using mulitple figures.

Then, when you get a REQ_DIRECT_EDIT, all you need to do is hit-test the
mouse location and the label(s). Of course a good application provides
keyboard equivalents, which shouldnt' be too hard either.
Re: editable figure [message #109876 is a reply to message #109846] Tue, 23 December 2003 04:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Randy Hudson wrote:
> "David Danie" <david_danie@hotmail.com> wrote in message
> news:bs65eo$qqf$2@eclipse.org...
>
>>David Danie wrote:
>>
>>>Hi Friends,
>>> I want to create a Figures, Connections with some name. the
>>>name should be editable. is it possible?.
>>>
>>>thanks
>>>David.
>>>
>>
>>Note: i don't want to use Labels with separate Editparts.
>
>
> So, can you instead use labels, but *without* separated editparts? So,
> basically, its just a property of the connection which happens to be
> displayed visually by using mulitple figures.
>
> Then, when you get a REQ_DIRECT_EDIT, all you need to do is hit-test the
> mouse location and the label(s). Of course a good application provides
> keyboard equivalents, which shouldnt' be too hard either.
>
>

Randy,
I am not clear about your comments.

Thanks
David Danie.
Re: editable figure [message #109883 is a reply to message #109839] Tue, 23 December 2003 05:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Brian Fernandes wrote:
> David,
>
> If you follow my recent post: "Labelling EditParts", you will see that I've
> implemented this using a separate model and editpart for the label. This is
> precicely becuase I want to be able to edit the label in place... ie. in the
> editor itself; which is what you want to do.
>
> The figure I used for the label extended Label and implemented
> AncestorListener so that it moved along with the figure it labels. I'm
> unsure of wheter DirectEditing is possible without an EditPart and another
> point to consider is; editing the label leads to changes in the model.
>
> Randy would be able to comment on whether all this is possible within Draw2D
> itself.
>
> All the best,
> Brian.
>
>

Brain,
If i create separate Editpart, Model for Label, is it possible
to add Labels along with connections, figures?.

for example,
public IFigure createFigute(){
Connection con = new PolylineConnection();
con.add(new MyLabel());
}

Because i want to creates some names, when i create figures, connections.

Regards
David Danie.
Re: editable figure [message #109890 is a reply to message #109876] Tue, 23 December 2003 06:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

What Randy means is, in EditPart#createFigure of the connection you create
2 figures. One is the the PolylineConnection that you used for the
connection (this is the figure you return from createFigure) and a second
Label figure that you use to label the connection. You can add this figure
as a child of the main figure using Figure#add but I think that would mess
up the layout of the main figure and its genuine children. So better is to
place the label onto your diagram layer yourself. As I mentioned in my
previous post, you can implement AncestorListener in your Label figure so
that it moves along with the main figure. Have a look at some of the Handles
in GEF to see how this works.

Regarding the DirectEditing with this technique; I'm not too sure.

If you choose to use a complete model / EditPart to implement labels, then
DirectEditing is not a big problem - it's exactly the same as direct editing
in Logic. If you wanted to allow the user the flexibility of positioning the
label himself, I think it would not be too hard either. The figure used for
the Label editpart is the same as detailed above. The label model must NOT
be added as a child of the model to be labelled - else the label will mess
up the layout of the figure again.


> If i create separate Editpart, Model for Label, is it possible
>to add Labels along with connections, figures?.

>for example,
> public IFigure createFigute(){
>Connection con = new PolylineConnection();
> con.add(new MyLabel());
> }

If MyLabel is a model class, you cannot add it as a child to the connection
FIGURE. I would suggest that your model class (of the figure to be labelled)
should have a member variable for the labels model.


Depending on the flexibility you need, both approaches (with and without
model / editParts) are workable, (I started off without using a separate
model / editpart, but ultimately found that for my needs, using a model for
the label would be simpler and cleaner).

Have a look at my "Labelling EditParts" post for more details.

All the best,
Brian.
Re: editable figure [message #109911 is a reply to message #109890] Tue, 23 December 2003 07:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Brian Fernandes wrote:
> What Randy means is, in EditPart#createFigure of the connection you create
> 2 figures. One is the the PolylineConnection that you used for the
> connection (this is the figure you return from createFigure) and a second
> Label figure that you use to label the connection. You can add this figure
> as a child of the main figure using Figure#add

I allready used this way.

but I think that would mess
> up the layout of the main figure and its genuine children. So better is to
> place the label onto your diagram layer yourself.

what is the digram layer?. do you mean add child in to
BaseDiagram(RootDiagram).


As I mentioned in my
> previous post, you can implement AncestorListener in your Label figure so
> that it moves along with the main figure. Have a look at some of the Handles
> in GEF to see how this works.



>
> Regarding the DirectEditing with this technique; I'm not too sure.
>
> If you choose to use a complete model / EditPart to implement labels, then
> DirectEditing is not a big problem - it's exactly the same as direct editing
> in Logic. If you wanted to allow the user the flexibility of positioning the
> label himself, I think it would not be too hard either. The figure used for
> the Label editpart is the same as detailed above. The label model must NOT
> be added as a child of the model to be labelled - else the label will mess
> up the layout of the figure again.
>
>
>
>> If i create separate Editpart, Model for Label, is it possible
>>to add Labels along with connections, figures?.
>
>
>>for example,
>> public IFigure createFigute(){
>>Connection con = new PolylineConnection();
>> con.add(new MyLabel());
>> }
>
>
> If MyLabel is a model class, you cannot add it as a child to the connection
> FIGURE. I would suggest that your model class (of the figure to be labelled)
> should have a member variable for the labels model.
>
>
> Depending on the flexibility you need, both approaches (with and without
> model / editParts) are workable, (I started off without using a separate
> model / editpart, but ultimately found that for my needs, using a model for
> the label would be simpler and cleaner).
>
> Have a look at my "Labelling EditParts" post for more details.
>
> All the best,
> Brian.
>
>
>
>
Re: editable figure [message #109918 is a reply to message #109890] Tue, 23 December 2003 09:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Brain,

Brian Fernandes wrote:
> What Randy means is, in EditPart#createFigure of the connection you create
> 2 figures. One is the the PolylineConnection that you used for the
> connection (this is the figure you return from createFigure) and a second
> Label figure that you use to label the connection. You can add this figure
> as a child of the main figure using Figure#add

I allready used this way. the label displayed always in left corner.

but I think that would mess
> up the layout of the main figure and its genuine children. So better is to
> place the label onto your diagram layer yourself.

what do you mean in diagram layer ?. adding label in to RootDiagram.

As I mentioned in my
> previous post, you can implement AncestorListener in your Label figure so
> that it moves along with the main figure. Have a look at some of the Handles
> in GEF to see how this works.
>
> Regarding the DirectEditing with this technique; I'm not too sure.
>
> If you choose to use a complete model / EditPart to implement labels, then
> DirectEditing is not a big problem - it's exactly the same as direct editing
> in Logic. If you wanted to allow the user the flexibility of positioning the
> label himself, I think it would not be too hard either. The figure used for
> the Label editpart is the same as detailed above. The label model must NOT
> be added as a child of the model to be labelled - else the label will mess
> up the layout of the figure again.
>
>
>
>> If i create separate Editpart, Model for Label, is it possible
>>to add Labels along with connections, figures?.
>
>
>>for example,
>> public IFigure createFigute(){
>>Connection con = new PolylineConnection();
>> con.add(new MyLabel());
>> }
>
>
> If MyLabel is a model class, you cannot add it as a child to the connection
> FIGURE. I would suggest that your model class (of the figure to be labelled)
> should have a member variable for the labels model.
>
>
> Depending on the flexibility you need, both approaches (with and without
> model / editParts) are workable, (I started off without using a separate
> model / editpart, but ultimately found that for my needs, using a model for
> the label would be simpler and cleaner).
>
> Have a look at my "Labelling EditParts" post for more details.
>
> All the best,
> Brian.
>
>
>
>

Now i am planning to add names as a property of Figure, Connections. So
give me some inputs about property pages.

Thanks
David Danie.
Re: editable figure [message #109922 is a reply to message #109918] Tue, 23 December 2003 11:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: brian.fernandes.codito.com

Hi David,


> I allready used this way. the label displayed always in left corner.
>
If you add the figure as a child, you will have to set its location as well.
You can do that by using a locator or simply setting the figures bounds in
it's validate method. Look at some handles... that will give you an idea of
how the label figure checks the location of the figure it is supposed to
label and positions itself accordingly.


> what do you mean in diagram layer ?. adding label in to RootDiagram.
yes. or you can create a separate layer for diagrams.
>

>
> Now i am planning to add names as a property of Figure, Connections. So
> give me some inputs about property pages.

Property pages are different from the property view. I don't know much about
property pages right now... but using the property view is pretty simple....
again you can look at the logic example. Just make sure your model classes
implement the IPropertySource interface.. the eclipse Property View will
pick up the properties of the currently selected EditPart automatically.

Brian.
Re: editable figure [message #109928 is a reply to message #109922] Tue, 23 December 2003 12:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Hi Brain,
thanks for your comments.
I will try it and let you know if i have any issues.

Regards
David Danie.

Brian Fernandes wrote:
> Hi David,
>
>
>
>>I allready used this way. the label displayed always in left corner.
>>
>
> If you add the figure as a child, you will have to set its location as well.
> You can do that by using a locator or simply setting the figures bounds in
> it's validate method. Look at some handles... that will give you an idea of
> how the label figure checks the location of the figure it is supposed to
> label and positions itself accordingly.
>
>
>
>>what do you mean in diagram layer ?. adding label in to RootDiagram.
>
> yes. or you can create a separate layer for diagrams.
>
>
>>Now i am planning to add names as a property of Figure, Connections. So
>>give me some inputs about property pages.
>
>
> Property pages are different from the property view. I don't know much about
> property pages right now... but using the property view is pretty simple....
> again you can look at the logic example. Just make sure your model classes
> implement the IPropertySource interface.. the eclipse Property View will
> pick up the properties of the currently selected EditPart automatically.
>
> Brian.
>
>
>
Re: editable figure [message #109964 is a reply to message #109890] Tue, 23 December 2003 21:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Brian Fernandes" <brian.fernandes@codito.com> wrote in message
news:bs97v4$ho9$1@eclipse.org...
> What Randy means is, in EditPart#createFigure of the connection you
create
> 2 figures. One is the the PolylineConnection that you used for the
> connection (this is the figure you return from createFigure) and a second
> Label figure that you use to label the connection. You can add this figure
> as a child of the main figure using Figure#add but I think that would mess
> up the layout of the main figure and its genuine children. So better is to

No, you would add the label directly to the connection as its child:

IFigure createFigure(...) {
PolylineConnection conn = new PolylineConnection();
myLabel = new Label();
conn.add(myLabel);
}

See the GEF article which shows how to add labels to connections
Re: editable figure [message #109992 is a reply to message #109964] Wed, 24 December 2003 06:20 Go to previous message
Eclipse UserFriend
Originally posted by: david_danie.hotmail.com

Randy Hudson wrote:
> "Brian Fernandes" <brian.fernandes@codito.com> wrote in message
> news:bs97v4$ho9$1@eclipse.org...
>
>>What Randy means is, in EditPart#createFigure of the connection you
>
> create
>
>>2 figures. One is the the PolylineConnection that you used for the
>>connection (this is the figure you return from createFigure) and a second
>>Label figure that you use to label the connection. You can add this figure
>>as a child of the main figure using Figure#add but I think that would mess
>>up the layout of the main figure and its genuine children. So better is to
>
>
> No, you would add the label directly to the connection as its child:
>
> IFigure createFigure(...) {
> PolylineConnection conn = new PolylineConnection();
> myLabel = new Label();
> conn.add(myLabel);
> }
>
> See the GEF article which shows how to add labels to connections
>
>

Now i got it.

thanks for your comments.

Regards,
David Danie.
Previous Topic:GDI+. Logic example with antialiasing (big)
Next Topic:Installing GEF correctly
Goto Forum:
  


Current Time: Sun Jun 22 15:27:14 EDT 2025

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

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

Back to the top