/*
public void switchLights(String roomName, boolean on) { for(Light l:
getLights(roomName)) { if(on) { rootNode.getLocalLightList(). } } }
967210
public void showNavMesh(boolean enabled) {
        if (enabled) {
            if (geoNavMesh == null) {
                Geometry debugNavMesh = (Geometry) logicalEntities
                        .getChild("NavMesh");
                this.geoNavMesh = SpatialFactory.createShape("NavMesh",
                        debugNavMesh.getMesh(), ColorRGBA.Green);
                this.geoNavMesh.setLocalTranslation(this.geoNavMesh
                        .getLocalTranslation());
            }
            house.attachChild(geoNavMesh);
        } else if (geoNavMesh != null) {
            geoNavMesh.removeFromParent();
        }
    }
1363758
@Override
    public void switchPlayerToSpectator(ApiBaseUser user) {
        try {
            room.switchPlayerToSpectator(CommandUtil.getSfsUser(user, api));
        } catch (SFSRoomException e) {
            throw new IllegalStateException(e);
        }
    }
1361256
public void setRoomConfigs(String roomName, HashMap<String, String> customConfigs)
            throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
        MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ(room, roomName, customConfigs);
        connection.createStanzaCollectorAndSend(mucLightSetConfigIQ).nextResultOrThrow();
    }
23628
@Override
    protected boolean onStateChange(int[] state) {
        final int color = state == null ? mColorStateList.getDefaultColor() : mColorStateList.getColorForState(state, mColor);
        boolean bFlag = mColor != color;
        if (bFlag) {
            mColor = color;
        }
        return bFlag;
    }
1073795
function(x, y) {
            // remove light from current position
            if(this.game.lighting.get(this.x, this.y)){
                this.game.lighting.remove(this.x, this.y);
            }
            // add to new position
            this.game.lighting.set(x, y, this.light_r, this.light_g, this.light_b);

            RL.Entity.prototype.moveTo.call(this, x, y);
        }
893354
void switchTwoRowHeaders(int rowIndex, int rowToIndex) {
        Object cellData = getRowHeaders()[rowToIndex];
        getRowHeaders()[rowToIndex] = getRowHeaders()[rowIndex];
        getRowHeaders()[rowIndex] = cellData;
    }
550976
protected void switchFactories(Gson newGson) {
        final Field factoriesField = DfReflectionUtil.getWholeField(newGson.getClass(), "factories");
        @SuppressWarnings("unchecked")
        final List<Object> factories = (List<Object>) DfReflectionUtil.getValueForcedly(factoriesField, newGson);
        final List<Object> filtered = new ArrayList<Object>();
        for (Object factory : factories) {
            if (factory instanceof ReflectiveTypeAdapterFactory) { // switched, only one time
                filtered.add(createReflectiveTypeAdapterFactory(newGson, factory));
            } else {
                filtered.add(factory);
            }
        }
        DfReflectionUtil.setValueForcedly(factoriesField, newGson, Collections.unmodifiableList(filtered));
    }
1019794
@SuppressWarnings("unused")
    public void setHighlightedDays(Calendar[] highlightedDays) {
        for (Calendar highlightedDay : highlightedDays) {
            this.highlightedDays.add(Utils.trimToMidnight((Calendar) highlightedDay.clone()));
        }
        if (mDayPickerView != null) mDayPickerView.onChange();
    }
727730
@Override
    public void onXml(ClientProperties cp)
    {
        hsmd.onInitialize();
        if (cp != null)
        {
            hsmd.setClientProperties(cp);
        }
    }
189442
@Override
    protected boolean onStateChange(int[] state) {
        final int color = mColorStateList.getColorForState(state, mColor);
        return changeColor(color);
    }
248781
function highlight(node, clear) {
        if (!_remoteHighlight) {
            _remoteHighlight = new Highlight("#cfc");
        }
        if (clear) {
            _remoteHighlight.clear();
        }
        _remoteHighlight.add(node, true);
    }
1318427
@Override
    public void onViewChild(ModelNode address, String childName) {
        TreeItem rootNode = findTreeItem(tree, address);
        TreeItem childNode = null;
        for(int i=0; i<rootNode.getChildCount(); i++)
        {
            TreeItem candidate = rootNode.getChild(i);
            if(childName.equals(candidate.getText()))
            {
                childNode = candidate;
                break;
            }
        }

        if(null==childNode)
            throw new IllegalArgumentException("No such child "+ childName + " on "+ address.toString());


        // deselect previous
        tree.setSelectedItem(null, false);

        // select next
        tree.setSelectedItem(childNode, false);
        tree.ensureSelectedItemVisible();

        onItemSelected(childNode);
    }
214305
@Override
    public void activateChildren(boolean activate) {
        if (activePane == null || !activePane.isVisible()) {
            ElementBase active = getFirstVisibleChild();
            setActivePane((ElementTreePane) active);
        }
        
        if (activePane != null) {
            activePane.activate(activate);
        }
    }
1351805
@Override
    public void setName(String name) {
        room.setName(name);
        apiRoom.setName(name);
    }
1015461
public void setAmbientLight(int i, Color color, boolean enableColor) {
	    float ambient[] = {
            (float)color.getRed(),
            (float)color.getGreen(),
            (float)color.getBlue(),
            (float)color.getAlpha()
        };
		gl.glEnable(GL2.GL_LIGHTING);
		gl.glEnable(GL2.GL_LIGHT0 + i);
		if(enableColor)
		    gl.glLightfv(GL2.GL_LIGHT0 + i, GL2.GL_AMBIENT, ambient, 0);
	}
1245999
void switchTwoColumns(int columnIndex, int columnToIndex) {
        checkForInit();
        int cellData = mColumnWidths[columnToIndex];
        mColumnWidths[columnToIndex] = mColumnWidths[columnIndex];
        mColumnWidths[columnIndex] = cellData;
    }
199948
@Override
  protected void visitSwitchNode(SwitchNode node) {

    Expression switchOn = coerceTypeForSwitchComparison(node.getExpr());
    SwitchBuilder switchBuilder = switchValue(switchOn);
    for (SoyNode child : node.getChildren()) {
      if (child instanceof SwitchCaseNode) {
        SwitchCaseNode scn = (SwitchCaseNode) child;
        ImmutableList.Builder<Expression> caseChunks = ImmutableList.builder();
        for (ExprNode caseExpr : scn.getExprList()) {
          Expression caseChunk = translateExpr(caseExpr);
          caseChunks.add(caseChunk);
        }
        Statement body = visitChildrenReturningCodeChunk(scn);
        switchBuilder.addCase(caseChunks.build(), body);
      } else if (child instanceof SwitchDefaultNode) {
        Statement body = visitChildrenReturningCodeChunk((SwitchDefaultNode) child);
        switchBuilder.setDefault(body);
      } else {
        throw new AssertionError();
      }
    }
    jsCodeBuilder.append(switchBuilder.build());
  }