}
});
popup.add(new AbstractAction(Lang.get("device.properties"), Icons.get("properties")) {
@Override
public void actionPerformed(ActionEvent e) {
new DeviceProperties(owner, vertex, false);
}
});
popup.add(new AbstractAction(Lang.get("action.delete"), Icons.get("remove")) {
public void actionPerformed(ActionEvent e) {
graph.removeVertex(vertex);
vv.repaint();
}
});
} else if (edge != null) {
pickedEdgeState.pick(edge, false);
popup.add(new AbstractAction(Lang.get("connection.properties"), Icons.get("properties")) {
@Override
public void actionPerformed(ActionEvent e) {
Pair<Device> p = Controller.getCurrentMap().getEndpoints(edge);
if (p.getFirst().equals(p.getSecond())) {
new InterfaceProperties(owner, p.getFirst().getInterfaceFor(edge));
} else {
new ConnectionProperties(owner, edge);
}
}
});
popup.add(new AbstractAction(Lang.get("action.delete"), Icons.get("remove")) {
public void actionPerformed(ActionEvent e) {
graph.removeEdge(edge);
vv.repaint();
}
});
} else {
popup.add(new AbstractAction(Lang.get("action.add"), Icons.get("add")) {
public void actionPerformed(ActionEvent e) {
Device newVertex = vertexFactory.create();
new DeviceProperties(owner, newVertex, true);
graph.addVertex(newVertex);
layout.setLocation(newVertex, vv.getRenderContext()
.getMultiLayerTransformer().inverseTransform(p));
vv.repaint();
}