pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.service.event
Class JFreeChartPNGOutputEvent

java.lang.Object
  extended by org.torweg.pulse.service.event.JFreeChartPNGOutputEvent
All Implemented Interfaces:
Event

public final class JFreeChartPNGOutputEvent
extends java.lang.Object
implements Event

Version:
$Revision: 2026 $
Author:
Daniel Dietz

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.torweg.pulse.service.event.Event
Event.Disposition
 
Constructor Summary
JFreeChartPNGOutputEvent(org.jfree.chart.JFreeChart chart, int width, int height, CacheMode cMode)
          Creates a new JFreeChartPNGOutputEvent for the given chart with the given width and height for the PNG.
 
Method Summary
 CacheMode getCacheMode()
          returns the CacheMode.
 boolean isOutputEvent()
          Indicates if this Event will write to the OutputStream and so render the OutputStream unwritable for future results.
 boolean isSingularEvent()
          Indicates that the Event will only be added once to the EventManager and block all other Events.
 boolean isStopEvent()
          Indicates if the Invoker should proceed executing other bundles or if it should terminate after executing this Event .
 void run(ServiceRequest request)
          Writes the chart to the ServletOutputStream.
 void setCacheMode(CacheMode c)
          sets the CacheMode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JFreeChartPNGOutputEvent

public JFreeChartPNGOutputEvent(org.jfree.chart.JFreeChart chart,
                                int width,
                                int height, CacheMode cMode)
                         throws java.lang.NullPointerException,
                                java.lang.IllegalArgumentException
Creates a new JFreeChartPNGOutputEvent for the given chart with the given width and height for the PNG.

Parameters:
chart - the JFreeChart to create the PNG from
width - the width for the PNG
height - the height for the PNG
cMode - the CacheMode
Throws:
java.lang.NullPointerException - if chart or cMode is null
java.lang.IllegalArgumentException - if width < 0 | height < 0
Method Detail

run

public void run(ServiceRequest request)
Writes the chart to the ServletOutputStream.

Specified by:
run in interface Event
Parameters:
request - the current ServiceRequest
See Also:
Event.run(org.torweg.pulse.service.request.ServiceRequest)

isOutputEvent

public boolean isOutputEvent()
Description copied from interface: Event
Indicates if this Event will write to the OutputStream and so render the OutputStream unwritable for future results.

Please note: After writing to the OutputStream it should be flushed and closed.

Specified by:
isOutputEvent in interface Event
Returns:
true
See Also:
Event.isOutputEvent()

isStopEvent

public boolean isStopEvent()
Description copied from interface: Event
Indicates if the Invoker should proceed executing other bundles or if it should terminate after executing this Event .

Specified by:
isStopEvent in interface Event
Returns:
true
See Also:
Event.isStopEvent()

isSingularEvent

public boolean isSingularEvent()
Description copied from interface: Event
Indicates that the Event will only be added once to the EventManager and block all other Events.

If an Event of the same type has already been added to the EventManager, subsequent calls to EventManager.addEvent(Event) will return without adding the given Event.

Specified by:
isSingularEvent in interface Event
Returns:
true
See Also:
Event.isSingularEvent()

getCacheMode

public CacheMode getCacheMode()
returns the CacheMode.

Specified by:
getCacheMode in interface Event
Returns:
the cache mode
See Also:
Event.getCacheMode()

setCacheMode

public void setCacheMode(CacheMode c)
sets the CacheMode.

Specified by:
setCacheMode in interface Event
Parameters:
c - the cache mode to set
See Also:
Event.setCacheMode(org.torweg.pulse.service.request.CacheMode)