{abstract} in written form

+1 vote
asked Jun 12, 2017 in Closed question / help by anonymous
Hello,

sometimes italic text is not perceptible or obvious enough, especially if using another font for class/method names like "Segoe Print" and using PlantUML's handwritten feature. Therefore, I want to use the same trick for my UML diagrams as you do, if drawing UML by hand in reality. You will usually apply the text "{abstract}" to methods, for example.

I found a way doing this in PlantUML, e.g.

class MyClass {

+abstractMethod() 	 	 {abstract}

}

Question 1:

Is there a more convenient and less verbose way achieving this? The nicest this would be a switch/option for PlantUML, i.e. I simply could use "{abstract} +abstractMethod()" as regular, but the switch decides how to present this.

Question 2:

I haven't found a way to display, if the class is abstract or not (using the written form of "{abstract}" and not italic).

Thanks in advance!

1 Answer

0 votes
answered Jan 26 by Anthony-Gaudino (7,550 points)

You can use macros to make it easier:

@startuml

!define ABSTRACT {abstract}

class MyClass {
+abstractMethod() \t\t ABSTRACT
}
@enduml
...