@Test public void testSetMinimumDate() { DateAxis axis = new DateAxis("Test Axis"); Date d1 = new Date(); Date d2 = new Date(d1.getTime() + 1); axis.setMaximumDate(d2); axis.setMinimumDate(d1); assertEquals(d1, axis.getMinimumDate()); Date d3 = new Date(d2.getTime() + 1); axis.setMinimumDate(d2); assertEquals(d3, axis.getMaximumDate()); }
public void setMinimumDate(Date date) { ParamChecks.nullNotPermitted(date, "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 extends ValueAxis implements Cloneable, Serializable { public void setMinimumDate(Date date) { ParamChecks.nullNotPermitted(date, "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 extends ValueAxis implements Cloneable, Serializable { public void setMinimumDate(Date date) { ParamChecks.nullNotPermitted(date, "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();  DateAxis(String label);  DateAxis(String label, TimeZone zone, Locale locale); }
DateAxis extends ValueAxis implements Cloneable, Serializable { public void setMinimumDate(Date date) { ParamChecks.nullNotPermitted(date, "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();  DateAxis(String label);  DateAxis(String label, TimeZone zone, Locale locale); TimeZone getTimeZone(); void setTimeZone(TimeZone zone); Timeline getTimeline(); void setTimeline(Timeline timeline); DateTickUnit getTickUnit(); void setTickUnit(DateTickUnit unit); void setTickUnit(DateTickUnit unit, boolean notify,
                            boolean turnOffAutoSelection); DateFormat getDateFormatOverride(); void setDateFormatOverride(DateFormat formatter); @Override void setRange(Range range); @Override void setRange(Range range, boolean turnOffAutoRange,
                         boolean notify); void setRange(Date lower, Date upper); @Override void setRange(double lower, double upper); Date getMinimumDate(); void setMinimumDate(Date date); Date getMaximumDate(); void setMaximumDate(Date maximumDate); DateTickMarkPosition getTickMarkPosition(); void setTickMarkPosition(DateTickMarkPosition position); @Override void configure(); boolean isHiddenValue(long millis); @Override double valueToJava2D(double value, Rectangle2D area,
                                RectangleEdge edge); double dateToJava2D(Date date, Rectangle2D area,
                               RectangleEdge edge); @Override double java2DToValue(double java2DValue, Rectangle2D area,
                                RectangleEdge edge); Date calculateLowestVisibleTickValue(DateTickUnit unit); Date calculateHighestVisibleTickValue(DateTickUnit unit); static TickUnitSource createStandardDateTickUnits(); static TickUnitSource createStandardDateTickUnits(TimeZone zone,
            Locale locale); @Override List<ValueTick> refreshTicks(Graphics2D g2, AxisState state,
            Rectangle2D dataArea, RectangleEdge edge); @Override AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea,
            Rectangle2D dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState); @Override void zoomRange(double lowerPercent, double upperPercent); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); }
DateAxis extends ValueAxis implements Cloneable, Serializable { public void setMinimumDate(Date date) { ParamChecks.nullNotPermitted(date, "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();  DateAxis(String label);  DateAxis(String label, TimeZone zone, Locale locale); TimeZone getTimeZone(); void setTimeZone(TimeZone zone); Timeline getTimeline(); void setTimeline(Timeline timeline); DateTickUnit getTickUnit(); void setTickUnit(DateTickUnit unit); void setTickUnit(DateTickUnit unit, boolean notify,
                            boolean turnOffAutoSelection); DateFormat getDateFormatOverride(); void setDateFormatOverride(DateFormat formatter); @Override void setRange(Range range); @Override void setRange(Range range, boolean turnOffAutoRange,
                         boolean notify); void setRange(Date lower, Date upper); @Override void setRange(double lower, double upper); Date getMinimumDate(); void setMinimumDate(Date date); Date getMaximumDate(); void setMaximumDate(Date maximumDate); DateTickMarkPosition getTickMarkPosition(); void setTickMarkPosition(DateTickMarkPosition position); @Override void configure(); boolean isHiddenValue(long millis); @Override double valueToJava2D(double value, Rectangle2D area,
                                RectangleEdge edge); double dateToJava2D(Date date, Rectangle2D area,
                               RectangleEdge edge); @Override double java2DToValue(double java2DValue, Rectangle2D area,
                                RectangleEdge edge); Date calculateLowestVisibleTickValue(DateTickUnit unit); Date calculateHighestVisibleTickValue(DateTickUnit unit); static TickUnitSource createStandardDateTickUnits(); static TickUnitSource createStandardDateTickUnits(TimeZone zone,
            Locale locale); @Override List<ValueTick> refreshTicks(Graphics2D g2, AxisState state,
            Rectangle2D dataArea, RectangleEdge edge); @Override AxisState draw(Graphics2D g2, double cursor, Rectangle2D plotArea,
            Rectangle2D dataArea, RectangleEdge edge,
            PlotRenderingInfo plotState); @Override void zoomRange(double lowerPercent, double upperPercent); @Override boolean equals(Object obj); @Override int hashCode(); @Override Object clone(); static final DateRange DEFAULT_DATE_RANGE; static final double DEFAULT_AUTO_RANGE_MINIMUM_SIZE_IN_MILLISECONDS; static final Date DEFAULT_ANCHOR_DATE; }