Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem to draw a vertical Label
Problem to draw a vertical Label [message #210264] Thu, 23 February 2006 15:45 Go to next message
Eclipse UserFriend
Originally posted by: virginie.legrand.gmail.com

Hi,

I tried to draw a Vertical Label :

public class VerticalLabel extends Label {

public VerticalLabel (String name) {
super(name);
}
....
protected void paintFigure(Graphics g) {
g.rotate (90);
super (g);

}
...
}

When adding to my Figure, it is displayed but not rotated !
What is wrong ?

thanks
Virginie
Re: Problem to draw a vertical Label [message #210575 is a reply to message #210264] Wed, 01 March 2006 18:08 Go to previous message
Steven R. Shaw is currently offline Steven R. ShawFriend
Messages: 128
Registered: July 2009
Senior Member
Not sure, I think you'd need to adjust the bounds of your label (to be
vertically oriented) otherwise it will likely be clipped to the horizontal
label extent.

There's a utility that you might find convenient:

org.eclipse.draw2dImageUtilities#createRotatedImageOfString( ..)

-Steve

"Virginie Legrand" <virginie.legrand@gmail.com> wrote in message
news:654acccb61a54b4acf07a870c4667b52$1@www.eclipse.org...
> Hi,
>
> I tried to draw a Vertical Label :
>
> public class VerticalLabel extends Label {
>
> public VerticalLabel (String name) {
> super(name);
> }
> ...
> protected void paintFigure(Graphics g) {
> g.rotate (90);
> super (g);
>
> }
> ..
> }
>
> When adding to my Figure, it is displayed but not rotated !
> What is wrong ?
>
> thanks
> Virginie
>
Previous Topic:Issue of Parent child Realtionship
Next Topic:How could I invoke the undoable command?
Goto Forum:
  


Current Time: Thu Apr 25 10:04:52 GMT 2024

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

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

Back to the top