cage.core
Class XMLEngine

java.lang.Object
  extended by cage.core.XMLEngine

public class XMLEngine
extends java.lang.Object

XMLEngine is a collection of methods for parsing various aspects of the XML files used in CAGE.

Author:
Seth Marinello

Constructor Summary
XMLEngine()
           
 
Method Summary
static Animation extractAnimation(nanoxml.XMLElement element)
          Creates an Animation from an XMLElement.
static Binding extractBinding(nanoxml.XMLElement element)
           
static void extractGamedata(nanoxml.XMLElement element, java.util.HashMap<java.lang.String,java.lang.Object> vars)
           
static HotSpot extractHotSpot(nanoxml.XMLElement element, int xOff, int yOff)
          Extract hot spot.
static Image extractImage(nanoxml.XMLElement element)
          Creates an Image from an XMLElement.
static Overlay extractOverlay(nanoxml.XMLElement element)
          Extract overlay.
static Scene extractScene(nanoxml.XMLElement element)
          Extract scene.
static Sound extractSound(nanoxml.XMLElement element)
          Creates a Sound from an XMLElement.
static Sprite extractSprite(nanoxml.XMLElement element)
          Extract sprite.
static Overlay.NamedPanel extractTextArea(nanoxml.XMLElement element)
          Extract text area.
static void parseGamedata(nanoxml.XMLElement element)
           
static void parseProduction(nanoxml.XMLElement element)
          Parses the production.
static void parseResources(nanoxml.XMLElement element)
          Parse a tree defining resources.
static void parseSave(nanoxml.XMLElement element)
           
static void parseScenes(nanoxml.XMLElement element)
          Parses the scenes.
static nanoxml.XMLElement parseXML(java.lang.String filename)
          Loads the XML file and parses it into an XML document tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLEngine

public XMLEngine()
Method Detail

parseXML

public static nanoxml.XMLElement parseXML(java.lang.String filename)
Loads the XML file and parses it into an XML document tree.

Parameters:
filename - filename to load
Returns:
The root element of the tree

parseResources

public static void parseResources(nanoxml.XMLElement element)
Parse a tree defining resources.

Parameters:
element - root of resources tree

extractImage

public static Image extractImage(nanoxml.XMLElement element)
Creates an Image from an XMLElement.

Parameters:
element - element defining the Image
Returns:
the Image created

extractAnimation

public static Animation extractAnimation(nanoxml.XMLElement element)
Creates an Animation from an XMLElement.

Parameters:
element - element defining the Animation
Returns:
the Animation created

extractSound

public static Sound extractSound(nanoxml.XMLElement element)
Creates a Sound from an XMLElement.

Parameters:
element - element defining the Sound
Returns:
the Sound created

parseSave

public static void parseSave(nanoxml.XMLElement element)

extractGamedata

public static void extractGamedata(nanoxml.XMLElement element,
                                   java.util.HashMap<java.lang.String,java.lang.Object> vars)

parseGamedata

public static void parseGamedata(nanoxml.XMLElement element)

parseScenes

public static void parseScenes(nanoxml.XMLElement element)
Parses the scenes.

Parameters:
element - the element

extractScene

public static Scene extractScene(nanoxml.XMLElement element)
Extract scene.

Parameters:
element - the element
Returns:
the scene

extractSprite

public static Sprite extractSprite(nanoxml.XMLElement element)
Extract sprite.

Parameters:
element - the element
Returns:
the sprite

extractHotSpot

public static HotSpot extractHotSpot(nanoxml.XMLElement element,
                                     int xOff,
                                     int yOff)
Extract hot spot.

Parameters:
element - the element
Returns:
the hot spot

parseProduction

public static void parseProduction(nanoxml.XMLElement element)
Parses the production.

Parameters:
element - the element

extractBinding

public static Binding extractBinding(nanoxml.XMLElement element)

extractOverlay

public static Overlay extractOverlay(nanoxml.XMLElement element)
Extract overlay.

Parameters:
element - the element
Returns:
the overlay

extractTextArea

public static Overlay.NamedPanel extractTextArea(nanoxml.XMLElement element)
Extract text area.

Parameters:
element - the element
Returns:
the overlay. named panel