org.eclipse.birt.chart.factory
Class RunTimeContext

java.lang.Object
  extended byorg.eclipse.birt.chart.factory.RunTimeContext
All Implemented Interfaces:
java.io.Serializable

public final class RunTimeContext
extends java.lang.Object
implements java.io.Serializable

Encapsulates runtime information associated with each chart generation and rendering session. It contains global objects that are defined per request.

See Also:
Serialized Form

Constructor Summary
RunTimeContext()
          A default zero-arg public constructor used for object creation.
 
Method Summary
 void clearState()
          Clears all the stored states.
 java.lang.String externalizedMessage(java.lang.String sChartKey)
          A convenience method provided to lookup externalized messages associated with a given message key.
 IActionRenderer getActionRenderer()
          Returns the IActionRenderer of current runtime context.
 LegendLayoutHints getLegendLayoutHints()
          Returns the LegendItemLayoutHints for current context.
 java.util.Locale getLocale()
          Deprecated. use getULocale() instead.
 ResourceHandle getResourceHandle()
          Returns an instance of the resource handle for which chart specific messages are externalized.
 IScriptClassLoader getScriptClassLoader()
          Returns the script classLoader if available.
 IChartScriptContext getScriptContext()
          Returns an instance of a script context associated with the chart being generated.
 ScriptHandler getScriptHandler()
          Returns an instance of a transient script handler associated with the chart being generated.
 java.util.Map getSeriesRenderers()
          Returns the series renderers for current context.
 java.lang.Object getState(java.lang.Object key)
          Returns the state object from store by the key.
 IStructureDefinitionListener getStructureDefinitionListener()
          Returns an instance of the structure definition listner for device renderers that need a structure definition notification when rendering primitives.
 com.ibm.icu.util.ULocale getULocale()
          Returns the locale associated with this runtime context.
 boolean isRightToLeft()
          Returns if current context is in a right-left platform.
 boolean isScriptingEnabled()
          Returns if scriting is enabled in current context.
 boolean notifyStructureChange(java.lang.String sEventName, java.lang.Object oSource)
          Notifies the structure definition listener of a change in the current running structure that defines a group of primitives being rendered and puts them into context with reference to the source object.
 void putState(java.lang.Object key, java.lang.Object state)
          Puts a state object to the store.
 java.lang.Object removeState(java.lang.Object key)
          Removes the state object by the key.
 void setActionRenderer(IActionRenderer iar)
          Sets an IActionRenderer instance to current runtime context.
 void setLegendLayoutHints(LegendLayoutHints lilh)
          Sets the LegendItemLayoutHints for current context.
 void setLocale(java.util.Locale lcl)
          Deprecated. use setULocale(ULocale) instead.
 void setMessageLookup(IMessageLookup iml)
          Defines an externalized message lookup implementation per chart model being executed.
 void setResourceHandle(ResourceHandle rh)
          Specifies a resource handle that facilitates retrieval of chart specific externalized messages.
 void setRightToLeft(boolean value)
          Sets the right-left mode for current context mandatorily.
 void setScriptClassLoader(IScriptClassLoader value)
          Sets the script classLoader.
 void setScriptContext(IChartScriptContext csc)
          Sets an instance of a chart script context associated with the chart being generated.
 void setScriptHandler(ScriptHandler sh)
          Sets an instance of a transient script handler associated with the chart being generated.
 void setScriptingEnabled(boolean value)
          Sepcifies if to enable scripting in current context.
 void setSeriesRenderers(java.util.Map msr)
          Sets the series renderers for current context.
 void setStructureDefinitionListener(IStructureDefinitionListener isdl)
          Internally sets an instance of the structure definition listener for device renderers that need a structure definition notification when rendering primitives.
 void setULocale(com.ibm.icu.util.ULocale lcl)
          Sets the locale associated with this runtime context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RunTimeContext

public RunTimeContext()
A default zero-arg public constructor used for object creation.

Method Detail

putState

public void putState(java.lang.Object key,
                     java.lang.Object state)
Puts a state object to the store.

Parameters:
key -
state -

getState

public java.lang.Object getState(java.lang.Object key)
Returns the state object from store by the key.

Parameters:
key -
Returns:

removeState

public java.lang.Object removeState(java.lang.Object key)
Removes the state object by the key.

Parameters:
key -
Returns:

clearState

public void clearState()
Clears all the stored states.


isScriptingEnabled

public boolean isScriptingEnabled()
Returns if scriting is enabled in current context.

Returns:

setScriptingEnabled

public void setScriptingEnabled(boolean value)
Sepcifies if to enable scripting in current context.

Parameters:
value -

getScriptClassLoader

public IScriptClassLoader getScriptClassLoader()
Returns the script classLoader if available.

Returns:

setScriptClassLoader

public void setScriptClassLoader(IScriptClassLoader value)
Sets the script classLoader.

Parameters:
value -

setStructureDefinitionListener

public void setStructureDefinitionListener(IStructureDefinitionListener isdl)
Internally sets an instance of the structure definition listener for device renderers that need a structure definition notification when rendering primitives.

Parameters:
isdl - The structure definition listener associated with the runtime context.

getStructureDefinitionListener

public IStructureDefinitionListener getStructureDefinitionListener()
Returns an instance of the structure definition listner for device renderers that need a structure definition notification when rendering primitives.

Returns:
The structure definition listener associated with the runtime context.

setActionRenderer

public void setActionRenderer(IActionRenderer iar)
Sets an IActionRenderer instance to current runtime context.

Parameters:
iar -

getActionRenderer

public IActionRenderer getActionRenderer()
Returns the IActionRenderer of current runtime context.

Returns:

setLegendLayoutHints

public void setLegendLayoutHints(LegendLayoutHints lilh)
Sets the LegendItemLayoutHints for current context.

Parameters:
lilh -

getLegendLayoutHints

public LegendLayoutHints getLegendLayoutHints()
Returns the LegendItemLayoutHints for current context.

Returns:

setSeriesRenderers

public void setSeriesRenderers(java.util.Map msr)
Sets the series renderers for current context.

Parameters:
msr -

getSeriesRenderers

public java.util.Map getSeriesRenderers()
Returns the series renderers for current context.

Returns:

notifyStructureChange

public boolean notifyStructureChange(java.lang.String sEventName,
                                     java.lang.Object oSource)
Notifies the structure definition listener of a change in the current running structure that defines a group of primitives being rendered and puts them into context with reference to the source object.

Parameters:
sEventName - Defines the structure being defined along with the event type
oSource - The source object on which the structure is being defined
Returns:
'true' if the structure definition listener exists and was notified of the change or 'false' otherwise.

getLocale

public java.util.Locale getLocale()
Deprecated. use getULocale() instead.

Returns the locale associated with this runtime context.

Returns:
The locale associated with this runtime context.

setLocale

public void setLocale(java.util.Locale lcl)
Deprecated. use setULocale(ULocale) instead.

Sets the locale associated with this runtime context. This is usually done when chart generation begins.

Parameters:
lcl - The locale associated with the runtime context.

getULocale

public com.ibm.icu.util.ULocale getULocale()
Returns the locale associated with this runtime context.

Returns:
The locale associated with this runtime context.
Since:
2.1

setULocale

public void setULocale(com.ibm.icu.util.ULocale lcl)
Sets the locale associated with this runtime context. This is usually done when chart generation begins.

Parameters:
lcl - The locale associated with the runtime context.
Since:
2.1

isRightToLeft

public boolean isRightToLeft()
Returns if current context is in a right-left platform. e.g. Arabic, Hebrew.

Returns:

setRightToLeft

public void setRightToLeft(boolean value)
Sets the right-left mode for current context mandatorily.

Parameters:
value -

getResourceHandle

public ResourceHandle getResourceHandle()
Returns an instance of the resource handle for which chart specific messages are externalized.

Returns:
An instance of the resource handle for which chart specific messages are externalized.

setResourceHandle

public void setResourceHandle(ResourceHandle rh)
Specifies a resource handle that facilitates retrieval of chart specific externalized messages.

Parameters:
rh - The resource handle.

getScriptHandler

public ScriptHandler getScriptHandler()
Returns an instance of a transient script handler associated with the chart being generated. The script handler is capable of executing callback scripts defined in the chart model.

Returns:
An instance of the script handler.

setScriptHandler

public void setScriptHandler(ScriptHandler sh)
Sets an instance of a transient script handler associated with the chart being generated. The script handler is capable of executing callback scripts defined in the chart model.

Parameters:
sh - An instance of the script handler.

getScriptContext

public IChartScriptContext getScriptContext()
Returns an instance of a script context associated with the chart being generated.

Returns:
An instance of the script context.

setScriptContext

public void setScriptContext(IChartScriptContext csc)
Sets an instance of a chart script context associated with the chart being generated.

Parameters:
csc - An instance of the chart script context.

setMessageLookup

public void setMessageLookup(IMessageLookup iml)
Defines an externalized message lookup implementation per chart model being executed.

Parameters:
iml - The externalized message lookup implementation.

externalizedMessage

public java.lang.String externalizedMessage(java.lang.String sChartKey)
A convenience method provided to lookup externalized messages associated with a given message key.

Parameters:
sChartKey - The key using which an externalized message is being looked up.
Returns:
The externalized message associated with the specified key.


Copyright © 2005-2007 Actuate Corp. All rights reserved.