|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ascape.model.event.DefaultScapeListener
org.ascape.view.nonvis.NonGraphicView
org.ascape.view.nonvis.ScapeFromXMLView
public class ScapeFromXMLView
A view that instantiates a scape with the contents of an XML file. Agents
will be assigned properties based on the values as defined in this example.
Field Summary | |
---|---|
static int |
RANDOM_ORDER
The Constant RANDOM_ORDER. |
static int |
SEQUENTIAL_ORDER
The Constant SEQUENTIAL_ORDER. |
static int |
SIZE_BY_FILE
Set scape size by the number of entries in the xml file. |
static int |
SIZE_BY_SCAPE
Set scape size by the existing size of the scape. |
static int |
UNDEFINED_MODE
The Constant UNDEFINED_MODE. |
static int |
UNDEFINED_ORDER
The Constant UNDEFINED_ORDER. |
Fields inherited from class org.ascape.model.event.DefaultScapeListener |
---|
listeningToScape, name, scape |
Constructor Summary | |
---|---|
ScapeFromXMLView()
|
Method Summary | |
---|---|
int |
getAssignmentOrder()
Gets the assignment order. |
int |
getMode()
Gets the mode. |
int |
getReadOrder()
Gets the read order. |
void |
parseFile(java.lang.String inputFileName)
Parse in the XML file, and set the root element and set flags (mode, assignmentOrder, readOrder). |
void |
parseStream(java.io.InputStream is)
Parse in the XML file, and set the root element and set flags (mode, assignmentOrder, readOrder). |
void |
scapeAdded(ScapeEvent scapeEvent)
Add the view to the scape, registering it as a listener, and ensuring that it hasn't been added to any other scapes. |
void |
scapeInitialized(ScapeEvent scapeEvent)
Called immediatly after the scape is initialized. |
void |
setAssignmentOrder(int assignmentOrder)
Sets the assignment order. |
void |
setMode(int mode)
Sets the mode. |
void |
setReadOrder(int readOrder)
Sets the read order. |
Methods inherited from class org.ascape.view.nonvis.NonGraphicView |
---|
isGraphic |
Methods inherited from class org.ascape.model.event.DefaultScapeListener |
---|
clone, environmentQuiting, getName, getScape, isLifeOfScape, isNotifyScapeAutomatically, notifyScapeUpdated, scapeClosing, scapeDeserialized, scapeIterated, scapeNotification, scapeRemoved, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int UNDEFINED_MODE
public static final int SIZE_BY_FILE
public static final int SIZE_BY_SCAPE
public static final int UNDEFINED_ORDER
public static final int RANDOM_ORDER
public static final int SEQUENTIAL_ORDER
Constructor Detail |
---|
public ScapeFromXMLView()
Method Detail |
---|
public void parseFile(java.lang.String inputFileName)
inputFileName
- the input file namepublic void parseStream(java.io.InputStream is)
is
- the ispublic void scapeAdded(ScapeEvent scapeEvent) throws java.util.TooManyListenersException
scapeAdded
in interface ScapeListener
scapeAdded
in class DefaultScapeListener
scapeEvent
- the event for this scape to make this view the observer of
java.util.TooManyListenersException
- the too many listeners exception
java.util.TooManyListenersException
- on attempt to add a scape when one is allready addedpublic void scapeInitialized(ScapeEvent scapeEvent)
scapeInitialized
in interface ScapeListener
scapeInitialized
in class DefaultScapeListener
scapeEvent
- the scape eventpublic int getAssignmentOrder()
public void setAssignmentOrder(int assignmentOrder)
assignmentOrder
- the new assignment orderpublic int getReadOrder()
public void setReadOrder(int readOrder)
readOrder
- the new read orderpublic int getMode()
public void setMode(int mode)
mode
- the new mode
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |