when do handle methods get called? [message #142855] |
Thu, 15 July 2004 15:38  |
Eclipse User |
|
|
|
all,
i have subclassed the ResizeHandle and the MoveHandle to do some custom
handle stuff, specifically rotation. all works well the first time the
handles get instantiated (from the createSelectionHandles() method of my
edit part policy). i first create the move handle and apply the rotation
function, then i create each resize handle for the eight different
directions. i pass the MoveHandle into the ResizeHandle constructor
because the MoveHandle has some info i need for the ResizeHandle,
specifically the XY info for the new corners and midpoints.
my problem is i do not understand the sequence of events that the GEF does
to redraw the handles. right now, there is rotation logic in the
paintFigure method of the MoveHandle. unfortunately, the ResizeHandles
are getting redrawn before the MoveHandle after the first time the handles
are created, so the ResizeHandles are not being updated properly. this is
the case if i change the angle in the model while the figure is currently
selected (through the properties view).
what objects are managing the handle drawing when the selected object is
asked to redraw itself. in this case, a new handle is not created. i
would like to find a better place to manage the rotation methods than the
paint() methods to do calculations and adjustments for the handles, but i
cannot find one.
thanks,
steve
|
|
|
Re: when do handle methods get called? [message #143108 is a reply to message #142855] |
Sun, 18 July 2004 13:03   |
Eclipse User |
|
|
|
never mind,
fixed my problem. just leaning more on the model.
steve
steven melzer wrote:
> all,
> i have subclassed the ResizeHandle and the MoveHandle to do some custom
> handle stuff, specifically rotation. all works well the first time the
> handles get instantiated (from the createSelectionHandles() method of my
> edit part policy). i first create the move handle and apply the rotation
> function, then i create each resize handle for the eight different
> directions. i pass the MoveHandle into the ResizeHandle constructor
> because the MoveHandle has some info i need for the ResizeHandle,
> specifically the XY info for the new corners and midpoints.
> my problem is i do not understand the sequence of events that the GEF does
> to redraw the handles. right now, there is rotation logic in the
> paintFigure method of the MoveHandle. unfortunately, the ResizeHandles
> are getting redrawn before the MoveHandle after the first time the handles
> are created, so the ResizeHandles are not being updated properly. this is
> the case if i change the angle in the model while the figure is currently
> selected (through the properties view).
> what objects are managing the handle drawing when the selected object is
> asked to redraw itself. in this case, a new handle is not created. i
> would like to find a better place to manage the rotation methods than the
> paint() methods to do calculations and adjustments for the handles, but i
> cannot find one.
> thanks,
> steve
|
|
|
Re: when do handle methods get called? [message #1780633 is a reply to message #143108] |
Thu, 25 January 2018 01:52  |
Eclipse User |
|
|
|
I met the familiar problem.
I just called the graphics.rotate function in #paintFigure(Graphics graphics).
The text of my label was rotated correctly, but the move handle and eight resize handles aren't rotated because the bounds in the editpart's figure isn't modified.
May you give me some suggestions to create the move handle and resize handles based on the rotated text position?
[Updated on: Tue, 06 February 2018 22:10] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03001 seconds