/** * Calculates the value of the highest visible tick on the axis. * * @param unit date unit to use. * * @return The value of the highest visible tick on the axis. */ public Date calculateHighestVisibleTickValue(DateTickUnit unit) { return previousStandardDate(getMaximumDate(), unit); }
/** * Calculates the value of the highest visible tick on the axis. * * @param unit date unit to use. * * @return The value of the highest visible tick on the axis. */ public Date calculateHighestVisibleTickValue(DateTickUnit unit) { return previousStandardDate(getMaximumDate(), unit); }
/** * Sets the minimum date visible on the axis and sends an * {@link AxisChangeEvent} to all registered listeners. If * <code>date</code> is on or after the current maximum date for * the axis, the maximum date will be shifted to preserve the current * length of the axis. * * @param date the date (<code>null</code> not permitted). * * @see #getMinimumDate() * @see #setMaximumDate(Date) */ public void setMinimumDate(Date date) { if (date == null) { throw new IllegalArgumentException("Null 'date' argument."); } // check the new minimum date relative to the current maximum date Date maxDate = getMaximumDate(); long maxMillis = maxDate.getTime(); long newMinMillis = date.getTime(); if (maxMillis <= newMinMillis) { Date oldMin = getMinimumDate(); long length = maxMillis - oldMin.getTime(); maxDate = new Date(newMinMillis + length); } setRange(new DateRange(date, maxDate), true, false); notifyListeners(new AxisChangeEvent(this)); }
/** * Sets the maximum date visible on the axis and sends an * {@link AxisChangeEvent} to all registered listeners. If * <code>maximumDate</code> is on or before the current minimum date for * the axis, the minimum date will be shifted to preserve the current * length of the axis. * * @param maximumDate the date (<code>null</code> not permitted). * * @see #getMinimumDate() * @see #setMinimumDate(Date) */ public void setMaximumDate(Date maximumDate) { if (maximumDate == null) { throw new IllegalArgumentException("Null 'maximumDate' argument."); } // check the new maximum date relative to the current minimum date Date minDate = getMinimumDate(); long minMillis = minDate.getTime(); long newMaxMillis = maximumDate.getTime(); if (minMillis >= newMaxMillis) { Date oldMax = getMaximumDate(); long length = oldMax.getTime() - minMillis; minDate = new Date(newMaxMillis - length); } setRange(new DateRange(minDate, maximumDate), true, false); notifyListeners(new AxisChangeEvent(this)); }
/** * Sets the maximum date visible on the axis and sends an * {@link AxisChangeEvent} to all registered listeners. If * {@code maximumDate} is on or before the current minimum date for * the axis, the minimum date will be shifted to preserve the current * length of the axis. * * @param maximumDate the date ({@code null} not permitted). * * @see #getMinimumDate() * @see #setMinimumDate(Date) */ public void setMaximumDate(Date maximumDate) { Args.nullNotPermitted(maximumDate, "maximumDate"); // check the new maximum date relative to the current minimum date Date minDate = getMinimumDate(); long minMillis = minDate.getTime(); long newMaxMillis = maximumDate.getTime(); if (minMillis >= newMaxMillis) { Date oldMax = getMaximumDate(); long length = oldMax.getTime() - minMillis; minDate = new Date(newMaxMillis - length); } setRange(new DateRange(minDate, maximumDate), true, false); fireChangeEvent(); }
/** * Sets the minimum date visible on the axis and sends an * {@link AxisChangeEvent} to all registered listeners. If * {@code date} is on or after the current maximum date for * the axis, the maximum date will be shifted to preserve the current * length of the axis. * * @param date the date ({@code null} not permitted). * * @see #getMinimumDate() * @see #setMaximumDate(Date) */ public void setMinimumDate(Date date) { Args.nullNotPermitted(date, "date"); // check the new minimum date relative to the current maximum date Date maxDate = getMaximumDate(); long maxMillis = maxDate.getTime(); long newMinMillis = date.getTime(); if (maxMillis <= newMinMillis) { Date oldMin = getMinimumDate(); long length = maxMillis - oldMin.getTime(); maxDate = new Date(newMinMillis + length); } setRange(new DateRange(date, maxDate), true, false); fireChangeEvent(); }
DateAxis axis = (DateAxis) plot.getDomainAxis(); final Date minDate = axis.getMinimumDate(); final Date maxDate = autoUpdate ? new Date(System.currentTimeMillis()) : axis.getMaximumDate(); if (autoUpdate) { axis.setMaximumDate(maxDate);
int value = this.slider.getValue(); long minimum = domainAxis.getMinimumDate().getTime(); long maximum = domainAxis.getMaximumDate().getTime(); if (value<lastValue) { // left minimum = minimum - delta;
Date upperDate = getMaximumDate();
Date upperDate = getMaximumDate();
Date upperDate = getMaximumDate();
Date upperDate = getMaximumDate();