PlantUMLãå ¥ãã¦ã¿ã
PlantUMLã使ã£ã¦UMLãæ¸ãã¦ã¿ããã¨æããã¾ãã¯ã»ããã¢ããããã®ã§ã¡ã¢ãæ®ãã
PlantUMLã¨ã¯ï¼
PlantUMLã¯UMLãã¤ã¢ã°ã©ã ãè¨è¿°ããããã®ãªã¼ãã³ã½ã¼ã¹ã®ãã¼ã«ã§ãä»ã®ãã¼ã«ã¨ã®éãã¯ããã¹ããã¡ã¤ã«ããå³ãçæããã¨ããç¹ã
astah* UMLã¨ãä»ã®ãã¼ã«ã¯ãã¦ã¹ã使ã£ã¦GUIã§å³ãæ¸ãã®ã¨æ¯ã¹ã¦ãPlantUMLã¯ããã¹ããã¡ã¤ã«ã«è¨è¿°ããå®ç¾©ã«åã£ã¦å³ãçæããã¨ããã®ãéãã
ããã¹ããã¡ã¤ã«ãªã®ã§ãã¼ã¸ã§ã³ç®¡çãããããããä»ã®ã¡ã³ãã¼ã¨ã®ã³ã©ãã¬ã¼ã·ã§ã³ãããããã
åé¢ãæ¸ãæ¹ãè¦ããªãã¨ãªããªãã®ã§ãã¤ãã·ã£ã«ã³ã¹ãã¯ãããã
çæããå³ã¯PNGï¼ã©ã¹ã¿ç»åï¼ãSVGï¼ãã¯ã¿ç»åï¼ã§çæã§ããã®ã§ãç¨éã«å¿ãã¦ä½¿ãåããã
çæã«ã¯PlantUMLã®ä»ã«Graphvizã¨ãããã®ã使ãã
PlantUMLã¯Javaã§æ¸ããã¦ããã®ã§ã¯ãã¹ãã©ãããã©ã¼ã ã ããGraphvizã¯ãã¤ãã£ããªã®ã§åãã©ãããã©ã¼ã ã«å¿ãããã¤ããªã使ç¨ããã
PlantUMLã®ã¤ã³ã¹ãã¼ã«
PlantUMLのダウンロードページããplantuml.jarããã¦ã³ãã¼ããã¦é©å½ãªãã©ã«ãã«ä¿åã
Graphvizã®ã¤ã³ã¹ãã¼ã«
Graphvizのダウンロードページããé©ãããã¤ããªããã¦ã³ãã¼ãã
ä»åã¯WindowsçZIPãã¡ã¤ã«ããã¦ã³ãã¼ããã¦ãreleaseãã©ã«ãã®ä¸èº«ãC:\Program Files\graphviz-2.38ã«å±éããã
ï¼C:\Program Files\graphviz-2.38\binã«å®è¡ãã¡ã¤ã«ãããããã«ããï¼
ã¤ã³ã¹ãã¼ã«å¾ã®åä½ç¢ºèª
plantuml.jarãç½®ãã¦ãããã©ã«ãã§ã³ãã³ãããã³ãããç«ã¡ä¸ãã¦ã以ä¸ãå®è¡ããã
java -jar plantuml.jar -testdot
PlantUMLã¨Graphvizããã¾ãåãã°ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ãåºãã¯ãã
The environment variable GRAPHVIZ_DOT has not been set Dot executable is c:\Program Files\graphviz-2.38\bin\dot.exe Dot version: dot - graphviz version 2.38.0 (20140413.2041) Installation seems OK. File generation OK
Graphvizã®å ´æã¯æ¢ãã¦ãããã®ãã
æå®ãããå ´åã¯ç°å¢å¤æ°GRAPHVIZ_DOTã«è¨å®ããã°è¯ãã¿ããã
PlantUMLã®åä½ç¢ºèª
plantuml.jarã¨åãã¨ããã«sample.txtãä½æã
å
容ã¯ä»¥ä¸ã®éãã
@startuml Class1 -> Class2 : å¦çA Class1 <-- Class2 @enduml
Class1ãããå¦çAãã¨ããã¡ãã»ã¼ã¸ãéã£ã¦ãClass2ããè¿ã£ã¦ããã¨ãããç°¡åãªã·ã¼ã±ã³ã¹å³ã
plantuml.jarãç½®ãã¦ãããã©ã«ãã§ã³ãã³ãããã³ãããç«ã¡ä¸ãã¦ã以ä¸ãå®è¡ããã
java -jar plantuml.jar sample.txt
ããã¨ä¸è¨ã®PNGãã¡ã¤ã«ï¼sample.pngï¼ãçæãããã
æ¢å®å¤ã§ã¯PNGãä½æãããã®ã§ãæ示çã«PNGãçæãããå ´åã¯ä¸è¨ã§å®è¡ããã
java -jar plantuml.jar -tpng sample.txt
SVGã§åºåãããå ´åã-tsvgãæå®ããã
java -jar plantuml.jar -tsvg sample.txt
ããã¨SVGãã¡ã¤ã«ï¼sample.svgï¼ãçæãããã
PlantUMLã®æ¸ãæ¹
日本語リファレンスãããã®ã§ããããåèã«æ¸ãã¦ã¿ããã