} catch (Exception excp) {
LOGGER.log(Level.WARNING, "Unable to fetch Cell ID integer " +
"from the drop target", excp);
return;
}
CellID cellID = new CellID(cellIDInt);
// Fetch the client-side Cell cache and find the Cell with the
// dropped CellID
WonderlandSession session = LoginManager.getPrimary().getPrimarySession();
CellCache cache = ClientContext.getCellCache(session);
if (cache == null) {
LOGGER.warning("Unable to find Cell cache for session " + session);
return;
}
Cell draggedCell = cache.getCell(cellID);
if (draggedCell == null) {
LOGGER.warning("Unable to find dragged Cell with ID " + cellID);
return;
}
// Find out what Cell ID this was dropped over. This will form the
// new parent. If the Cell is dropped over the world root, then set
// the CellID to InvalidCellID
CellID parentCellID = CellID.getInvalidCellID();
SortedTreeNode treeNode = (SortedTreeNode) path.getLastPathComponent();
Object userObject = treeNode.getUserObject();
Cell newParent = null;
if (userObject instanceof Cell && !(userObject instanceof EnvironmentCell)) {
parentCellID = ((Cell) userObject).getCellID();