Improve error reporting. New error page that gives a bit more of an explanation...
[frank.git] / prod / net / jaekl / frank / Schedule.java
index edd1b398a602afff7e23aa734d892ee5de6c8a1f..10616b23007608c5802fb4989ee61dbf8408295e 100644 (file)
@@ -13,13 +13,15 @@ import net.jaekl.frank.octranspo.StopInfo;
 import net.jaekl.frank.octranspo.Trip;
 
 public class Schedule {
-       Locale m_locale;
-       FrankBundle m_bundle;
        DateFormat m_hourMinFmt;
        DateFormat m_hourMinSecFmt;
+       FrankBundle m_bundle;
+       Locale m_locale;
+       Style m_style;
        
        public Schedule(Locale locale) {
                m_locale = locale;
+               m_style = new Style();
                m_bundle = FrankBundle.getInst(locale);
                m_hourMinFmt = new SimpleDateFormat("hh:mma", locale);
                m_hourMinSecFmt = new SimpleDateFormat("hh:mm:ssa", locale);
@@ -40,17 +42,7 @@ public class Schedule {
        String mapUrl(double latitude, double longitude) {
                return "http://www.openstreetmap.org/?mlat=" + latitude + "&mlon=" + longitude + "&zoom=15";
        }
-       
-       void writeStyle(PrintWriter pw) {
-               pw.println("<STYLE>");
-               pw.println("  body {background-color: #F0F0C0; font-size: 1.5em; }");
-               pw.println("  #trips {border-collapse: collapse; font-size: 1.5em; }");
-               pw.println("  #trips td, #trips th {border: 1px solid #600000; padding: 3px 3px 3px 3px; text-align: center;}");
-               pw.println("  #trips th {background-color: #800000; color: #FFFFFF; }");
-               pw.println("  #trips tr.ghost td {background-color: #C0C0C0;}");
-               pw.println("</STYLE>");
-       }
-       
+
        // Countdown timer that updates time remaining until each bus is expected.
        void writeScript(PrintWriter pw, String remainArray, int remainCount) {
                String min = trans(FrankBundle.MINUTES);
@@ -82,7 +74,7 @@ public class Schedule {
                pw.println("<HTML>");
                pw.println("<HEAD>");
                pw.println("<TITLE>" + title + "</TITLE>");
-               writeStyle(pw);
+               new Style().writeStyle(pw);
                pw.println("</HEAD>");
        }