Shouldn't getDragTracker() return always the same instance of a DragTracker? [message #24963] |
Mon, 07 October 2002 10:48  |
Eclipse User |
|
|
|
Hello,
I am a bit concerned by the implementation of the getDragTracker() method in
class org.eclipse.gef.examples.logicdesigner.edit.LogicDiagramEdit Part of
the Logical Diagram Editor example (latest version, i.e., 20020821).
Indeed, this method implementation:
public DragTracker getDragTracker(Request req){
return new MarqueeDragTracker();
}
returns a new object each time it is called.... and it is called each time a
drag selection is began.
Shouldn't it be better to use a singleton to create once a
MarqueeDragTracker() and always return this instance?
I made this modification to my code which run fine, except that it does no
longuer perform so many object creations...
Is this okay from GEF interfaces / internal flow of calls, or am I taking a
risk?
Best regards,
Alex
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02410 seconds