public class ASTSites
extends java.lang.Object
This class provides the ability to load launch sites from a data file and to store them in an accessible structure. The sample data file Launch-Sites.dat is under the data files directory. A launch site data file **MUST** be in the format specifically designed for this book. The format can be gleaned by opening the sample Launch-Sites.dat data file and examining its contents. The format is straightforward and is documented in comments within the data file itself.
Copyright (c) 2018
Constructor and Description |
---|
ASTSites() |
Modifier and Type | Method and Description |
---|---|
static boolean |
areSitesLoaded()
Check to see if a Launch Sites database has been loaded.
|
static void |
clearLaunchSites()
Clear all the currently loaded Launch Sites data
|
static int |
findSiteName(java.lang.String name)
Search the currently loaded sites database and return an index into the
database for the requested site.
|
static javax.swing.filechooser.FileNameExtensionFilter |
getFileExtFilter()
Gets a filter for filtering Launch Sites data files by extension.
|
static int |
getNumSites()
Gets the number of Launch Sites in the currently loaded Sites database.
|
static ASTLatLon |
getSiteLat(int idx)
Returns launch site latitude
|
static java.lang.String |
getSiteName(int idx)
Returns launch site name
|
static java.lang.String |
getSitesFilename()
Gets the filename for the currently loaded Launch Sites database.
|
static java.lang.String |
getSitesFileToOpen()
Puts up a browser window and gets a Launch Sites data filename.
|
static boolean |
loadSitesDB(java.lang.String filename)
Loads Launch Sites database from disk.
|
public static java.lang.String getSitesFilename()
public static javax.swing.filechooser.FileNameExtensionFilter getFileExtFilter()
public static ASTLatLon getSiteLat(int idx)
idx
- index into Launch Sites databasepublic static java.lang.String getSiteName(int idx)
idx
- index into Launch Sites databasepublic static int getNumSites()
public static boolean areSitesLoaded()
public static void clearLaunchSites()
public static java.lang.String getSitesFileToOpen()
public static int findSiteName(java.lang.String name)
name
- name of the site to findpublic static boolean loadSitesDB(java.lang.String filename)
filename
- Full filename (including path) to load