*/
public static JRGenericPrintElement makeFlashElement(JRPrintElement template,
String swfUrl, Map flashVars, Map elementParameters)
{
// TODO use JRTemplateGenericElement
JRBaseGenericPrintElement flashEl = new JRBaseGenericPrintElement(
template.getDefaultStyleProvider());
// copy all attribute from the template element
flashEl.setX(template.getX());
flashEl.setY(template.getY());
flashEl.setWidth(template.getWidth());
flashEl.setHeight(template.getHeight());
flashEl.setStyle(template.getStyle());
flashEl.setMode(template.getOwnModeValue());
flashEl.setBackcolor(template.getOwnBackcolor());
flashEl.setForecolor(template.getOwnForecolor());
flashEl.setOrigin(template.getOrigin());
flashEl.setKey(template.getKey());
flashEl.setGenericType(FLASH_ELEMENT_TYPE);
flashEl.setParameterValue(PARAMETER_SWF_URL, swfUrl);
for (Iterator it = flashVars.entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
String name = (String) entry.getKey();
Object value = entry.getValue();
String paramName = PARAMETER_FLASH_VAR_PREFIX + name;
flashEl.setParameterValue(paramName, value);
}
if (elementParameters != null && !elementParameters.isEmpty())
{
for (Iterator it = elementParameters.entrySet().iterator(); it.hasNext();)
{
Map.Entry entry = (Map.Entry) it.next();
String name = (String) entry.getKey();
Object value = entry.getValue();
flashEl.setParameterValue(name, value);
}
}
return flashEl;
}