}
public void layout(View view) {
ObjectField field = null;
int x = 0;
Size size = view.getSize();
size.contract(view.getPadding());
int width = size.getWidth();
int maxHeight = size.getHeight();
View[] views = view.getSubviews();
for (int i = 0; i < views.length; i++) {
View v = views[i];
ObjectAdapter object = ((ObjectContent) v.getContent()).getObject();
if (field == null) {
ObjectSpecification nc = object.getSpecification();
ObjectField[] fields = nc.getFields();
for (int j = 0; j < fields.length; j++) {
field = fields[j];
if (field.getType().isOfType(Isis.getSpecificationLoader().loadSpecification(TimePeriod.class))) {
break;
}
}
}
TimePeriod tp = (TimePeriod) object.getField(field);
int y = (int) (((tp.getStart().longValue() - from) * maxHeight) / to);
int height = (int) (((tp.getEnd().longValue() - tp.getStart().longValue()) * maxHeight) / to);
v.setLocation(new Location(x, y));
v.setSize(new Size(width, height));
}
}