| 
| what happens when create a new model from palette? [message #160272] | Fri, 03 December 2004 01:53  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: hitdemo2002.yahoo.com.cn 
 in logic example, there are two way to create a new model from palette:
 
 the one:left click a templete button in palette,then drag the mouse to
 some place in diagram,release mouse,create a new model.
 
 the two:click a templete button in palette, then in some place in diagram
 ,left click mouse, create a new model.
 
 in method one, mainly use LogicTemplateTransferDropTargetListener to
 accomplish this function.and if i want to add extrally function at this
 moment,i can add code to LogicElementFactory.such as
 
 if (TemplateConstants.TEMPLATE_LOGIC_LABEL.equals(template))
 LogicLabel ss= new LogicLabel();
 ss.setXXX();//
 return ss();
 
 but in method two, CombinedTemplateCreationEntry create a new instance of
 templete, and when left click mouse in diagram, it is do what????i want to
 add some extrally function at this moment?what can i do?
 |  |  |  | 
| 
| Re: what happens when create a new model from palette? [message #160304 is a reply to message #160272] | Fri, 03 December 2004 02:55  |  | 
| Eclipse User  |  |  |  |  | Originally posted by: Lamont_Gilbert.rigidsoftware.com 
 hitdemo2002 wrote:
 > in logic example, there are two way to create a new model from palette:
 > the one:left click a templete button in palette,then drag the mouse to
 > some place in diagram,release mouse,create a new model.
 >
 > the two:click a templete button in palette, then in some place in
 > diagram ,left click mouse, create a new model.
 >
 > in method one, mainly use LogicTemplateTransferDropTargetListener to
 > accomplish this function.and if i want to add extrally function at this
 > moment,i can add code to LogicElementFactory.such as
 >   if (TemplateConstants.TEMPLATE_LOGIC_LABEL.equals(template))
 >            LogicLabel ss= new LogicLabel();
 >            ss.setXXX();//
 >            return ss();
 >
 > but in method two, CombinedTemplateCreationEntry create a new instance
 > of templete, and when left click mouse in diagram, it is do what????i
 > want to add some extrally function at this moment?what can i do?
 >
 That is probably implemented by a CreationTool.  search for
 org.eclipse.gef.palette.CreationToolEntry or
 org.eclipse.gef.tools.CreationTool
 
 --
 Respectfully,
 
 
 CL Gilbert
 
 "Verily, verily, I say unto you, He that entereth not by the door() into
 the sheepfold{}, but climbeth up some other *way, the same is a thief
 and a robber."
 
 GnuPG Key Fingerprint:
 82A6 8893 C2A1 F64E A9AD  19AE 55B2 4CD7 80D2 0A2D
 
 For a free Java interface to Freechess.org see
 http://www.rigidsoftware.com/Chess/chess.html
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.03431 seconds