Debug.error("ScenarioGraphicLoader: problem with location file: " +
Debug.error("ScenarioGraphicLoader: problem finding the location file: " +
    public synchronized ScenarioGraphicList createData() {        ScenarioGraphicList list = new ScenarioGraphicList();        Hashtable library = new Hashtable();        // Create location data        if (locationFile != null &&            nameIndex != -1) {            Debug.message("scenario", "Reading location file...");            try {                CSVFile locations = new CSVFile(locationFile);                locations.loadData();                Iterator records = locations.iterator();                while (records.hasNext()) {                    String name = null;                    String icon = null;                    Vector record = (Vector) records.next();                    name = (String)record.elementAt(nameIndex);                    if (iconIndex != -1) {                        icon = (String)record.elementAt(iconIndex);                    }                    if (name != null) {                        ScenarioPoint location = new ScenarioPoint(name, icon);                        location.setShowName(showNames);                        drawingAttributes.setTo(location);                        library.put(name.intern(), location);                        list.add(location);                    } else {                        Debug.error("ScenaroGraphicLoader: no name to use to create location: " + name);                    }                }            } catch (MalformedURLException murle) {                Debug.error("ScenarioGraphicLoader: problem with location file: " +                             locationFile);                return list;            } catch (ArrayIndexOutOfBoundsException aioobe) {                Debug.error("ScenarioGraphicLoader: problem parsing location file: " + locationFile);            } catch (NullPointerException npe) {                Debug.error("ScenarioGraphicLoader (" + getName() + ") null pointer exception, most likely a problem finding the organization data file");            }        } else {            Debug.error("ScenarioGraphicLoader(" + getName() +                         "): Location file (" +                         locationFile + ") not configured.");            return list;        }        // OK, got the locations built up, need to fill up the scenario        // Create location data        if (activityFile != null &&            activityNameIndex != -1 &&            latIndex != -1 && lonIndex != -1 && timeIndex != -1) {            Debug.message("scenario", "Reading activity file...");            try {                CSVFile activities = new CSVFile(activityFile);                activities.loadData(); // numbers as strings == false                Iterator records = activities.iterator();                while (records.hasNext()) {                    String name = null;                    float lat;                    float lon;                    long time;                    Vector record = (Vector) records.next();                    name = record.elementAt(activityNameIndex).toString().intern();                    try {                        lat = ((Double)record.elementAt(latIndex)).floatValue();                        lon = ((Double)record.elementAt(lonIndex)).floatValue();                        // parse time from string, ending up with                        // milliseconds from time epoch.                        String timeString = (String)record.elementAt(timeIndex);                        timeDate = timeFormat.parse(timeString);                        time = timeDate.getTime();                        if (time < startTime) {                            startTime = time;                        }                        if (time > endTime) {                            endTime = time;                        }                        dataBounds.add((double)lon, (double)lat);                        if (name != null) {                            ScenarioPoint point = (ScenarioPoint)library.get(name);                            if (point != null) {                                TimeStamp ts = new TimeStamp(lat, lon, time);                                point.addTimeStamp(ts);                            } else {                                Debug.error("SenaroGraphicLoader: ScenarioPoint not found for " + name + ", entry: " + record);                            }                        } else {                            Debug.error("SenaroGraphicLoader: no name to use to create activity point: " + name);                        }                    } catch (ClassCastException cce) {                        Object obj0 = record.elementAt(activityNameIndex);                        Object obj1 = record.elementAt(latIndex);                        Object obj2 = record.elementAt(lonIndex);                        Object obj3 = record.elementAt(timeIndex);                        Debug.error(                            "ScenarioGraphicLoader(" + getName() +                             ") has problem with indexes in activity file for " +                             obj0 +  " (" + obj0.getClass().getName() + ")" +                            ":\n\tlat index = " + latIndex +                             ", value = " + obj1 +  " (" + obj1.getClass().getName() +                             ")\n\t lon index = " + lonIndex +                             ", value = " + obj2 + " (" + obj2.getClass().getName() +                             ")\n\t time index = " + timeIndex +                             ", value = " + obj3 + " (" + obj3.getClass().getName() +                             ")");                    } catch (ParseException pe) {                        Debug.output("ScenarioGraphicLoader(" + getName() +                                     ") has problem with time format. " +                                      pe.getMessage());                    }                }            } catch (MalformedURLException murle) {                Debug.error("ScenarioGraphicLoader: problem with activity file: " +                             activityFile);                return list;            } catch (NullPointerException npe) {                Debug.error("ScenarioGraphicLoader (" + getName() + ") null pointer exception, most likely a problem finding the activites data file");            }        } else {            Debug.error("ScenarioGraphicLoader(" + getName() + "): Activity file (" +                         activityFile + ") not configured.");            return list;        }        this.time = startTime;        Debug.message("scenario", "Reading files OK");        return list;    }