GraphicPrimitiveContainer.Rectangle rect = (Rectangle) primitive;
TaskActivity activity = (TaskActivity) primitive.getModelObject();
if (activity != null) {
if (activity.isFirst() && rect.myLeftX - 2 <= x
&& rect.myLeftX + 2 >= x) {
result = new TaskBoundaryChartItem(activity.getTask(), true);
}
if (result == null && activity.isLast()
&& rect.myLeftX + rect.myWidth - 2 <= x
&& rect.myLeftX + rect.myWidth + 2 >= x) {
result = new TaskBoundaryChartItem(activity.getTask(),
false);
}
if (result == null) {
result = new TaskRegularAreaChartItem(activity.getTask());
}