View Javadoc

1   /*
2    * "Peko" Visual Novel System
3    *
4    * All Rights Reserved.
5    * Copyright (c) 1999-2003 Tsukuba Bunko.
6    *
7    * $Id: SlideHandler.java,v 1.1 2005/07/11 12:49:19 ppoi Exp $
8    */
9   package tsukuba_bunko.peko.scenario.stage;
10  
11  import	org.xml.sax.Attributes;
12  
13  import	tsukuba_bunko.peko.Logger;
14  
15  import	tsukuba_bunko.peko.resource.ResourceManager;
16  
17  import	tsukuba_bunko.peko.scenario.PSMLUtil;
18  
19  
20  /***
21   * @author	$Author: ppoi $
22   * @version	$Revision: 1.1 $
23   */
24  public class SlideHandler	extends StageElementHandler	{
25  
26  	/***
27  	 * <code>SlideHandler</code> のインスタンスを生成します。
28  	 */
29  	public SlideHandler()
30  	{
31  		super();
32  	}
33  
34  
35  //
36  //	ElementHandler の実装
37  //
38  	public void startElement( String namspaceURI, String localName, String qName, Attributes attrs )
39  	{
40  		StageCoordinator	coordinator = getStageCoordinator();
41  		if( "show-slide".equals(localName) )	{
42  			String	slide = PSMLUtil.getAttributeValue( attrs, "image" );
43  			if( slide == null )	{
44  				Logger.warn( MessageIDs.SCN3006W, new Object[]{getSceneContext().getCurrentPath()} );
45  				return;
46  			}
47  			else	{
48  				coordinator.showSlide( slide );
49  			}
50  
51  			String	effect = PSMLUtil.getAttributeValue( attrs, "effect" );
52  			if( effect == null )	{
53  				ResourceManager	resources = ResourceManager.getInstance();
54  				effect = (String)resources.getResource( ResourceIDs.DEFAULT_EFFECT_SLIDE, true );
55  			}
56  			coordinator.updateStage( effect );
57  		}
58  		else if( "hide-slide".equals(localName) )	{
59  			coordinator.hideSlide();
60  
61  			String	effect = PSMLUtil.getAttributeValue( attrs, "effect" );
62  			if( effect == null )	{
63  				ResourceManager	resources = ResourceManager.getInstance();
64  				effect = (String)resources.getResource( ResourceIDs.DEFAULT_EFFECT_SLIDE, true );
65  			}
66  			coordinator.updateStage( effect );
67  		}
68  	}
69  }