How to draw draw2D Label vertically [message #209385] |
Tue, 14 February 2006 10:00 |
Eclipse User |
|
|
|
Originally posted by: s.prasad2.zensar.com
Hello,
I would like to draw draw2d Label (org.eclipse.draw2d.Label) "vertically".
Would be great if you suggest someting about it.
Thanks,
-sanjay
|
|
|
|
Re: How to draw draw2D Label vertically [message #209435 is a reply to message #209395] |
Tue, 14 February 2006 15:07 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
I'm not sure rotation would be considered a style. It requires altering the
preferred size.
"Ptitjes" <ptitjes@beuz.org> wrote in message
news:dsscgd$gbp$1@utils.eclipse.org...
> Sanjay,
>
> Just subclass the Label, and override the paintFigure() method by calling
> graphics.rotate(90); before super.paintFigure().
>
> Draw2d team seems to look for a plugable style mechanism that would allow
> to decorate your figures without subclassing them. But you'll have to be
> patient.
>
> Didier.
>
> Sanjay P semwal wrote:
>> Hello,
>>
>> I would like to draw draw2d Label (org.eclipse.draw2d.Label)
>> "vertically".
>> Would be great if you suggest someting about it.
>>
>> Thanks,
>> -sanjay
|
|
|
Re: Soem issues with coordinates [message #209479 is a reply to message #209435] |
Wed, 15 February 2006 14:03 |
Eclipse User |
|
|
|
Originally posted by: geeteshjain.yahoo.com
hi .. i have a issue with the behaviour of graphics object when object is
rotated.
I have been trying to display a text vertically (for Swimlane) in bottom
to top fashion.
for which iam using rotate() method .
protected void paintFigure(Graphics g) {
Rectangle r = getBounds()
g.rotate(270);
g.drawString("Pool", r.x, r.y-55);
}
But after using the rotate method, the coordinates changes..
So i want to know how to trace the exact x,y coordinates after the
rotation method, so that i can place text "pool" in the required fashion
Thanks .
Geetesh
|
|
|
Re: Soem issues with coordinates [message #209633 is a reply to message #209479] |
Fri, 17 February 2006 14:52 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
You need to first translate to the location where the top-left placement of
the rotated text will be. Then rotate, then draw the text at 0,0.
"Geetesh" <geeteshjain@yahoo.com> wrote in message
news:678eb4b89651e9a9e36e3c3ec0ff9188$1@www.eclipse.org...
> hi .. i have a issue with the behaviour of graphics object when object is
> rotated.
> I have been trying to display a text vertically (for Swimlane) in bottom
> to top fashion.
> for which iam using rotate() method .
>
> protected void paintFigure(Graphics g) {
> Rectangle r = getBounds()
> g.rotate(270);
> g.drawString("Pool", r.x, r.y-55);
>
> }
>
> But after using the rotate method, the coordinates changes.. So i want to
> know how to trace the exact x,y coordinates after the rotation method, so
> that i can place text "pool" in the required fashion
>
> Thanks .
> Geetesh
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04017 seconds