PolylineConnection color when focused [message #1059230] |
Fri, 17 May 2013 12:13 |
|
Hi all,
I have a GMF diagram created with a graphical element of type PolylineConnectionEx ( this would be the baseclass). My figure element is properly displayed but I would like to change its color at selection time, meaning the color of the line dash to become green or something.
Do you have any hints for this? In the EditPart for this figure I see no handling for it. I have handleFocusedGain from IFigure but the note says not to overwrite it. Doing the opposite does not execute this code.
Any other clues?
|
|
|
|
Re: PolylineConnection color when focused [message #1059536 is a reply to message #1059426] |
Mon, 20 May 2013 11:24 |
|
Hi Ralph,
Thank you for the hint. I have now the following:
- created the editPolicy with the key SELECTION_FEEDBACK_ROLE
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
new MyFigureItemSemanticEditPolicy());
- in the xxxItemSemanticEditPolicy I override the getHost -> had no other idea to get the figure
public EditPart getHost() {
IFigure figure=null;
if(super.getHost() instanceof MyFigureEditPart)
{
((MyFigureEditPart)super.getHost()).getFigure().setForegroundColor(new Color(null, 153, 204, 255));
}
return super.getHost();
}
So now I have it colored. Moving to another figure of same type, will color the newly selected as well but the previous is still colored. How should I clear the color from the previous figure?
Thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03082 seconds