/** * Sets the time zone for the axis and sends an {@link AxisChangeEvent} to * all registered listeners. * * @param zone the time zone (<code>null</code> not permitted). * * @since 1.0.4 * * @see #getTimeZone() */ public void setTimeZone(TimeZone zone) { if (zone == null) { throw new IllegalArgumentException("Null 'zone' argument."); } if (!this.timeZone.equals(zone)) { this.timeZone = zone; setStandardTickUnits(createStandardDateTickUnits(zone, this.locale)); notifyListeners(new AxisChangeEvent(this)); } }
/** * Sets the locale for the axis and sends a change event to all registered * listeners. * * @param locale the new locale ({@code null} not permitted). */ public void setLocale(Locale locale) { Args.nullNotPermitted(locale, "locale"); this.locale = locale; setStandardTickUnits(createStandardDateTickUnits(this.timeZone, this.locale)); fireChangeEvent(); }
/** * Sets the time zone for the axis and sends an {@link AxisChangeEvent} to * all registered listeners. * * @param zone the time zone ({@code null} not permitted). * * @since 1.0.4 * * @see #getTimeZone() */ public void setTimeZone(TimeZone zone) { Args.nullNotPermitted(zone, "zone"); this.timeZone = zone; setStandardTickUnits(createStandardDateTickUnits(zone, this.locale)); fireChangeEvent(); }
private static ValueAxis createDateAxis() { DateAxis timeAxis = new DateAxis("Timestamp (" + DATE_FORMAT + ")"); SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); timeAxis.setDateFormatOverride(sdf); timeAxis.setLowerMargin(0D); timeAxis.setUpperMargin(0D); timeAxis.setAutoRange(true); timeAxis.setStandardTickUnits(DateAxis.createStandardDateTickUnits()); return defaultAxis(timeAxis); }
timeAxis.setStandardTickUnits(DateAxis.createStandardDateTickUnits(TimeZone.getDefault(), Locale.ENGLISH));