Diagram with boxes
Source code name: "graph2.py"
Programming language: Python
Topic: Plots/Graph
DMelt Version 1. Last modified: 07/18/2015. License: Free
http://datamelt.org/code/cache/graph2_3381.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.



from java.awt import *
from jhplot import *
from jhplot.jadraw import Diagram


Xpos=0.25 
Ypos=0.4 
c1=HPlotJa("Canvas",400,300,1,1,0)
c1.setGTitle("DMelt structure", Color.blue)
c1.visible()

gl=Diagram.TextBox(" Java Virtual Machine ", Xpos,Ypos+0.3)
gl.setFillColor(Color.white)
c1.add(gl)

gl=Diagram.TextBox("Java API", Xpos,Ypos+0.15)
gl.setRelWH(0.25,0.1,"NDC")
gl.setFillColor(Color.white)
c1.add(gl)


gl=Diagram.TextBox("DMelt API ", Xpos+0.26,Ypos+0.15)
gl.setColor(Color.gray)
gl.setRelWH(0.30,0.1,"NDC")
c1.add(gl)

gl=Diagram.TextBox("Libraries", Xpos+0.26,Ypos)
gl.setColor(Color.gray)
gl.setRelWH(0.30,0.1,"NDC")
c1.add(gl)

gl=Diagram.TextBox("DMelt IDE", Xpos+0.26,Ypos-0.15)
gl.setColor(Color.gray)
gl.setRelWH(0.30,0.1,"NDC")
c1.add(gl)

gl=Diagram.FLine(Xpos+0.1,Ypos-0.1)
gl.setRelWH(-0.15,0.0,"NDC")
gl.setStroke(2)
c1.add(gl)

gl=Diagram.Blob(Xpos-0.05, Ypos-0.1)
gl.setRelWH(0.18,0.05,"NDC")
c1.add(gl)

gl=Diagram.Text("Web services", Xpos-0.17,Ypos-0.08)
c1.add(gl)


# show all now
c1.update()