| java.lang.Object com.jgraph.svgplugin.JGraphpadSVGServer
JGraphpadSVGServer | public class JGraphpadSVGServer (Code) | | Simple webserver to stream SVG, PNG and JPG content to clients. This
implementation is based on nanoHttpd (http://nanohttpd.sourceforge.net/).
|
Inner Class :public class Response | |
Method Summary | |
protected JGraph | createGraph(GraphLayoutCache cache) Creates a new graph for the specified cache and puts it into the
backingFrame component hierachy. | protected JGraph | getGraph(String reference) Returns a JGraph for the specified reference. | public ServerSocket | getServerSocket() | public Response | serve(String uri, String method, Properties header, Properties parms) Serves the response for the specified request. | protected Response | serveImage(JGraph graph, String format) Produces a JPG or PNG image of the specified graph. | protected Response | serveIndex() Produces a HTML index page of all diagrams in the document model. | protected Response | serveSVG(JGraph graph) Produces an SVG image of the specified graph. | public void | setServerSocket(ServerSocket serverSocket) |
HTTP_OKHTTP_REDIRECTHTTP_FORBIDDENHTTP_NOTFOUNDHTTP_BADREQUESTHTTP_INTERNALERRORHTTP_NOTIMPLEMENTED | final public static String HTTP_OKHTTP_REDIRECTHTTP_FORBIDDENHTTP_NOTFOUNDHTTP_BADREQUESTHTTP_INTERNALERRORHTTP_NOTIMPLEMENTED(Code) | | Some HTTP response status codes
|
MIME_PLAINTEXTMIME_HTMLMIME_DEFAULT_BINARYMIME_PNGMIME_JPG | final public static String MIME_PLAINTEXTMIME_HTMLMIME_DEFAULT_BINARYMIME_PNGMIME_JPG(Code) | | Common mime types for dynamic content
|
serverSocket | protected ServerSocket serverSocket(Code) | | Holds the socket the server is listening on.
|
JGraphpadSVGServer | public JGraphpadSVGServer(JGraphEditor editor, int port) throws IOException(Code) | | Starts a HTTP server for the enclosing editor on the specified port.
Throws an IOException if the socket is already in use
|
createGraph | protected JGraph createGraph(GraphLayoutCache cache)(Code) | | Creates a new graph for the specified cache and puts it into the
backingFrame component hierachy.
|
serve | public Response serve(String uri, String method, Properties header, Properties parms) throws IOException(Code) | | Serves the response for the specified request. This returns a HTML index
containing the links to the diagrams in the editor's document model, or
one of the diagrams as an SVG, JPG or PNG image.
Parameters: uri - Percent-decoded URI without parameters, for example"/index.cgi" Parameters: method - "GET", "POST" etc. Parameters: parms - Parsed, percent decoded parameters from URI and, in case ofPOST, data. Parameters: header - Header entries, percent decoded HTTP response, see class Response for details throws: IOException - |
serveImage | protected Response serveImage(JGraph graph, String format) throws IOException(Code) | | Produces a JPG or PNG image of the specified graph.
|
serveIndex | protected Response serveIndex()(Code) | | Produces a HTML index page of all diagrams in the document model.
|
serveSVG | protected Response serveSVG(JGraph graph) throws IOException(Code) | | Produces an SVG image of the specified graph.
|
setServerSocket | public void setServerSocket(ServerSocket serverSocket)(Code) | | Parameters: serverSocket - The serverSocket to set. |
|
|