}
if (!(message instanceof CellHierarchyMessage))
throw new RuntimeException("Unexpected message type "+message.getClass().getName());
CellHierarchyMessage msg = (CellHierarchyMessage)message;
switch(msg.getActionType()) {
case LOAD_CELL :
for(CellCacheMessageListener l : listeners) {
l.loadCell(msg.getCellID(),
msg.getCellClassName(),
msg.getLocalBounds(),
msg.getParentID(),
msg.getCellTransform(),
msg.getSetupData(),
msg.getCellName()
);
}
// if (viewCellID!=null && viewCellID.equals(msg.getCellID())) {
//
// clientView.viewCellConfigured(viewCellID);
// // We only need notification once
// viewCellID = null;
// }
break;
case CONFIGURE_CELL:
// Update recieving a "configure cell" message, dispatch to all
// of the listeners. A "configure" message simply send a new
// client cell state to an already existing cell.
for (CellCacheMessageListener l : listeners) {
l.configureCell(msg.getCellID(), msg.getSetupData(), msg.getCellName());
}
break;
case UNLOAD_CELL :
for(CellCacheMessageListener l : listeners) {
l.unloadCell(msg.getCellID());
}
break;
case DELETE_CELL :
for(CellCacheMessageListener l : listeners) {
l.deleteCell(msg.getCellID());
}
break;
case CHANGE_PARENT:
// Unused at the moment, CellEditConnectionHandler processes reparenting
// for(CellCacheMessageListener l : listeners) {
// l.changeParent(msg.getCellID(), msg.getParentID(), msg.getCellTransform());
// }
break;
default :
logger.warning("Message type not implemented "+msg.getActionType());
}
}