1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package tsukuba_bunko.peko.scenario.stage;
20
21 import org.xml.sax.Attributes;
22
23 import tsukuba_bunko.peko.resource.ResourceManager;
24
25 import tsukuba_bunko.peko.scenario.PSMLUtil;
26
27
28 /***
29 * <samp>background</samp> を処理する <code>ElementHandler</code> です。
30 * @author $Author: ppoi $
31 * @version $Revision: 1.2 $
32 */
33 public class BackgroundHandler extends StageElementHandler {
34
35 /***
36 * <code>BackgroundHandler</code> のインスタンスを作成します。
37 */
38 public BackgroundHandler()
39 {
40 super();
41 }
42
43
44
45
46
47 public void startElement( String namespaceURI, String localName, String qName, Attributes attrs )
48 {
49 StageCoordinator coordinator = getStageCoordinator();
50 String background = PSMLUtil.getAttributeValue( attrs, "image" );
51 if( background != null ) {
52 coordinator.setBackgroundImage( background );
53 }
54 else {
55 background = PSMLUtil.getAttributeValue( attrs, "color" );
56 coordinator.setBackgroundColor( background );
57 }
58
59 String effect = PSMLUtil.getAttributeValue( attrs, "effect" );
60 if( effect == null ) {
61 ResourceManager resources = ResourceManager.getInstance();
62 effect = (String)resources.getResource( ResourceIDs.DEFAULT_EFFECT_BACKGROUND, true );
63 }
64 if( !coordinator.isSlideVisible() ) {
65 coordinator.updateStage( effect );
66 }
67 }
68 }