Change border style in class diagram + Arrows to arrows

0 votes
asked Mar 2, 2013 in Wanted features by anonymous
edited Mar 2, 2013

Hi,

I am trying to draw C++ML conceptions using plantuml, but I would need to change the border style (I want it to be in a dot-hyphen style), such as the image here http://www.cplusplusml.org/documentation/templates.html#template_specialization . I didn't find a way to do, I can only change border color for the moment. I would also need some hyphen-dot style arrows.

 

Have a nice weekend!

 

edit : I also would need arrows linking a class to an other arrow.

To sum up:

  • C++ML represents template parameters as meta-information (hyphen-dot border style).
  • A templated class is a class with hyphen-dot arrows linking to template parameters
  • A templated class can inherit from a template parameter by having its inheritance arrow pointing to the template parameter arrow
commented Apr 26, 2013 by anonymous
is there any way to define the weight of the linestyleto create thinner and thicker lines?

1 Answer

0 votes
answered Mar 4, 2013 by plantuml (187,460 points)

Hi,

Even if this is not pure UML, since it can be done quite easily, so here a first beta that support this:
https://dl.dropbox.com/u/13064071/plantuml.jar

@startuml
class Foo1 #red ##00FFFF {
}

class FooDashed ##[dashed]blue {
}

class FooDotted ##[dotted]blue {
}

class FooBold ##[bold] {
}

@enduml

 

As you can see, you can specify after ## a color for the line, or a style (dotted/dashed/bold).

This is a first draft, with probably some bugs.

For consistency, we should probably also add a skinparam, and also skinned stereotypes.

We are also thinking about allowing foo1 <|<|-- foo2 to draw double arrow inheritance arrrows.

Feedback appreciate, and thanks for your suggestion!

commented Mar 4, 2013 by anonymous
I tried the dashed and dotted, something between the two (1 dot, then 1 dash, then 1 dot, etc.) would be more C++ML standards compliant, but not gonna complain, it is already great (and fast answer too), thanks! :D

What do you think about the arrow to arrow? There is an example here : https://docs.google.com/document/d/1cN7qmiw_o-VDRvdPPMYtlVIp_pVspbR34wh1sGZOlE0/edit?usp=sharing . Sorry, the drawing is not respecting the C++ML color and style convention, but the main idea is :

Child inherits from Parent<Child>, so basically, Parent is a class taking a template parameter (called TChild here, in grey), that's why there is an inheritance link from Child to Parent, with an extra arrow from this link to Child, showing that the inheritance has a parameter. As you can see, the bottom of the hyphen-dots arrow has a small orthogonal line, to show that the arrow begins there (it can be useful, to make the difference between two hyphen-dot arrows, like between the one linking [Parent-|>GrandParent] to Parent, and the one linking the previous link to [the Parent TChild link]).

I am not experienced in Java, but if you feel these features are not the priority, I can try to add these features myself, but not sure I will do great job ^^

Thanks again for your fast answer!
...