Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Highlight a PictogramElement(Animated Highlighting of a Graphiti Shape)
Highlight a PictogramElement [message #770008] Fri, 23 December 2011 04:35 Go to next message
Kunal Prasad is currently offline Kunal Prasad
Messages: 18
Registered: September 2009
Junior Member
Hi,

I am using Graphiti to develop a editor, where I wish to add debug feature. So user can see shapes getting highlighted when he steps from on node to another in the runtime. Right now I am able to just select the element, which results in change of selection for each node based on debug step.

However, the requirement is to highlight the current debug shape with a outer rectangle of red color. For this there is no direct support from Graphiti, I tried using GEF to draw the rectangle but, it immediately gets repainted due to paintShape method of GFAbstractShape.

So please suggest any effective way to highlight a shape in Graphiti editor, It would be added feature if we can perform some animation like blinking rectangle, or fly-in animation for the outer rectangle.

Thanks,
Kunal
Re: Highlight a PictogramElement [message #771891 is a reply to message #770008] Wed, 28 December 2011 13:14 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Hi Kunal,

I would implement this as a direct part of the shape visualization. The add
feature for that shape would draw an additional outer colored rectangle in
case the domain object is selected in the runtime and the update feature
would also check for this and cause an update if the shape is marked but not
selected or vice versa.

HTH,
Michael
Re: Highlight a PictogramElement [message #771898 is a reply to message #770008] Wed, 28 December 2011 13:34 Go to previous messageGo to next message
Hernan Gonzalez is currently offline Hernan Gonzalez
Messages: 181
Registered: October 2010
Location: Buenos Aires, Argentina
Senior Member
I've implemented this using special decorators - works ok
See here
Re: Highlight a PictogramElement [message #772178 is a reply to message #771898] Thu, 29 December 2011 07:17 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
FWIW: That will be another another (future) possibility. The patch attached
there is still on the waiting list to get integrated. We have some backlog
here due to the large editor API change...

Michael
Re: Highlight a PictogramElement [message #772216 is a reply to message #772178] Thu, 29 December 2011 09:23 Go to previous messageGo to next message
Kunal Prasad is currently offline Kunal Prasad
Messages: 18
Registered: September 2009
Junior Member
Hi All,

Thanks for the suggestions. I would like to bring one important point over here is that when a node is highlighted during debug process, change in diagram model is not acceptable since its a temporary rendering. It should behave as decorations from the tool behavior provider. Let us see the possibility to add a new type of decorator, or in other terms, let allow the user to have his own flavor of decorator, which never modifies the diagram model, but participates in the rendering / painting of the node.

I am still looking for a better solution, Hernan's idea is good, but surely will need new APIs in tool behavior to expose this functionality.

Thanks & Regards,
Kunal
Re: Highlight a PictogramElement [message #1065707 is a reply to message #772216] Thu, 27 June 2013 08:30 Go to previous messageGo to next message
anudeep arya is currently offline anudeep arya
Messages: 36
Registered: March 2013
Member
Hi all

i now have the same problem.did anyone get alternative solution for the problem..
can anyone explain me in brief what can be done to achieve this feature(Change color of pictogram on selection and revert back when it is deselected)

Regards,
Anudeep
Re: Highlight a PictogramElement [message #1065880 is a reply to message #1065707] Fri, 28 June 2013 06:59 Go to previous messageGo to next message
anudeep arya is currently offline anudeep arya
Messages: 36
Registered: March 2013
Member
HI,
Can anyone please give me a solution for the problem.I need it urgent.
Re: Highlight a PictogramElement [message #1065926 is a reply to message #1065880] Fri, 28 June 2013 10:49 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1595
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Anudeep,

did you have a look at the border decorators Hernan mentioned? They are part
of the Graphiti 0.9 shipment already and can be used to draw or colored
rectangle around a shape without modifying the diagram model. See
http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.graphiti.doc%2Fresources%2Fdocu%2Fgfw%2Frendering-decorators.htm&cp=20_1_4_4

Michael
Previous Topic:How do I change color in programmatic way
Next Topic:Send To Front/Back requires a write txn?
Goto Forum:
  


Current Time: Sun Sep 21 12:20:28 GMT 2014

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

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