Moving Diagram Elements

You can visually move elements into different packages, or operations and attributes into different classes, by dragging them on top of the destination icon and dropping them. For example, you can drag classes into a package (class diagram), or components into a node (deployment diagram).

When you move an element, it is deleted from the source package or element and moved into the destination package or element. Copied elements are not deleted from their source.

When you drag elements or members around on a class diagram, the appearance of other element icons change when the dragged element crosses their boundaries. This indicates that the icon has received focus and is a potential drop target. For class, interface, and package elements, the drop focus is represented by a black rectangle around the icon border.

Tip: Moving classes into and out of package elements is a quick and easy way to restructure your project. Package statements are refactored to reflect new changes, including changes to import statements of other classes.