@Override
protected void setStatus(CellStatus status, boolean increasing) {
synchronized(listenerRecords) {
super.setStatus(status, increasing);
ViewManager vm = ClientContextJME.getViewManager();
switch(status) {
case ACTIVE :
if (increasing) {
CellTransform worldTransform = cell.getWorldTransform();
for(ProximityListenerRecord l : listenerRecords)
l.updateWorldBounds(worldTransform);
vm.addViewManagerListener(this);
primaryViewCellChanged(null, vm.getPrimaryViewCell());
cell.addTransformChangeListener(cellTransformListener);
}
break;
case DISK :
if (viewTransformListener!=null) {
vm.removeViewManagerListener(this);
primaryViewCellChanged(vm.getPrimaryViewCell(), null);
cell.removeTransformChangeListener(cellTransformListener);
}
synchronized (listenerRecords) {
for (ProximityListenerRecord rec : listenerRecords) {
rec.cleanup(vm.getPrimaryViewCell().getCellID());
}
listenerRecords.clear();
}
break;
}