|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--JourneySat.Travel
This class manages the information about a travel and the status
of the navigation in the journal.
A travel is sequence of days (JourneySat.Day);
each day contains a sequence of places (JourneySat.Place) and
each place holds a sequence of contents (JourneySat.Content).
The status of the travel is represented by a current day, a current
place and a current content. It can be accessed using the getCurrentDay,
getCurrentDayIndex, getCurrentPlace, getCurrentPlaceIndex, getCurrentContent
and getCurrentContentIndex methods.
The contents in a place can also be accessed with getContentArray.
Defined in travel.js
| Field Summary | |
Object |
loader
|
| Constructor Summary | |
JourneySat.Travel
()
|
|
| Method Summary | |
void
|
asynchronousMode(<boolean> mode)
Sets the synchronization mode for the XMLHttpRequest that loads the XML from the remote server. |
boolean
|
changeDay(<JourneySat.Date> newDate)
Changes the date of the current day. |
void
|
deleteContent()
Removes the current content from the travel. |
void
|
deleteDay()
Removes the current day from the travel sequence. |
void
|
deletePlace()
Removes the current place from the travel. |
void
|
firstDay()
Moves to the first day of the travel and updates. |
void
|
firstPlace()
Moves to the first place of the travel. |
JourneySat.Content[]
|
getContentArray()
Returns the contents of the current place as an array. |
JourneySat.Content
|
getCurrentContent()
Returns the current content. |
int
|
getCurrentContentIndex()
Returns the position of the current content in the sequence of the contents inside the current place. |
JourneySat.Day
|
getCurrentDay()
Returns the current day. |
int
|
getCurrentDayIndex()
Returns the position of the current day in the sequence of travel days. |
JourneySat.Place
|
getCurrentPlace()
Returns the current place. |
int
|
getCurrentPlaceIndex()
Returns the position of the current place in the sequence of travel days. |
GPoint
|
getCurrentPoint()
Returns the GPoint object corresponding to the coordinates of the current place |
JourneySat.Date
|
getEndDate()
Returns the end date of the travel as a JourneySat.Date object |
int
|
getNumberOfContents()
Returns the number of contents in the travel |
int
|
getNumberOfDays()
Returns the number of days in the travel |
int
|
getNumberOfPlaces()
Returns the number of places in the travel |
XMLHttpRequest
|
getRequest()
Returns the request object used to retrieve the XML from the server |
JourneySat.Date
|
getStartDate()
Returns the start date of the travel as a JourneySat.Date object |
String
|
getTravelDates()
Returns the date range of the travel as a string in the format yyyy/mm/dd - yyyy/mm/dd |
String
|
getTravelDescription()
Returns the description of the travel |
String
|
getTravelTitle()
Returns the travel title |
int
|
getZoomLevel()
Returns the default zoom level for the travel. |
void
|
goToDay(<int> n)
Moves to the n-th day in the travel. |
void
|
goToPlace(<int> n)
Moves to the n-th place in the travel. |
Object
|
insertContent()
|
boolean
|
insertDay(newDay)
Adds a new day to the travel. |
boolean
|
insertPlace()
Adds a new place to the travel. |
boolean
|
isAsynchronous()
Returnes the synchronization mode |
void
|
lastDay()
Moves to the last day of the travel. |
void
|
lastPlace()
Moves to the last place and to the last day of the travel. |
void
|
load()
Loads the XML file and creates the internal data structure that represents the travel. |
void
|
log(<String> msg)
Logs a message. |
void
|
moveDownContent()
Swaps the current content with the one that follows it in a place. |
boolean
|
moveDownDay()
Swaps the current day with the one that follows it in the travel sequence. |
void
|
moveDownPlace()
Swaps the current place with the one that follows it in a day. |
void
|
moveUpContent()
Swaps the current content with the one that precedes it in a place. |
boolean
|
moveUpDay()
Swaps the current day with the one that precedes it in the travel sequence. |
void
|
moveUpPlace()
Swaps the current place with the one that precedes it in a day. |
void
|
nextContent()
Moves the current content to the one that follows it in the same place. |
void
|
nextDay()
Moves to the next day of the travel. |
void
|
nextPlace()
Moves the current place to the next place in the travel and update the current day if needed |
void
|
onload()
Handler function, called when Loader completes loading the XML file. |
void
|
prevContent()
Moves the current content to the one that precedes it in the same place. |
void
|
prevDay()
Moves to the previous day of the travel. |
void
|
prevPlace()
Moves the current place to the previous place in the travel and also update the current day if needed. |
void
|
setDataFile(<String> dataFile)
Specifies the URL of the XML data file. |
void
|
setEndDate(<JourneySat.Date> date)
Sets the end date of the travel |
void
|
setNumberOfContents(<int> contents)
Sets the number of contents |
void
|
setNumberOfDays(<int> days)
Sets the number of days |
void
|
setNumberOfPlaces(<int> places)
Sets the number of places |
void
|
setStartDate(<JourneySat.Date> date)
Sets the start date of the travel |
void
|
setTravelDescription(<String> descr)
Sets the description of the travel |
void
|
setTravelTitle(<String> title)
Sets the travel title |
void
|
setZoomLevel(<int> zoomLevel)
Sets the default zoom level for the travel. |
String
|
toString()
Returns a XML representation of the places array. |
<static> String
|
getFormattedDate(<int> sY, <int> sM, <int> sD, <String> sep)
Prepares a formatted representation of a date in the format yyyy |
| Field Detail |
Object loader
| Constructor Detail |
JourneySat.Travel()
| Method Detail |
void asynchronousMode(<boolean> mode)
mode - true for asynchronous communication, false for synchronous.
boolean changeDay(<JourneySat.Date> newDate)
newDate - The new date for the day
dayNode - A reference to the tree node that contains the day
void deleteContent()
void deleteDay()
void deletePlace()
void firstDay()
void firstPlace()
JourneySat.Content[] getContentArray()
JourneySat.Content getCurrentContent()
int getCurrentContentIndex()
JourneySat.Day getCurrentDay()
int getCurrentDayIndex()
JourneySat.Place getCurrentPlace()
int getCurrentPlaceIndex()
GPoint getCurrentPoint()
JourneySat.Date getEndDate()
int getNumberOfContents()
int getNumberOfDays()
int getNumberOfPlaces()
XMLHttpRequest getRequest()
the - request
JourneySat.Date getStartDate()
String getTravelDates()
String getTravelDescription()
String getTravelTitle()
int getZoomLevel()
void goToDay(<int> n)
n - The number of the day, the first day of the travel is numbered as 1.
void goToPlace(<int> n)
n - The number of the place, the first place of the travel is numbered as 1.
Object insertContent()
boolean insertDay(newDay)
day - The day
boolean insertPlace()
boolean isAsynchronous()
void lastDay()
void lastPlace()
void load()
void log(<String> msg)
msg - the message to log
void moveDownContent()
boolean moveDownDay()
void moveDownPlace()
void moveUpContent()
boolean moveUpDay()
void moveUpPlace()
void nextContent()
void nextDay()
void nextPlace()
void onload()
void prevContent()
void prevDay()
void prevPlace()
void setDataFile(<String> dataFile)
dataFile - the URL of the XML data file
void setEndDate(<JourneySat.Date> date)
date - The end date, of type JourneySat.Date
void setNumberOfContents(<int> contents)
contents - The number of contents
void setNumberOfDays(<int> days)
days - The number of days
void setNumberOfPlaces(<int> places)
places - The number of places
void setStartDate(<JourneySat.Date> date)
date - The start date, of type JourneySat.Date
void setTravelDescription(<String> descr)
descr - The description of the travel
void setTravelTitle(<String> title)
title - The travel title
void setZoomLevel(<int> zoomLevel)
zoomLevel - The zoom level
String toString()
<static> String getFormattedDate(<int> sY, <int> sM, <int> sD, <String> sep)
sY - the year
sM - the month
sD - the day
sep - the separator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||