Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » stereotyping port
stereotyping port [message #475125] Mon, 13 August 2007 13:26 Go to next message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

With uml2 tools I select a port and an interface and I want to stereotype
them.

I have the object, when I debug I see that I have the relevant element
selected. Next I want to look up the relevant stereotypes using (got this
from the class diagram example, I'm doing it in the component diagram):

EList<Stereotype> stereotypes = element.getApplicableStereotypes();

My element is an instance of port and I want to retrieve any relevant
stereotypes that exist. By relevant stereotypes I mean stereotypes that
extend UML:port in my uml definition.

However when I do this I get an empty list.

One other thing. When I have retrieved a relevant sterotype and want to
apply it. I can do this with applyStereotype?

thx in advance for any help,

regards,
Nick
Re: stereotyping port [message #475126 is a reply to message #475125] Mon, 13 August 2007 15:01 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Nick,

If you've defined your profile and stereotypes correctly and you've applied
your profile to your model correctly, then getApplicableStereotypes() should
return all stereotypes that you could apply to your port. If you send your
profile I could have a look at it to double check it.

And yes, applyStereotype() should apply your stereotype.

- James.


"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:f2a67332a35c6d66b5e524235968c723$1@www.eclipse.org...
> hi,
>
> With uml2 tools I select a port and an interface and I want to stereotype
> them.
>
> I have the object, when I debug I see that I have the relevant element
> selected. Next I want to look up the relevant stereotypes using (got this
> from the class diagram example, I'm doing it in the component diagram):
>
> EList<Stereotype> stereotypes = element.getApplicableStereotypes();
>
> My element is an instance of port and I want to retrieve any relevant
> stereotypes that exist. By relevant stereotypes I mean stereotypes that
> extend UML:port in my uml definition.
>
> However when I do this I get an empty list.
>
> One other thing. When I have retrieved a relevant sterotype and want to
> apply it. I can do this with applyStereotype?
>
> thx in advance for any help,
>
> regards,
> Nick
>
Re: stereotyping port [message #475134 is a reply to message #475126] Wed, 15 August 2007 19:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

thx for your reply,

My model is very simple, I have a stereotype, a metaclass reference and an
extension that links stereotype to the reference class. I then define it.
I did this in the new->other uml diagrams->component. The component
diagram is then linked to the uml meta model right?

So really the only thing i'm not sure about is:
and you've applied
your profile to your model correctly,

Do I have to apply the uml stereotype definitions to my component diagram,
in code or in the ui?

regards,
Nick
Re: stereotyping port [message #475135 is a reply to message #475126] Thu, 16 August 2007 10:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

I just noticed something.

If I create a class diagram. In the UML diagram I create a profile, name
the profile something, then go to umleditor->profile->define. This works

If I create a component diagram. In the UML diagram I create a profile,
name the profile something, then go to umleditor->profile->define. This
does NOT work.

If I can't define it then I can't use any stereotypes in the component
diagram.

regards,
Nick
Re: stereotyping port [message #475136 is a reply to message #475135] Thu, 16 August 2007 12:56 Go to previous messageGo to next message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Nick,

That sounds like a UMLTools usability issue. You might want to ask this
question there.

- James.

"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:32b4dfad46f9f1752100445a138a6c75$1@www.eclipse.org...
> hi,
>
> I just noticed something.
>
> If I create a class diagram. In the UML diagram I create a profile, name
> the profile something, then go to umleditor->profile->define. This works
>
> If I create a component diagram. In the UML diagram I create a profile,
> name the profile something, then go to umleditor->profile->define. This
> does NOT work.
>
> If I can't define it then I can't use any stereotypes in the component
> diagram.
>
> regards,
> Nick
>
Re: stereotyping port [message #475137 is a reply to message #475136] Thu, 16 August 2007 15:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

The uml2tools newsgroup seems to be dead. I've seen some questions posted
but no answers from anyone who really knows anything.

What I want to do is this:
define stereotypes in the uml diagram
use the stereotypes to stereotype components in comp. diagram.

As a quick fix I could programmatically add stereotypes so that when I
right click a component it gets the stereotypes from there.

My question really is can you explain how I can access/modify the profile
with code so that the comp. diagram can use it, or is this too uml2tools
specific?

At the moment getApplicableStereotypes returns nothing. I'd like it to
return some stereotypes that I can use.

regards,
Nick
Re: stereotyping port [message #475138 is a reply to message #475137] Thu, 16 August 2007 17:34 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Nick,

The getting started articles in UML2 explain how to work programatically
with profiles. Everything you need to work with profiles should be
outlined there, ie. adding stereotypes programatically, defining your
profile etc.

Whether the UML2Tools Component diagram can use that information is a
question I can't answer. Also, I don't know if they provide a convenient
means to "define" your profile, from your previous post it sounds like it
works with Class diagrams but not Component diagrams?

If you follow the instructions in the getting started article regarding
profiles, then getApplicableStereotypes should work. If it doesn't then
you can post your profile with model and I can have a look at it, or you can
step into the getApplicableStereotypes() method and determine why it is
failing.

- James.


"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:d690cfc48f64c04f41ee55a02e9e3c63$1@www.eclipse.org...
> hi,
>
> The uml2tools newsgroup seems to be dead. I've seen some questions posted
> but no answers from anyone who really knows anything.
>
> What I want to do is this:
> define stereotypes in the uml diagram
> use the stereotypes to stereotype components in comp. diagram.
>
> As a quick fix I could programmatically add stereotypes so that when I
> right click a component it gets the stereotypes from there.
>
> My question really is can you explain how I can access/modify the profile
> with code so that the comp. diagram can use it, or is this too uml2tools
> specific?
>
> At the moment getApplicableStereotypes returns nothing. I'd like it to
> return some stereotypes that I can use.
>
> regards,
> Nick
>
Re: stereotyping port [message #624386 is a reply to message #475125] Mon, 13 August 2007 15:01 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Nick,

If you've defined your profile and stereotypes correctly and you've applied
your profile to your model correctly, then getApplicableStereotypes() should
return all stereotypes that you could apply to your port. If you send your
profile I could have a look at it to double check it.

And yes, applyStereotype() should apply your stereotype.

- James.


"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:f2a67332a35c6d66b5e524235968c723$1@www.eclipse.org...
> hi,
>
> With uml2 tools I select a port and an interface and I want to stereotype
> them.
>
> I have the object, when I debug I see that I have the relevant element
> selected. Next I want to look up the relevant stereotypes using (got this
> from the class diagram example, I'm doing it in the component diagram):
>
> EList<Stereotype> stereotypes = element.getApplicableStereotypes();
>
> My element is an instance of port and I want to retrieve any relevant
> stereotypes that exist. By relevant stereotypes I mean stereotypes that
> extend UML:port in my uml definition.
>
> However when I do this I get an empty list.
>
> One other thing. When I have retrieved a relevant sterotype and want to
> apply it. I can do this with applyStereotype?
>
> thx in advance for any help,
>
> regards,
> Nick
>
Re: stereotyping port [message #624416 is a reply to message #475126] Wed, 15 August 2007 19:39 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

thx for your reply,

My model is very simple, I have a stereotype, a metaclass reference and an
extension that links stereotype to the reference class. I then define it.
I did this in the new->other uml diagrams->component. The component
diagram is then linked to the uml meta model right?

So really the only thing i'm not sure about is:
and you've applied
your profile to your model correctly,

Do I have to apply the uml stereotype definitions to my component diagram,
in code or in the ui?

regards,
Nick
Re: stereotyping port [message #624417 is a reply to message #475126] Thu, 16 August 2007 10:10 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

I just noticed something.

If I create a class diagram. In the UML diagram I create a profile, name
the profile something, then go to umleditor->profile->define. This works

If I create a component diagram. In the UML diagram I create a profile,
name the profile something, then go to umleditor->profile->define. This
does NOT work.

If I can't define it then I can't use any stereotypes in the component
diagram.

regards,
Nick
Re: stereotyping port [message #624418 is a reply to message #475135] Thu, 16 August 2007 12:56 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Hi Nick,

That sounds like a UMLTools usability issue. You might want to ask this
question there.

- James.

"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:32b4dfad46f9f1752100445a138a6c75$1@www.eclipse.org...
> hi,
>
> I just noticed something.
>
> If I create a class diagram. In the UML diagram I create a profile, name
> the profile something, then go to umleditor->profile->define. This works
>
> If I create a component diagram. In the UML diagram I create a profile,
> name the profile something, then go to umleditor->profile->define. This
> does NOT work.
>
> If I can't define it then I can't use any stereotypes in the component
> diagram.
>
> regards,
> Nick
>
Re: stereotyping port [message #624419 is a reply to message #475136] Thu, 16 August 2007 15:37 Go to previous message
Eclipse UserFriend
Originally posted by: nickkirtley.gmail.com

hi,

The uml2tools newsgroup seems to be dead. I've seen some questions posted
but no answers from anyone who really knows anything.

What I want to do is this:
define stereotypes in the uml diagram
use the stereotypes to stereotype components in comp. diagram.

As a quick fix I could programmatically add stereotypes so that when I
right click a component it gets the stereotypes from there.

My question really is can you explain how I can access/modify the profile
with code so that the comp. diagram can use it, or is this too uml2tools
specific?

At the moment getApplicableStereotypes returns nothing. I'd like it to
return some stereotypes that I can use.

regards,
Nick
Re: stereotyping port [message #624420 is a reply to message #475137] Thu, 16 August 2007 17:34 Go to previous message
james bruck is currently offline james bruckFriend
Messages: 1724
Registered: July 2009
Senior Member
Nick,

The getting started articles in UML2 explain how to work programatically
with profiles. Everything you need to work with profiles should be
outlined there, ie. adding stereotypes programatically, defining your
profile etc.

Whether the UML2Tools Component diagram can use that information is a
question I can't answer. Also, I don't know if they provide a convenient
means to "define" your profile, from your previous post it sounds like it
works with Class diagrams but not Component diagrams?

If you follow the instructions in the getting started article regarding
profiles, then getApplicableStereotypes should work. If it doesn't then
you can post your profile with model and I can have a look at it, or you can
step into the getApplicableStereotypes() method and determine why it is
failing.

- James.


"Nick Kirtley" <nickkirtley@gmail.com> wrote in message
news:d690cfc48f64c04f41ee55a02e9e3c63$1@www.eclipse.org...
> hi,
>
> The uml2tools newsgroup seems to be dead. I've seen some questions posted
> but no answers from anyone who really knows anything.
>
> What I want to do is this:
> define stereotypes in the uml diagram
> use the stereotypes to stereotype components in comp. diagram.
>
> As a quick fix I could programmatically add stereotypes so that when I
> right click a component it gets the stereotypes from there.
>
> My question really is can you explain how I can access/modify the profile
> with code so that the comp. diagram can use it, or is this too uml2tools
> specific?
>
> At the moment getApplicableStereotypes returns nothing. I'd like it to
> return some stereotypes that I can use.
>
> regards,
> Nick
>
Previous Topic:Borland Together 2006
Next Topic:Adding additional non-UML informations
Goto Forum:
  


Current Time: Tue Apr 16 08:26:31 GMT 2024

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

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

Back to the top