SmartClient Version: v10.1p_2016-02-26/Pro Deployment (built 2016-02-26)
I am having some problems with events in my timeline overlapping.

As you can see, 3 events in the timeline are overlapping.
Here is a testcase that shows the problem:
I am having some problems with events in my timeline overlapping.
As you can see, 3 events in the timeline are overlapping.
Here is a testcase that shows the problem:
Code:
public Timeline getTimeline()
{
final Timeline timeline = new Timeline();
timeline.setHeight100();
timeline.setCanRemoveEvents(false);
timeline.setCanEditLane(true);
timeline.setShowEventDescriptions(false);
timeline.setEventSnapGap(1440); // 60 * 24
timeline.setShowIndicators(true);
timeline.setUseEventCanvasRolloverControls(false);
timeline.setFirstDayOfWeek(0);
timeline.setLaneEventPadding(2); // add a little space around events
timeline.setShowWeekends(true);
HeaderLevel[] headerLevels = new HeaderLevel[]{
new HeaderLevel(TimeUnit.WEEK),
new HeaderLevel(TimeUnit.DAY)
};
timeline.setHeaderLevels(headerLevels);
timeline.setLaneFields(new ListGridField[]{ new ListGridField("title", "Developer", 120)});
timeline.setLanes(TimelineLaneData.getRecords());
timeline.setData(TimelineData.getRecords());
timeline.setDefaultTimelineColumnSpan(50);
Date startDate = DateUtil.getAbsoluteDate(RelativeDate.WEEK_AGO);
// if you don't call this, you'll get defaultTimelineColumnSpan columns (20)
timeline.setStartDate(startDate);
Date endDate = DateUtil.getAbsoluteDate(RelativeDate.WEEK_AGO);
CalendarUtil.addDaysToDate(endDate, 50);
timeline.setEndDate(endDate);
return timeline;
}
public static class TimelineData {
private static CalendarEvent[] records;
private static Date today = new Date();
private static int year = today.getYear();
private static int month = today.getMonth();
private static int start = today.getDate();
public TimelineData() {
}
public static CalendarEvent[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public static CalendarEvent[] getNewRecords() {
return new CalendarEvent[]{
new CalendarEvent(1, "Test 1", "", new Date(year, month, start - 1,0,0,0), new Date(year, month, start + 11, 0,0,0), "charlesMadigen"),
new CalendarEvent(2, "Test 2", "", new Date(year, month, start, 0,0,0), new Date(year, month, start + 11, 0,0,0), "charlesMadigen"),
new CalendarEvent(3, "Test 3", "", new Date(year, month, start, 0,0,0), new Date(year, month, start + 12, 0,0,0), "charlesMadigen"),
new CalendarEvent(4, "Test 4", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 15, 0,0,0), "charlesMadigen"),
new CalendarEvent(5, "Test 5", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 16, 0,0,0), "charlesMadigen"),
new CalendarEvent(6, "Test 6", "", new Date(year, month, start + 11,0,0,0), new Date(year, month, start + 17, 0,0,0), "charlesMadigen")
};
}
}
public static class TimelineLaneData {
private static Lane[] records;
public static Lane[] getRecords() {
if (records == null) {
records = getNewRecords();
}
return records;
}
public TimelineLaneData() {
}
public static Lane[] getNewRecords() {
Lane[] lanes = new Lane[]{
getLane("charlesMadigen", "Charles Madigen", "Managers"),
getLane("tamaraKane", "Tamara Kane", "Developers"),
getLane("darcyFeeney", "Darcy Feeney", "Managers"),
getLane("kaiKong", "Kai Kong", "Developers"),
getLane("shelleyFewel", "Shelley Fewel", "Managers"),
getLane("garretMonroe", "Garret Monroe", "Developers")
};
return lanes;
}
private static Lane getLane(String name, String title, String devGroup) {
Lane lane = new Lane(name, title);
lane.setAttribute("devGroup", devGroup);
return lane;
}
}
Comment