Dashed Border on Single Rectangle?

0 votes
asked Dec 6, 2017 in Wanted features by bx
Is it possible to apply a dashed border to a single rectangle without the << stereotype >> language appearing in the rectangle itself?

1 Answer

0 votes
answered Dec 7, 2017 by plantuml (138,660 points)

With last beta http://beta.plantuml.net/plantuml.jar

You can have:

@startuml

rectangle blahblah as bb  #line.dotted {
    rectangle "first3" as fst #77F;line.dashed {
        rectangle third #red;line.dashed
        (forth)
        rectangle fifth #line.bold
    }
    rectangle "second" as scnd
    fst -> scnd

}
@enduml

Is this what you are looking for ?

commented Dec 11, 2017 by bx
Do you have a link to a .war version of the beta that I can download? I'm not sure how to load the .jar on Java EE Eclipse - Tomcat v7 that I'm running. Thank you!
commented Dec 11, 2017 by plantuml (138,660 points)
We've just released version 1.2017.20 so you can download last war from download page http://plantuml.com/download
commented Dec 13, 2017 by bx
Thanks!

Is the Public Server updated?  If so, I don't see dashed borders when I run the code you posted above...?

See here:

http://www.plantuml.com/plantuml/uml/RO-z2W8n383tFaMuBZheud2383Vv7lr9RQ6saCJfk7VNMZb_C90Xy7tmPM8n9BThLehGYIcNZ62pYMt1C5WBe7CgkFTL13tC2XxpXeUGYEKmD3YmW1x7yx4BXkCgV4iI4tdGXFuJNS5Dg2Hn-qSCAKXy1TcQkxBy9Z6wMlmpYLtfK6lRdVgj5ZLXyUtjEm00

Any idea what might be wrong?

Thanks so much again for the quick implementation!
commented Dec 14, 2017 by bx
You are right, must have been a cache issue as I see it is working now. Thank you!
commented Dec 24, 2017 by bx
Hmmm, I think there is an unexpected behavior with the latest version 1.2017.20. The following code on version .19 correctly ignored the comments (which are embedded within the rectangle definition), but version .20 doesn't ignore the comments, rather it includes them as text:

rectangle "<b>Test\n<size:12>Test 2\n<size:10>/'CN1391-TAXCLASS-START'/U.S. Partnership △/'CN1391-TAXCLASS-END'/" as CN1391 [[https://www.google.com/1391 {Text}]]  #White /'ICONFORCN1391'/

Is that something you may be able to address?

Thank  you!
commented Dec 24, 2017 by plantuml (138,660 points)
Version .20 somehow fixes rules about comment. Before this version, the behavior was not well defined.
Now, comments using /' and '/ must be either at start or at end of the line.
The real reason why we are fixing this is that, in some future, it will allow us to use /' or '/ for other purpose.

We really like to stick on this. However, we understand that this change may be an issue for you, so we are open to discussion. :-)

Right now, you can use the following diagram which is close to yours (the hyperlink is missing)
@startuml
rectangle CN1391 #white [<b>Test\n<size:12>Test 2<size:10>/'CN1391-TAXCLASS-START'/
U.S. Partnership △/'CN1391-TAXCLASS-END'/
] /'ICONFORCN1391'/
@enduml

If this sounds like an acceptable solution for you, we could implement the use of hyperlink in that case so that:
@startuml
rectangle CN1391 [[https://www.google.com/1391 {Text}]] #white [<b>Test\n<size:12>Test 2<size:10>/'CN1391-TAXCLASS-START'/
U.S. Partnership △/'CN1391-TAXCLASS-END'/
] /'ICONFORCN1391'/
@enduml
will give the same result as your example.
What do you think about it ?
commented Dec 25, 2017 by bx
I appreciate your willingness to try to accommodate my needs!

It may be workable, but it makes things more complicated on my end as I currently use the comments as markers which are used by Regex to find and replace specific data.

Breaking it up across multiple lines adds some complexity, for example, as I have a script which deletes lines based on whether a certain comment is there. Since right now all is on one line, I just need one comment (such as /'ICONFORCN1391'/) to delete the entire line, if multiple lines I would need to add that to each line, and the code would look much messier and have much more text as well (currently my diagrams are quite big, and I imagine this additional text in the code will make the URL longer and potentially too long for my webserver to load via URL).

I don't need it to be /' '/, any syntax that allows the text between the strings to be ignored is fine. Perhaps you can change it to some other character so you can use /' '/ for something else?

Thanks for your time and consideration!
commented Dec 26, 2017 by plantuml (138,660 points)
Ok. With last beta http://beta.plantuml.net/plantuml.jar , you can have:

@startuml
rectangle "<b>Test\n<size:12>Test 2\n<size:10>/'''CN1391-TAXCLASS-START'''/U.S. Partnership/'''CN1391-TAXCLASS-END'''/" as CN1391 [[https://www.google.com/1391 {Text}]]  #White /'ICONFORCN1391'/
@enduml

The special syntax /'''xxxx'''/ with three simple quotes works anywhere in the line.
Using three simple quotes decreases (according to us) the chance of clashes with future syntax extensions. Note also that this syntax only accept letters/underscore/dash in the comment.
I think it will be ok for you.

Tell us if it's not the case!
...