EMMA Coverage Report (generated Fri Mar 15 09:08:15 CET 2013)
[all classes][jpacman.controller]

COVERAGE SUMMARY FOR SOURCE FILE [Animator.java]

nameclass, %method, %block, %line, %
Animator.java100% (2/2)100% (6/6)100% (38/38)100% (12/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class Animator100% (1/1)100% (4/4)100% (27/27)100% (9/9)
Animator (BoardViewer): void 100% (1/1)100% (16/16)100% (4/4)
access$000 (Animator): BoardViewer 100% (1/1)100% (3/3)100% (1/1)
start (): void 100% (1/1)100% (4/4)100% (2/2)
stop (): void 100% (1/1)100% (4/4)100% (2/2)
     
class Animator$1100% (1/1)100% (2/2)100% (11/11)100% (3/3)
Animator$1 (Animator): void 100% (1/1)100% (6/6)100% (1/1)
actionPerformed (ActionEvent): void 100% (1/1)100% (5/5)100% (2/2)

1package jpacman.controller;
2 
3import java.awt.event.ActionEvent;
4import java.awt.event.ActionListener;
5 
6import javax.swing.Timer;
7 
8/**
9 * The primary responsibility of this class is
10 * to trigger the board viewer to display the
11 * next animation.
12 *
13 * @author Arie van Deursen, 2007.
14 * @version $Id: Animator.java,v 1.5 2008/02/03 19:43:38 arie Exp $
15 *
16 */
17public class Animator {
18 
19    /**
20     * The viewer that must be informed to show the
21     * next animation.
22     */
23    private BoardViewer boardViewer;
24 
25    /**
26     * The timer used.
27     */
28    private Timer timer;
29 
30    /**
31     * The delay between two animations.
32     */
33    private static final int DELAY = 200;
34 
35    /**
36     * Create an animator for a particular board viewer.
37     * @param bv The view to be animated.
38     */
39    public Animator(BoardViewer bv) {
40        boardViewer = bv;
41        timer = new Timer(DELAY,
42                new ActionListener() {
43            public void actionPerformed(ActionEvent e) {
44                boardViewer.nextAnimation();
45            }
46        }
47        );
48    }
49 
50    /**
51     * Stop triggering animation events.
52     */
53    public void stop() {
54        timer.stop();
55    }
56 
57    /**
58     * Start triggering animation events.
59     */
60    public void start()  {
61        timer.start();
62    }
63}

[all classes][jpacman.controller]
EMMA 2.0.5312 (C) Vladimir Roubtsov