private static synchronized void saveGrid(ComponentWrapper parComp, LinkedHashMap<Integer, Cell> grid)
{
if (PARENT_GRIDPOS_MAP == null)
PARENT_GRIDPOS_MAP = new WeakHashMap<Object, ArrayList<WeakCell>>(4);
ArrayList<WeakCell> weakCells = new ArrayList<WeakCell>(grid.size());
for (Map.Entry<Integer, Cell> e : grid.entrySet()) {
Cell cell = e.getValue();
Integer xyInt = e.getKey();
if (xyInt != null) {
int x = (xyInt << 16) >> 16;
int y = xyInt >> 16;
for (CompWrap cw : cell.compWraps)
weakCells.add(new WeakCell(cw.comp.getComponent(), x, y, cell.spanx, cell.spany));
}
}
PARENT_GRIDPOS_MAP.put(parComp.getComponent(), weakCells);
}