/** * Adds a block to the container. * * @param block the block ({@code null} permitted). */ public void add(Block block) { add(block, null); }
/** * Adds a block to the container. * * @param block the block (<code>null</code> permitted). */ public void add(Block block) { add(block, null); }
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); } } } }
result.add(legendItem);
result.add(legendItem);