Java Code Examples for org.jfree.data.time.TimePeriodAnchor#START

The following examples show how to use org.jfree.data.time.TimePeriodAnchor#START . 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: OHLCSeriesCollection.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 2
Source File: OHLCSeriesCollection.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 3
Source File: OHLCSeriesCollection.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 4
Source File: OHLCSeriesCollection.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 5
Source File: OHLCSeriesCollection.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 6
Source File: OHLCSeriesCollection.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond(); 
    }
    return result;
}
 
Example 7
Source File: OHLCSeriesCollection.java    From opensim-gui with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond(); 
    }
    return result;
}
 
Example 8
Source File: ExtTimeTableXYDataset.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates a new dataset with the given time zone and locale.
 *
 * @param zone   the time zone to use (<code>null</code> not permitted).
 * @param locale the locale to use (<code>null</code> not permitted).
 */
public ExtTimeTableXYDataset( final TimeZone zone, final Locale locale ) {
  if ( zone == null ) {
    throw new IllegalArgumentException( "Null 'zone' argument." );
  }
  if ( locale == null ) {
    throw new IllegalArgumentException( "Null 'locale' argument." );
  }
  this.values = new DefaultKeyedValues2D( true );
  this.workingCalendar = Calendar.getInstance( zone, locale );
  this.xPosition = TimePeriodAnchor.START;
}
 
Example 9
Source File: ExtTimeTableXYDataset.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @param period the time period.
 * @return The x-value.
 */
private long getXValue( final TimePeriod period ) {
  long result = 0L;
  if ( this.xPosition == TimePeriodAnchor.START ) {
    result = period.getStart().getTime();
  } else if ( this.xPosition == TimePeriodAnchor.MIDDLE ) {
    final long t0 = period.getStart().getTime();
    final long t1 = period.getEnd().getTime();
    result = t0 + ( t1 - t0 ) / 2L;
  } else if ( this.xPosition == TimePeriodAnchor.END ) {
    result = period.getEnd().getTime();
  }
  return result;
}
 
Example 10
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}
 
Example 11
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Returns the x-value for a time period.
 *
 * @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();
    }
    else if (this.xPosition == TimePeriodAnchor.MIDDLE) {
        result = period.getMiddleMillisecond();
    }
    else if (this.xPosition == TimePeriodAnchor.END) {
        result = period.getLastMillisecond();
    }
    return result;
}