}
}
private void maybeShowPopup(MouseEvent event) {
if (event.isPopupTrigger()) {
GraphPiece piece = NodeController.getGUI(this.graph).getGraphPieceAt(event.getPoint());
if (piece instanceof Node) {
prepareNodePopupMenu((Node) piece);
this.nodePopup.show(event.getComponent(), event.getX(), event.getY());
} else if (piece instanceof Edge) {
this.edgePopup.show(event.getComponent(), event.getX(), event.getY());