You can use this command :
* In the diagram definition, like any other commands,
* In an included file,
* In a configuration file, provided in the command line or the ANT task.
Usage
You can use this command :
In the diagram definition, like any other commands,
You can force the use of a black&white output using skinparam monochrome true command.
@startuml
skinparam monochrome true
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
Black and White
You can force the use of a black&white output using skinparam monochrome true command.
@startuml
skinparam monochrome true
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
Shadowing
You can disable the shadowing using the skinparam shadowing false command.
@startuml
left to right direction
skinparam shadowing<<no_shadow>> false
skinparam shadowing<<with_shadow>> true
actor User
(Glowing use case) <<with_shadow>> as guc
(Flat use case) <<no_shadow>> as fuc
User -- guc
User -- fuc
@enduml
You can force the use of a black&white output using skinparam monochrome reverse command.
This can be useful for black background environment.
@startuml
skinparam monochrome reverse
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
Reverse colors
You can force the use of a black&white output using skinparam monochrome reverse command.
This can be useful for black background environment.
@startuml
skinparam monochrome reverse
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
You can change the font for the drawing using xxxFontColor,
xxxFontSize and xxxFontName parameters.
示例:
skinparam classFontColor red
skinparam classFontSize 10
skinparam classFontName Aapex
也可以使用 skinparam defaultFontName 命令, 来修改默认的字体。
You can also change the default font for all fonts using skinparam defaultFontName.
Example:
skinparam defaultFontName Aapex
请注意:字体名称高度依赖于操作系统,因此不要过度使用它, 当你考虑到可移植性时。
Helvetica and Courier 应该是全平台可用。
Please note the fontname is highly system dependent, so do not
over use it, if you look for portability. Helvetica and Courier
should be available on all system.
还有更多的参数可用,你可以通过下面的命令打印它们:
java -jar plantuml.jar -language
A lot of parameters are available. You can list them using the following command:
java -jar plantuml.jar -language
Font color, name and size
You can change the font for the drawing using xxxFontColor,
xxxFontSize and xxxFontName parameters.
Example:
skinparam classFontColor red
skinparam classFontSize 10
skinparam classFontName Aapex
You can also change the default font for all fonts using skinparam defaultFontName.
Example:
skinparam defaultFontName Aapex
Please note the fontname is highly system dependent, so do not
over use it, if you look for portability. Helvetica and Courier
should be available on all system.
A lot of parameters are available. You can list them using the following command:
java -jar plantuml.jar -language
文本对齐 (Text Alignment)
通过left, right or center, 可以设置文本对齐.
也可以 sequenceMessageAlign 指令 赋值为 direction 或 reverseDirection
以便让文本对齐与箭头方向一致。
Text alignment can be set up to left, right or center.
You can also use direction or reverseDirection values for sequenceMessageAlign
which align text depending on arrow direction.
Param name
Default value
Comment
sequenceMessageAlign
left
用于时序图中的 消息 (message)
sequenceReferenceAlign
center
在时序图中用于 ref over
@startuml
skinparam sequenceMessageAlign center
Alice -> Bob : Hi
Alice -> Bob : This is very long
@enduml
WARNING
This translation need to be updated.
WARNING
Text Alignment
Text alignment can be set to left, right or center in skinparam sequenceMessageAlign.
You can also use direction or reverseDirection values to align text depending on arrow direction.
Param name
Default value
Comment
sequenceMessageAlign
left
Used for messages in sequence diagrams
sequenceReferenceAlign
center
Used for ref over in sequence diagrams
@startuml
skinparam sequenceMessageAlign center
Alice -> Bob : Hi
Bob -> Alice : This is very long
@enduml
@startuml
skinparam sequenceMessageAlign right
Alice -> Bob : Hi
Bob -> Alice : This is very long
@enduml
@startuml
skinparam sequenceMessageAlign direction
Alice -> Bob : Hi
Bob -> Alice: Hi
@enduml
Examples
@startuml
skinparam backgroundColor #EEEBDC
skinparam handwritten true
skinparam sequence {
ArrowColor DeepSkyBlue
ActorBorderColor DeepSkyBlue
LifeLineBorderColor blue
LifeLineBackgroundColor #A9DCDF
ParticipantBorderColor DeepSkyBlue
ParticipantBackgroundColor DodgerBlue
ParticipantFontName Impact
ParticipantFontSize 17
ParticipantFontColor #A9DCDF
ActorBackgroundColor aqua
ActorFontColor DeepSkyBlue
ActorFontSize 17
ActorFontName Aapex
}
actor User
participant "First Class" as A
participant "Second Class" as B
participant "Last Class" as C
User -> A: DoWork
activate A
A -> B: Create Request
activate B
B -> C: DoWork
activate C
C --> B: WorkDone
destroy C
B --> A: Request Created
deactivate B
A --> User: Done
deactivate A
@enduml
@startuml
skinparam handwritten true
skinparam actor {
BorderColor black
FontName Courier
BackgroundColor<< Human >> Gold
}
skinparam usecase {
BackgroundColor DarkSeaGreen
BorderColor DarkSlateGray
BackgroundColor<< Main >> YellowGreen
BorderColor<< Main >> YellowGreen
ArrowColor Olive
}
User << Human >>
:Main Database: as MySql << Application >>
(Start) << One Shot >>
(Use the application) as (Use) << Main >>
User -> (Start)
User --> (Use)
MySql --> (Use)
@enduml
所有skinparam的参数列表 (List of all skinparam parameters)
本文档并不总能保持最新,你可以使用下面命令查看完成的参数列表
Since the documentation is not always up to date, you can have the complete list of parameters using this command:
java -jar plantuml.jar -language
或者可以使用命令,产生一幅有所有skinparam参数的图:
Or you can generate a "diagram" with a list of all the skinparam parameters using:
结果如下:
That will give you the following result:
@startuml
help skinparams
@enduml
你也可以在 https://plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html
查看 ’‘skinparam’‘ 的参数.
You can also view each skinparam parameters with its results displayed at the page [`All Skin Parameters`](https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html) of [`Ashley's PlantUML Doc`](https:plantuml-documentation.readthedocs.io/en/latest/index.html#):
* [https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html](https:plantuml-documentation.readthedocs.io/en/latest/formatting/all-skin-params.html).
WARNING
This translation need to be updated.
WARNING
List of all skinparam parameters
Since the documentation is not always up to date, you can have the complete list of parameters using this command:
java -jar plantuml.jar -language
Or you can generate a "diagram" with a list of all the skinparam parameters using help skinparams.
That will give you the following result, from this page (code of this command):