JMSLTM Numerical Library 6.1

com.imsl.chart
Class JspBean

java.lang.Object
  extended by com.imsl.chart.JspBean
All Implemented Interfaces:
Serializable

public class JspBean
extends Object
implements Serializable

JspBean is used to refer to charts in a Java Server Page that are later rendered using the ChartServlet.

See Also:
ChartServlet, Chart Programmer's Guide: Servlets, Serialized Form

Constructor Summary
JspBean()
          Creates a JspBean object.
 
Method Summary
 String getChartServletName()
          Returns the URL of the servlet used to render the chart.
 boolean getCreateImageMap()
          Returns true if a client-side imagemap is to be created.
 String getId()
          Returns the identifier number for the chart.
 String getImageMap()
          Returns an HTML for the client-side imagemap.
 String getImageTag()
          Returns an HTML image tag.
 String getMapName()
          Returns the name of the client-size imagemap.
 Dimension getSize()
          Returns the size of the generated image.
 void registerChart(Chart chart, javax.servlet.http.HttpServletRequest request)
          Saves the chart and sets the chart attribute "Size".
protected  void saveChart(Chart chart, javax.servlet.http.HttpServletRequest request)
          Saves the chart so that a servlet can later render it.
 void setChartServletName(String chartServletName)
          Sets the URL of the servlet used to render the chart.
 void setCreateImageMap(boolean createImageMap)
          Sets a flag indicating if a client-size imagemap is to be generated.
 void setSize(Dimension size)
          Sets the size of the generated image.
 void setSize(int width, int height)
          Sets the size of the generated image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspBean

public JspBean()
Creates a JspBean object.

Method Detail

getChartServletName

public String getChartServletName()
Returns the URL of the servlet used to render the chart.


getCreateImageMap

public boolean getCreateImageMap()
Returns true if a client-side imagemap is to be created.


getId

public String getId()
Returns the identifier number for the chart. It is assigned a unique random value by the constructor.


getImageMap

public String getImageMap()
Returns an HTML for the client-side imagemap. This HTML is to be inserted into the page being generated.

Returns:
the HTML map tag. If no map is defined the empty string is returned.

getImageTag

public String getImageTag()
Returns an HTML image tag. This is normally inserted into the HTML being generated.

Returns:
the HTML tag refering to the servlet-generated chart. If no image is defined the empty string is returned.

getMapName

public String getMapName()
Returns the name of the client-size imagemap. This is null if CreateImageMap is false.


getSize

public Dimension getSize()
Returns the size of the generated image.


registerChart

public void registerChart(Chart chart,
                          javax.servlet.http.HttpServletRequest request)
Saves the chart and sets the chart attribute "Size". The chart is saved using the saveChart method. If the ChartServletName has not been set, it is set to "ContextPath/servlet/com.imsl.chart.ChartServlet", where "ContextPath is the context path in the request.

Parameters:
chart - is the chart to be registered. The Dimension-value attribute "Size" is set in the root node of the chart tree. The Size attribute is used by ChartServlet.
request - from the Java Server Page.

saveChart

protected void saveChart(Chart chart,
                         javax.servlet.http.HttpServletRequest request)
Saves the chart so that a servlet can later render it. The chart is saved in the HttpSession, associated with the request, under the key "chartNNN", where NNN is the value of the id property. This method can be overridden to change the mechanism by which the bean and the servlet correspond.

Parameters:
chart - is the chart to be registered.
request - from the Java Server Page. The chart is saved in its session object.

setChartServletName

public void setChartServletName(String chartServletName)
Sets the URL of the servlet used to render the chart. Its initial value is null. It is usually set in the registerChart method. Since this is used only in the image tag, it can be specified relative to the URL of the page in which the image tag is used.

Parameters:
chartServletName - is the location of the chart servlet to be used in the generated image tag.

setCreateImageMap

public void setCreateImageMap(boolean createImageMap)
Sets a flag indicating if a client-size imagemap is to be generated. Its initial value is false. A client-side image map has an entry for each node in which the chart attribute HREF is defined. The values of HREF attributes are URLs. Such regions are treated by the browser as hyperlinks.

Parameters:
createImageMap - is true if a client-side image map is to be generated.
See Also:
ChartNode.setHREF(String)

setSize

public void setSize(Dimension size)
Sets the size of the generated image. Its initial value is new Dimension(300,300).

Parameters:
size - is the size of the generated image.

setSize

public void setSize(int width,
                    int height)
Sets the size of the generated image. Its initial value is new Dimension(300,300).

Parameters:
width - is the width of the generated image.
height - is the height of the generated image.

JMSLTM Numerical Library 6.1

Copyright © 1970-2010 Visual Numerics, Inc.
Built July 30 2010.