1 package org.opentrafficsim.road.network.animation;
2
3 import java.awt.Color;
4 import java.awt.Graphics2D;
5 import java.awt.image.ImageObserver;
6 import java.rmi.RemoteException;
7
8 import javax.naming.NamingException;
9
10 import nl.tudelft.simulation.dsol.animation.D2.Renderable2D;
11
12 import org.opentrafficsim.core.dsol.OTSSimulatorInterface;
13 import org.opentrafficsim.core.network.animation.PaintPolygons;
14 import org.opentrafficsim.road.network.lane.Shoulder;
15
16
17
18
19
20
21
22
23
24
25 public class ShoulderAnimation extends Renderable2D
26 {
27
28 private final Color color;
29
30
31
32
33
34
35
36
37 public ShoulderAnimation(final Shoulder source, final OTSSimulatorInterface simulator, final Color color)
38 throws NamingException, RemoteException
39 {
40 super(source, simulator);
41 this.color = color;
42 }
43
44
45 @Override
46 public final void paint(final Graphics2D graphics, final ImageObserver observer)
47 {
48 Shoulder shoulder = (Shoulder) getSource();
49 PaintPolygons.paintMultiPolygon(graphics, this.color, shoulder.getLocation(), shoulder.getContour(), true);
50 }
51 }