Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Animation on Connection.
Animation on Connection. [message #234709] Tue, 29 May 2007 10:19 Go to next message
Eclipse UserFriend
Originally posted by: rakesh.pramati.com

Hi,

I want to animate connection figure.

There are 2 editparts and there is a polyline connection between two
editparts.
I want to draw a small ball image which moves just above the connection
line, which moves from source to target editpart. This should happen on
event based.

I tried in following manner but doesn't help.

In PolylineConnection.java

Override

outlinedShape(Graphics g){...} method and trying to draw an image on the
graphics but didn't find the way to remove the image from Graphics and
things
are not happening smoothly.


Any pointer? I need some help immediately.

Thanks in Adavnce.

Thanks
-Rakesh
Re: Animation on Connection. [message #234760 is a reply to message #234709] Wed, 30 May 2007 06:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rakesh.pramati.com

Hi,
After I post a question on news group, I found an answer.
Better way to handle the situation doing animation job on feedback layer
of Editor in separate thread. Just add Figure to FeedbackLayer and remove
it after some interval before you add new one. For better understanding
just see the code below.

This code is written in one of the Connection Editpart.

Image image =
ServicemodelDiagramEditorPlugin.getBundledImageDescriptor("\\icons\\go_over.gif ").createImage();
final ImageFigure imageFigure = new ImageFigure(image);
new Thread(){
public void run() {
int x = 100;
for(int i = 0; i< 1000;i++){
removeFromFeedback(imageFigure);
if(x > 400)
x = 100;
imageFigure.setBounds(new Rectangle(x,100,16,16));
if(i== 999)
break;
addToFeedback(imageFigure);
x = x+16;
try {
getFeedbackLayer().repaint();
sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}.start();

Hope this might help to somebody.

-Rakesh
Re: Animation on Connection. [message #642726 is a reply to message #234760] Thu, 02 December 2010 14:14 Go to previous message
Mostafa ElShafei is currently offline Mostafa ElShafeiFriend
Messages: 39
Registered: October 2010
Member
Hello Rakesh,

I really need to implement this but with GMF not GEF.
I've searched allover the internet nothing showed up :(:(Sad

can you please give me any clue???

Thanks in advance for your help. Smile
Previous Topic:Animation on editpart
Next Topic:Need help syncing scrollbar and figurecanvas
Goto Forum:
  


Current Time: Tue Mar 19 08:42:29 GMT 2024

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

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

Back to the top