src/main/java/com/mxgraph/swing/mxGraphComponent.java
protected void updateCellOverlayComponent(mxCellState state,
			mxICellOverlay overlay)
	{
		if (overlay instanceof Component)
		{
			Component comp = (Component) overlay;

			if (comp.getParent() == null)
			{
				getGraphControl().add(comp, 0);
			}

			mxRectangle rect = overlay.getBounds(state);

			if (rect != null)
			{
				comp.setBounds(rect.getRectangle());
				comp.setVisible(true);
			}
			else
			{
				comp.setVisible(false);
			}
		}
	}
/**
	 * Notified when an overlay has been removed from the graph. This
	 * implementation removes the given overlay from its parent if it is a
	 * component inside a component hierarchy.
	 */
Notified when an overlay has been removed from the graph. This
implementation removes the given overlay from its parent if it is a
component inside a component hierarchy.
Notified when an overlay has been removed from the graph . This implementation removes the given overlay from its parent if it is a component inside a component hierarchy .
protected void updateCellOverlayComponent(mxCellState state,
			mxICellOverlay overlay)
	{
		if (overlay instanceof Component)
		{
			Component comp = (Component) overlay;
			if (comp.getParent() == null)
			{
				getGraphControl().add(comp, 0);
			}
			mxRectangle rect = overlay.getBounds(state);
			if (rect != null)
			{
				comp.setBounds(rect.getRectangle());
				comp.setVisible(true);
			}
			else
			{
				comp.setVisible(false);
			}
		}
	}
protected void updateCellOverlayComponent ( mxCellState state , mxICellOverlay overlay ) { if ( overlay instanceof Component ) { Component comp = ( Component ) overlay ; if ( comp . getParent ( ) == null ) { getGraphControl ( ) . add ( comp , 0 ) ; } mxRectangle rect = overlay . getBounds ( state ) ; if ( rect != null ) { comp . setBounds ( rect . getRectangle ( ) ) ; comp . setVisible ( true ) ; } else { comp . setVisible ( false ) ; } } }
Notified when an overlay has been removed from the graph.
Notified when an overlay has been removed from the graph .