public void readXMLToRenderer(XMLStreamReader reader, Item item) throws XMLStreamException { if (reader.getLocalName().equals(XML_RENDERER)) { String valueString = reader.getElementText(); System.out.println("@Var: renderer.... " + valueString); LegendItemRenderer availableRenderer = LegendController.getInstance().getRenderers().get(valueString); System.out.println("@Var: renderer.... " + availableRenderer); if (availableRenderer != null) { item.setData(LegendItem.RENDERER, availableRenderer); } } }
@Override public Item[] getItems(Graph graph, AttributeModel attributeModel) { LegendModel legendManager = LegendController.getInstance().getLegendModel(); ArrayList<Item> legendItems = legendManager.getLegendItems(); ArrayList<Item> items = new ArrayList<Item>(); for (Item item : legendItems) { if (isBuilderForItem(item)) { items.add(item); } } return items.toArray(new Item[items.size()]); }