3

I'm making class diagram in draw.io.

I add a package and a class to the paper. How do I add the class to the package? (just plain putting it there on the package seems silly and what if I wanted to move the whole package?)

Aditional question: is there any way to move the name of the package away from the center of the package?

3 Answers 3

5

I figured out that you can do this by doing voodoo magic. Select the package and then click on the "Text" tab, next make sure the position is to the left and then select the Arrow with the line over (it's highlighted in the image), next set the top spacing (I made mine -5pt). This is the best quick way of doing this without having to do so much work. Copy and paste also works for multiple packages. You can also adjust the size of the space by selecting the orange circle (in the image below). I hope this helps someone.

Text properties in draw.io Package diagram

1

To make class part of a package:

  1. Select package
  2. Use Arrange -> Group from menu
  3. Drag and drop class on package when it's surrounded by outline

This method also works with other shapes.

1
  • Nice n easy. Ta
    – Jag
    Dec 19, 2018 at 14:40
0

In the UML 2.5 Package, there is a Package block, that has boundedLbl=1;labelInHeader=1 in the style, which positions the text in the tab. You can also set container=1 in the style to puts elements into the package.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.