}
}
private void maybeShowPopup(MouseEvent event) {
if (event.isPopupTrigger()) {
GraphPiece piece = this.graph.getGUI().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());