Apply the specified ComponentOp to the supplied component and then all its descendants, up
to the specified maximum depth.
552478
public static void applyToHierarchy (Component comp, int depth, ComponentOp op)
    {
        if (comp == null) {
            return;
        }

        op.apply(comp);
        if (comp instanceof Container && --depth >= 0) {
            Container c = (Container) comp;
            int ccount = c.getComponentCount();
            for (int ii = 0; ii < ccount; ii++) {
                applyToHierarchy(c.getComponent(ii), depth, op);
            }
        }
    }
487869
function(component){
		var edges = 0;
		for(var i=0;i<component.nodes.length;i++){
			var node = component.nodes[i];
			edges += node.nodes.length;
			
			this.setComponentRefs(node.obj, component);
		}
		component.circuits = (edges>>1) - component.nodes.length + 1;
		
		this.setExtraData(component);
	}
14786
public void addToGroup(final T component) {
		ComponentGroupModel model = getOrCreateComponentModel();
		model.components.add(component);
		MemoryUtil.checkSize(model.components.size(), this.getClass().getSimpleName());
	}
155571
public void applyToAncestors( Operation operation ) {
        PlanNode ancestor = getParent();
        while (ancestor != null) {
            operation.apply(ancestor);
            ancestor = ancestor.getParent();
        }
    }
624021
public void setMaxDepth(int maxDepth) {
		this.maxDepth = maxDepth > UNLIMITED_DEPTH ? maxDepth : UNLIMITED_DEPTH;
		getConfig().setProperty(SPIDER_MAX_DEPTH, Integer.toString(this.maxDepth));

	}
602060
protected void apply(CompiledPlan plan, AbstractParsedStmt parsedStmt)
    {
        try {
            AbstractPlanNode planGraph = plan.rootPlanGraph;
            planGraph = recursivelyApply(planGraph, parsedStmt);
            plan.rootPlanGraph = planGraph;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
539500
void removeAllButDeepestAndAddCacheLeafNodes(int depth) {
        Queue<SchemaTableTree> queue = new LinkedList<>();
        queue.add(this);
        while (!queue.isEmpty()) {
            SchemaTableTree current = queue.remove();
            if (current.stepDepth < depth && current.children.isEmpty() && !current.isEmit() && !current.isOptionalLeftJoin()) {
                removeNode(current);
            } else {
                queue.addAll(current.children);
                if ((current.stepDepth == depth && current.children.isEmpty()) || (current.isEmit() && current.children.isEmpty()) || current.isOptionalLeftJoin() && current.children.isEmpty()) {
                    this.leafNodes.add(current);
                }
            }
        }
    }
278963
protected void componentWasResized(int newTop, int newLeft, int newWidth, int newHeight)
    {
		rampDownValue = (float)getDesiredFPS()/2000F;
		maxPeakLevelRampDownDelay = rampDownValue/50F;
		
		if (newTop<0 || newLeft<0 || newWidth<0 || newHeight<0) return;

		myBottom = newTop + newHeight;
		myHalfHeight = (float)newHeight/2f;
		barWidth = newWidth/bands;

		color = new Color[newHeight+1];
		for (int i=0; i<=newHeight; i++)
		{
			int color1 = i*255/newHeight;
			int color2 = 255-color1;
			color[i] = new Color(color1, color2, 0);
		}
		SKMax = 1024;
		SKcolor = new Color[SKMax];
		for (int i=0; i<256; i++)
		{
			SKcolor[i] = new Color(0, 0, i);
		}
		for (int i=256; i<512; i++)
		{
			SKcolor[i] = new Color(0, i-256, 511-i);
		}
		for (int i=512; i<768; i++)
		{
			SKcolor[i] = new Color(i-512, 767-i, 0);
		}
		for (int i=768; i<1024; i++)
		{
			SKcolor[i] = new Color(255, i-768, 0);
		}
    }
1037578
@Override
    public Dimension maximumLayoutSize(Container parent) {
        return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
    }
1075351
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
            ELException
    {
        UIViewRoot root = ComponentSupport.getViewRoot(ctx, parent);
        if (root != null)
        {
            if (this.locale != null)
            {
                root.setLocale(ComponentSupport.getLocale(ctx, this.locale));
            }
            if (this.renderKitId != null)
            {
                String v = this.renderKitId.getValue(ctx);
                root.setRenderKitId(v);
            }
            String encodingValue = null;
            if (this.contentType != null)
            {
                // This value is read as rfc2616 section 3.7 Media Types.
                // We should check and extract the param "charset" and assing
                // it as encoding for this page.
                String v = this.contentType.getValue(ctx);
                if (v != null)
                {
                    int j = v.indexOf(';');
                    if (j >= 0)
                    {
                        int i = v.indexOf("charset",j);
                        if (i >= 0)
                        {
                            i = v.indexOf('=',i)+1;
                            if (v.length() > i)
                            {
                                encodingValue = v.substring(i);
                            }
                            // Substract charset from encoding, it will be added 
                            // later on FaceletViewDeclarationLanguage.createResponseWriter
                            // by calling response.setContentType
                            v = v.substring(0 , j);
                        }
                    }
                }
                ctx.getFacesContext().getAttributes().put("facelets.ContentType", v);
            }
            if (this.encoding != null)
            {
                String v = this.encoding.getValue(ctx);
                ctx.getFacesContext().getAttributes().put("facelets.Encoding", v);
            }
            else if (encodingValue != null)
            {
                ctx.getFacesContext().getAttributes().put("facelets.Encoding", encodingValue);
            }
            if (this.beforePhase != null)
            {
                MethodExpression m = this.beforePhase.getMethodExpression(ctx, null, LISTENER_SIG);
                root.setBeforePhaseListener(m);
            }
            if (this.afterPhase != null)
            {
                MethodExpression m = this.afterPhase.getMethodExpression(ctx, null, LISTENER_SIG);
                root.setAfterPhaseListener(m);
            }
            if (this.transientAttribute != null)
            {
                root.setTransient(this.transientAttribute.getBoolean(ctx));
            }
            if (this.contracts != null)
            {
                String contractsValue = this.contracts.getValue(ctx);
                if (contractsValue != null)
                {
                    String[] values = StringUtils.trim(
                        StringUtils.splitShortString(contractsValue, ','));
                    if (values != null)
                    {
                        List<String> list = new ArrayList<String>();
                        for (String v : values)
                        {
                            list.add(v);
                        }
                        ctx.getFacesContext().setResourceLibraryContracts(list);
                    }
                }
            }
            if (this.oamEnableViewPool != null)
            {
                root.getAttributes().put("oamEnableViewPool", this.oamEnableViewPool.getBoolean(ctx));
            }
        }
        this.nextHandler.apply(ctx, parent);
    }
343033
private static void expandAllRecursively(JTree tree, TreePath treePath)
    {
        TreeModel model = tree.getModel();
        Object lastPathComponent = treePath.getLastPathComponent();
        int childCount = model.getChildCount(lastPathComponent);
        if (childCount == 0)
        {
            return;
        }
        tree.expandPath(treePath);
        for (int i=0; i<childCount; i++)
        {
            Object child = model.getChild(lastPathComponent, i);
            int grandChildCount = model.getChildCount(child);
            if (grandChildCount > 0)
            {
                class LocalTreePath extends TreePath
                {
                    private static final long serialVersionUID = 0;
                    public LocalTreePath(
                        TreePath parent, Object lastPathComponent)
                    {
                        super(parent, lastPathComponent);
                    }
                }
                TreePath nextTreePath = new LocalTreePath(treePath, child);
                expandAllRecursively(tree, nextTreePath);
            }
        }
    }
1191441
function onAddChild(e) {
        var self = this;
        if (e.target === self) {
            updateSubTreeStatus(self, e.component, self.get('depth'), e.index);
        }
    }
15165
public void setBelow(Component belowContent) {

        int i = m_mainPanel.getComponentIndex(m_mainPanel);
        Component oldBelow = m_mainPanel.getComponent(i + 1);
        if (oldBelow == null) {
            m_mainPanel.addComponent(belowContent);
        } else {
            m_mainPanel.replaceComponent(oldBelow, belowContent);
        }
    }
235250
@Override
    public void componentResized(final ComponentEvent EVENT) {
        final Container PARENT = getParent();
        if ((PARENT != null) && (PARENT.getLayout() == null)) {
            setSize(getWidth(), getHeight());
        } else {
            //setSize(new Dimension(getWidth(), getHeight()));
            setPreferredSize(new Dimension(getWidth(), getHeight()));
        }

        calcInnerBounds();

        if (getWidth() >= getHeight()) {
            // Horizontal
            setOrientation(Orientation.HORIZONTAL);
            recreateLedImages(getInnerBounds().height);
            recreateUserLedImages(getInnerBounds().height);

            if (isLedOn()) {
                setCurrentLedImage(getLedImageOn());
            } else {
                setCurrentLedImage(getLedImageOff());
            }
            setLedPosition((getInnerBounds().width - 20.0 - 16.0) / getInnerBounds().width, 0.453271028);

            if (isUserLedOn()) {
                setCurrentUserLedImage(getUserLedImageOn());
            } else {
                setCurrentUserLedImage(getUserLedImageOff());
            }
            setUserLedPosition(18.0 / getInnerBounds().width, 0.453271028);
        } else {
            // Vertical
            setOrientation(Orientation.VERTICAL);
            recreateLedImages(getInnerBounds().width);
            recreateUserLedImages(getInnerBounds().width);

            if (isLedOn()) {
                setCurrentLedImage(getLedImageOn());
            } else {
                setCurrentLedImage(getLedImageOff());
            }
            setLedPosition(0.453271028, (20.0 / getInnerBounds().height));

            if (isUserLedOn()) {
                setCurrentUserLedImage(getUserLedImageOn());
            } else {
                setCurrentUserLedImage(getUserLedImageOff());
            }
            setUserLedPosition((getInnerBounds().width - 18.0 - 16.0) / getInnerBounds().width, 0.453271028);
        }
        getModel().setSize(getLocation().x, getLocation().y, getWidth(), getHeight());
        init(getInnerBounds().width, getInnerBounds().height);
        revalidate();
        //repaint();
    }
396959
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException,
            ELException
    {
        if (_template != null)
        {
            //VariableMapper orig = ctx.getVariableMapper();
            //if (_params != null)
            //{
            //    VariableMapper vm = new VariableMapperWrapper(orig);
            //    ctx.setVariableMapper(vm);
            //    for (int i = 0; i < _params.length; i++)
            //    {
            //        _params[i].apply(ctx, parent);
            //    }
            //}
            AbstractFaceletContext actx = (AbstractFaceletContext) ctx;
            FaceletCompositionContext fcc = FaceletCompositionContext.getCurrentInstance(ctx);
            actx.extendClient(this);
            if (_params != null)
            {
                String uniqueId = fcc.generateUniqueComponentId();
                //VariableMapper vm = new VariableMapperWrapper(orig);
                //ctx.setVariableMapper(vm);
                for (int i = 0; i < _params.length; i++)
                {
                    _params[i].apply(ctx, parent, _params[i].getName(ctx), _params[i].getValue(ctx), uniqueId);
                }
            }

            try
            {
                ctx.includeFacelet(parent, _template.getValue(ctx));
            }
            finally
            {
                actx.popExtendedClient(this);
                //ctx.setVariableMapper(orig);
            }
        }
        else
        {
            this.nextHandler.apply(ctx, parent);
        }
    }
498388
private void scanAllNodes(Parent parent, PseudoClass pseudoClass) {
        parent.getChildrenUnmodifiable().addListener(new ListChangeListener<Node>() {
            @Override
            public void onChanged(javafx.collections.ListChangeListener.Change<? extends Node> c) {
                while (c.next()) {
                    if (!c.wasPermutated() && !c.wasUpdated()) {
                        for (Node addedNode : c.getAddedSubList()) {
                            if (addedNode instanceof Parent) {
                                scanAllNodes((Parent) addedNode, pseudoClass);
                            }
                        }
                    }
                }
            }
        });
        for (Node component : parent.getChildrenUnmodifiable()) {
            if (component instanceof Pane) {
                ((Pane) component).getChildren().addListener(new ListChangeListener<Node>() {
                    @Override
                    public void onChanged(javafx.collections.ListChangeListener.Change<? extends Node> c) {
                        while (c.next()) {
                            if (!c.wasPermutated() && !c.wasUpdated()) {
                                for (Node addedNode : c.getAddedSubList()) {
                                    if (addedNode instanceof Parent) {
                                        scanAllNodes((Parent) addedNode, pseudoClass);
                                    }
                                }
                            }
                        }
                    }
                });
                //if the component is a container, scan its children
                scanAllNodes((Pane) component, pseudoClass);
            } else if (component instanceof ScrollPane) {
                ((ScrollPane) component).contentProperty().addListener((o, oldVal, newVal) -> {
                    scanAllNodes((Parent) newVal, pseudoClass);
                });
                //if the component is a container, scan its children
                if (((ScrollPane) component).getContent() instanceof Parent) {

                    scanAllNodes((Parent) ((ScrollPane) component).getContent(), pseudoClass);
                }
            } else if (component instanceof Control) {
                //if the component is an instance of IInputControl, add to list
                component.pseudoClassStateChanged(PSEUDO_CLASS_EX_SMALL,
                    pseudoClass == PSEUDO_CLASS_EX_SMALL);
                component.pseudoClassStateChanged(PSEUDO_CLASS_SMALL, pseudoClass == PSEUDO_CLASS_SMALL);
                component.pseudoClassStateChanged(PSEUDO_CLASS_MEDIUM, pseudoClass == PSEUDO_CLASS_MEDIUM);
                component.pseudoClassStateChanged(PSEUDO_CLASS_LARGE, pseudoClass == PSEUDO_CLASS_LARGE);
            }
        }
    }
340614
private void attach(JComponent componentToBeDecorated) {
        detach();

        decoratedComponent = componentToBeDecorated;

        if (decoratedComponent != null) {
            decoratedComponent.addComponentListener(decoratedComponentTracker);
            decoratedComponent.addAncestorListener(decoratedComponentTracker);
            decoratedComponent.addHierarchyBoundsListener(decoratedComponentTracker);
            decoratedComponent.addHierarchyListener(decoratedComponentTracker);
            decoratedComponent.addPropertyChangeListener("enabled", decoratedComponentTracker);
            decoratedComponent.addPropertyChangeListener("ancestor", decoratedComponentTracker);

            attachToLayeredPane();
        }
    }