org.jfree.data.time.TimePeriodAnchor Java Examples

The following examples show how to use org.jfree.data.time.TimePeriodAnchor. 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: TimePeriodValuesCollectionTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Tests the equals() method.
 */
public void testEquals() {
    
    TimePeriodValuesCollection c1 = new TimePeriodValuesCollection();
    TimePeriodValuesCollection c2 = new TimePeriodValuesCollection();
    assertTrue(c1.equals(c2));
    
    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));
    
    TimePeriodValues v1 = new TimePeriodValues("Test");
    TimePeriodValues v2 = new TimePeriodValues("Test");
    
    c1.addSeries(v1);
    assertFalse(c1.equals(c2));
    c2.addSeries(v2);
    assertTrue(c1.equals(c2));
}
 
Example #2
Source File: TimePeriodValuesCollectionTests.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Tests the equals() method.
 */
public void testEquals() {
    
    TimePeriodValuesCollection c1 = new TimePeriodValuesCollection();
    TimePeriodValuesCollection c2 = new TimePeriodValuesCollection();
    assertTrue(c1.equals(c2));
    
    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));
    
    TimePeriodValues v1 = new TimePeriodValues("Test");
    TimePeriodValues v2 = new TimePeriodValues("Test");
    
    c1.addSeries(v1);
    assertFalse(c1.equals(c2));
    c2.addSeries(v2);
    assertTrue(c1.equals(c2));
}
 
Example #3
Source File: OHLCSeriesCollectionTests.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #4
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 #5
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 #6
Source File: OHLCSeriesCollectionTest.java    From buffer_bci with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #7
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 #8
Source File: ExtTimeTableXYDataset.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Sets the position within each time period that is used for the X values, then sends a {@link DatasetChangeEvent} to
 * all registered listeners.
 *
 * @param anchor the anchor position (<code>null</code> not permitted).
 * @see #getXPosition()
 */
public void setXPosition( final TimePeriodAnchor anchor ) {
  if ( anchor == null ) {
    throw new IllegalArgumentException( "Null 'anchor' argument." );
  }
  this.xPosition = anchor;
  notifyListeners( new DatasetChangeEvent( this, this ) );
}
 
Example #9
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 #10
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 #11
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 #12
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 #13
Source File: OHLCSeriesCollectionTest.java    From openstock with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #14
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 #15
Source File: OHLCSeriesCollectionTest.java    From ccu-historian with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #16
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 #17
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 #18
Source File: OHLCSeriesCollectionTest.java    From ECG-Viewer with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #19
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 #20
Source File: OHLCSeriesCollectionTest.java    From SIMVA-SoS with Apache License 2.0 5 votes vote down vote up
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
@Test
public void testEquals() {
    OHLCSeriesCollection c1 = new OHLCSeriesCollection();
    OHLCSeriesCollection c2 = new OHLCSeriesCollection();
    assertEquals(c1, c2);

    // add a series
    OHLCSeries s1 = new OHLCSeries("Series");
    s1.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c1.addSeries(s1);
    assertFalse(c1.equals(c2));
    OHLCSeries s2 = new OHLCSeries("Series");
    s2.add(new Year(2006), 1.0, 1.1, 1.2, 1.3);
    c2.addSeries(s2);
    assertTrue(c1.equals(c2));

    // add an empty series
    c1.addSeries(new OHLCSeries("Empty Series"));
    assertFalse(c1.equals(c2));
    c2.addSeries(new OHLCSeries("Empty Series"));
    assertTrue(c1.equals(c2));

    c1.setXPosition(TimePeriodAnchor.END);
    assertFalse(c1.equals(c2));
    c2.setXPosition(TimePeriodAnchor.END);
    assertTrue(c1.equals(c2));

}
 
Example #21
Source File: TimeSeriesCollectionTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test the getSurroundingItems() method to ensure it is returning the 
 * values we expect.
 */
public void testGetSurroundingItems() {
    
    TimeSeries series = new TimeSeries("Series 1", Day.class);
    TimeSeriesCollection collection = new TimeSeriesCollection(series);
    collection.setXPosition(TimePeriodAnchor.MIDDLE);
    
    // for a series with no data, we expect {-1, -1}...
    int[] result = collection.getSurroundingItems(0, 1000L);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == -1);
    
    // now test with a single value in the series...
    Day today = new Day();
    long start1 = today.getFirstMillisecond();
    long middle1 = today.getMiddleMillisecond();
    long end1 = today.getLastMillisecond();
    
    series.add(today, 99.9);
    result = collection.getSurroundingItems(0, start1);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == 0);
    
    result = collection.getSurroundingItems(0, middle1);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 0);
    
    result = collection.getSurroundingItems(0, end1);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == -1);
    
    // now add a second value to the series...
    Day tomorrow = (Day) today.next();
    long start2 = tomorrow.getFirstMillisecond();
    long middle2 = tomorrow.getMiddleMillisecond();
    long end2 = tomorrow.getLastMillisecond();
    
    series.add(tomorrow, 199.9);
    result = collection.getSurroundingItems(0, start2);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 1);
    
    result = collection.getSurroundingItems(0, middle2);
    assertTrue(result[0] == 1);
    assertTrue(result[1] == 1);
    
    result = collection.getSurroundingItems(0, end2);
    assertTrue(result[0] == 1);
    assertTrue(result[1] == -1);
    
    // now add a third value to the series...
    Day yesterday = (Day) today.previous();
    long start3 = yesterday.getFirstMillisecond();
    long middle3 = yesterday.getMiddleMillisecond();
    long end3 = yesterday.getLastMillisecond();
    
    series.add(yesterday, 1.23);
    result = collection.getSurroundingItems(0, start3);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == 0);
    
    result = collection.getSurroundingItems(0, middle3);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 0);
    
    result = collection.getSurroundingItems(0, end3);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 1);
    
}
 
Example #22
Source File: TimePeriodAnchorTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test the equals() method.
 */
public void testEquals() {
    assertTrue(TimePeriodAnchor.START.equals(TimePeriodAnchor.START));
    assertTrue(TimePeriodAnchor.MIDDLE.equals(TimePeriodAnchor.MIDDLE));
    assertTrue(TimePeriodAnchor.END.equals(TimePeriodAnchor.END));
}
 
Example #23
Source File: TimePeriodAnchorTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test the equals() method.
 */
public void testEquals() {
    assertTrue(TimePeriodAnchor.START.equals(TimePeriodAnchor.START));
    assertTrue(TimePeriodAnchor.MIDDLE.equals(TimePeriodAnchor.MIDDLE));
    assertTrue(TimePeriodAnchor.END.equals(TimePeriodAnchor.END));
}
 
Example #24
Source File: TimeSeriesCollectionTests.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Test the getSurroundingItems() method to ensure it is returning the
 * values we expect.
 */
public void testGetSurroundingItems() {

    TimeSeries series = new TimeSeries("Series 1");
    TimeSeriesCollection collection = new TimeSeriesCollection(series);
    collection.setXPosition(TimePeriodAnchor.MIDDLE);

    // for a series with no data, we expect {-1, -1}...
    int[] result = collection.getSurroundingItems(0, 1000L);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == -1);

    // now test with a single value in the series...
    Day today = new Day();
    long start1 = today.getFirstMillisecond();
    long middle1 = today.getMiddleMillisecond();
    long end1 = today.getLastMillisecond();

    series.add(today, 99.9);
    result = collection.getSurroundingItems(0, start1);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == 0);

    result = collection.getSurroundingItems(0, middle1);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 0);

    result = collection.getSurroundingItems(0, end1);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == -1);

    // now add a second value to the series...
    Day tomorrow = (Day) today.next();
    long start2 = tomorrow.getFirstMillisecond();
    long middle2 = tomorrow.getMiddleMillisecond();
    long end2 = tomorrow.getLastMillisecond();

    series.add(tomorrow, 199.9);
    result = collection.getSurroundingItems(0, start2);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 1);

    result = collection.getSurroundingItems(0, middle2);
    assertTrue(result[0] == 1);
    assertTrue(result[1] == 1);

    result = collection.getSurroundingItems(0, end2);
    assertTrue(result[0] == 1);
    assertTrue(result[1] == -1);

    // now add a third value to the series...
    Day yesterday = (Day) today.previous();
    long start3 = yesterday.getFirstMillisecond();
    long middle3 = yesterday.getMiddleMillisecond();
    long end3 = yesterday.getLastMillisecond();

    series.add(yesterday, 1.23);
    result = collection.getSurroundingItems(0, start3);
    assertTrue(result[0] == -1);
    assertTrue(result[1] == 0);

    result = collection.getSurroundingItems(0, middle3);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 0);

    result = collection.getSurroundingItems(0, end3);
    assertTrue(result[0] == 0);
    assertTrue(result[1] == 1);

}
 
Example #25
Source File: OHLCSeriesCollection.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the position within each time period that is used for the X values
 * when the collection is used as an {@link XYDataset}, then sends a
 * {@link DatasetChangeEvent} is sent to all registered listeners.
 *
 * @param anchor  the anchor position (<code>null</code> not permitted).
 *
 * @since 1.0.11
 */
public void setXPosition(TimePeriodAnchor anchor) {
    if (anchor == null) {
        throw new IllegalArgumentException("Null 'anchor' argument.");
    }
    this.xPosition = anchor;
    fireDatasetChanged(new DatasetChangeInfo());
    //TODO: fill in real change info
}
 
Example #26
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the position within each time period that is used for the X
 * value when the collection is used as an {@link XYDataset}.
 *
 * @return The anchor position (never <code>null</code>).
 *
 * @since 1.0.11
 */
public TimePeriodAnchor getXPosition() {
    return this.xPosition;
}
 
Example #27
Source File: OHLCSeriesCollection.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the position within each time period that is used for the X
 * value when the collection is used as an {@link XYDataset}.
 *
 * @return The anchor position (never <code>null</code>).
 *
 * @since 1.0.11
 */
public TimePeriodAnchor getXPosition() {
    return this.xPosition;
}
 
Example #28
Source File: OHLCSeriesCollection.java    From openstock with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the position within each time period that is used for the X values
 * when the collection is used as an {@link XYDataset}, then sends a
 * {@link DatasetChangeEvent} is sent to all registered listeners.
 *
 * @param anchor  the anchor position (<code>null</code> not permitted).
 *
 * @since 1.0.11
 */
public void setXPosition(TimePeriodAnchor anchor) {
    ParamChecks.nullNotPermitted(anchor, "anchor");
    this.xPosition = anchor;
    notifyListeners(new DatasetChangeEvent(this, this));
}
 
Example #29
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the position within each time period that is used for the X values
 * when the collection is used as an {@link XYDataset}, then sends a
 * {@link DatasetChangeEvent} is sent to all registered listeners.
 *
 * @param anchor  the anchor position (<code>null</code> not permitted).
 *
 * @since 1.0.11
 */
public void setXPosition(TimePeriodAnchor anchor) {
    ParamChecks.nullNotPermitted(anchor, "anchor");
    this.xPosition = anchor;
    notifyListeners(new DatasetChangeEvent(this, this));
}
 
Example #30
Source File: OHLCSeriesCollection.java    From buffer_bci with GNU General Public License v3.0 2 votes vote down vote up
/**
 * Sets the position within each time period that is used for the X values
 * when the collection is used as an {@link XYDataset}, then sends a
 * {@link DatasetChangeEvent} is sent to all registered listeners.
 *
 * @param anchor  the anchor position (<code>null</code> not permitted).
 *
 * @since 1.0.11
 */
public void setXPosition(TimePeriodAnchor anchor) {
    ParamChecks.nullNotPermitted(anchor, "anchor");
    this.xPosition = anchor;
    notifyListeners(new DatasetChangeEvent(this, this));
}