public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JFrame frame = new JFrame("TimeFinder Planner");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
CalendarSettings settings = new CalendarSettings();
// set 1/4h as one timeslot, now even half of an hour will be displayed
settings.setMillisPerTimeslot(15 * 60 * 1000L);
settings.setTimeslotsPerDay(4 * 8);
settings.setStartDate(new DateTime(2009, 4, 6, 8, 0, 0, 0));
TimeFinderPlanner planner = new TimeFinderPlanner(settings);
// monday
planner.addInterval(new IntervalLongImpl("Interval 1", 2009, 4, 6, 8, 30, 60));
planner.addInterval(new IntervalLongImpl("Interval 2", 2009, 4, 6, 9, 0, 60));
planner.addInterval(new IntervalLongImpl("Interval A", 2009, 4, 6, 10, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval B", 2009, 4, 6, 10, 0, 180));
planner.addInterval(new IntervalLongImpl("Interval C", 2009, 4, 6, 11, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval D", 2009, 4, 6, 13, 0, 180));
planner.addInterval(new IntervalLongImpl("Interval E", 2009, 4, 6, 14, 0, 120));
// tuesday
planner.addInterval(new IntervalLongImpl("Interval 3", 2009, 4, 7, 8, 30, 30));
planner.addInterval(new IntervalLongImpl("Interval 3", 2009, 4, 7, 9, 0, 60));
planner.addInterval(new IntervalLongImpl("Interval 4a", 2009, 4, 7, 10, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 4b", 2009, 4, 7, 13, 0, 180));
planner.addInterval(new IntervalLongImpl("Interval 4c", 2009, 4, 7, 14, 0, 60));
// wednesday
planner.addInterval(new IntervalLongImpl("Interval 5", 2009, 4, 8, 9, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 6 more description "
+ "to show line breaking", 2009, 4, 8, 10, 0, 120));
// explicit line breaking
planner.addInterval(new IntervalLongImpl("brok\nken", 2009, 4, 9, 15, 0, 30));
// implicit
planner.addInterval(new IntervalLongImpl("Interval 7 show line breaking and "
+ "clipping not shown ? 123 ********", 2009, 4, 9, 9, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 8", 2009, 4, 9, 11, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 9", 2009, 4, 9, 10, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 10", 2009, 4, 9, 11, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 11", 2009, 4, 9, 13, 0, 120));
planner.addInterval(new IntervalLongImpl("Interval 12", 2009, 4, 10, 8, 30, 60));
planner.addInterval(new IntervalLongImpl("Interval 13 smaller than one hour", 2009, 4, 10, 9, 30, 30));
frame.setContentPane(planner);
frame.setSize(1000, 640);
frame.setVisible(true);
}
});
}