Coverage report

| %line | %branch
--- | --- | ---
tsukuba_bunko.peko.scenario.util.WaitHandler |
0% |
0% |

1 |  |
     /*
2 |  |
      * "Peko" Visual Novel System
3 |  |
      *
4 |  |
      * All Rights Reserved.
5 |  |
      * Copyright (c) 1999-2003 Tsukuba Bunko.
6 |  |
      *
7 |  |
      * $Id: WaitHandler.java,v 1.2 2005/07/11 14:23:15 ppoi Exp $
8 |  |
      */
9 |  |
     package tsukuba_bunko.peko.scenario.util;
10 |  |
11 |  |
     import	org.xml.sax.Attributes;
12 |  |
13 |  |
     import	tsukuba_bunko.peko.ActionControler;
14 |  |
     import	tsukuba_bunko.peko.Logger;
15 |  |
     import	tsukuba_bunko.peko.PekoSystem;
16 |  |
17 |  |
     import	tsukuba_bunko.peko.scenario.ElementHandler;
18 |  |
     import	tsukuba_bunko.peko.scenario.PSMLUtil;
19 |  |
20 |  |
21 |  |
     /**
22 |  |
      * <samp>wait</samp> 要素を処理する ElementHandler です。
23 |  |
      * @author	$Author: ppoi $
24 |  |
      * @version	$Revision: 1.2 $
25 |  |
      */
26 |  |
     public class WaitHandler	extends ElementHandler	{
27 |  |
28 |  |
     	/**
29 |  |
     	 * <code>WaitHandler</code> のインスタンスを作成します。
30 |  |
     	 */
31 |  |
     	public WaitHandler()
32 |  |
     	{
33 | 0 |
     		super();
34 | 0 |
     	}
35 |  |
36 |  |
37 |  |
     	/**
38 |  |
     	 * <samp>dur</samp> 属性で指定されたミリ秒時間、コントローラに処理の中断を指示します。
39 |  |
     	 * @param	attrs	属性
40 |  |
     	 */
41 |  |
     	public void waitFor( Attributes attrs )
42 |  |
     	{
43 | 0 |
     		ActionControler	controler = PekoSystem.getInstance().getActionControler();
44 |  |
45 | 0 |
     		String	dur = PSMLUtil.getAttributeValue( attrs, "dur" );
46 | 0 |
     		if( dur == null )	{
47 | 0 |
     			controler.stop();
48 | 0 |
     		}
49 |  |
     		else	{
50 |  |
     			try	{
51 | 0 |
     				controler.stop( Long.parseLong(dur) );
52 |  |
     			}
53 | 0 |
     			catch( NumberFormatException nfe )	{
54 | 0 |
     				Logger.warn( MessageIDs.SCN6001W, new Object[]{getSceneContext().getCurrentPath()}, nfe );
55 | 0 |
     				controler.stop();
56 | 0 |
     			}
57 |  |
     		}
58 | 0 |
     	}
59 |  |
60 |  |
61 |  |
     //
62 |  |
     //	ContentHandler の実装
63 |  |
     //
64 |  |
     	public void startDocument()
65 |  |
     	{
66 | 0 |
     		ActionControler	controler = PekoSystem.getInstance().getActionControler();
67 | 0 |
     		controler.setSaveEnabled( true );
68 | 0 |
     	}
69 |  |
70 |  |
     	public void endDocument()
71 |  |
     	{
72 | 0 |
     		ActionControler	controler = PekoSystem.getInstance().getActionControler();
73 | 0 |
     		controler.setSaveEnabled( false );
74 | 0 |
     	}
75 |  |
76 |  |
     	public void startElement( String namespaceURI, String localName, String qName, Attributes attrs )
77 |  |
     	{
78 | 0 |
     		waitFor( attrs );
79 | 0 |
     	}
80 |  |
     }

This report is generated by jcoverage, Maven and Maven JCoverage Plugin.