/** * Method used for unserialization * * @param in * @throws IOException * @throws ClassNotFoundException */ @SuppressWarnings("unchecked") private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.readInt(); dataListeners = (List<ListDataListener>) in.readObject(); layers = (LinkedList<Layer<?>>) in.readObject(); // We remove layer with null data since if the unserialization of a layer failed, its data is // null removeNoDataLayers(); }