Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.nwoods.jgo.web
Class JGoImageServlet

    java.lang.Object
      javax.servlet.GenericServlet
          javax.servlet.http.HttpServlet
              com.nwoods.jgo.web.JGoImageServlet

All Implemented Interfaces:
  java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JGoImageServlet
extends javax.servlet.http.HttpServlet

This class implements an HttpServlet that produces JPEG images of JGoDocuments rather than HTML pages.

The servlet keeps an arbitrary number of named documents (JGoDocument) indexed in the ServletContext. The HttpSession keeps the current view (JGoJPEGView), so that the current selection and view size/position/scale are maintained and accessible from other servlets.

This servlet can handle additional requests besides just generating an image to be displayed by the browser. It can handle arbitrary actions as specified in the "act" parameter. It also handles keyboard commands and mouse commands. The exact behaviors can be customized by the cooperation of the HTML page invoking this servlet and the implementation of this servlet.

See Also:
  Serialized Form

Constructor Summary
`JGoImageServlet()`

Method Summary
`void` | `adjustScale(JGoJPEGView view, java.lang.String scalestr)` Scale requests are a little more complex than just specifying the new scale as a double float.
`void` | `doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)` This method processes the mouse down and up events on the JGoJPEGView named in the GoView parameter by using JGoImageEventProcessor, and then produces a JPEG image of that view.
`void` | `doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)`
`static java.lang.String` | `getRequestParameter(javax.servlet.http.HttpServletRequest request, java.lang.String p, java.lang.String def)` convenience function for defaulting parameters
`static boolean` | `getRequestParameterBoolean(javax.servlet.http.HttpServletRequest request, java.lang.String p, boolean def)` convenience function for defaulting parameters
`static double` | `getRequestParameterDouble(javax.servlet.http.HttpServletRequest request, java.lang.String p, double def)` convenience function for defaulting parameters
`static int` | `getRequestParameterInt(javax.servlet.http.HttpServletRequest request, java.lang.String p, int def)` convenience function for defaulting parameters
`void` | `init()`
`void` | `produceImage(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, JGoJPEGView view)` Generate the image, using docx, docy as the upper left corner, a size of width, height, and a scale factor of scale.

Methods inherited from class javax.servlet.http.HttpServlet
`doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service`

Methods inherited from class javax.servlet.GenericServlet
`destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JGoImageServlet

    public JGoImageServlet()

Method Detail

### doPost

    public void doPost(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response)
                throws javax.servlet.ServletException,
                       java.io.IOException

  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

### doGet

    public void doGet(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws javax.servlet.ServletException,
                      java.io.IOException

  This method processes the mouse down and up events on the JGoJPEGView named in the GoView parameter by using JGoImageEventProcessor, and then produces a JPEG image of that view. If the GoViewData parameter is not blank, it will generate the JavaScript data associated with the view. The JavaScript data includes tooltip and cursor data.

  Throws:
    `javax.servlet.ServletException`
    `java.io.IOException`

### produceImage

    public void produceImage(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             JGoJPEGView view)

  Generate the image, using docx, docy as the upper left corner, a size of width, height, and a scale factor of scale. All of the parameters as passed in as part of the request HttpServletRequest. Generate the image, using the view's defaults if not specified in request.

  Parameters:
    `request` -
    `response` -
    `view` -

### adjustScale

    public void adjustScale(JGoJPEGView view,
                            java.lang.String scalestr)

  Scale requests are a little more complex than just specifying the new scale as a double float. They can be prefixed with "*", "+", and "-", to indicate that the current scale should be adjusted in that manner by the following double value.

  Parameters:
    `view` -
    `scalestr` -

### init

    public void init()
              throws javax.servlet.ServletException

  Throws:
    `javax.servlet.ServletException`

### getRequestParameter

    public static java.lang.String getRequestParameter(javax.servlet.http.HttpServletRequest request,
                                                       java.lang.String p,
                                                       java.lang.String def)

  convenience function for defaulting parameters

  Parameters:
    `request` -
    `p` - parameter whose value is requested
    `def` - default value
  Returns:

### getRequestParameterInt

    public static int getRequestParameterInt(javax.servlet.http.HttpServletRequest request,
                                             java.lang.String p,
                                             int def)

  convenience function for defaulting parameters

  Parameters:
    `request` -
    `p` - parameter whose value is requested
    `def` - default value
  Returns:

### getRequestParameterDouble

    public static double getRequestParameterDouble(javax.servlet.http.HttpServletRequest request,
                                                   java.lang.String p,
                                                   double def)

  convenience function for defaulting parameters

  Parameters:
    `request` -
    `p` -
    `def` -
  Returns:

### getRequestParameterBoolean

    public static boolean getRequestParameterBoolean(javax.servlet.http.HttpServletRequest request,
                                                     java.lang.String p,
                                                     boolean def)

  convenience function for defaulting parameters

  Parameters:
    `request` -
    `p` -
    `def` -
  Returns:

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD