Coverage report

  %line %branch
tsukuba_bunko.peko.scenario.stage.AtOnceHandler
0% 
0% 

 1  
 /*
 2  
  * All Rights Reserved.
 3  
  * Copyright (C) 1999-2005 Tsukuba Bunko.
 4  
  *
 5  
  * Licensed under the BSD License ("the License"); you may not use
 6  
  * this file except in compliance with the License.
 7  
  * You may obtain a copy of the License at
 8  
  *
 9  
  *       http://www.tsukuba-bunko.org/licenses/LICENSE.txt
 10  
  *
 11  
  * Unless required by applicable law or agreed to in writing, software
 12  
  * distributed under the License is distributed on an "AS IS" BASIS,
 13  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14  
  * See the License for the specific language governing permissions and
 15  
  * limitations under the License.
 16  
  *
 17  
  * $Id: AtOnceHandler.java,v 1.2 2005/08/18 14:37:40 ppoi Exp $
 18  
  */
 19  
 package tsukuba_bunko.peko.scenario.stage;
 20  
 
 21  
 import	org.xml.sax.Attributes;
 22  
 import	org.xml.sax.SAXException;
 23  
 
 24  
 import	tsukuba_bunko.peko.scenario.HandlerRegistry;
 25  
 import	tsukuba_bunko.peko.scenario.PSMLUtil;
 26  
 
 27  
 
 28  
 /**
 29  
  * <samp>at-once</samp> 要素を処理する ElementHandler です。
 30  
  * @author	$Author: ppoi $
 31  
  * @version	$Revision: 1.2 $
 32  
  */
 33  
 public class AtOnceHandler	extends StageElementHandler	{
 34  
 
 35  
 	/**
 36  
 	 * 現在使用中の StageElementHandler
 37  
 	 */
 38  0
 	private StageElementHandler	_child = null;
 39  
 
 40  
 	/**
 41  
 	 * level
 42  
 	 */
 43  0
 	private int	_level = 0;
 44  
 
 45  
 	/**
 46  
 	 * 更新に使用するエフェクト
 47  
 	 */
 48  0
 	private String	_effect = null;
 49  
 
 50  
 	/**
 51  
 	 * スライド操作を含むかどうか
 52  
 	 */
 53  0
 	private boolean	_containsSlideOperation = false;
 54  
 
 55  
 
 56  
 	/**
 57  
 	 * <code>AtOnceHandler</code> のインスタンスを作成します。
 58  
 	 */
 59  
 	public AtOnceHandler()
 60  
 	{
 61  0
 		super();
 62  0
 	}
 63  
 
 64  
 
 65  
 //
 66  
 //	ContentHandler の実装
 67  
 //
 68  
 	public void startDocument()
 69  
 	{
 70  0
 		_child = null;
 71  0
 		_level = 0;
 72  0
 		_containsSlideOperation = false;
 73  0
 		super.startDocument();
 74  0
 	}
 75  
 
 76  
 	public void endDocument()
 77  
 	{
 78  0
 		StageCoordinator	coordinator = getStageCoordinator();
 79  0
 		if( _effect == null )	{
 80  0
 			coordinator.updateStage();
 81  0
 		}
 82  
 		else	{
 83  0
 			if( !coordinator.isSlideVisible() || _containsSlideOperation )	{
 84  0
 				coordinator.updateStage( _effect );
 85  
 			}
 86  
 		}
 87  0
 		super.endDocument();
 88  0
 	}
 89  
 
 90  
 	public void startElement( String namespaceURI, String localName, String qName, Attributes attrs )
 91  
 		throws SAXException
 92  
 	{
 93  0
 		if( _child != null )	{
 94  0
 			_level++;
 95  0
 			_child.startElement( namespaceURI, localName, qName, attrs );
 96  0
 		}
 97  0
 		else if( localName.equals("at-once") )	{
 98  0
 			_effect = PSMLUtil.getAttributeValue( attrs, "effect" );
 99  0
 		}
 100  
 		else	{
 101  0
 			HandlerRegistry	registry = getSceneContext().getSceneProcessor().getHandlerRegistry();
 102  0
 			_child = (StageElementHandler)registry.getElementHandler( namespaceURI, localName );
 103  0
 			if( _child instanceof SlideHandler )	{
 104  0
 				_containsSlideOperation = true;
 105  
 			}
 106  0
 			if( _child != null )	{
 107  0
 				_child.setParentHandler( this );
 108  0
 				_child.setSceneContext( getSceneContext() );
 109  0
 				_child.startDocument();
 110  0
 				_level++;
 111  0
 				_child.startElement( namespaceURI, localName, qName, attrs );
 112  
 			}
 113  
 		}
 114  0
 	}
 115  
 
 116  
 	public void endElement( String namespaceURI, String localName, String qName )
 117  
 		throws SAXException
 118  
 	{
 119  0
 		if( _child != null )	{
 120  0
 			_level--;
 121  0
 			_child.endElement( namespaceURI, localName, qName );
 122  0
 			if( _level == 0 )	{
 123  0
 				_child.endDocument();
 124  0
 				_child.setParentHandler( null );
 125  0
 				_child.setSceneContext( null );
 126  0
 				_child = null;
 127  
 			}
 128  
 		}
 129  0
 	}
 130  
 }

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