View Javadoc

    1   /*
    2    * "Peko" Visual Novel System
    3    *
    4    * All Rights Reserved.
    5    * Copyright (c) 1999-2003 Tsukuba Bunko.
    6    *
    7    * $Id: SceneFlowHandler.java,v 1.1 2005/07/11 12:49:19 ppoi Exp $
    8    */
    9   package tsukuba_bunko.peko.scenario.util;
    10
    11  import	org.xml.sax.Attributes;
    12
    13  import	tsukuba_bunko.peko.scenario.ElementHandler;
    14  import	tsukuba_bunko.peko.scenario.PSMLUtil;
    15  import	tsukuba_bunko.peko.scenario.NextSceneMapping;
    16
    17
    18  /***
    19   * @author	${Author}$
    20   * @version	${Revision}$
    21   */
    22  public class SceneFlowHandler	extends ElementHandler	{
    23
    24
    25  	public void endDocument()
    26  	{
    27  		setEndOfScene( true );
    28  	}
    29
    30  	public void startElement( String namespaceURI, String localName, String qName, Attributes attrs )
    31  	{
    32  		String	nextSceneName = PSMLUtil.getAttributeValue( attrs, "next-scene" );
    33  		if( nextSceneName != null )	{
    34  			nextSceneName = nextSceneName.trim();
    35  			if( nextSceneName.length() > 0 )	{
    36  				NextSceneMapping	mapping = new NextSceneMapping();
    37  				mapping.setDefaultSceneMapping( nextSceneName );
    38  				getSceneContext().setNextSceneMapping( mapping );
    39  			}
    40  		}
    41  	}
    42  }