1 package org.opentrafficsim.road.gtu.animation;
2
3 import org.djunits.unit.SpeedUnit;
4 import org.djunits.value.vdouble.scalar.Acceleration;
5 import org.djunits.value.vdouble.scalar.Speed;
6 import org.opentrafficsim.core.gtu.animation.AccelerationGTUColorer;
7 import org.opentrafficsim.core.gtu.animation.GTUColorer;
8 import org.opentrafficsim.core.gtu.animation.IDGTUColorer;
9 import org.opentrafficsim.core.gtu.animation.SpeedGTUColorer;
10 import org.opentrafficsim.core.gtu.animation.SwitchableGTUColorer;
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class DefaultSwitchableGTUColorer extends SwitchableGTUColorer
26 {
27
28 private static final long serialVersionUID = 20150000L;
29
30
31 private static final GTUColorer[] COLORERS;
32
33 static
34 {
35 COLORERS = new GTUColorer[3];
36 COLORERS[0] = new IDGTUColorer();
37 COLORERS[1] = new SpeedGTUColorer(new Speed(150, SpeedUnit.KM_PER_HOUR));
38 COLORERS[2] = new AccelerationGTUColorer(Acceleration.createSI(-6.0), Acceleration.createSI(2));
39 }
40
41
42
43
44 public DefaultSwitchableGTUColorer()
45 {
46 super(0, DefaultSwitchableGTUColorer.COLORERS);
47 }
48
49 }