Attaches the decoration to the specified component.

@param componentToBeDecorated Component to be decorated.
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();
        }
    }
401795
@Override
	public void add(final WComponent component) {
		getCardContainer().add(component);
		CardManagerModel model = getComponentModel();

		if (model.visibleComponent == null) {
			model.visibleComponent = component;
		}
	}
686420
protected void initContent() {

        if (m_decoratedPanel != null) {
            m_decoratedPanel.removeFromParent();
        }
        m_decoratedPanel = new CmsSimpleDecoratedPanel(m_decorationWidth, m_mainWidget, m_decorationWidgets);
        m_panel.insert(m_decoratedPanel, 0);
        setSmallView(m_smallView);
    }
511416
public void displaySelection(final WComponent selectedComponent) {
		WComponent currentComponent = getCurrentComponent();

		if (selectedComponent == currentComponent) {
			// We are already displaying this component, so nothing to do.
			return;
		}

		// We have a new selection so display it.
		container.removeAll();
		container.add(selectedComponent);
	}
205005
public void setRootComponent(final MvcComponent component) {
        if (uiThreadRunner.isOnUiThread()) {
            try {
                graph.setRootComponent(component);
            } catch (Graph.IllegalRootComponentException e) {
                throw new MvcGraphException(e.getMessage(), e);
            }
        } else {
            uiThreadRunner.post(new Runnable() {
                @Override
                public void run() {
                    try {
                        graph.setRootComponent(component);
                    } catch (Graph.IllegalRootComponentException e) {
                        throw new MvcGraphException(e.getMessage(), e);
                    }
                }
            });
        }
    }
1280798
protected <T extends IComponent> void addComponent(Class<T> componentType, T component) {
        components.put(componentType, component);
    }
1122857
private Integer getDecoratedComponentLayerInLayeredPane(JLayeredPane layeredPane) {
        Container ancestorInLayer = decoratedComponent;
        while (!layeredPane.equals(ancestorInLayer.getParent())) {
            ancestorInLayer = ancestorInLayer.getParent();
        }

        return (layeredPane.getLayer(ancestorInLayer) + DECORATION_LAYER_OFFSET);
    }
1306404
protected void buildComponent() {
        addComponent(titleLayout);
        setComponentAlignment(titleLayout, Alignment.TOP_LEFT);
        setWidth(100, Unit.PERCENTAGE);
        setImmediate(true);
        addStyleName("action-history-header");
        addStyleName("bordered-layout");
        addStyleName("no-border-bottom");
    }
716776
private static void injectComponent(final Component<?> component, final boolean inner) {

        // Retrieve all fields annotated with Link
        for (final Field field : ClassUtility.getAnnotatedFields(component.getClass(), Link.class)) {
            final String keyPart = field.getAnnotation(Link.class).value();
            if (inner) {
                if (InnerComponent.class.isAssignableFrom(field.getType())) {
                    if (keyPart.isEmpty()) {
                        injectInnerComponent(component, field);
                    } else {
                        injectInnerComponent(component, field, keyPart);
                    }
                }
            } else {
                if (Component.class.isAssignableFrom(field.getType())) {
                    if (keyPart.isEmpty()) {
                        injectComponent(component, field);
                    } else {
                        injectComponent(component, field, keyPart);
                    }
                }
            }
        }

    }
29739
public static void addComponentToFrame(final JInternalFrame internalFrame,
		final Component component)
	{
		internalFrame.add(component, BorderLayout.CENTER);
		internalFrame.pack();
	}
329743
public final void addComponent(ComponentUpdater component)
    {
        updaters.add(component);
        services.add(component);
        if (component instanceof HandlerListener)
        {
            addListener((HandlerListener) component);
        }
    }
464644
public synchronized void addComponent(ComponentEvent event)
    {
        try
        {
            if(log.isDebugEnabled())log.debug("Component added "+event);
            Object o=event.getComponent();
            
            ModelMBean mbean=ModelMBeanImpl.mbeanFor(o);
            if (mbean==null)
                log.warn("No MBean for "+o);
            else
            {
                ObjectName oName=null;
                if (mbean instanceof ModelMBeanImpl)
                {
                    ((ModelMBeanImpl)mbean).setBaseObjectName(getObjectName().toString());
                    oName=
                        getMBeanServer().registerMBean(mbean,null).getObjectName();
                }
                else
                {
                    oName=uniqueObjectName(getMBeanServer(),
                                           o,
                                           getObjectName().toString());
                    oName=getMBeanServer().registerMBean(mbean,oName)
                        .getObjectName();
                }
                Holder holder = new Holder(oName,mbean);
                _mbeanMap.put(o,holder);
            }
        }
        catch(Exception e)
        {
            log.warn(LogSupport.EXCEPTION,e);
        }
    }
1204190
public void addTaggedComponent(final String tag, final WComponent component) {
		if (Util.empty(tag)) {
			throw new IllegalArgumentException("A tag must be provided.");
		}
		if (component == null) {
			throw new IllegalArgumentException("A component must be provided.");
		}

		TemplateModel model = getOrCreateComponentModel();
		if (model.taggedComponents == null) {
			model.taggedComponents = new HashMap<>();
		} else {
			if (model.taggedComponents.containsKey(tag)) {
				throw new IllegalArgumentException("The tag [" + tag + "] has already been added.");
			}
			if (model.taggedComponents.containsValue(component)) {
				throw new IllegalArgumentException("Component has already been added.");
			}
		}
		model.taggedComponents.put(tag, component);
		add(component);
	}
1095123
public void onAttach(GVRSceneObject sceneObj)
    {
        super.onAttach(sceneObj);
        GVRComponent comp = getComponent(GVRRenderData.getComponentType());

        if (comp == null)
        {
            throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh");
        }

        GVRMesh mesh = ((GVRRenderData) comp).getMesh();
        if (mesh == null)
        {
            throw new IllegalStateException("Cannot attach a morph to a scene object without a base mesh");
        }
        GVRShaderData mtl = getMaterial();

        if ((mtl == null) ||
            !mtl.getTextureDescriptor().contains("blendshapeTexture"))
        {
            throw new IllegalStateException("Scene object shader does not support morphing");
        }
        copyBaseShape(mesh.getVertexBuffer());
        mtl.setInt("u_numblendshapes", mNumBlendShapes);
        mtl.setFloatArray("u_blendweights", mWeights);
    }
603477
void add(final WComponent component) {
		assertAddSupported(component);
		assertNotReparenting(component);

		if (!(this instanceof Container)) {
			throw new UnsupportedOperationException("Components can only be added to a container");
		}

		ComponentModel model = getOrCreateComponentModel();

		if (model.getChildren() == null) {
			model.setChildren(new ArrayList<WComponent>(1));
		}

		model.getChildren().add(component);

		if (isLocked()) {
			component.setLocked(true);
		}

		if (component instanceof AbstractWComponent) {
			((AbstractWComponent) component).getOrCreateComponentModel().setParent((Container) this);
			((AbstractWComponent) component).addNotify();
		}
	}
538180
public void addRow(Component component) {

        Component actualComponent = component == null ? m_newComponentFactory.get() : component;
        I_CmsEditableGroupRow row = m_rowBuilder.buildRow(this, actualComponent);
        m_container.addComponent(row);
        updatePlaceholder();
        updateButtonBars();
        updateGroupValidation();
    }
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();
    }