MultiText transparency + animations in Graphiti [message #1694603] |
Wed, 06 May 2015 11:14  |
Eclipse User |
|
|
|
Dear Michael,
I am currently trying to add animations to Graphiti and I am struggling with modifying the transparency of a GFTextFlow, the internal Figure associated with a MultiText.
Actually it looks like all GF* inheriting from Figure do not have the same internal design, especially regarding the transparency and GraphicsAlgorithm management. For example GFText internally stores a Text and calls the method Graphics#setAlpha() with the transparency given by the Text GA. It also provides a convenient method "getGraphicsAlgorithm()" which returns this internal Text shape. On the other hand GFTextFlow (its sibling for MultiText shapes) also stores a MultiText but does not call the method Graphics#setAlpha() and neither provides a method to get the stored MultiText.
Indeed when anyone wants to play with the draw2d shapes, we got quite early blocked because of these inconsistencies...
What I would suggest is:
- To have a unified way to get back to GraphicsAlgorithm(s) from GFShapes by adding an API interface providing at least a method "getGraphicsAlgorithm" for all GF elements which directly represent a GraphicsAlgorithm.
- To have an abstract class implementing the previous interface and setting common values coming from GraphicsAlgorithm(s). All "final" GFShapes should extend this class.
- To add transparency support for GFTextFlow -> MultiText shapes
I would like to know your opinion on these proposals.
By the way I have found a way to "animate" a bit Graphiti shapes programmatically. The main point to have an "animation thing" is to spawn a background Thread which plays "frames" corresponding to the decomposition of the move from the start point to the end point and sleeps for a given amount of time between two frames.
It works quite well for translations and resize and except from the MultiText thing it works well for transparency modification. I am working on a kind of library supporting these animations, when it will be finished I can post my code here if anyone is interested.
Best regards,
Jérôme
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26564 seconds