|
KavaChart 5.3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ve.kavachart.servlet.Bean
public abstract class Bean
A server side chart bean for creating image files and image streams corresponding to a list of properties. This bean is designed to be used from servlets, such as com.ve.kavachart.servlet.ChartServlet although a servlet isn't required. Subclasses of this bean load instances of various kinds of KavaChart charts, and modify data and aesthetic aspects of those charts via properties that parallel KavaChart applets. Image information can be generated in various encodings, and stored locally in the bean or written to a file.
These beans use a CacheManager to write image data to a File if required, and can identify and load a pre-written chart definition from a disk cache if it already exists. This is done by generating unique file names that correspond (via a Secure Hash Algorithm digest) to the bean's property list. If the properties are changed, the file name will also change. If a file with this bean's automatic name already exists in the disk cache, the image will not be regenerated unless the property "useCache" is set to false.
Field Summary | |
---|---|
protected boolean |
antialiasOn
|
static com.ve.kavachart.utility.CacheCleaner |
cacheCleaner
|
ChartInterface |
chart
|
protected com.ve.kavachart.utility.DataProvider |
dataProvider
|
java.lang.String |
delimiter
|
protected java.lang.String |
dwellLabelTemplate
|
protected boolean |
dwellUseDatasetName
|
protected boolean |
dwellUseString
|
protected boolean |
dwellUseXValue
|
protected boolean |
dwellUseY2Value
|
protected boolean |
dwellUseYValue
|
protected java.text.Format |
dwellXLabelFormat
|
protected java.lang.String |
dwellXString
|
protected java.lang.String |
dwellY2String
|
protected java.text.NumberFormat |
dwellYLabelFormat
|
protected java.lang.String |
dwellYString
|
protected boolean |
isChartServlet
|
protected boolean |
javascriptTooltips
|
static java.lang.String |
keyCheckFailure
|
static java.lang.String |
keyIP
|
protected java.io.OutputStream |
logStream
|
com.ve.kavachart.utility.ParameterParser |
parser
|
protected java.util.Properties |
properties
|
boolean |
remoteStream
|
static java.lang.String |
serverIP
|
protected boolean |
useDwellLabel
|
protected UserImagingCodec |
userImagingCodec
|
protected java.util.Locale |
userLocale
|
Constructor Summary | |
---|---|
Bean()
|
Method Summary | |
---|---|
void |
accumulateProperty(java.lang.String name,
java.lang.Object value)
Convenience method for building properties that have the form a,b,c,d,... |
protected void |
buildChart()
Creates a chart instance for imaging by the CacheManager. |
void |
drawMyStuff(java.awt.Graphics g)
Draws overlays (if any). |
void |
generate()
Starts image generation, if the image isn't cached. |
protected void |
generate(boolean geometriesOnly)
Generates the image geometries for linkmaps, as well as encoding the image when geometriesOnly is set to false. |
ChartInterface |
getChart()
Returns the com.ve.kavachart.chart.ChartInterface managed by this bean. |
com.ve.kavachart.utility.DataProvider |
getDataProvider()
Returns the bean's DataProvider, if defined. |
Dataset |
getDataset(ChartInterface chart,
int which)
Returns null. |
protected java.lang.String |
getDwellLabelLabelString(Datum d)
Returns a label string for the specified Datum |
protected java.lang.String |
getDwellLabelXString(Datum d)
Returns an X value string for the specified Datum |
protected java.lang.String |
getDwellLabelY2String(Datum d)
|
protected java.lang.String |
getDwellLabelYString(Datum d)
Returns a Y value string for the specified Datum |
java.lang.String |
getFileName()
Returns the name of the file containing image data. |
protected java.lang.String |
getFileName(boolean geometriesOnly)
|
byte[] |
getImageBytes()
Returns a byte array of encoded image data for this chart. |
java.lang.String |
getLinkMap()
Generates a link map and ALT statements to create tooltip popups over Datum objects |
protected java.lang.String |
getLinkMap(boolean geometriesOnly)
|
java.io.OutputStream |
getLogStream()
Returns the logging OutputStream, or null if undefined |
void |
getMyDatasets(java.lang.String s)
doesn't do anything here... |
void |
getMyOptions()
Generally implemented by subclasses of this class. |
protected void |
getOptions()
Called to parse this chart's property list. |
java.lang.String |
getParameter(java.lang.String name)
Get the value of a specified property. |
java.util.Enumeration |
getParameterNames()
Return the entire property list. |
java.lang.String |
getProperty(java.lang.String property)
Return a specified property. |
abstract void |
init()
Must be implemented by subclass to set the protected variable "chart" to an instance of a com.ve.kavachart.chart.Chart subclass (BarChart, LineChart, etc.), and call "getOptions()". |
protected void |
initializeToolTipVars()
|
protected void |
initLocale()
Checks for a custom locale setting otherwise sets the charts locale to the default |
void |
loadProperties(java.lang.String filename)
Load default properties from a specified file. |
void |
log(java.lang.String s)
Log errors. |
java.awt.Image |
makeURLImage(java.lang.String s)
Creates an Image from the specified filename. |
protected java.io.InputStream |
openFile(java.lang.String s)
|
java.io.InputStream |
openURL(java.lang.String s)
Internal utility method |
void |
setDataProvider(com.ve.kavachart.utility.DataProvider dp)
Sets an external data provider for this chart. |
protected void |
setDelimiter()
Sets the delimiter if parser is null |
void |
setLogStream(java.io.OutputStream out)
Sets the output stream used to log errors |
void |
setProperties(java.util.Properties props)
Copy the property values of props into this chart bean. |
void |
setProperty(java.lang.String property,
java.lang.Object value)
Define the specified property. |
void |
setStringProperty(java.lang.String property,
java.lang.String value)
Define the specified property. |
void |
setUserImagingCodec(UserImagingCodec codec)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean remoteStream
public com.ve.kavachart.utility.ParameterParser parser
public transient ChartInterface chart
protected java.util.Properties properties
protected java.io.OutputStream logStream
protected boolean useDwellLabel
protected java.text.Format dwellXLabelFormat
protected java.text.NumberFormat dwellYLabelFormat
protected boolean dwellUseXValue
protected boolean dwellUseYValue
protected boolean dwellUseY2Value
protected boolean dwellUseString
protected boolean dwellUseDatasetName
protected java.lang.String dwellXString
protected java.lang.String dwellYString
protected java.lang.String dwellY2String
protected UserImagingCodec userImagingCodec
protected boolean antialiasOn
protected boolean javascriptTooltips
protected java.lang.String dwellLabelTemplate
public static com.ve.kavachart.utility.CacheCleaner cacheCleaner
protected com.ve.kavachart.utility.DataProvider dataProvider
public static java.lang.String keyCheckFailure
public static java.lang.String keyIP
public static java.lang.String serverIP
public java.lang.String delimiter
protected boolean isChartServlet
protected java.util.Locale userLocale
Constructor Detail |
---|
public Bean()
Method Detail |
---|
public void setProperties(java.util.Properties props)
props
- public void accumulateProperty(java.lang.String name, java.lang.Object value)
name
- java.lang.Stringvalue
- java.lang.Objectgprotected void buildChart() throws ChartException
ChartException
public void drawMyStuff(java.awt.Graphics g)
g
- java.awt.Graphicspublic void generate() throws ChartException
ChartException
protected void generate(boolean geometriesOnly) throws ChartException
geometriesOnly
-
ChartException
public ChartInterface getChart()
public Dataset getDataset(ChartInterface chart, int which)
getDataset
in interface com.ve.kavachart.utility.GetParam
chart
- com.ve.kavachart.chart.ChartInterfacewhich
- int
protected java.lang.String getDwellLabelLabelString(Datum d)
protected java.lang.String getDwellLabelXString(Datum d)
protected java.lang.String getDwellLabelYString(Datum d)
protected java.lang.String getDwellLabelY2String(Datum d)
public java.lang.String getFileName() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getFileName(boolean geometriesOnly)
public byte[] getImageBytes()
public java.lang.String getLinkMap() throws java.lang.Exception
java.lang.Exception
protected java.lang.String getLinkMap(boolean geometriesOnly) throws java.lang.Exception
java.lang.Exception
public java.io.OutputStream getLogStream()
public void getMyDatasets(java.lang.String s)
getMyDatasets
in interface com.ve.kavachart.utility.GetParam
s
- java.lang.Stringpublic void getMyOptions()
protected void getOptions()
public java.lang.String getParameter(java.lang.String name)
getParameter
in interface com.ve.kavachart.utility.GetParam
name
- java.lang.String
public java.util.Enumeration getParameterNames()
public java.lang.String getProperty(java.lang.String property)
property
- java.lang.String
public abstract void init()
protected void initializeToolTipVars()
protected void initLocale()
public void loadProperties(java.lang.String filename)
public void log(java.lang.String s)
s
- java.lang.Stringpublic java.awt.Image makeURLImage(java.lang.String s)
makeURLImage
in interface com.ve.kavachart.utility.GetParam
s
- java.lang.String
protected java.io.InputStream openFile(java.lang.String s)
public java.io.InputStream openURL(java.lang.String s)
openURL
in interface com.ve.kavachart.utility.GetParam
s
- java.lang.String
public void setLogStream(java.io.OutputStream out)
out
- java.io.OutputStreampublic void setStringProperty(java.lang.String property, java.lang.String value)
property
- java.lang.Stringvalue
- java.lang.Stringpublic void setProperty(java.lang.String property, java.lang.Object value)
property
- java.lang.Stringvalue
- java.lang.Objectpublic void setUserImagingCodec(UserImagingCodec codec)
protected void setDelimiter()
public void setDataProvider(com.ve.kavachart.utility.DataProvider dp)
setDataProvider
in interface com.ve.kavachart.utility.GetParam
dp
- DataProvidercom.ve.kavachart.applet.GetParam#setDataProvider(DataProvider)
public com.ve.kavachart.utility.DataProvider getDataProvider()
getDataProvider
in interface com.ve.kavachart.utility.GetParam
com.ve.kavachart.applet.GetParam#getDataProvider()
|
KavaChart 5.3.1 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |