Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » How to add an existing class to a diagram?
How to add an existing class to a diagram? [message #534021] Mon, 17 May 2010 18:04 Go to next message
Joel Parker is currently offline Joel ParkerFriend
Messages: 2
Registered: May 2010
Junior Member
This question seems so obvious I can't be the first to ask it, but searching this list didn't turn up anything.

How do I add an existing class to my class diagram? I have multiple class diagrams, one of which already contains a certain class. I'd like to add the same class to another diagram.

I've tried dragging the connection arrow from a class already in the diagram, choosing "Usage To", then choosing "Existing Element", but nothing happens. I've also tried opening up the .uml model and dragging the class I want over to the diagram, but nothing there either. I've also tried adding a shortcut from the diagram right-click menu, but this doesn't seem to be same thing (for example, it has a shortcut arrow).

Anyone know what I'm missing here?
Re: How to add an existing class to a diagram? [message #543653 is a reply to message #534021] Wed, 30 June 2010 08:35 Go to previous messageGo to next message
rodolphe  is currently offline rodolphe Friend
Messages: 10
Registered: June 2010
Junior Member
Hi, Looking for that feature too.

let me know if you find how to do that
Re: How to add an existing class to a diagram? [message #543750 is a reply to message #543653] Wed, 30 June 2010 13:29 Go to previous messageGo to next message
rodolphe  is currently offline rodolphe Friend
Messages: 10
Registered: June 2010
Junior Member
okay, found the answer, It was quite simple:

1 - Open the diagram where you want to import your classes

2 - in your project explorer, expand the .uml file where there are the classes you want to reuse

3 - drag the classes from the explorer to the diagram editor. Your can also right click in the diagram and use "Create shortcut".

4 - Scream something like "OMG I did It!"

Beware you create a shortcut, and are not moving the class. a shortcut class has a windows-like shortcut icon on the display box.

If you move the class, it will be removed from the input diagram. (the associations and relationships will not be lost) you can move back the class but your styling (ie, positionning) will be lost.
Re: How to add an existing class to a diagram? [message #554673 is a reply to message #543750] Tue, 24 August 2010 03:43 Go to previous messageGo to next message
Bevon Palod is currently offline Bevon PalodFriend
Messages: 7
Registered: July 2009
Junior Member
Hi rodolphe,
I've tried this, but I don't see any classes or shortcuts added to my class diagram (altho, the editor is marked dirty). Can I ask what level of Eclipse (and UML2Tools) you're using?

I'm currently using Eclipse v3.6.0 (Helios) with UML2Tools v0.9.2-2010-07-17 added into the dropins folder (with any pre-requisites manually added first via Update Manager).

Thanks,
Bevon
Re: How to add an existing class to a diagram? [message #554709 is a reply to message #554673] Tue, 24 August 2010 07:49 Go to previous messageGo to next message
rodolphe  is currently offline rodolphe Friend
Messages: 10
Registered: June 2010
Junior Member
I'm using

Eclipse 3.5.2 with
org.eclipse.uml2tools (0.9.0.v200906190654) "UML2 Tools Plug-in (Incubation)"


explanation screenshot :

http://j.imagehost.org/0318/externalclassdiagram.jpg
Re: How to add an existing class to a diagram? [message #554836 is a reply to message #554709] Tue, 24 August 2010 13:52 Go to previous messageGo to next message
Bevon Palod is currently offline Bevon PalodFriend
Messages: 7
Registered: July 2009
Junior Member
Hi rodolphe,
Thanks for the info. I've tried this again with Eclipse v3.5.2 with the UML2Tools feature installed via Update Manager and I'm able to drag'n'drop to create shortcuts now. The "Create Shortcuts" menu item still doesn't do anything for me except mark the editor as dirty, but I'm fine with it.

Thanks!

PS OMG I did it!!
Re: How to add an existing class to a diagram? [message #625813 is a reply to message #543653] Wed, 30 June 2010 13:29 Go to previous messageGo to next message
rodolphe  is currently offline rodolphe Friend
Messages: 10
Registered: June 2010
Junior Member
okay, found the answer, It was quite simple:

1 - Open the diagram where you want to import your classes

2 - in your project explorer, expand the .uml file where there are the classes you want to reuse

3 - drag the classes from the explorer to the diagram editor. Your can also right click in the diagram and use "Create shortcut".

4 - Scream something like "OMG I did It!"

Beware you create a shortcut, and are not moving the class. a shortcut class has a windows-like shortcut icon on the display box.

If you move the class, it will be removed from the input diagram. (the associations and relationships will not be lost) you can move back the class but your styling (ie, positionning) will be lost.
Re: How to add an existing class to a diagram? [message #625968 is a reply to message #543750] Tue, 24 August 2010 03:43 Go to previous messageGo to next message
Bevon Palod is currently offline Bevon PalodFriend
Messages: 7
Registered: July 2009
Junior Member
Hi rodolphe,
I've tried this, but I don't see any classes or shortcuts added to my class diagram (altho, the editor is marked dirty). Can I ask what level of Eclipse (and UML2Tools) you're using?

I'm currently using Eclipse v3.6.0 (Helios) with UML2Tools v0.9.2-2010-07-17 added into the dropins folder (with any pre-requisites manually added first via Update Manager).

Thanks,
Bevon
Re: How to add an existing class to a diagram? [message #625969 is a reply to message #625968] Tue, 24 August 2010 07:49 Go to previous messageGo to next message
rodolphe  is currently offline rodolphe Friend
Messages: 10
Registered: June 2010
Junior Member
I'm using

Eclipse 3.5.2 with
org.eclipse.uml2tools (0.9.0.v200906190654) "UML2 Tools Plug-in (Incubation)"


explanation screenshot :

http://j.imagehost.org/view/0318/externalclassdiagram
Re: How to add an existing class to a diagram? [message #625971 is a reply to message #625969] Tue, 24 August 2010 13:52 Go to previous message
Bevon Palod is currently offline Bevon PalodFriend
Messages: 7
Registered: July 2009
Junior Member
Hi rodolphe,
Thanks for the info. I've tried this again with Eclipse v3.5.2 with the UML2Tools feature installed via Update Manager and I'm able to drag'n'drop to create shortcuts now. The "Create Shortcuts" menu item still doesn't do anything for me except mark the editor as dirty, but I'm fine with it.

Thanks!

PS OMG I did it!!
Previous Topic:Compile UML2TOOLS
Next Topic:Sequence diagrams: How to add message data? And using editor in general...
Goto Forum:
  


Current Time: Mon Nov 24 18:16:30 GMT 2014

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

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