0

*edit: I understand that stackoverflow has banned all questions regarding using Microsoft's Visio. I'm a bit surprised by that, but if someone would bend the rules and help me out I'd greatly appreciate it.

I already tried looking at microsoft's website and other forums on the internet and I'm not finding what I'm looking for. Perhaps there is someone here who knows about Visio 2010.

I dragged and dropped a static structure shape for a UML Class onto my drawing area, and I filled out all the data in it. I then realized that I needed to change it from a class to interface shape. I thought I could simply right click and change this, but no. I tried going to drawing options, but all that does is change it for the future so that it will automatically create an interface shape when I drag and drop.

Isn't there any way to take data from these shapes so I can reuse it again without having to retype it all over in the data fields?

I tried creating a shape data set like msdn blog talks about. I chose to "create from an existing set"---thinking that this means creating from my already existing data from my class shape. Unfortunately this wasn't this case, and it ended up being completely empty....for some reason.

I would think it would be silly that someone would have to manually recreate all the class info all over again, simply because they wanted to change the shape of a UML static structure.

4

2 回答 2

2

You are not changing the shape, you are changing the meaning of the model entity - their meaning is different therefore the shape cannot be changed.

If you are only using your diagram for display purposes, you can add a new <<interface>> stereotype that can be applied to classes, and apply this stereotype to the classes you want to refactor. Otherwise, sadly, you'll have to write it all again.

于 2012-06-23T19:10:19.500 回答
1

You can try the following (worked for me):

  1. Create a new interface and name it whatever you like
  2. In the Model Explorer drag and drop all methods, etc. from your class to your interface.
  3. Drag the interface you just created from the Model Explorer to the actual document (You'll get the interface in a lollipop representation)
  4. Add the interface to your class (the line end of the lollipop has to be attached to class)

By doing this you can quickly create an interface and move the methods from the class to the interface. Also, when the lollipop interface is attached to the class, all methods are added to the class, too.

于 2013-12-17T10:31:06.280 回答