Study編 .xmlファイルの中身

記事作成日: 2022-11-10

前回と同じように白紙でSaveした時の.xmlファイルの中身を見てみました。

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="127.0.0.1" modified="2022-11-10T05:36:33.928Z" agent="5.0 (Windows)" etag="gxHfcVa4KRw2NT1mhKB1" version="20.5.3" type="device">
	<diagram id="ODODqY4LTbHJpW5b_ZvE" name="ページ1">
		<mxGraphModel dx="595" dy="327" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
			<root>
				<mxCell id="0"/>
				<mxCell id="1" parent="0"/>
			</root>
		</mxGraphModel>
	</diagram>
</mxfile>

白紙でもいろいろ情報が入っています。

mxGraphModel にはgridSizeなどの属性がいくつかあります。

1つ図形を追加してみます。

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="127.0.0.1" modified="2022-11-10T06:00:20.345Z" agent="5.0 (Windows)" etag="u-OwQGCBukpOWHtrzrtL" version="20.5.3" type="device">
	<diagram id="ODODqY4LTbHJpW5b_ZvE" name="ページ1">
		<mxGraphModel dx="595" dy="327" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
			<root>
				<mxCell id="0"/>
				<mxCell id="1" parent="0"/>
				<mxCell id="_qWNQSCmciw2vm_HkTGi-1" value="" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
					<mxGeometry x="250" y="140" width="120" height="60" as="geometry"/>
				</mxCell>
			</root>
		</mxGraphModel>
	</diagram>
</mxfile>

id="_qWNQSCmciw2vm_HkTGi-1"のが1つ追加されました。

昔mxGraphを少し勉強したけどすっかり忘れていたのが思い出してきました。

ついでにスイムレーン図を白紙から追加してみました。

<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="127.0.0.1" modified="2022-11-10T06:15:55.003Z" agent="5.0 (Windows)" etag="E7E4eTe0M0cSZ1RdwRHr" version="20.5.3" type="device">
	<diagram id="ODODqY4LTbHJpW5b_ZvE" name="ページ1">
		<mxGraphModel dx="595" dy="1496" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
			<root>
				<mxCell id="0"/>
				<mxCell id="1" parent="0"/>
				<mxCell id="_qWNQSCmciw2vm_HkTGi-2" value="Pool" style="swimlane;childLayout=stackLayout;resizeParent=1;resizeParentMax=0;startSize=20;html=1;" vertex="1" parent="1">
					<mxGeometry x="130.00000000000045" y="-70" width="360" height="480" as="geometry"/>
				</mxCell>
				<mxCell id="_qWNQSCmciw2vm_HkTGi-3" value="Lane 1" style="swimlane;startSize=20;html=1;" vertex="1" parent="_qWNQSCmciw2vm_HkTGi-2">
					<mxGeometry y="20" width="120" height="460" as="geometry"/>
				</mxCell>
				<mxCell id="_qWNQSCmciw2vm_HkTGi-4" value="Lane 2" style="swimlane;startSize=20;html=1;" vertex="1" parent="_qWNQSCmciw2vm_HkTGi-2">
					<mxGeometry x="120" y="20" width="120" height="460" as="geometry"/>
				</mxCell>
				<mxCell id="_qWNQSCmciw2vm_HkTGi-5" value="Lane 3" style="swimlane;startSize=20;html=1;" vertex="1" parent="_qWNQSCmciw2vm_HkTGi-2">
					<mxGeometry x="240" y="20" width="120" height="460" as="geometry"/>
				</mxCell>
			</root>
		</mxGraphModel>
	</diagram>
</mxfile>

PoolとLane1-3の4つのmxCellが追加されました。すっきりわかりやすくてよくできてますね。