Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Add decoration to EditPart?
Add decoration to EditPart? [message #229837] Thu, 25 January 2007 17:14 Go to next message
Eclipse UserFriend
Originally posted by: devconsole.gmail.com

Is it possible to add a decoration to an EditPart?

I would simply like to place a label next to an EditPart without the
label being a part of the EditPart. Meaning when you select the EditPart
the associated label should not be selected.
Re: Add decoration to EditPart? [message #229846 is a reply to message #229837] Thu, 25 January 2007 17:18 Go to previous messageGo to next message
Nhu Le is currently offline Nhu LeFriend
Messages: 47
Registered: July 2009
Member
This is a multi-part message in MIME format.
--------------080809020106070204040703
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

You can use transparent border as per the attached newsgroup msg.

Nhu

Dave Console wrote:
> Is it possible to add a decoration to an EditPart?
>
> I would simply like to place a label next to an EditPart without the
> label being a part of the EditPart. Meaning when you select the EditPart
> the associated label should not be selected.


--------------080809020106070204040703
Content-Type: message/rfc822;
name="Attached Message"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="Attached Message"

Path: utils.eclipse.org!not-for-mail
From: Nhu Le <nle.misc@gmail.com>
Newsgroups: eclipse.tools.gef
Subject: Re: draw2d: label follows figure
Date: Thu, 18 Jan 2007 09:43:45 -0500
Organization: EclipseCorner
Message-ID: <eoo131$ote$1@utils.eclipse.org>
References: <eom6ie$qa7$1@utils.eclipse.org>
NNTP-Posting-Host: 142.92.45.201
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: utils.eclipse.org 1169131425 25518 142.92.45.201 (18 Jan 2007 14:43:45 GMT)
X-Complaints-To: news@utils.eclipse.org
NNTP-Posting-Date: Thu, 18 Jan 2007 14:43:45 +0000 (UTC)
User-Agent: Thunderbird 1.5 (X11/20051201)
In-Reply-To: <eom6ie$qa7$1@utils.eclipse.org>
Xref: utils.eclipse.org eclipse.tools.gef:18469

If you want a label that is always at the same location wrt the figure,
then you have to create your own figure with some transparent border to
put the label (to create the illusion that the label is outside the
figure). Look into getHandleBounds() of interface HandleBounds.

If you want a label that can be moved anywhere on the screen (like in
the case of a label of a port for a component) then you may want to
create another layer for your labels and create a label locator class
(extends AbstractLocator). The parent-child figure relationship will
obviously not like usual but since the label should be the leaf of the
relationship tree, you can probably create a simple (like getOwner()???)
just so that you can get to the figure from the label (to replace
getParent()).

Nhu

Aleksandr Kravets wrote:
> Hello,
>
> In my GEF application I have a figure which is basically an ImageFigure.
> I am looking for a way to create a label that follows that figure. I
> tried using DelegatingLayout on my figure, but of course the label is
> positioned in the figure, may be there is a way to offset the
> positioning of the label so it's outside the figure?
>
> Thanks for your help,
> Alex

--------------080809020106070204040703--
Re: Add decoration to EditPart? [message #229860 is a reply to message #229846] Thu, 25 January 2007 19:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: devconsole.gmail.com

Nhu Le wrote:
> If you want a label that is always at the same location wrt the figure,
> then you have to create your own figure with some transparent border to
> put the label (to create the illusion that the label is outside the
> figure). Look into getHandleBounds() of interface HandleBounds.

The HandleBounds interface is exactly what I was looking for, thank you
very much.

Now I simply use a Label with an icon and let getHandleBounds() return
the value of getIconBounds()..
Re: Add decoration to EditPart? [message #233159 is a reply to message #229860] Wed, 18 April 2007 09:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: achassagne.gmail.com

Dave Console a écrit :
> I would simply like to place a label next to an EditPart without the label being a part of the EditPart.
> Meaning when you select the EditPart the associated label should not be selected.

Hi Dave!

I wanted to do exactly the same thing...
I tried the solution proposed by Nhu but the part of the figure that is
outside the handle bounds is still selectable this way, which is not
what we wanted... or am I missing something?

Thanks for your help!
Regards,

Arnaud
Re: Add decoration to EditPart? [message #233223 is a reply to message #233159] Thu, 19 April 2007 07:26 Go to previous message
Eclipse UserFriend
Originally posted by: achassagne.gmail.com

Arnaud Chassagne a écrit :
> Dave Console a écrit :
>> I would simply like to place a label next to an EditPart without the
>> label being a part of the EditPart. Meaning when you select the
>> EditPart the associated label should not be selected.
>
> Hi Dave!
>
> I wanted to do exactly the same thing...
> I tried the solution proposed by Nhu but the part of the figure that is
> outside the handle bounds is still selectable this way, which is not
> what we wanted... or am I missing something?
>
> Thanks for your help!
> Regards,
>
> Arnaud

Anyone else has an idea? please...
Previous Topic:showing a tooltip when resizing
Next Topic:EditPart selection feedback
Goto Forum:
  


Current Time: Tue Apr 16 23:51:56 GMT 2024

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

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

Back to the top