July 16, 2008 1. Introduction JVizServer is a public domain drawing server software. It supports all (including future) drawing methods of java.awt.Graphics (and many extra methods of java.awt.Graphics2D) by using Java reflection. However, there is no limitation on the client's programming language, because JVizServer uses text-based drawing commands. 2. Quick Start Compile: "javac *.java" and move all class files to net/freescitech/jvs/ Usage: java net.freescitech.jvs.JVizServer [-n host tcp_port] [cmd_files] where "-n host tcp_port" specifies the host name (IP address) and the TCP port to listen. For test, don't use it, then the console will be used. Option cmd_files specifies the .cmd files to read on start up. See test.cmd for an example. After it starts up, try to input some commands from the console (or from a network client). I suppose it is quite trivial to learn. 3. Command There are three kinds of commands supported. (1) low-level commands, which are drawing methods of java.awt.Graphics and java.awt.Graphics2D provided by the JRE. Supported drawing methods with respect to JRE 6 (aka. 1.6) are listed in available_methods.txt. Actually it is simply the set of methods taking supported data types (and having no return value). For usage of these methods, see the JRE API. http://java.sun.com/javase/6/docs/api/ (2) high-level commands, which take the next format: h begin x y module method ... ... (module method related commands) ... ... h end x y module method JVizServer will call the specified method of the given module to draw the image and put it at orgin (x, y). Currently, it supports Graphviz, for which, the ... commands is the dot commands used by Graphviz. Again, see test.cmd for an example. (3) special # commands, which are not drawing methods themselves but affects the way to draw, e.g., flush the input (without an explicit #flush command, JVizServer will not draw the commands for efficiency), or do a complete redraw (the default is to draw commands that arrived after the last drawing, which is efficient but may result a strange display). Currently the next special commands are available: #set origin x y: set the virtual origin to (x, y). This changes the displayed coordinates of the current mouse pointer. #set size w h: set the real size to width w and height h. #set viewport x y: set the real viewport to (x, y). #set scale n d: set the scale to n/d. #set layer n mode: set the current layer to n with the given mode. Mode 0 = hide, 1 = show and 2 = clear (delete all drawing commands!!). #remove drawing_command: remove the specified drawing command from the current (the default) layer. Not implemented now simply because I don't know why to use it :-p. #file filenames: read from the given files (be careful there is no loop). #info message: set the status line (info label) to the given message. #flush: flush the input (default is not to flush). This triggers a redraw but only the newly arrived commands are drawn. This is for efficiency but may result strange drawing. In that case, try a complete redraw by #refresh command please. #refresh: do a complete redraw. It first clears the background, then draw all the commands from beginning to the end. #exit: #quit: shutdown the system. 4. Remark If you find it is useful (or can be improved), please drop me a line. I will be glad to heare feedbacks from you :-). Have fun! Liang Zhao