if (warning != null && warning.length() > 0)
{
icon = (icon != null) ? icon : warningIcon;
// Creates the overlay with the image and warning
mxCellOverlay overlay = new mxCellOverlay(icon, warning);
// Adds a handler for single mouseclicks to select the cell
if (select)
{
overlay.addMouseListener(new MouseAdapter()
{
/**
* Selects the associated cell in the graph
*/
public void mousePressed(MouseEvent e)
{
if (getGraph().isEnabled())
{
getGraph().setSelectionCell(cell);
}
}
});
overlay.setCursor(new Cursor(Cursor.HAND_CURSOR));
}
// Sets and returns the overlay in the graph
return addCellOverlay(cell, overlay);
}