double start = this.timeline.toTimelineValue(new Date((long) getRange().getLowerBound()));
double length = (this.timeline.toTimelineValue((long) getRange().getUpperBound())
- this.timeline.toTimelineValue((long) getRange().getLowerBound()));
Range adjusted = null;
if (isInverted()) {
adjusted = new DateRange(
this.timeline.toMillisecond((long) (start + (length * (1 - upperPercent)))),
this.timeline.toMillisecond((long) (start + (length * (1 - lowerPercent))))
);
}
else {
adjusted = new DateRange(this.timeline.toMillisecond(
(long) (start + length * lowerPercent)),
this.timeline.toMillisecond((long) (start + length * upperPercent))
);
}
setRange(adjusted);