Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Animation on editpart
Animation on editpart [message #248208] Thu, 09 April 2009 15:06 Go to next message
BG is currently offline BG
Messages: 45
Registered: July 2009
Member
Hi,
I have requirement to show animation on editparts. i,e i have set of
connections which has a source and traget node.
On a event i need to highlight the single node at a time till it reaches
its target point node

eq

A C1 B C2 D
where C1 and C2 are connections and A,B and D are the nodes

with the below implementationn it is all the nodes are get highlighted
together but what i need is first highlight the A,then some time interval
B and then C

private void blinkingFeature(Set<ConnectionEditPart> tracedConnEditParts)
{
for (ConnectionEditPart connectionEditPart : tracedConnEditParts)
{
final GraphicalEditPart targetEditPart =
(GraphicalEditPart)connectionEditPart.getTarget();
final GraphicalEditPart sourcEditPart =
(GraphicalEditPart)connectionEditPart.getSource();

Thread thread1 = new Thread(new AnimatePort(targetEditPart));
thread1.start();
Thread thread2 = new Thread(new AnimatePort(sourcEditPart));
thread2.start();
}
}



private class AnimatePort implements Runnable
{
GraphicalEditPart graphicalEditPart;
public AnimatePort(final GraphicalEditPart graphicalEditPart)
{
this.graphicalEditPart = graphicalEditPart;
}
public void run() {
for(int i = 1; i < 20;i++)
{
if(i % 2 == 0)
{
Display.getDefault().syncExec( new Runnable(){

@Override
public void run() {

setColorBorder(graphicalEditPart, ColorConstants.red);
}

});
}else
{
Display.getDefault().syncExec( new Runnable(){

@Override
public void run() {
setColorBorder(graphicalEditPart, ColorConstants.black);

}

});
}
try {
Thread.sleep(300);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}


I tried the thread join but it us blocking my UI update process. Any idea
how achive this ?

Regards
Byre
Re: Animation on editpart [message #642712 is a reply to message #248208] Thu, 02 December 2010 08:26 Go to previous message
Mostafa ElShafei is currently offline Mostafa ElShafei
Messages: 39
Registered: October 2010
Member
Hello all,

I want to achieve the same, any updates????

Thanks in advance for any help. Smile

[Updated on: Thu, 02 December 2010 08:31]

Report message to a moderator

Previous Topic:Customize Palette
Next Topic:Animation on Connection.
Goto Forum:
  


Current Time: Thu Apr 17 03:40:12 EDT 2014

Powered by FUDForum. Page generated in 0.02840 seconds