Multilingual Wiki Documentation

You are currently using syntax.
In an attempt to improve PlantUML documentation...
Please do not use this website for your own diagrams.
You can click here and use the online server here for your own documentation.

Wiki Toc    View page history    Add new chapter    Reorder page    Raw


Skinparam: 重要なお知らせ

Skinparam: IMPORTANT NOTICE

skinparam は現在非推奨であり、段階的に廃止されています。

単純なケースや後方互換性のためにまだサポートされていますが、ユーザーはより複雑なスタイリングシナリオをサポートするCSSスタイルに移行する必要があります。

skinparam is now deprecated and is being phased out.

Although it is still supported for simple cases and for backward compatibility, users should migrate to CSS style, which supports more complex styling scenarios.

Skinparamコマンド

Skinparam command

skinparam コマンドを使って、図面の色やフォントを変更することができます。

skinparam backgroundColor transparent

You can change colors and font of the drawing using the skinparam command.

Example:

skinparam backgroundColor transparent

使用法

Usage

このコマンドは、 で使用することができます。
You can use this command :

入れ子

Nested

繰り返しを避けるため、定義を入れ子にすることができます。例えば、

skinparam xxxxParam1 value1
skinparam xxxxParam2 value2
skinparam xxxxParam3 value3
skinparam xxxxParam4 value4

この定義と以下の定義は全く同じ意味になります:

skinparam xxxx {
    Param1 value1
    Param2 value2
    Param3 value3
    Param4 value4
}

To avoid repetition, it is possible to nest definition. So the following definition :

skinparam xxxxParam1 value1
skinparam xxxxParam2 value2
skinparam xxxxParam3 value3
skinparam xxxxParam4 value4

is strictly equivalent to:

skinparam xxxx {
    Param1 value1
    Param2 value2
    Param3 value3
    Param4 value4
}

白黒

Black and White

skinparam monochrome trueコマンドを使用すると、出力結果を白黒にすることができます。

@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

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

skinparam shadowing falseを使用すると、影の描画を無くすことができます。

@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 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

色の反転

Reverse colors

skinparam monochrome reverseコマンドを使用すると、出力結果が色の反転した白黒となります。これは、背景色が黒の環境の場合に便利です。

@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 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

Colors

標準色名やRGBコードを使用することができます。

@startuml
colors
@enduml

transparentは、画像の背景色にのみ使用可能です。

You can use either standard color name or RGB code.

@startuml
colors
@enduml

transparent can only be used for background of the image.

文字色、フォント名、フォントサイズ

Font color, name and size

xxxFontColorxxxFontSizexxxFontNameのパラメータを使用して、文字の描画を変更することができます。

例:

skinparam classFontColor red
skinparam classFontSize 10
skinparam classFontName Aapex

skinparam defaultFontNameを使用すると、すべての文字描画に対してデフォルト値を設定することもできます。

例:

skinparam defaultFontName Aapex

フォント名はシステムに大きく依存していることにご注意ください。ポータビリティを考慮するなら、最小限の使用にとどめてください。HelveticaCourierであれば、どのようなシステムでも使用できるでしょう。

多くのパラメータがありますが、次のコマンドで一覧を出力することができます:

java -jar plantuml.jar -language

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 systems.

A lot of parameters are available. You can list them using the following command:

java -jar plantuml.jar -language

テキストの配置

Text Alignment

skinparam sequenceMessageAlignを使用すると、テキストの配置をleftrightcenterに設定することができます。 directionまたはreverseDirectionを使用すると、矢印の方向に応じてテキストの位置が決定されます。

パラメタ名 デフォルト値 備考
sequenceMessageAlign left シーケンス図のメッセージに使用
sequenceReferenceAlign center シーケンス図のref overに使用

@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

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

@startuml
skinparam roundcorner 20
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
}
skinparam stereotypeCBackgroundColor YellowGreen

Class01 "1" *-- "many" Class02 : contains

Class03 o-- Class04 : aggregation
@enduml

@startuml
skinparam interface {
  backgroundColor RosyBrown
  borderColor orange
}

skinparam component {
  FontSize 13
  BackgroundColor<<Apache>> LightCoral
  BorderColor<<Apache>> #FF6655
  FontName Courier
  BorderColor black
  BackgroundColor gold
  ArrowFontName Impact
  ArrowColor #FF6655
  ArrowFontColor #777777
}

() "Data Access" as DA
[Web Server] << Apache >>

DA - [First Component]
[First Component] ..> () HTTP : use
HTTP - [Web Server]
@enduml

@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>

node node1
node node2 <<shared node>>
database Production

skinparam component {
    backgroundColor<<static lib>> DarkKhaki
    backgroundColor<<shared lib>> Green
}

skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml

@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

@startuml
skinparam roundcorner 20
skinparam class {
BackgroundColor PaleGreen
ArrowColor SeaGreen
BorderColor SpringGreen
}
skinparam stereotypeCBackgroundColor YellowGreen

Class01 "1" *-- "many" Class02 : contains

Class03 o-- Class04 : aggregation
@enduml

@startuml
skinparam interface {
  backgroundColor RosyBrown
  borderColor orange
}

skinparam component {
  FontSize 13
  BackgroundColor<<Apache>> LightCoral
  BorderColor<<Apache>> #FF6655
  FontName Courier
  BorderColor black
  BackgroundColor gold
  ArrowFontName Impact
  ArrowColor #FF6655
  ArrowFontColor #777777
}

() "Data Access" as DA
[Web Server] << Apache >>

DA - [First Component]
[First Component] ..> () HTTP : use
HTTP - [Web Server]
@enduml

@startuml
[AA] <<static lib>>
[BB] <<shared lib>>
[CC] <<static lib>>

node node1
node node2 <<shared node>>
database Production

skinparam component {
    backgroundColor<<static lib>> DarkKhaki
    backgroundColor<<shared lib>> Green
}

skinparam node {
borderColor Green
backgroundColor Yellow
backgroundColor<<shared node>> Magenta
}
skinparam databaseBackgroundColor Aqua
@enduml

すべてのskinparamパラメータの一覧

List of all skinparam parameters

コマンドラインで-languageを使用するか、次のコマンドを使用して、skinparamパラメータの一覧を表示する図を生成することができます:
  • help skinparams
  • skinparameters

コマンドライン: -languageコマンド

ドキュメンテーションは常に最新とは限らないため、次のコマンドを使用して全パラメータの一覧を確認することができます:

java -jar plantuml.jar -language

コマンド: help skinparams

以下の結果が得られます。このコマンドのソースコードはCommandHelpSkinparam.javaにあります。

@startuml
help skinparams
@enduml

コマンド: skinparameters

@startuml
skinparameters 
@enduml

All Skin Parameters on the Ashley's PlantUML Doc

Ashley's PlantUML DocAll Skin Parametersで、各skinparamパラメータの見た目を確認することができます。

You can use -language on the command line or generate a "diagram" with a list of all the skinparam parameters using :
  • help skinparams
  • skinparameters

Command Line: -language command

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

Command: help skinparams

That will give you the following result, from this page (code of this command): CommandHelpSkinparam.java

@startuml
help skinparams
@enduml

Command: skinparameters

@startuml
skinparameters 
@enduml

All Skin Parameters on the Ashley's PlantUML Doc

You can also view each skinparam parameters with its results displayed at the page All Skin Parameters of Ashley's PlantUML Doc:


Please report any bugs to plantuml@gmail.com or here.
This website is still in beta testing.