*
* @param layerID
* @return
*/
private mxCell getZLevelLayer(int layerID) {
mxCell layer = zLevelLayer.get(Integer.valueOf(layerID));
if (layer == null) {
mxCell parent = (mxCell) modelGraph.getDefaultParent();
int i = 0;
for (i = 0; i < parent.getChildCount()
&& (Integer) parent.getChildAt(i).getValue() < layerID; i++) {
// we have to insert the layer at the correct position so we
// have to search manually
}
layer = (mxCell) modelGraph.addCell(new mxCell(layerID), parent, i,
null, null);
zLevelLayer.put(Integer.valueOf(layerID), layer);
}
return layer;
}