Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » MultiText transparency + animations in Graphiti
MultiText transparency + animations in Graphiti [message #1694603] Wed, 06 May 2015 15:14 Go to next message
Jerome S. is currently offline Jerome S.Friend
Messages: 9
Registered: March 2015
Junior Member
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,
Re: MultiText transparency + animations in Graphiti [message #1694810 is a reply to message #1694603] Fri, 08 May 2015 07:18 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1926
Registered: July 2009
Location: Walldorf, Germany
Senior Member

thanks for that proposal, actually I also found several inconsistencies
between Text and MultiText shapes. And it is also true that for other shapes
some cleanup would be needed as well.

So, your proposals sound good to me and I think we should go for something
like that. The only thing I'm not sure about is the introduction of the
abstract base class all shapes can implement, that will be in conflict with
the current class hierarchy. It might be we have to use delegation here.

So, would you file an enhancement bug to track work on this? Not sure if we
can get this into the current release (Eclipse Mars in June) still, as we
are already quite far in the cycle, the milestone will be the first release

Regarding anination: that sounds cool, looking forward to that. :-)

Re: MultiText transparency + animations in Graphiti [message #1694984 is a reply to message #1694810] Mon, 11 May 2015 08:24 Go to previous message
Jerome Sivadier is currently offline Jerome SivadierFriend
Messages: 15
Registered: May 2015
Junior Member

I am glad you agree with this enhancement proposal ! Here is the bugzilla part:

I will keep you in touch regarding animations, I still have several improvements to make to avoid the creation of one Thread per shape which would be really costly Smile.

Previous Topic:Updating graphical model in MultiEditor
Next Topic:Programmatically avoid Activities during Connection Creation
Goto Forum:

Current Time: Sun May 16 01:04:21 GMT 2021

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

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

Back to the top