How do I change the border style of a rectangle

0 votes
asked Jun 7 by newportg (180 points)

Hi,

 

I want to change the border style of a rectangle within a skinparam block.

I've tried this, but it doesnt work.

skinparam rectangle {
    BorderColor<<Software System>> ##[dashed]Green
}
 
whats the answer.
Thanks
Gary

1 Answer

0 votes
answered Jun 10 by plantuml (135,550 points)

Right now,  you cannot define dashed rectangle. This only applies to links.

The only setting available beside colors is "round corner".

Working example:

@startuml
skinparam rectangle {
    BorderColor Blue
    BorderColor<<Software System>> Green
    RoundCorner<<Software System>> 25
}
rectangle rect1<<Software System>>
rectangle rect2

rect1 -[dashed]-> rect2
@enduml

http://www.plantuml.com/plantuml/uml/RO-z2i9048JxUufzWHG9s8KZ98MzASLYSTSVlDkLlJj4n7St1a48cMgO-M2OBcMqN69mwNQLEnf6C3vcb7DWU3cOrAiHsw113VfGU1csxQYd_41Z69yfS_GUjiOiCxZJ8ZIe2Q-2pSQztN_nw-eLRe4qRWvggFQ4wS9qgFolw5Xe-lC1

We might improve this in the future, but it's difficult to find a nice syntax. Ideas welcome!

Regards,

commented Oct 27 by anonymous
What's against BorderStyle (solid/dashed/dotted)? We already have BorderColor...
commented Oct 27 by plantuml (135,550 points)
Well, really nothing :-)
We were out of creative inspiration here.

So with last beta, http://beta.plantuml.net/plantuml.jar

you can have:

@startuml
skinparam rectangle {
    BorderColor Blue
    BorderColor<<Software System>> Green
    RoundCorner<<Software System>> 25
    BorderStyle<<Software System>> dashed
    BorderStyle dotted
}
rectangle rect1<<Software System>>
rectangle rect2

rect1 -[dashed]-> rect2
@enduml

Tell us if it's what you were looking for.
(And if you find issues, because we made something quick&dirty)
commented Oct 29 by anonymous
You guys are quick, awesome! I'll take it for a testdrive this week. If I find anything I'll post it in this thread. Cheers!
commented Nov 6 by anonymous
It works. I do have one more request though: I'd like to use it like this:
skinparam rectangle {
    borderColor<<System Boundry>> #ababab
    borderStyle<<System Boundry>> dashed
    borderThickness<<System Boundry>> 1
    roundCorner<<System Boundry>> 15
    fontColor<<System Boundry>> #ababab
}
wihch doesn't work yet. Would that be a valid use case for you and (relatively) easy to implement?

Cheers!
commented Nov 7 by plantuml (135,550 points)
Thanks for the feedback. It's fixed in last beta
http://beta.plantuml.net/plantuml.jar
Tell us if you find other issues!
commented Nov 28 by jacy
border style extension is a nice addition however it appears outer rectangle does not pick up the dashed param - may be I am using it wrong
skinparam rectangle {
    borderColor<<System Boundry>> Red
    borderStyle<<System Boundry>> dashed
    borderThickness<<System Boundry>> 1
    roundCorner<<System Boundry>> 25
    fontColor<<System Boundry>> #ababab
    borderStyle dashed
    roundCorner 25
}

rectangle blahblah as bb <<System Boundry>> {
    rectangle "first" as fst <<System Boundry>> {
        rectangle third
        (forth)
        rectangle fifth <<System Boundry>>
    }
    rectangle "second" as scnd
    fst -> scnd

}
commented Nov 28 by plantuml (135,550 points)
You're right : the implementation was not complete.
It should be fixed in last beta http://beta.plantuml.net/plantuml.jar
Thanks for the report!
commented Nov 30 by jacy
great job, many thanks, now I can experiment with making some aws diagrams per milo-minderbinder https://github.com/milo-minderbinder/AWS-PlantUML but with the dashed borders people have come to expect.
commented 6 days ago by bx
Is it possible to apply a dashed border to a single rectangle without the << stereotype >> language appearing in the rectangle?
...