lt.monarch.chart.servlet
Class ChartImageBuilder

java.lang.Object
  extended by lt.monarch.chart.servlet.ChartImageBuilder
All Implemented Interfaces:
java.io.Serializable, ViewContainer

public class ChartImageBuilder
extends java.lang.Object
implements ViewContainer

ViewContainer implementation for image and image map generation

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  java.awt.Color background
          image background
protected  View chart
          the chart to render
protected  ChartObjectsMap chartObjectsMap
          a chart objects map of the view container
protected  HotSpotMap hotSpotMap
          a hot spot map of the view container
protected  java.awt.Image image
          an image to render chart into
protected  java.awt.Insets insets
          insets of the image, which indicate the size of the image's border
protected  java.awt.Dimension size
          size of image
 
Constructor Summary
Constructor and Description
ChartImageBuilder(View chart)
          Constructs a new ChartImageBuilder with the specified chart.
 
Method Summary
Modifier and Type Method and Description
 void addGestureListener(GestureListener l)
          Does nothing.
 void addMouseListener(java.awt.event.MouseListener l)
          Dummy implementation.
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
          Dummy implementation.
 void addMouseWheelListener(java.awt.event.MouseWheelListener l)
          Does nothing.
 void addMultitouchListener(MultitouchListener l)
          Does nothing.
 void cleanup()
          Cleans this chart image builder object.
protected  void finalize()
          Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
 java.awt.Color getBackground()
          Gets the chart image background.
 ChartObjectsMap getChartObjectsMap()
          Returns a chart objects map for the view container.
 java.awt.Component getComponent()
          Returns the Component associated with this view container.
 HotSpotMap getHotSpotMap()
          Returns a hot spot map for the view container.
 java.awt.Image getImage()
          Returns the internal image.
 java.awt.Insets getInsets()
          Determines the insets of the chart image, which indicate the size of the images's border.
 AbstractGraphics getUpdateGraphics()
          Returns graphics context of the chart image.
 View getView()
          Returns chart view.
 void removeGestureListener(GestureListener l)
          Does nothing.
 void removeMouseListener(java.awt.event.MouseListener l)
          Dummy implementation.
 void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
          Dummy implementation.
 void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
          Does nothing.
 void removeMultitouchListener(MultitouchListener l)
          Does nothing.
 void render()
          Renders the chart into an internal image buffer
 void repaint(Rectangle2D r)
          Dummy implementation.
 void revalidate()
          Dummy implementation.
 void setBackground(java.awt.Color background)
          Sets background color for the chart image.
 void setChartObjectsMap(ChartObjectsMap map)
          Sets a chart objects map for the view container.
 void setHotSpotMap(HotSpotMap map)
          Sets a hot spot map for the view container.
 void setInsets(java.awt.Insets insets)
          Sets image insets.
 void setSize(java.awt.Dimension size)
          Sets size of the image.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

chart

protected View chart
the chart to render


size

protected java.awt.Dimension size
size of image


background

protected java.awt.Color background
image background


insets

protected java.awt.Insets insets
insets of the image, which indicate the size of the image's border


hotSpotMap

protected HotSpotMap hotSpotMap
a hot spot map of the view container


chartObjectsMap

protected ChartObjectsMap chartObjectsMap
a chart objects map of the view container


image

protected java.awt.Image image
an image to render chart into

Constructor Detail

ChartImageBuilder

public ChartImageBuilder(View chart)
Constructs a new ChartImageBuilder with the specified chart.

Parameters:
chart - the chart
Method Detail

setBackground

public void setBackground(java.awt.Color background)
Sets background color for the chart image.

Parameters:
background - the image background

getBackground

public java.awt.Color getBackground()
Gets the chart image background.

Returns:
chart image background

setInsets

public void setInsets(java.awt.Insets insets)
Sets image insets.

Parameters:
insets - image insets

getInsets

public java.awt.Insets getInsets()
Determines the insets of the chart image, which indicate the size of the images's border.

Returns:
insets of the chart image

setSize

public void setSize(java.awt.Dimension size)
Sets size of the image.

Parameters:
size - The dimension specifying the new size of the image.

getComponent

public java.awt.Component getComponent()
Returns the Component associated with this view container.

Specified by:
getComponent in interface ViewContainer
Returns:
null

getUpdateGraphics

public AbstractGraphics getUpdateGraphics()
Returns graphics context of the chart image.

Specified by:
getUpdateGraphics in interface ViewContainer
Returns:
graphics context of the chart image

render

public void render()
Renders the chart into an internal image buffer


getImage

public java.awt.Image getImage()
Returns the internal image.

Returns:
the internal image

getHotSpotMap

public HotSpotMap getHotSpotMap()
Returns a hot spot map for the view container.

Specified by:
getHotSpotMap in interface ViewContainer
Returns:
a hot spot map for the view container

setHotSpotMap

public void setHotSpotMap(HotSpotMap map)
Sets a hot spot map for the view container.

Parameters:
map - the hot spot map

getChartObjectsMap

public ChartObjectsMap getChartObjectsMap()
Returns a chart objects map for the view container.

Specified by:
getChartObjectsMap in interface ViewContainer
Returns:
a chart objects map for the view container

setChartObjectsMap

public void setChartObjectsMap(ChartObjectsMap map)
Sets a chart objects map for the view container.

Parameters:
map - the chart objects map

repaint

public void repaint(Rectangle2D r)
Dummy implementation. Does nothing.

Specified by:
repaint in interface ViewContainer
Parameters:
r - the area to repaint

revalidate

public void revalidate()
Dummy implementation. Does nothing.

Specified by:
revalidate in interface ViewContainer

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Dummy implementation. Does nothing.

Specified by:
addMouseListener in interface ViewContainer
Parameters:
l - the mouse listener

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l)
Dummy implementation. Does nothing.

Specified by:
removeMouseListener in interface ViewContainer
Parameters:
l - the mouse listener

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Dummy implementation. Does nothing.

Specified by:
addMouseMotionListener in interface ViewContainer
Parameters:
l - the mouse motion listener

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
Dummy implementation. Does nothing.

Specified by:
removeMouseMotionListener in interface ViewContainer
Parameters:
l - the mouse motion listener

addMouseWheelListener

public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
Does nothing.

Specified by:
addMouseWheelListener in interface ViewContainer
Parameters:
l - the mouse listener

removeMouseWheelListener

public void removeMouseWheelListener(java.awt.event.MouseWheelListener l)
Does nothing.

Specified by:
removeMouseWheelListener in interface ViewContainer
Parameters:
l - the mouse motion listener

addGestureListener

public void addGestureListener(GestureListener l)
Does nothing.

Specified by:
addGestureListener in interface ViewContainer
Parameters:
l - the gesture listener

addMultitouchListener

public void addMultitouchListener(MultitouchListener l)
Does nothing.

Specified by:
addMultitouchListener in interface ViewContainer
Parameters:
l - the gesture listener

removeGestureListener

public void removeGestureListener(GestureListener l)
Does nothing.

Specified by:
removeGestureListener in interface ViewContainer
Parameters:
l - the gesture listener

removeMultitouchListener

public void removeMultitouchListener(MultitouchListener l)
Does nothing.

Specified by:
removeMultitouchListener in interface ViewContainer
Parameters:
l - the gesture listener

cleanup

public void cleanup()
Cleans this chart image builder object. After this object is unusable and can be garbage collected.


finalize

protected void finalize()
                 throws java.lang.Throwable
Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. Calls cleanup method if it isn't called yet.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - the Exception raised by this method

getView

public View getView()
Returns chart view.

Specified by:
getView in interface ViewContainer
Returns:
Returns the chart view.