// fall back to style name
if (title == null) {
title = layerInfo.getNamedStyleInfo().getName();
}
LegendItemComponentInfo item = new LegendItemComponentInfo();
LegendGraphicComponentInfo graphic = new LegendGraphicComponentInfo();
graphic.setLabel(title);
graphic.setRuleInfo(rule);
graphic.setLayerId(layerInfo.getServerLayerId());
item.addChild(graphic);
item.addChild(getLegendLabel(legend, title));
legend.addChild(item);
}
} else if (layer instanceof RasterLayer && layer.isShowing()) {