關於PhpStorm中如何繪畫UML的解析

藏色散人
發布: 2021-07-13 14:49:13
轉載
2247 人瀏覽過

IDE支援

  • #Phpstorm

    • ##在Plugins中安裝

      PlantUML integration外掛程式

    • http://www.graphviz.org/網站下載graphviz.exe並安裝(這個軟體可以支援更多的UML語法)

    • 將graphviz安裝目錄下的

      dot.exe路徑加入PlantUML的設定中

#文件

  • 文件位址:

    http://plantuml.com/

  • 建議使用

    活動圖-Activity-bate語法:活動圖Activity-Beta(https://plantuml.com/zh/activity-diagram-beta)

  • #活動圖(新語法)

目前活動圖(activity diagram)的語法有許多限制和缺點,例如程式碼難以維護。所以從V7947開始提出一種全新的、更好的語法格式和軟體實作供使用者使用(beta版)。就像序列圖一樣,新的軟體實現的另一個優點是它不再依賴與Graphviz。

新的語法將會取代舊的語法。然而考慮到相容性,舊的語法仍被能夠使用以確保向前相容。
但是我們鼓勵使用者使用新的語法格式。

語法

基礎

  • @startuml@enduml開始、結束標記,表示UML解析的部分

  • startend表示圖示的開始與結束。圖示的開始和結束。

  • :Hello world;活動標籤(activity label)以冒號開始,以分號結束。活動預設安裝它們定義的順序就行連接。

  • ifthenelseelseif設定分支測試。標註文字則放在括號中。

  • repeatrepeatwhile 重複迴圈。

  • whileendwhile進行while迴圈。也可以在關鍵字endwhile後面加上標註,還有一種方式是使用關鍵字is

  • forkfork againend fork表示並行處理。

  • noteend notefloating note left 等等表示註釋,例如:

floating note left: This is a note
:foo2;
note right
  This note is on several
  //lines// and can
  contain HTML
  ====
  * Calling the method ""foo()"" is prohibited
end note
登入後複製
  • #HotPin:activity;#AAAAAA:ending of the process; 表示顏色

使用
    ->
  • 標記,你可以為箭頭添加文字或修改箭頭顏色。

    dotted, dashed

    ,
  • bold
  • hidden arrows 和顏色標記,例如-[#blue]->

透過定義分區(partition),你可以把多個活動組合(group)在一起。透過定義分區(partition),你可以把多個活動組合(group)在一起。例如:

關於PhpStorm中如何繪畫UML的解析

partition Initialization {
    :read config file;
    :init internal variable;
}
登入後複製


使用管道符號|來定義泳道。還可以改變泳道的顏色。

關鍵字

detach###移除箭頭。 ############透過修改活動標籤最後的分號分隔符號(;),可以為活動設定不同的形狀。 ###|、、/、]、}############
:next(o)|
:Receiving;
split
 :nak(i)
split again
 :ack(i)
split again
 :err(i)
split again
 :foo/
split again
 :i > 5}
stop
end split
:finish;
登入後複製
###一個範例###
@startuml
start
if (is login?) then (Y)
    if (gived box?) then (Y)
        :illegal request;
        detach
    else (N)
        :release box;
        :get boxOid;
    endif
else (N)
    if (has boxOid?) then (N)
        :illegal request;
        detach
    endif
endif

:check wechat broswer;
if (wechat broswer?) then (Y)
    if (get openid from cookie?) then (Y)
        if (get userInfo from DB by openid?) then (N)
            :clear openid in cookie;
            :re-request Url;
            detach
        endif
    else (N)
        :location wechat auth;
        detach
    endif
endif

:receive chocolate;

end
@enduml
登入後複製
############ ############更多phpstorm技術文章,請造訪######phpstorm######教學欄位! ###

以上是關於PhpStorm中如何繪畫UML的解析的詳細內容。更多資訊請關注PHP中文網其他相關文章!

相關標籤:
來源:segmentfault.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!