src/main/java/com/mxgraph/swing/mxGraphComponent.java
public mxICellOverlay addCellOverlay(Object cell, mxICellOverlay overlay)
	{
		mxICellOverlay[] arr = getCellOverlays(cell);

		if (arr == null)
		{
			arr = new mxICellOverlay[] { overlay };
		}
		else
		{
			mxICellOverlay[] arr2 = new mxICellOverlay[arr.length + 1];
			System.arraycopy(arr, 0, arr2, 0, arr.length);
			arr2[arr.length] = overlay;
			arr = arr2;
		}

		overlays.put(cell, arr);
		mxCellState state = graph.getView().getState(cell);

		if (state != null)
		{
			updateCellOverlayComponent(state, overlay);
		}

		eventSource.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY, "cell",
				cell, "overlay", overlay));

		return overlay;
	}
/**
	 * Adds an overlay for the specified cell. This method fires an addoverlay
	 * event and returns the new overlay.
	 * 
	 * @param cell
	 *            Cell to add the overlay for.
	 * @param overlay
	 *            Overlay to be added for the cell.
	 */
Adds an overlay for the specified cell. This method fires an addoverlay
event and returns the new overlay.

@param cell
Cell to add the overlay for.
@param overlay
Overlay to be added for the cell.
Adds an overlay for the specified cell . This method fires an addoverlay event and returns the new overlay . @param cell Cell to add the overlay for . @param overlay Overlay to be added for the cell .
public mxICellOverlay addCellOverlay(Object cell, mxICellOverlay overlay)
	{
		mxICellOverlay[] arr = getCellOverlays(cell);
		if (arr == null)
		{
			arr = new mxICellOverlay[] { overlay };
		}
		else
		{
			mxICellOverlay[] arr2 = new mxICellOverlay[arr.length + 1];
			System.arraycopy(arr, 0, arr2, 0, arr.length);
			arr2[arr.length] = overlay;
			arr = arr2;
		}
		overlays.put(cell, arr);
		mxCellState state = graph.getView().getState(cell);
		if (state != null)
		{
			updateCellOverlayComponent(state, overlay);
		}
		eventSource.fireEvent(new mxEventObject(mxEvent.ADD_OVERLAY, "cell",
				cell, "overlay", overlay));
		return overlay;
	}
public mxICellOverlay addCellOverlay ( Object cell , mxICellOverlay overlay ) { mxICellOverlay [ ] arr = getCellOverlays ( cell ) ; if ( arr == null ) { arr = new mxICellOverlay [ ] { overlay } ; } else { mxICellOverlay [ ] arr2 = new mxICellOverlay [ arr . length + 1 ] ; System . arraycopy ( arr , 0 , arr2 , 0 , arr . length ) ; arr2 [ arr . length ] = overlay ; arr = arr2 ; } overlays . put ( cell , arr ) ; mxCellState state = graph . getView ( ) . getState ( cell ) ; if ( state != null ) { updateCellOverlayComponent ( state , overlay ) ; } eventSource . fireEvent ( new mxEventObject ( mxEvent . ADD_OVERLAY , "cell" , cell , "overlay" , overlay ) ) ; return overlay ; }
Adds an overlay for the specified cell.
Adds an overlay for the specified cell .