return;
}
}
private void attachOrb(CellID hostCellID, boolean attach) {
Cell newHostCell = ClientContext.getCellCache(session).getCell(hostCellID);
if (newHostCell == null) {
logger.warning("Can't find host cell for " + hostCellID);
return;
}
if (logger.isLoggable(Level.FINE)) {
String s = "None";
if (hostCell != null) {
s = hostCell.getCellID().toString();
}
logger.fine("Attach " + attach + " avatarCellID "
+ avatarCell.getCellID() + " new host " + newHostCell.getCellID()
+ " current host " + s);
}
if (attach) {
if (hostCell != null) {
/*
* Someone else has attached the Orb.
*/
logger.fine("Detaching " + orbCell.getCellID() + " from "
+ hostCell.getCellID());
detachOrb(false);
}
synchronized (detachedOrbList) {
detachedOrbList.remove(orbCell);
}
ArrayList<OrbCell> attachedOrbList = attachedOrbMap.get(newHostCell);
if (attachedOrbList == null) {
attachedOrbList = new ArrayList();
attachedOrbMap.put(newHostCell, attachedOrbList);
}
synchronized (attachedOrbList) {
attachedOrbList.remove(orbCell);
attachedOrbList.add(orbCell);
}
hostCell = newHostCell;
newHostCell.addTransformChangeListener(this);
positionAttachedOrbs(newHostCell);
} else {
detachOrb(true);
}
return;