Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Rotation and Transparency
Rotation and Transparency [message #244287] Mon, 14 July 2008 17:20 Go to next message
Michael Swearingen is currently offline Michael SwearingenFriend
Messages: 26
Registered: July 2009
Junior Member
Hello Everyone,

I've seen this topic before but being a GEF newbie the posts confused me.
I would like to add rotation and transparency to the shapes in my project.
Currently I am using built in Draw2D objects and haven't written /
overridden a paint function yet. I understand that I need to override the
paint functions and use the rotation and setAlpha functions in the
graphics object to change the rotation and transparency values to what I
want. My question is which function(s) do I need to override, and can I
do something like:

@Override
public void paint(Graphics graphics)
{
graphics.setAlpha(100);
super.paint(graphics);
}

or do I need to do something more in depth?

Thanks,
MS
Re: Rotation and Transparency [message #244329 is a reply to message #244287] Wed, 16 July 2008 08:58 Go to previous message
Simon Bernard is currently offline Simon BernardFriend
Messages: 345
Registered: July 2009
Senior Member
Hello,

To add alpha to your figure you must do something like the
foregroundColor or backgroundColor stuff in class Figure!
- add an attribute,Setter,Getter
- use it to set the alpha of your graphics in the paint as you do

To add rotate,that will be more difficult, but you can see this bug :
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=117012
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=167316
I do not advise you to use rotate of the graphics, it allow you to only
do rotation around the origin (0,0)

Simon Bernard

Michael S. a écrit :
> Hello Everyone,
>
> I've seen this topic before but being a GEF newbie the posts confused
> me. I would like to add rotation and transparency to the shapes in my
> project. Currently I am using built in Draw2D objects and haven't
> written / overridden a paint function yet. I understand that I need to
> override the paint functions and use the rotation and setAlpha functions
> in the graphics object to change the rotation and transparency values to
> what I want. My question is which function(s) do I need to override,
> and can I do something like:
>
> @Override
> public void paint(Graphics graphics)
> {
> graphics.setAlpha(100);
> super.paint(graphics);
> }
>
> or do I need to do something more in depth?
>
> Thanks,
> MS
>
Previous Topic:Square But Not Rectangle Problem
Next Topic:Moving Shapes Problem
Goto Forum:
  


Current Time: Fri Apr 26 09:25:09 GMT 2024

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

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

Back to the top