Akash Mandole
Akash Mandole

Reputation: 1

Customizing Selection Handles of GEF figures

Whenever a figure is selected in the GEF Editor, by default, we see a black,filled rectangle resize handles and a black border outlining the figure. I am implementing a feature where i am explicitly(through code) applying handles to a figure.

Following are some issues i am facing :

1) The handles are not placed close to the figure. They are placed leaving some space between handle and figure

2) I want to change the color filled from black to red

I am new to this kind of development so any examples of customizing these handles will be really use full.

Thanking in advance.

Upvotes: 0

Views: 640

Answers (1)

vainolo
vainolo

Reputation: 6987

The handles are created by the SelectionHandlesEditPolicy (this is an abstract class, the implementation is done in ResizableEditPolicy). This policy is added by GEF to a child figure when it is added to a parent that has a ConstrainedLayoutEditPolicy (i.e. XYLayoutEditPolicy).

What you can do is inherit from your container's edit policy (i.e. XYLayoutEditPolicy) and override the createChildEditPolicy method to return a SelectionHandlesEditPolicy that you implement that creates the handles the way you want them to look.

Upvotes: 0

Related Questions