Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Highlight the lines/connections
Highlight the lines/connections [message #854277] Mon, 23 April 2012 21:00 Go to next message
Che Bumagat is currently offline Che BumagatFriend
Messages: 41
Registered: February 2012
Member
Hello GMF Experts!

In my diagram editor, I'm trying to add a feature that when a user hovers the mouse on a connecting line between Figure A to Figure B, it highlights both the connecting line and the borders for Figures A and B. (Basically, I was just thinking of changing the line border to "NEON GREEN" to indicate a highlighted figure)

How do I do this in GMF? Is there an example that I can follow for this feature?
Is this done by adding a new Edit Policy?

Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854760 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854767 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854773 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854778 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854784 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854791 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #854799 is a reply to message #854277] Tue, 24 April 2012 08:06 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 29
Registered: July 2009
Junior Member
Hello,

You should use the SelectionEditPolicy (org.eclipse.gef.editpolicies)
and override method showSelection().
This policy corresponds to the role EditPolicy.SELECTION_FEEDBACK_ROLE.

You can change it in the createDefaultEditPolicies() of your edge edit part.

Regards,

Laurent

On 23/04/2012 23:00, Che Bumagat wrote:
> Hello GMF Experts!
>
> In my diagram editor, I'm trying to add a feature that when a user
> hovers the mouse on a connecting line between Figure A to Figure B, it
> highlights both the connecting line and the borders for Figures A and B.
> (Basically, I was just thinking of changing the line border to "NEON
> GREEN" to indicate a highlighted figure)
>
> How do I do this in GMF? Is there an example that I can follow for this
> feature?
> Is this done by adding a new Edit Policy?
> Thanks again and appreciate the help in advance!
Re: Highlight the lines/connections [message #855071 is a reply to message #854760] Tue, 24 April 2012 13:51 Go to previous messageGo to next message
Che Bumagat is currently offline Che BumagatFriend
Messages: 41
Registered: February 2012
Member
Hi,

Thanks for the reply. I tried that implementation and it enabled me to change the Figure properties (i.e. border colors etc) but only when I select the actual link or connection in the diagram.

Is there a way to do this just by hovering the mouse over my target Edit Part (i.e. connections). I tried implementing the MouseMotionListener.mouseHover() in my EditPolicy but that didn't help me.

As always, appreciat the help!

Re: Highlight the lines/connections [message #855073 is a reply to message #855071] Tue, 24 April 2012 13:52 Go to previous message
Che Bumagat is currently offline Che BumagatFriend
Messages: 41
Registered: February 2012
Member
What I mean by, "it didn't help me' was that at runtime, it didn't hit the my implemented method in mouseHover().
Previous Topic:How can I add nodes with the CreateElementRequest
Next Topic:How do you set the lines not to overlap each other?
Goto Forum:
  


Current Time: Tue Oct 20 03:50:50 GMT 2020

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

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

Back to the top