Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » when do handle methods get called?
when do handle methods get called? [message #142855] Thu, 15 July 2004 19:38 Go to next message
steven melzer is currently offline steven melzerFriend
Messages: 38
Registered: July 2009
Member
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 17:03 Go to previous messageGo to next message
steven melzer is currently offline steven melzerFriend
Messages: 17
Registered: July 2009
Junior Member
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 06:52 Go to previous message
lee lucky is currently offline lee luckyFriend
Messages: 26
Registered: October 2017
Junior Member
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: Wed, 07 February 2018 03:10]

Report message to a moderator

Previous Topic:Apply changes to all the figures
Next Topic:[GEF]Call rotate in paintFigure but moveHandle isn't rotated
Goto Forum:
  


Current Time: Fri Apr 19 23:09:56 GMT 2024

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

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

Back to the top