| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 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 |
|
|
| 22 |
|
|
| 23 |
|
|
| 24 |
|
public class SlideHandler extends StageElementHandler { |
| 25 |
|
|
| 26 |
|
|
| 27 |
|
|
| 28 |
|
|
| 29 |
|
public SlideHandler() |
| 30 |
|
{ |
| 31 |
0 |
super(); |
| 32 |
0 |
} |
| 33 |
|
|
| 34 |
|
|
| 35 |
|
|
| 36 |
|
|
| 37 |
|
|
| 38 |
|
public void startElement( String namspaceURI, String localName, String qName, Attributes attrs ) |
| 39 |
|
{ |
| 40 |
0 |
StageCoordinator coordinator = getStageCoordinator(); |
| 41 |
0 |
if( "show-slide".equals(localName) ) { |
| 42 |
0 |
String slide = PSMLUtil.getAttributeValue( attrs, "image" ); |
| 43 |
0 |
if( slide == null ) { |
| 44 |
0 |
Logger.warn( MessageIDs.SCN3006W, new Object[]{getSceneContext().getCurrentPath()} ); |
| 45 |
0 |
return; |
| 46 |
|
} |
| 47 |
|
else { |
| 48 |
0 |
coordinator.showSlide( slide ); |
| 49 |
|
} |
| 50 |
|
|
| 51 |
0 |
String effect = PSMLUtil.getAttributeValue( attrs, "effect" ); |
| 52 |
0 |
if( effect == null ) { |
| 53 |
0 |
ResourceManager resources = ResourceManager.getInstance(); |
| 54 |
0 |
effect = (String)resources.getResource( ResourceIDs.DEFAULT_EFFECT_SLIDE, true ); |
| 55 |
|
} |
| 56 |
0 |
coordinator.updateStage( effect ); |
| 57 |
0 |
} |
| 58 |
0 |
else if( "hide-slide".equals(localName) ) { |
| 59 |
0 |
coordinator.hideSlide(); |
| 60 |
|
|
| 61 |
0 |
String effect = PSMLUtil.getAttributeValue( attrs, "effect" ); |
| 62 |
0 |
if( effect == null ) { |
| 63 |
0 |
ResourceManager resources = ResourceManager.getInstance(); |
| 64 |
0 |
effect = (String)resources.getResource( ResourceIDs.DEFAULT_EFFECT_SLIDE, true ); |
| 65 |
|
} |
| 66 |
0 |
coordinator.updateStage( effect ); |
| 67 |
|
} |
| 68 |
0 |
} |
| 69 |
|
} |