});
popup.add(new AbstractAction("Show data") {
public void actionPerformed(ActionEvent e) {
System.out.println(v.toString()+" has been selected with right click");
// convert vertex into XGrapher node
Node n = mapper.toXGrapher(v);
// fire event
app.commBus().fireEvent(XGrapherEventType.NODE_SELECTION,
null, n);
}
});
popup.show(vv, e.getX(), e.getY());
} else {
final edu.uci.ics.jung.graph.Edge edge = ps.getEdge(e
.getX(), e.getY());
if (edge != null) {
JPopupMenu popup = new JPopupMenu();
popup.add(new AbstractAction(edge.getUserDatum(GraphAttributeType.NAME).toString()) {
public void actionPerformed(ActionEvent e) {
System.out.println("Shown popup of"
+ edge.toString());
}
});
popup.show(vv, e.getX(), e.getY());
}
}
} else {
// runs events to manage edge/vertex selection
Vertex v = ps.getVertex(e.getX(), e.getY());
if (v != null) {
// a vertex has been selected
System.out.println(v.toString());
// convert vertex into XGrapher node
Node n = mapper.toXGrapher(v);
// fire event
app.commBus().fireEvent(XGrapherEventType.NODE_SELECTION,
null, n);
} else {
edu.uci.ics.jung.graph.Edge jedge = ps.getEdge(e.getX(), e