|
Re: Rotation and Transparency [message #244329 is a reply to message #244287] |
Wed, 16 July 2008 08:58 |
Simon Bernard 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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03748 seconds