Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[gef-dev] How to redraw a Connection

Hi all,
i'm developing a multipage Editor using GEF.
I have some blocks connected through standard Connection objects, in
particular I have a TransitionEditPart that extends
AbstractConnectionEditPart.
The TransitionEditPart draws a Polyline connection as follows:

PolylineConnection c = new PolylineConnection();
setLineAppearence(c);
c.setConnectionRouter(new ManhattanConnectionRouter());
// Creates a tooltip with the transition ID
tooltip = new Label("  "+host.getID()+"  ");
tooltip.setOpaque(true);
c.setToolTip(tooltip);
c.setTargetDecoration(new PolylineDecoration());
return c;

The problem is that I have 5 types of transitions and everyone has its own
color and appearence (I set this with the setLineAppearence method). The
TransitionEditPart is associated to a PropertySheet that shows its type.
When I change the type in the Property View, I update the model and then
fire a property change event, caught by the propertyChange method of my
TransitionEditPart. 
So...the question: how can I force the Connection to be redrawn? I tried all
the repaint, revalidate, refresh methods, but the visual aspect of the edit
part never changes according to the the modified property. I think that a
solution could be to delete the Connection and then redraw it, but I'm not
able to do that...

Any suggestion?

In general which is the best way to do a graphical refresh of an Edit Part
after a property change event? My solution in other cases was to
delete/add/refresh the part...
 
Thanks in advance,
	Alessandro



Back to the top