I agree with Bob, that this would be better handled using stereotypes . It also occurred to me that it might be an interesting use case for scriptability though. There are these occassional needs for being able to script something without having to write a plugin.
Mark On 3/19/09, Bob Tarling <[email protected]> wrote: > I would suggest that you use stereotypes rather than colour to give > special meaning to an actor. > > Creating buttons that will automatically assign a stereotype to the > model element it creates is something I've long wanted to do should I > not be as pressed as I am with so many other tasks. > > To achieve this for a hard-coded stereotype of your choice you could > extend CmdCreateNode to your own custom code. > > The following is an idea just typed by hand so you will need to tweak > to get to work. > > public class ActionCreateStereotypedNode extends CmdCreateNode { > > private final Object stereotype; > > public ActionCreateStereotypedNode(Object nodeType, Object > stereotype, String name) { > super(nodeType, name); > this.sterotype = stereotype; > } > > public Object makeNode() { > Object actor = super.makeNode(); > Model.getExtensionMechanismsHelper().addCopyStereotype(actor, > myStereotype); > return actor; > } > } > > With this you can have a stereotype of you choice set in the model element. > > If you really want colour then you could get your Fig to change colour > according to stereotype. > > Bob. > > > 2009/3/19 aminesirine <[email protected]>: >> Hello >> I still not very familiar with the source code, i can't really understand >> your solution. >> here's the procedure that I follow to create the new button >> 1)I add the new button declaration in button.properties >> 2)I set the icon for my button >> 3)in UMLUseCaseDiagram.java I add the declaration of the Action: >> private Action actionActorT; >> 4)finally i implement the getActionActorT() method >> //////////////////////////////////////////// >> protected Action getActionActorT() { >> if (actionActorT == null) { >> actionActorT = new RadioAction(new CmdCreateNode( >> Model.getMetaTypes().getActor(), "button.new-actorT")); >> } >> return actionActorT; >> } >> //////////////////////////////////////////// >> the result: the new button appers in the toolbar but when i click on it, >> the same actor appears >> the question is ,how to separate between the figure of the normal actor >> and the new actor >> thank you >> >> ------------------------------------------------------ >> http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1357378 >> >> To unsubscribe from this discussion, e-mail: >> [[email protected]]. >> To be allowed to post to the list contact the mailing list moderator, >> email: [[email protected]] >> > > ------------------------------------------------------ > http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1358823 > > To unsubscribe from this discussion, e-mail: > [[email protected]]. > To be allowed to post to the list contact the mailing list moderator, email: > [[email protected]] > -- Mark Fortner blog: http://feeds.feedburner.com/jroller/ideafactory ------------------------------------------------------ http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1359166 To unsubscribe from this discussion, e-mail: [[email protected]]. To be allowed to post to the list contact the mailing list moderator, email: [[email protected]]
