from java.awt import *
from jhplot import *
from jhplot.jadraw import Diagram
c1=HPlotJa("Canvas",600,400,1,1,0)
c1.setGTitle("Feynman Diagram objects", Color.blue)
c1.visible()
c1.showEditor(1) # show diagram editor
gl=Diagram.Box(0.1,0.1) # box
gl.setRelWH(0.05,0.05,"NDC")
c1.add(gl)
gl=Diagram.Blob(0.1,0.2) # blob
gl.setRelWH(0.01,0.01,"NDC")
c1.add(gl)
gl=Diagram.Vertex(0, 0.1,0.3) # a vertex
gl.setRelWH(0.01,0.01,"NDC")
c1.add(gl)
gl=Diagram.GLine(0.1,0.4) # gluon line
gl.setStroke(2)
gl.setRelWH(0.1,0.2,"NDC")
c1.add(gl)
gl=Diagram.PLine(0.4,0.1) # gluon line
gl.setStroke(2)
gl.setRelWH(0.1,0.2,"NDC")
c1.add(gl)
gl=Diagram.FLine(0.4,0.3) # gluon line
gl.setStroke(2)
gl.setRelWH(0.1,0.2,"NDC")
c1.add(gl)
c1.update()