2014-02-19 12 views

답변

0

해결책 :

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.