/** * Internal use only. */ public Control cloneForSpatial(Spatial spatial) { try { AnimControl clone = (AnimControl) super.clone(); clone.spatial = spatial; clone.channels = new ArrayList<AnimChannel>(); clone.listeners = new ArrayList<AnimEventListener>(); if (skeleton != null) { clone.skeleton = new Skeleton(skeleton); } // animationMap is cloned, but only ClonableTracks will be cloned as they need a reference to a cloned spatial for (Entry<String, Animation> animEntry : animationMap.entrySet()) { clone.animationMap.put(animEntry.getKey(), animEntry.getValue().cloneForSpatial(spatial)); } return clone; } catch (CloneNotSupportedException ex) { throw new AssertionError(); } }
/** * Internal use only. */ @Override public Control cloneForSpatial(Spatial spatial) { try { AnimControl clone = (AnimControl) super.clone(); clone.spatial = spatial; clone.channels = new ArrayList<AnimChannel>(); clone.listeners = new ArrayList<AnimEventListener>(); if (skeleton != null) { clone.skeleton = new Skeleton(skeleton); } // animationMap is cloned, but only ClonableTracks will be cloned as they need a reference to a cloned spatial for (Entry<String, Animation> animEntry : animationMap.entrySet()) { clone.animationMap.put(animEntry.getKey(), animEntry.getValue().cloneForSpatial(spatial)); } return clone; } catch (CloneNotSupportedException ex) { throw new AssertionError(); } }