private void addItemBlock(LegendItem item) { Block block = createLegendItemBlock(item); this.items.add(block); }
/** * Fetches the latest legend items. */ protected void fetchLegendItems() { this.items.clear(); RectangleEdge p = getPosition(); if (RectangleEdge.isTopOrBottom(p)) { this.items.setArrangement(this.hLayout); } else { this.items.setArrangement(this.vLayout); } for (int s = 0; s < this.sources.length; s++) { LegendItemCollection legendItems = this.sources[s].getLegendItems(); if (legendItems != null) { for (int i = 0; i < legendItems.getItemCount(); i++) { LegendItem item = legendItems.get(i); Block block = createLegendItemBlock(item); this.items.add(block); } } } }