Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to draw draw2D Label vertically
How to draw draw2D Label vertically [message #209385] Tue, 14 February 2006 10:00 Go to next message
Eclipse UserFriend
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 #209395 is a reply to message #209385] Tue, 14 February 2006 16:47 Go to previous messageGo to next message
Didier Villevalois is currently offline Didier VillevaloisFriend
Messages: 86
Registered: July 2009
Member
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: How to draw draw2D Label vertically [message #209435 is a reply to message #209395] Tue, 14 February 2006 15:07 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
>
>
Re: Soem issues with coordinates [message #1715206 is a reply to message #209633] Fri, 20 November 2015 09:11 Go to previous message
Swaroop Shastri is currently offline Swaroop ShastriFriend
Messages: 7
Registered: November 2015
Junior Member
Hi,
Can you tell me is there any way, we can optimize paintfigure () method in GEF ? I am see it is getting called continuously , so want to make sure it does not leak memory ...
Previous Topic:meassuring performance and optimization of figure painting
Next Topic:[GEF4] FXViewer don't work into FX SplitPane.
Goto Forum:
  


Current Time: Fri Apr 26 06:50:47 GMT 2024

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

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

Back to the top