@Override
public void valueChanged(GraphSelectionEvent e) {
super.valueChanged(e);
// Bomb out with a ClassCastException in case the event's source is
// something unexpected. Not robust, but a good debugging feature :)
GraphSelectionModel sm = (GraphSelectionModel) e.getSource();
// New --- Bertoli Marco ---
// Checks selection cells to enables correct toolbar elements
boolean foundStations = false;
boolean cannotAddBlockingRegion = false;
boolean foundConnection = false;
Object[] cells = sm.getSelectionCells();
for (Object cell : cells) {
if (cell instanceof JmtCell) {
foundStations = true;
// If selected station is member of a BlockingRegion, signals it
if (((JmtCell) cell).getParent() instanceof BlockingRegion) {