use of com.revolsys.swing.map.layer.record.renderer.AbstractMultipleRenderer in project com.revolsys.open by revolsys.
the class AbstractRecordLayer method addRenderer.
@Override
public int addRenderer(final LayerRenderer<?> child, final int index) {
final AbstractRecordLayerRenderer oldRenderer = getRenderer();
AbstractMultipleRenderer rendererGroup;
if (oldRenderer instanceof AbstractMultipleRenderer) {
rendererGroup = (AbstractMultipleRenderer) oldRenderer;
} else {
final AbstractRecordLayer layer = oldRenderer.getLayer();
rendererGroup = new MultipleRecordRenderer(layer);
rendererGroup.addRenderer(oldRenderer);
setRenderer(rendererGroup);
}
if (index == 0) {
rendererGroup.addRenderer(0, (AbstractRecordLayerRenderer) child);
return 0;
} else {
rendererGroup.addRenderer((AbstractRecordLayerRenderer) child);
return rendererGroup.getRenderers().size() - 1;
}
}
Aggregations