protected void fetchLegendItems() {
        this.items.clear();
        RectangleEdge p = getPosition();
        if (RectangleEdge.isTopOrBottom(p)) {
            this.items.setArrangement(this.hLayout);
        }
        else {
            this.items.setArrangement(this.vLayout);
        }

        if (this.sortOrder.equals(SortOrder.ASCENDING)) {
            for (LegendItemSource source : this.sources) {
                LegendItemCollection legendItems =
                        source.getLegendItems();
                if (legendItems != null) {
                    for (int i = 0; i < legendItems.getItemCount(); i++) {
                        addItemBlock(legendItems.get(i));
                    }
                }
            }
        }
        else {
            for (int s = this.sources.length - 1; s >= 0; s--) {
                LegendItemCollection legendItems =
                    this.sources[s].getLegendItems();
                if (legendItems != null) {
                    for (int i = legendItems.getItemCount()-1; i >= 0; i--) {
                        addItemBlock(legendItems.get(i));
                    }
                }
            }
        }
    }