net.sf.jasperreports.engine.export
Class FlashPrintElement

java.lang.Object
  extended by net.sf.jasperreports.engine.export.FlashPrintElement

public final class FlashPrintElement
extends java.lang.Object

Utility class that creates generic print elements of Flash type.

Such an element has a parameter that provides the URL of the SWF movie, and a list of parameters that acts a Flash variables.

Version:
$Id: FlashPrintElement.java 5050 2012-03-12 10:11:26Z teodord $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)
See Also:
FlashHtmlHandler

Field Summary
static java.lang.String FLASH_ELEMENT_NAME
          The name of Flash generic elements.
static JRGenericElementType FLASH_ELEMENT_TYPE
          The qualified type of Flash generic elements.
protected static int LINK_PARAM_NAME_GROUP
           
protected static java.util.regex.Pattern LINK_PATTERN
           
static java.lang.String PARAMETER_FLASH_VAR_PREFIX
          The prefix of parameter names that acts as Flash variables.
static java.lang.String PARAMETER_SWF_URL
          The name of the parameter that provides the URL of the SWF movie.
static java.lang.String PROPERTY_ALLOW_SCRIPT_ACCESS
          Property that determines the value of the allowScriptAccess parameter for Flash elements.
static java.lang.String PROPERTY_IGNORE_SIZE
          Boolean property used to avoid setting the width and height of the SWFLoader control in the Flash report viewer.
 
Method Summary
static GenericElementHandlerBundle getHandlerBundle()
          Returns the bundle of export handlers for Flash elements.
static JRGenericPrintElement makeFlashElement(JRPrintElement template, java.lang.String swfUrl, java.util.Map<java.lang.String,java.lang.Object> flashVars, java.util.Map<java.lang.String,java.lang.Object> elementParameters)
          Creates a Flash generic element by copying all base element attributes from a template instance.
static java.lang.String makeLinkParameterName(JRPrintHyperlink hyperlink)
          Returns the name of the parameter to be used for a hyperlink, as used by makeLinkPlaceholder(JRPrintHyperlink) and resolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer).
static java.lang.String makeLinkPlaceholder(JRPrintHyperlink hyperlink)
          Returns a placeholder to be used in a Flash variable for a hyperlink.
static java.lang.String makeLinkPlaceholder(java.lang.String linkId)
          Returns a placeholder to be used in a Flash variable for a hyperlink.
static java.lang.String resolveLinks(java.lang.String text, JRGenericPrintElement element, JRHyperlinkProducer linkProducer)
          Resolves hyperlink placeholders to URLs in a Flash variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FLASH_ELEMENT_NAME

public static final java.lang.String FLASH_ELEMENT_NAME
The name of Flash generic elements.

See Also:
Constant Field Values

FLASH_ELEMENT_TYPE

public static final JRGenericElementType FLASH_ELEMENT_TYPE
The qualified type of Flash generic elements.


PARAMETER_SWF_URL

public static final java.lang.String PARAMETER_SWF_URL
The name of the parameter that provides the URL of the SWF movie.

See Also:
Constant Field Values

PARAMETER_FLASH_VAR_PREFIX

public static final java.lang.String PARAMETER_FLASH_VAR_PREFIX
The prefix of parameter names that acts as Flash variables.

See Also:
Constant Field Values

PROPERTY_IGNORE_SIZE

public static final java.lang.String PROPERTY_IGNORE_SIZE
Boolean property used to avoid setting the width and height of the SWFLoader control in the Flash report viewer.

Defaults to false.

See Also:
Constant Field Values

PROPERTY_ALLOW_SCRIPT_ACCESS

public static final java.lang.String PROPERTY_ALLOW_SCRIPT_ACCESS
Property that determines the value of the allowScriptAccess parameter for Flash elements.

The property can be set at element, report and system levels.

See Also:
Constant Field Values

LINK_PATTERN

protected static final java.util.regex.Pattern LINK_PATTERN

LINK_PARAM_NAME_GROUP

protected static final int LINK_PARAM_NAME_GROUP
See Also:
Constant Field Values
Method Detail

getHandlerBundle

public static GenericElementHandlerBundle getHandlerBundle()
Returns the bundle of export handlers for Flash elements.

Returns:
Flash elements export handler bundle

makeFlashElement

public static JRGenericPrintElement makeFlashElement(JRPrintElement template,
                                                     java.lang.String swfUrl,
                                                     java.util.Map<java.lang.String,java.lang.Object> flashVars,
                                                     java.util.Map<java.lang.String,java.lang.Object> elementParameters)
Creates a Flash generic element by copying all base element attributes from a template instance.

Parameters:
template - the element from which to copy base attributes
swfUrl - the URL of the SWF movie
flashVars - a map of Flash variables
elementParameters - additional parameters to be set on the Flash element. Hyperlink objects need to be set as element parameters.
Returns:
a Flash generic element

makeLinkParameterName

public static java.lang.String makeLinkParameterName(JRPrintHyperlink hyperlink)
Returns the name of the parameter to be used for a hyperlink, as used by makeLinkPlaceholder(JRPrintHyperlink) and resolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer).

Parameters:
hyperlink - the hyperlink
Returns:
the hyperlink parameter name
See Also:
makeLinkPlaceholder(JRPrintHyperlink)

makeLinkPlaceholder

public static java.lang.String makeLinkPlaceholder(JRPrintHyperlink hyperlink)
Returns a placeholder to be used in a Flash variable for a hyperlink.

This method uses System.identityHashCode(hyperlink) as link Id.

Parameters:
hyperlink - the hyperlink
Returns:
the link placeholder
See Also:
makeLinkPlaceholder(String)

makeLinkPlaceholder

public static java.lang.String makeLinkPlaceholder(java.lang.String linkId)
Returns a placeholder to be used in a Flash variable for a hyperlink.

The placeholders will be resolved to links at export time by resolveLinks(String, JRGenericPrintElement, JRHyperlinkProducer).

Parameters:
linkId - the Id of the link, which needs to be used as hyperlink parameter name
Returns:
the link placeholder

resolveLinks

public static java.lang.String resolveLinks(java.lang.String text,
                                            JRGenericPrintElement element,
                                            JRHyperlinkProducer linkProducer)
Resolves hyperlink placeholders to URLs in a Flash variable.

Parameters:
text - the text in which hyperlink placeholders are to be replaced
element - the print element where hyperlink parameters will be looked for
linkProducer - the hyperlink producer which transforms hyperlink objects to String URLs
Returns:
the text with hyperlink placeholders replaced by URLs
See Also:
makeLinkPlaceholder(String)


© 2001-2010 Jaspersoft Corporation www.jaspersoft.com