@startuml
' 允许各种图混合使用
allowmixing
' UML图标题
title 类适配器模式

class Voltage220V{
	+ output220V(): void
}

interface Voltage5V{
	+ output5V(): void
}

class VoltageAdapter{
	+ output5V(): void
}

/'适配器继承220V电压'/
Voltage220V <|-left- VoltageAdapter

/'适配器实现5v电压'/
Voltage5V <|.. VoltageAdapter

class Phone{
	+ charging(): void
}

/'手机依赖5V电压'/
Voltage5V <.. Phone

class Client

Phone <.. Client
VoltageAdapter <.. Client


/''''说明与样式
' 类之间的关系
依赖关系..>     .>		<.		<..
继承关系--|>    -|>		<|-		<|--
实现关系..|>    .|>		<|.		<|..
关联关系-->     <-->		--		->		<->
聚合关系--o     <--o		o-		o--
组合关系--*     <--*		*-		*--

' 访问权限
- private
# protected
~ default
+ public

' 备注
1. note top of Object : 备注在对象的四周
2. note "无方位位置" as Note1
3. note left: 备注在前一个类的四周
4. note on link #red : 链接注释
5. note left of Object
	注释内容
   end note

' 包
package com.lft.design.pattern {
	' 接口
	interface Interface
	' 棒棒糖接口()-- ()- --() -()
	Interface2 ()-- A
	' 抽象类
	abstract class AbstractClass
}
' 枚举
enum TimeUnit{
	DAYS
	HOURS
	MINUTES
	SECONDS
}

' 泛型
class Eye<? extends Head>{

}

' 命名空间
namespace net.dummy #DDDDDD {
	Meeting o-- Person
	.BaseClass <|- Meeting
}

' 改变箭头方向 left right up down
A .up.> B

' 关系类
class Student{
	Name
}
Student "0..*" -- "1..*" Course
(Student, Course) . Enrollment
class Enrollment{
	drop()
	cancel()
}

' 普通类
class Person{
	..Field..
	{field}				- name: String
	{static}{field}		- head: Head
	--Constructor--
	+ Person(name: String)
	==Method==
	{method}			+ getName(): String
	{abstract}{method}	+ doSomething(): void
	__Other__
}
class Head
Person "1" *-- "1" Head : contains >

' 类说明
class A << (I,#FF7700) 说明 >>
' 箭头颜色
A .[#395862].> B
'/


'' 类图样式

' 全局样式
skinparam {
	' 全局背景颜色
	backgroundColor #F0F7F7

	' 画布样式
	DiagramBorderColor #677C81
	DiagramBorderThickness 1

	' 分辨率
	Dpi 1920

	' 是否启用阴影
	Shadowing false


	' 手写样式是否启用
	handwritten false

	' 标题样式
	TitleBackgroundColor #CBD8D8
	TitleBorderColor #A5ADAD
	TitleBorderRoundCorner 16
	TitleBorderThickness 1
	TitleFontColor #6A8181
	TitleFontName YouYuan
	TitleFontSize 20

	' 箭头
	ArrowColor #6D6D6D
    ArrowThickness 1
	ArrowFontColor #6D6D6D
	ArrowFontName  Fira Code
	ArrowFontSize 16

	' 注释样式
	NoteBackgroundColor #E3EAED
	NoteBorderColor #47A7AB
    NoteFontColor #283428
    NoteFontName YouYuan
    NoteFontSize 16

	' 类图主样式
	ClassBackgroundColor #E3EAED
    ClassHeaderBackgroundColor #CBD8D8
	ClassBorderColor #A0A4AF
    ClassBorderThickness 1
    ClassAttributeIconSize 14
    ClassAttributeFontName  Fira Code
    ClassAttributeFontColor #303030
    ClassAttributeFontSize 16
    ClassFontColor #283428
    ClassFontName Fira Code
    ClassFontSize 18

    ' 图头标志样式
    StereotypeABackgroundColor #C3E88D
    StereotypeABorderColor #347998
    StereotypeCBackgroundColor #4FC3F7
    StereotypeCBorderColor #3683A5
    StereotypeEBackgroundColor #F78C6C
    StereotypeEBorderColor #894D3E
    StereotypeIBackgroundColor #C3E88D
    StereotypeIBorderColor #6F8150
    StereotypeNBackgroundColor #C691E9
    StereotypeNBorderColor #5D436A

	' 类图包样式
	PackageBackgroundColor #EAF9F7-#D4F1F2
	PackageBorderThickness 1
	PackageBorderColor 6D6D6D
    PackageFontColor #283428
    PackageFontName Fira Code
    PackageFontSize 18
    '''包样式 <<Node>> <<Rectangle>> <<Folder>> <<Frame>> <<Cloud>> <<Database>>
    PackageStyle Frame
    PackageTitleAlignment center

	' 用例图样式
    UsecaseBackgroundColor #CBD8D8
    UsecaseBorderColor #A0A4AF
    UsecaseBorderThickness 1
    UsecaseFontColor #283428
    UsecaseFontName Fira Code
    UsecaseFontSize 16
    UsecaseStereotypeFontColor #283428
    UsecaseStereotypeFontName Fira Code
    UsecaseStereotypeFontSize 12

	' 矩形样式
	RectangleBackgroundColor #E3EAED
	RectangleBorderColor #A0A4AF
	RectangleBorderThickness 1
	RectangleFontColor #283428
	RectangleFontName Fira Code
	RectangleFontSize 18
	' 字体样式 Normal Bold Italic
	RectangleFontStyle Bold Italic
}
@enduml