It occured to be ProM-specific.
The section 3.5.2 of the pdf mentioned in the question contains the answer about how to add a label to a plain JGraph, and I had to use a bit different code to get any effect:
newArc = addArc(places.get(src), transitions.get(dest));
if (label != null) {
AttributeMap amap = newArc.getAttributeMap();
amap.put(AttributeMap.LABEL, "Hello world");
amap.put(AttributeMap.SHOWLABEL, true);
amap.put(AttributeMap.LABELALONGEDGE, true);
}
This code resides in a class derived from AbstractResetInhibitorNet
, the instance of which is called graph
. This instance is later converted to a JGraph with a code
ProMJGraphPanel visualizeGraph(PluginContext context,
CPNGraph graph, // instanceof AbstractResetInhibitorNet
ViewSpecificAttributeMap map) {
ProMGraphModel model = new ProMGraphModel(graph);
GraphLayoutConnection layoutConnection = new GraphLayoutConnection(graph);
layoutConnection.expandAll();
ProMJGraph jgraph = new ProMJGraph(model, map, layoutConnection);
...
}