protected void updateMatParamOverrides() { refreshFlags &= ~RF_MATPARAM_OVERRIDE; worldOverrides.clear(); if (parent == null) { worldOverrides.addAll(localOverrides); } else { assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0; worldOverrides.addAll(parent.worldOverrides); worldOverrides.addAll(localOverrides); } }
public void setCameras(final List<Camera> cameras) { this.cameras.clear(); this.cameras.addAll(cameras); }
protected void initializePending(){ AppState[] array = getInitializing(); if (array.length == 0) return; synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }
public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); name = ic.readString("name", null); worldBound = (BoundingVolume) ic.readSavable("world_bound", null); cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit); batchHint = ic.readEnum("batch_hint", BatchHint.class, BatchHint.Inherit); queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class, RenderQueue.Bucket.Inherit); shadowMode = ic.readEnum("shadow_mode", ShadowMode.class, ShadowMode.Inherit); localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY); localLights = (LightList) ic.readSavable("lights", null); localLights.setOwner(this); ArrayList<MatParamOverride> localOverridesList = ic.readSavableArrayList("overrides", null); if (localOverridesList == null) { localOverrides = new SafeArrayList<>(MatParamOverride.class); } else { localOverrides = new SafeArrayList(MatParamOverride.class, localOverridesList); } worldOverrides = new SafeArrayList<>(MatParamOverride.class); //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split //the AnimControl creates the SkeletonControl for old files and add it to the spatial. //The SkeletonControl must be the last in the stack so we add the list of all other control before it. //When backward compatibility won't be needed anymore this can be replaced by : //controls = ic.readSavableArrayList("controlsList", null)); controls.addAll(0, ic.readSavableArrayList("controlsList", null)); userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null); }
public SafeArrayList(Class<E> elementType, Collection<? extends E> c) { this.elementType = elementType; addAll(c); }
protected void updateMatParamOverrides() { refreshFlags &= ~RF_MATPARAM_OVERRIDE; worldOverrides.clear(); if (parent == null) { worldOverrides.addAll(localOverrides); } else { assert (parent.refreshFlags & RF_MATPARAM_OVERRIDE) == 0; worldOverrides.addAll(parent.worldOverrides); worldOverrides.addAll(localOverrides); } }
public DragAndDropControl( DragAndDropListener... initialListeners ) { listeners.addAll(Arrays.asList(initialListeners)); }
@Override public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); controls.addAll(0, ic.readSavableArrayList("controlsList", null)); } }
/** * Completely rebuilds the component stack from the index, layer ordering, * and top list. This should be called whenever changes are made to these * data structures that cannot be reconciled with surgical changes to the * components list. */ protected void rebuildStack() { components.clear(); for( String s : layerOrder ) { GuiComponent layer = index.get(s); if( layer != null ) { components.add(layer); } } // Add the top components components.addAll(topList); }
protected void initializePending(){ AppState[] array = getInitializing(); if (array.length == 0) return; synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }
protected void initializePending(){ AppState[] array = getInitializing(); synchronized( states ) { // Move the states that will be initialized // into the active array. In all but one case the // order doesn't matter but if we do this here then // a state can detach itself in initialize(). If we // did it after then it couldn't. List<AppState> transfer = Arrays.asList(array); states.addAll(transfer); initializing.removeAll(transfer); } for (AppState state : array) { state.initialize(this, app); } }
public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); name = ic.readString("name", null); worldBound = (BoundingVolume) ic.readSavable("world_bound", null); cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit); batchHint = ic.readEnum("batch_hint", BatchHint.class, BatchHint.Inherit); queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class, RenderQueue.Bucket.Inherit); shadowMode = ic.readEnum("shadow_mode", ShadowMode.class, ShadowMode.Inherit); localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY); localLights = (LightList) ic.readSavable("lights", null); localLights.setOwner(this); //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split //the AnimControl creates the SkeletonControl for old files and add it to the spatial. //The SkeletonControl must be the last in the stack so we add the list of all other control before it. //When backward compatibility won't be needed anymore this can be replaced by : //controls = ic.readSavableArrayList("controlsList", null)); controls.addAll(0, ic.readSavableArrayList("controlsList", null)); userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null); }
public void read(JmeImporter im) throws IOException { InputCapsule ic = im.getCapsule(this); name = ic.readString("name", null); worldBound = (BoundingVolume) ic.readSavable("world_bound", null); cullHint = ic.readEnum("cull_mode", CullHint.class, CullHint.Inherit); batchHint = ic.readEnum("batch_hint", BatchHint.class, BatchHint.Inherit); queueBucket = ic.readEnum("queue", RenderQueue.Bucket.class, RenderQueue.Bucket.Inherit); shadowMode = ic.readEnum("shadow_mode", ShadowMode.class, ShadowMode.Inherit); localTransform = (Transform) ic.readSavable("transform", Transform.IDENTITY); localLights = (LightList) ic.readSavable("lights", null); localLights.setOwner(this); ArrayList<MatParamOverride> localOverridesList = ic.readSavableArrayList("overrides", null); if (localOverridesList == null) { localOverrides = new SafeArrayList<>(MatParamOverride.class); } else { localOverrides = new SafeArrayList(MatParamOverride.class, localOverridesList); } worldOverrides = new SafeArrayList<>(MatParamOverride.class); //changed for backward compatibility with j3o files generated before the AnimControl/SkeletonControl split //the AnimControl creates the SkeletonControl for old files and add it to the spatial. //The SkeletonControl must be the last in the stack so we add the list of all other control before it. //When backward compatibility won't be needed anymore this can be replaced by : //controls = ic.readSavableArrayList("controlsList", null)); controls.addAll(0, ic.readSavableArrayList("controlsList", null)); userData = (HashMap<String, Savable>) ic.readStringSavableMap("user_data", null); }