グラフを描くJavaアプリケーション
*1116221960*[Java制作ツール]VGJ
オープンソースのJavaアプリケーションでこんな図(添付図)が描ける。
アプリケーションとJavaソースのダウンロード先は→
http://www.eng.auburn.edu/department/cse/research/graph_drawing/graph_drawing.html
※ インストール方法
http://www.eng.auburn.edu/department/cse/research/graph_drawing/graph_drawing.html から C:\download\VGJ (たとえば)に VGJ.zip を保存 そのまま解凍するとそこにインストールされるので、 C:\download\VGJ\VGJ\graph_drawing 以下にできる EDU パッケージを実行する WINDOWS コマンドプロンプト で C:\download\VGJ\VGJ\graph_drawing> java EDU.auburn.VGJ.VGJ
読み込みデータ構造は、結構簡単→
こんなテキストデータ
graph [ directed 1 node [ id 0 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -212.0 y 424.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 1 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -240.0 y 360.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 2 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -163.0 y 327.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 3 label "" graphics [ Image [ Type "" Location "" ] center [ x -202.0 y 264.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 4 label "" graphics [ Image [ Type "" Location "" ] center [ x -89.0 y 248.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 5 label "" graphics [ Image [ Type "" Location "" ] center [ x -74.0 y 182.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 6 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 158.0 y 62.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 7 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 88.0 y -17.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 8 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 252.0 y -88.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 9 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 182.0 y -160.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 10 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 39.0 y -138.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 11 label "" graphics [ Image [ Type "" Location "" ] center [ x -40.0 y -97.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 12 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -63.0 y 11.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 13 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -295.0 y 127.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 15 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -170.0 y -200.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 16 label "" graphics [ Image [ Type "" Location "" ] center [ x -19.0 y -294.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 17 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x 253.0 y -288.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 18 label "" graphics [ Image [ Type "File" Location "C:\download\VGJ\VGJ\graph_drawing\red-ball.gif" ] center [ x -318.0 y -186.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 19 label "" graphics [ Image [ Type "" Location "" ] center [ x -403.0 y -399.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 20 label "" graphics [ Image [ Type "" Location "" ] center [ x -291.0 y -401.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 21 label "" graphics [ Image [ Type "" Location "" ] center [ x -185.0 y -411.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 22 label "" graphics [ Image [ Type "" Location "" ] center [ x -99.0 y -405.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 23 label "" graphics [ Image [ Type "" Location "" ] center [ x 12.0 y -400.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 24 label "" graphics [ Image [ Type "" Location "" ] center [ x 110.0 y -401.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 25 label "" graphics [ Image [ Type "" Location "" ] center [ x 215.0 y -393.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 26 label "" graphics [ Image [ Type "" Location "" ] center [ x 311.0 y -390.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 27 label "" graphics [ Image [ Type "" Location "" ] center [ x -120.0 y -209.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 28 label "" graphics [ Image [ Type "" Location "" ] center [ x -225.0 y -395.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 29 label "" graphics [ Image [ Type "" Location "" ] center [ x -241.0 y -142.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 30 label "" graphics [ Image [ Type "" Location "" ] center [ x -350.0 y -401.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] node [ id 31 label "" graphics [ Image [ Type "" Location "" ] center [ x 60.0 y -398.0 z 0.0 ] width 20.0 height 20.0 depth 20.0 ] vgj [ labelPosition "below" shape "Oval" ] ] edge [ linestyle "solid" label "" source 18 target 30 ] edge [ linestyle "solid" label "" source 8 target 9 ] edge [ linestyle "solid" label "" source 15 target 16 ] edge [ linestyle "solid" label "" source 2 target 4 ] edge [ linestyle "solid" label "" source 10 target 23 ] edge [ linestyle "solid" label "" source 12 target 11 ] edge [ linestyle "solid" label "" source 8 target 17 ] edge [ linestyle "solid" label "" source 17 target 26 ] edge [ linestyle "solid" label "" source 9 target 16 ] edge [ linestyle "solid" label "" source 7 target 10 ] edge [ linestyle "solid" label "" source 0 target 1 ] edge [ linestyle "solid" label "" source 29 target 15 ] edge [ linestyle "solid" label "" source 1 target 3 ] edge [ linestyle "solid" label "" source 6 target 7 ] edge [ linestyle "solid" label "" source 0 target 2 ] edge [ linestyle "solid" label "" source 1 target 13 ] edge [ linestyle "solid" label "" source 2 target 3 ] edge [ linestyle "solid" label "" source 5 target 6 ] edge [ linestyle "solid" label "" source 7 target 11 ] edge [ linestyle "solid" label "" source 13 target 18 ] edge [ linestyle "solid" label "" source 10 target 31 ] edge [ linestyle "solid" label "" source 11 target 21 ] edge [ linestyle "solid" label "" source 6 target 8 ] edge [ linestyle "solid" label "" source 4 target 5 ] edge [ linestyle "solid" label "" source 16 target 22 ] edge [ linestyle "solid" label "" source 15 target 20 ] edge [ linestyle "solid" label "" source 27 target 28 ] edge [ linestyle "solid" label "" source 13 target 29 ] edge [ linestyle "solid" label "" source 9 target 24 ] edge [ linestyle "solid" label "" source 3 target 29 ] edge [ linestyle "solid" label "" source 17 target 25 ] edge [ linestyle "solid" label "" source 4 target 27 ] edge [ linestyle "solid" label "" source 18 target 19 ] edge [ linestyle "solid" label "" source 5 target 12 ] edge [ linestyle "solid" label "" source 12 target 27 ] ]