Java Code Examples for org.jfree.data.time.RegularTimePeriod#downsize()

The following examples show how to use org.jfree.data.time.RegularTimePeriod#downsize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PeriodAxis.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Creates a new axis.
 * 
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range 
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range 
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 */
public PeriodAxis(String label, 
                  RegularTimePeriod first, RegularTimePeriod last, 
                  TimeZone timeZone) {
    
    super(label, null);
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.calendar = Calendar.getInstance(timeZone);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, 
            new SimpleDateFormat("MMM"));
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, 
            new SimpleDateFormat("yyyy"));
    
}
 
Example 2
Source File: PeriodAxis.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new axis.
 * 
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range 
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range 
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 */
public PeriodAxis(String label, 
                  RegularTimePeriod first, RegularTimePeriod last, 
                  TimeZone timeZone) {
    
    super(label, null);
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.calendar = Calendar.getInstance(timeZone);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, 
            new SimpleDateFormat("MMM"));
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, 
            new SimpleDateFormat("yyyy"));
    
}
 
Example 3
Source File: PeriodAxis.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}
 
Example 4
Source File: PeriodAxis.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}
 
Example 5
Source File: PeriodAxis.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}
 
Example 6
Source File: PeriodAxis.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}
 
Example 7
Source File: PeriodAxis.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    if (timeZone == null) {
        throw new IllegalArgumentException("Null 'timeZone' argument.");
    }
    if (locale == null) {
        throw new IllegalArgumentException("Null 'locale' argument.");
    }
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class,
            new SimpleDateFormat("MMM", locale));
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class,
            new SimpleDateFormat("yyyy", locale));
}
 
Example 8
Source File: PeriodAxis.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}
 
Example 9
Source File: PeriodAxis.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Creates a new axis.
 *
 * @param label  the axis label (<code>null</code> permitted).
 * @param first  the first time period in the axis range
 *               (<code>null</code> not permitted).
 * @param last  the last time period in the axis range
 *              (<code>null</code> not permitted).
 * @param timeZone  the time zone (<code>null</code> not permitted).
 * @param locale  the locale (<code>null</code> not permitted).
 *
 * @since 1.0.13
 */
public PeriodAxis(String label, RegularTimePeriod first,
        RegularTimePeriod last, TimeZone timeZone, Locale locale) {
    super(label, null);
    ParamChecks.nullNotPermitted(timeZone, "timeZone");
    ParamChecks.nullNotPermitted(locale, "locale");
    this.first = first;
    this.last = last;
    this.timeZone = timeZone;
    this.locale = locale;
    this.calendar = Calendar.getInstance(timeZone, locale);
    this.first.peg(this.calendar);
    this.last.peg(this.calendar);
    this.autoRangeTimePeriodClass = first.getClass();
    this.majorTickTimePeriodClass = first.getClass();
    this.minorTickMarksVisible = false;
    this.minorTickTimePeriodClass = RegularTimePeriod.downsize(
            this.majorTickTimePeriodClass);
    setAutoRange(true);
    this.labelInfo = new PeriodAxisLabelInfo[2];
    SimpleDateFormat df0 = new SimpleDateFormat("MMM", locale);
    df0.setTimeZone(timeZone);
    this.labelInfo[0] = new PeriodAxisLabelInfo(Month.class, df0);
    SimpleDateFormat df1 = new SimpleDateFormat("yyyy", locale);
    df1.setTimeZone(timeZone);
    this.labelInfo[1] = new PeriodAxisLabelInfo(Year.class, df1);
}