//filtering requested styles
Set requestedStyles = collectRequestedStyles(styles);
//collect used styles
Map usedStylesMap = new SequencedHashMap();
Map allStylesMap = new HashMap();
for (Iterator it = styles.iterator(); it.hasNext();)
{
JRStyle style = (JRStyle) it.next();
if (requestedStyles.contains(style))
{
collectUsedStyles(style, usedStylesMap, allStylesMap);
}
allStylesMap.put(style.getName(), style);
}
List includedStyles = new ArrayList();
for (Iterator it = usedStylesMap.keySet().iterator(); it.hasNext();)
{
JRStyle style = (JRStyle) it.next();
JRStyle newStyle = getStyle(style);
includedStyles.add(newStyle);