All Packages Class Hierarchy This Package Previous Next Index
public void drawgfx(Figure fig, Hashtable env, V2V usr2pxl) ; public String drawps(Figure fig, Hashtable env, V2V usr2ps) ;The job of the first is to take the figure element, use usr2pxl to represent it in pxl coordinates (which has the origin at the upper left hand corner and uses as a unit one pixel) and plot the result in the Graphics object of fig. The job of the second is to take the figure element, use usr2ps to represent it in postscript coordinates (which has the origin at the lower left hand corner and uses as a unit one Adobe point, which is 1/72 inch) and return a string which plots the result in postscript. In both, the values of the appropriate environment variables are to be taken from env.
public abstract void drawgfx(Figure fig, Hashtable env, V2V usr2pxl)
public void drawgfx(Figure fig, Hashtable env, V2V usr2pxl) { double[] pxlfrom, pxlto ; pxlfrom = usr2pxl.map(from) ; pxlto = usr2pxl.map(to) ; gfx.drawLine((int)pxlfrom[0],(int)pxlfrom[1], (int)pxlto[0],(int)pxlto[1]) ; }This routine assumes that the starting point of the line is a two component aray called from and that the end point of the line is a two component array called to.
public abstract String drawps(Figure fig, Hashtable env, V2V usr2ps)
public String drawps(Figure fig, Hashtable env, V2V usr2ps) { double[] psfrom, psto ; psfrom = usr2ps.map(from) ; psto = usr2ps.map(to) ; return "newpath\n" +psfrom[0]+" "+psfrom[1]+" moveto\n" +psto[0]+" "+psto[1]+" lineto stroke\n" ; }
All Packages Class Hierarchy This Package Previous Next Index