Package org.jfree.data.time

Examples of org.jfree.data.time.RegularTimePeriod


     */
    public void testClone() {

        TimeSeries series = new TimeSeries("Test Series");

        RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
        try {
            series.add(jan1st2002, new Integer(42));
        }
        catch (SeriesException e) {
            System.err.println("Problem adding to series.");
View Full Code Here


        s2.setKey("Time Series 1");
        boolean b2 = s1.equals(s2);
        assertTrue("b2", b2);

        RegularTimePeriod p1 = new Day();
        RegularTimePeriod p2 = p1.next();
        s1.add(p1, 100.0);
        s1.add(p2, 200.0);
        boolean b3 = s1.equals(s2);
        assertFalse("b3", b3);
View Full Code Here

     */
    public void testClone() {

        TimeSeries series = new TimeSeries("Test Series");

        RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
        try {
            series.add(jan1st2002, new Integer(42));
        }
        catch (SeriesException e) {
            System.err.println("Problem adding to series.");
View Full Code Here

        s2.setKey("Time Series 1");
        boolean b2 = s1.equals(s2);
        assertTrue("b2", b2);

        RegularTimePeriod p1 = new Day();
        RegularTimePeriod p2 = p1.next();
        s1.add(p1, 100.0);
        s1.add(p2, 200.0);
        boolean b3 = s1.equals(s2);
        assertFalse("b3", b3);
View Full Code Here

        }
        if (data instanceof XisSymbolic) {
            xStr = ((XisSymbolic) data).getXSymbolicValue(series, item);
        }
        else if (data instanceof TimeSeriesCollection) {
            RegularTimePeriod p
                = ((TimeSeriesCollection) data).getSeries(series)
                    .getTimePeriod(item);
            xStr = p.toString();
        }
        else {
            double x = data.getXValue(series, item);
            xStr = Double.toString(round(x, 2));
        }
View Full Code Here

     */
    public void testClone() {

        TimePeriodValues series = new TimePeriodValues("Test Series");

        RegularTimePeriod jan1st2002 = new Day(1, MonthConstants.JANUARY, 2002);
        try {
            series.add(jan1st2002, new Integer(42));
        }
        catch (SeriesException e) {
            System.err.println("Problem adding to collection.");
View Full Code Here

        s1.setRangeDescription(null);
        assertFalse(s1.equals(s2));
        s2.setRangeDescription(null);
        assertTrue(s1.equals(s2));

        RegularTimePeriod p1 = new Day();
        RegularTimePeriod p2 = p1.next();
        s1.add(p1, 100.0);
        s1.add(p2, 200.0);
        boolean b3 = s1.equals(s2);
        assertFalse("b3", b3);
View Full Code Here

    /**
     * A test for bug report 1161329.
     */
    public void test1161329() {
        TimePeriodValues tpv = new TimePeriodValues("Test");
        RegularTimePeriod t = new Day();
        tpv.add(t, 1.0);
        t = t.next();
        tpv.add(t, 2.0);
        tpv.delete(0, 1);
        assertEquals(0, tpv.getItemCount());
        tpv.add(t, 2.0);
        assertEquals(1, tpv.getItemCount());
View Full Code Here

     * Creates a time series for testing.
     *
     * @return A time series.
     */
    private TimeSeries createSeries() {
        RegularTimePeriod t = new Day();
        TimeSeries series = new TimeSeries("Test");
        series.add(t, 1.0);
        t = t.next();
        series.add(t, 2.0);
        t = t.next();
        series.add(t, null);
        t = t.next();
        series.add(t, 4.0);
        return series;
    }
View Full Code Here

      chartElement.addElement( "height" ).setText( Integer.toString( height ) ); //$NON-NLS-1$
      for ( int row = 0; row < chartDataDefinition.getSeriesCount(); row++ ) {
        for ( int column = 0; column < chartDataDefinition.getItemCount( row ); column++ ) {
          Number value = chartDataDefinition.getY( row, column );
          Comparable rowKey = chartDataDefinition.getSeriesKey( row );
          RegularTimePeriod columnKey = chartDataDefinition.getSeries( row ).getTimePeriod( column );
          Element valueElement = chartElement.addElement( "value2D" ); //$NON-NLS-1$
          valueElement.addElement( "value" ).setText( value.toString() ); //$NON-NLS-1$
          valueElement.addElement( "row-key" ).setText( rowKey.toString() ); //$NON-NLS-1$
          valueElement.addElement( "column-key" ).setText( columnKey.toString() ); //$NON-NLS-1$
        }
      }
      String mapString = ImageMapUtilities.getImageMap( mapName, info );
      chartElement.addElement( "imageMap" ).setText( mapString ); //$NON-NLS-1$
      chartElement.addElement( "image" ).setText( fileName ); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.jfree.data.time.RegularTimePeriod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.