Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Inefficient Create Commands in LogicDesigner
Inefficient Create Commands in LogicDesigner [message #49087] Thu, 12 December 2002 17:40 Go to next message
Bradley Schmerl is currently offline Bradley SchmerlFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
>
>
Re: Inefficient Create Commands in LogicDesigner [message #227713 is a reply to message #49116] Sun, 10 December 2006 23:58 Go to previous message
Eclipse UserFriend
Originally posted by: taylorpj.btopenworld.com

I still don't understand this. I agree that multiple Command objects seem to be created needlessly. Can someone clear this up for me?
Previous Topic:Editor not working inside a MultiPageEditor
Next Topic:draw2d "scrolling monitor" question
Goto Forum:
  


Current Time: Sat Jul 27 18:19:46 GMT 2024

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

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

Back to the top