Inefficient Create Commands in LogicDesigner [message #49087] |
Thu, 12 December 2002 17:40 |
Bradley Schmerl Messages: 26 Registered: July 2009 |
Junior Member |
|
|
Hi,
I'm trying to write an in GEF that has its own CreateRequest. Subclassing
from CreateRequest (and CreateRequest.Factory), works fine. However, I
noticed in the getCreateCommand method of XYLayoutEditPolicy that every time
there is a mouse move event, it generates a new object. This seems
inefficient, considering that I only want to create the object when I click
the mouse button.
I looked at LogicXYLayoutEditPolicy.getCreateCommand and noticed the same
thing happening, i.e., request.getNewObject is called on every mouse move,
creating a lot of needless objects.
Am I missing something here? Is there a way to only create the object once,
and then reset the request once the command has been executed?
Bradley.
|
|
|
Re: Inefficient Create Commands in LogicDesigner [message #49116 is a reply to message #49087] |
Thu, 12 December 2002 18:05 |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
Please look at the implementation of getNewObject(). The object is only
created once.
Furthermore, if your Command does not require the new object in order to
determine its execution enablement, the command can hold onto the Request,
and only call getNewObject() if execute() is called.
"Bradley Schmerl" <schmerl@cs.cmu.edu> wrote in message
news:atahbn$lgf$1@rogue.oti.com...
> Hi,
>
> I'm trying to write an in GEF that has its own CreateRequest. Subclassing
> from CreateRequest (and CreateRequest.Factory), works fine. However, I
> noticed in the getCreateCommand method of XYLayoutEditPolicy that every
time
> there is a mouse move event, it generates a new object. This seems
> inefficient, considering that I only want to create the object when I
click
> the mouse button.
>
> I looked at LogicXYLayoutEditPolicy.getCreateCommand and noticed the same
> thing happening, i.e., request.getNewObject is called on every mouse move,
> creating a lot of needless objects.
>
> Am I missing something here? Is there a way to only create the object
once,
> and then reset the request once the command has been executed?
>
> Bradley.
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.06989 seconds