// for (Link link : ((NetworkRoute) leg.getRoute()).getLinks()) {
/* I regularly got an exception with the above line:
* Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: org.matsim.core.population.routes.GenericRouteImpl
* at org.matsim.vis.otfvis.opengl.queries.QuerySpinne.collectLinksFromTrip(QuerySpinne.java:XXX)
* ...
* I assume that it comes from the fact that some routes are not network routes (but, say, pt routes).
* So I included an "instanceof NetworkRoute" before the cast at two places (maybe there are more).
(2) replaced "i%2" by "instanceof Leg/Act" at one place (probably there are more).
(3) replaced "trip only" by "leg only" since that was what it was really doing.