Example usage for org.jfree.data.time RegularTimePeriod getMiddleMillisecond

List of usage examples for org.jfree.data.time RegularTimePeriod getMiddleMillisecond

Introduction

In this page you can find the example usage for org.jfree.data.time RegularTimePeriod getMiddleMillisecond.

Prototype

public long getMiddleMillisecond(Calendar calendar) 

Source Link

Document

Returns the millisecond closest to the middle of the time period, evaluated using the supplied calendar (which incorporates a timezone).

Usage

From source file:edu.dlnu.liuwenpeng.Time.TimeSeriesCollection.java

/**    
* Returns the x-value for a time period.    
*    /*w ww .  j a  v  a2  s.c  o m*/
* @param period  the time period (<code>null</code> not permitted).    
*    
* @return The x-value.    
*/
protected synchronized long getX(RegularTimePeriod period) {
    long result = 0L;
    if (this.xPosition == TimePeriodAnchor.START) {
        result = period.getFirstMillisecond(this.workingCalendar);
    } else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond(this.workingCalendar);
    } else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond(this.workingCalendar);
    }
    return result;
}