Question

In my project, when I do a grouping of vertices, by default is adding a dotted shape in my edge. I wish I could add a picture on this ledge where the User can interact.

For example:

not expanded:

enter image description here

expanded:

enter image description here

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top