Solution:
mxIGraphModel model = graph.getModel();
// start to change model
model.beginUpdate();
mxGeometry geo = new mxGeometry(0, 0.5, PORT_DIAMETER,
PORT_DIAMETER);
// Because the origin is at upper left corner, need to translate to
// position the center of port correctly
geo.setOffset(new mxPoint(-PORT_RADIUS, -PORT_RADIUS));
geo.setRelative(true);
mxCell port = new mxCell(cell.getAttribute("label"), geo,
style);
port.setVertex(true);
//is not a port!!!!!!!!
port.setConnectable(false);
graph.addCell(port, cell);
//send to back!
graph.cellsOrdered(new Object[]{cell}, true);
// end changes, generate the events and update UndoManager
model.endUpdate();
Att,
Alexandre.