Coverage report

  %line %branch
tsukuba_bunko.peko.resource.IconDeserializer
0% 
0% 

 1  
 /*
 2  
  * "Peko" Visual Novel System
 3  
  *
 4  
  * All Rights Reserved.
 5  
  * Copyright (c) 1999-2003 Tsukuba Bunko.
 6  
  *
 7  
  * $Id: IconDeserializer.java,v 1.1 2005/07/11 12:49:18 ppoi Exp $
 8  
  */
 9  
 package tsukuba_bunko.peko.resource;
 10  
 
 11  
 import	java.net.URL;
 12  
 
 13  
 import	javax.swing.ImageIcon;
 14  
 
 15  
 import	org.xml.sax.SAXException;
 16  
 
 17  
 import	tsukuba_bunko.resource.SimpleDeserializer;
 18  
 
 19  
 
 20  
 /**
 21  
  * {@link javax.swing.ImageIcon} 型のリソースに対する {@link tsukuba_bunko.resource.ResourceDeserializer} 実装です。
 22  
  * @author	$Author: ppoi $
 23  
  * @version	$Revision: 1.1 $
 24  
  * @see <a href="http://softlab.tsukuba-bunko.org/peko/userguide/resource.html#type-peko:icon">peko:icon 型のリソース</a>
 25  
  */
 26  
 public class IconDeserializer	extends SimpleDeserializer	{
 27  
 
 28  
 	/**
 29  
 	 * ベース URL
 30  
 	 */
 31  0
 	private URL	_baseURL = null;
 32  
 
 33  
 
 34  
 	/**
 35  
 	 * <code>IconDeserializer</code> のインスタンスを作成します。
 36  
 	 */
 37  
 	public IconDeserializer()
 38  
 	{
 39  0
 		super();
 40  0
 	}
 41  
 
 42  
 
 43  
 	/**
 44  
 	 * ベース URL を設定します.
 45  
 	 * @param	baseURL	ベース URL
 46  
 	 */
 47  
 	public void setBaseURL( URL baseURL )
 48  
 	{
 49  0
 		_baseURL = baseURL;
 50  0
 	}
 51  
 
 52  
 
 53  
 //
 54  
 //	SimpleDeserializer の実装
 55  
 //
 56  
 	public Object convertValue( String source )
 57  
 		throws SAXException
 58  
 	{
 59  
 		try	{
 60  0
 			if( _baseURL != null )	{
 61  0
 				return new ImageIcon( class="keyword">new URL(_baseURL, source) );
 62  
 			}
 63  
 			else	{
 64  0
 				return new ImageIcon( source );
 65  
 			}
 66  
 		}
 67  0
 		catch( Exception e )	{
 68  0
 			throw new SAXException( e );
 69  
 		}
 70  
 	}
 71  
 }

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