Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Label aligned along a connection
Label aligned along a connection [message #163373] Sun, 09 January 2005 15:30 Go to next message
Eclipse UserFriend
Originally posted by: ilja.selenzow.web.de

Hi,

is it possible to align a label along a connection so it will stay aligned
in this way even when connection is drawed in the vertical direction?

Thanks in advance.

Ilja
Re: Label aligned along a connection [message #163410 is a reply to message #163373] Mon, 10 January 2005 15:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Text cannot be rotated in SWT.

"Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
news:crrim1$j69$1@www.eclipse.org...
> Hi,
>
> is it possible to align a label along a connection so it will stay aligned
> in this way even when connection is drawed in the vertical direction?
>
> Thanks in advance.
>
> Ilja
>
>
Re: Label aligned along a connection [message #163511 is a reply to message #163410] Mon, 10 January 2005 22:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ilja.selenzow.web.de

Hmm, what about something like "TextFlow" alining each letter? So I can get
results like this:

| S \ S / S
| t \ t / t
| a \ a / a
| r \ r / r
| t \ t / t

Is it possible? What would be the best approach to do this?

Thanks in advance.

Ilja
"Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
news:cru8kg$b6u$1@www.eclipse.org...
> Text cannot be rotated in SWT.
>
> "Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
> news:crrim1$j69$1@www.eclipse.org...
>> Hi,
>>
>> is it possible to align a label along a connection so it will stay
>> aligned
>> in this way even when connection is drawed in the vertical direction?
>>
>> Thanks in advance.
>>
>> Ilja
>>
>>
>
>
Re: Label aligned along a connection [message #163580 is a reply to message #163511] Tue, 11 January 2005 15:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

I think that rotating the font using an Image buffer would look better.

"Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
news:crv003$8dk$1@www.eclipse.org...
> Hmm, what about something like "TextFlow" alining each letter? So I can
get
> results like this:
>
> | S \ S / S
> | t \ t / t
> | a \ a / a
> | r \ r / r
> | t \ t / t
>
> Is it possible? What would be the best approach to do this?
>
> Thanks in advance.
>
> Ilja
> "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
> news:cru8kg$b6u$1@www.eclipse.org...
> > Text cannot be rotated in SWT.
> >
> > "Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
> > news:crrim1$j69$1@www.eclipse.org...
> >> Hi,
> >>
> >> is it possible to align a label along a connection so it will stay
> >> aligned
> >> in this way even when connection is drawed in the vertical direction?
> >>
> >> Thanks in advance.
> >>
> >> Ilja
> >>
> >>
> >
> >
>
>
Re: Label aligned along a connection [message #163980 is a reply to message #163580] Fri, 14 January 2005 20:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ilja.selenzow.web.de

Hello,

could you be a little more precisely, please? Or is there an example on how
I could do this?

Thanks in advance.

Ilja

"Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
news:cs0sg4$s0f$1@www.eclipse.org...
>I think that rotating the font using an Image buffer would look better.
>
> "Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
> news:crv003$8dk$1@www.eclipse.org...
>> Hmm, what about something like "TextFlow" alining each letter? So I can
> get
>> results like this:
>>
>> | S \ S / S
>> | t \ t / t
>> | a \ a / a
>> | r \ r / r
>> | t \ t / t
>>
>> Is it possible? What would be the best approach to do this?
>>
>> Thanks in advance.
>>
>> Ilja
>> "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
>> news:cru8kg$b6u$1@www.eclipse.org...
>> > Text cannot be rotated in SWT.
>> >
>> > "Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
>> > news:crrim1$j69$1@www.eclipse.org...
>> >> Hi,
>> >>
>> >> is it possible to align a label along a connection so it will stay
>> >> aligned
>> >> in this way even when connection is drawed in the vertical direction?
>> >>
>> >> Thanks in advance.
>> >>
>> >> Ilja
>> >>
>> >>
>> >
>> >
>>
>>
>
>
Re: Label aligned along a connection [message #164138 is a reply to message #163980] Mon, 17 January 2005 16:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Rotate the image of text similar to how photoshop or gimp would do it. I
don't know the algorithms off hand, but I think it involves using matrix
transforms and weighted sampling of one image into another.

"Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
news:cs9adu$teb$1@www.eclipse.org...
> Hello,
>
> could you be a little more precisely, please? Or is there an example on
> how I could do this?
>
> Thanks in advance.
>
> Ilja
>
> "Randy Hudson" <none@us.ibm.com> schrieb im Newsbeitrag
> news:cs0sg4$s0f$1@www.eclipse.org...
>>I think that rotating the font using an Image buffer would look better.
Re: Label aligned along a connection [message #164190 is a reply to message #164138] Mon, 17 January 2005 22:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ilja.selenzow.web.de

Thank you Randy very much for your fast answer,

but the algorithm to perform an affine transformation of a piction isn't my
difficulty, I think...a little bit of coordinates manipulation and
interpolation ;)

But there are two another problems I have to deal with:

1. How can I get an image (preffered a bitmap) of my text that I can rotate
then?
2. How can I place the rotated image on my connection so it won't cover the
figure connection starts at?

______ ________
| |
Label____________ but: |_Label__________
______| ________|


Thanks in advance and I'm sorry, when I'm asking stupid questions.

Ilja
Re: Label aligned along a connection [message #164212 is a reply to message #164190] Mon, 17 January 2005 23:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ilja Selenzow" <ilja.selenzow@web.de> wrote in message
news:cshcnt$dk1$1@www.eclipse.org...
> Thank you Randy very much for your fast answer,
>
> but the algorithm to perform an affine transformation of a piction isn't
> my difficulty, I think...a little bit of coordinates manipulation and
> interpolation ;)
>
> But there are two another problems I have to deal with:
>
> 1. How can I get an image (preffered a bitmap) of my text that I can
> rotate then?

paint to an SWT Image, then call getImageData(). see FigureUtilities for an
example of 90 degree text rotation.
Re: Label aligned along a connection [message #164220 is a reply to message #164190] Mon, 17 January 2005 23:33 Go to previous message
Brian Fernandes is currently offline Brian FernandesFriend
Messages: 68
Registered: July 2009
Member
Ilja,

You can use the following snippet to get bitmap data for rotation.

label would be the Draw2D label figure you wish to rotate, width and
height correspond to the label width and height.

Image = new Image(display, width, height);
GC gc = new GC(image);
SWTGraphics graphics = new SWTGraphics(gc);
label.paint(graphics);
graphics.dispose();
gc.dispose();

image.getImageData() will return an ImageData object whose data field
would be the bitmap data. This data will vary according to your screen
depth - you could get an 8(not sure), 16, 24 or 32 bit bitmap.

Hope this helps,
Brian.


Ilja Selenzow wrote:

> Thank you Randy very much for your fast answer,

> but the algorithm to perform an affine transformation of a piction isn't my
> difficulty, I think...a little bit of coordinates manipulation and
> interpolation ;)

> But there are two another problems I have to deal with:

> 1. How can I get an image (preffered a bitmap) of my text that I can rotate
> then?
> 2. How can I place the rotated image on my connection so it won't cover the
> figure connection starts at?

> ______ ________
> | |
> Label____________ but: |_Label__________
> ______| ________|


> Thanks in advance and I'm sorry, when I'm asking stupid questions.

> Ilja
Previous Topic:Nested properties
Next Topic:Connection Anchors
Goto Forum:
  


Current Time: Fri Sep 27 07:28:38 GMT 2024

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

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

Back to the top