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);
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);
pw.println("<HTML>");
pw.println("<HEAD>");
pw.println("<TITLE>" + title + "</TITLE>");
- writeStyle(pw);
+ new Style().writeStyle(pw);
pw.println("</HEAD>");
}