int index = Integer.parseInt(indexStr);
if (panelId < index) {
panelId = index;
}
Panel existingPanel = renderedPanels.get(index);
if (existingPanel != null) {
if (!updating || selectedPanels.contains(existingPanel)) {
// update existing panel
existingPanel.update(canvasContent);
changeOrder(existingPanel, zorder);
}
} else {
String viewType = canvasContent.getManifestedViewType();
ComponentRegistry cr = ComponentRegistryAccess.getComponentRegistry();
AbstractComponent comp = cr.getComponent(componentId);
View viewManifestation = getManifestation(comp, viewType, canvasContent);
if (viewManifestation == null) { return; }
Panel panel = createPanel(viewManifestation, index, this);
viewManifestation.setNamingContext(panel);
Dimension dimension = canvasContent.getDimension();
Point location = canvasContent.getStartPoint();
Rectangle bound = new Rectangle(location, dimension);
panel.setBounds(bound);
placeWidget(panel, zorder);
renderedPanels.put(index, panel);
}
}