/** * Dispatches repaint notification to all registered cameras. * * @param parentBounds bounds needing repainting in parent coordinate system */ protected void notifyCameras(final PBounds parentBounds) { final int count = getCameraCount(); for (int i = 0; i < count; i++) { final PCamera each = (PCamera) cameras.get(i); each.repaintFromLayer(parentBounds, this); } }
/** * Write this layer and all its children out to the given stream. Note that * the layer writes out any cameras that are viewing it conditionally, so * they will only get written out if someone else writes them * unconditionally. * * @param out object to which the layer should be streamed * @throws IOException may occur while serializing to stream */ private void writeObject(final ObjectOutputStream out) throws IOException { if (!(out instanceof PObjectOutputStream)) { throw new RuntimeException("May not serialize PLayer to a non PObjectOutputStream"); } out.defaultWriteObject(); final int count = getCameraCount(); for (int i = 0; i < count; i++) { ((PObjectOutputStream) out).writeConditionalObject(cameras.get(i)); } out.writeObject(Boolean.FALSE); }