Package org.jfree.data.time

Examples of org.jfree.data.time.Second


        Locale saved = Locale.getDefault();
        Locale.setDefault(Locale.ITALY);
        Calendar cal = Calendar.getInstance(Locale.ITALY);
        cal.set(2006, Calendar.JANUARY, 16, 3, 47, 55);
        cal.set(Calendar.MILLISECOND, 999);
        Second s = new Second(55, 47, 3, 16, 1, 2006);
        assertEquals(cal.getTime(), s.getEnd());
        Locale.setDefault(saved);
    }
View Full Code Here


     * A basic check for the testPreviousStandardDate() method when the
     * tick unit is 1 second.
     */
    public void testPreviousStandardDateSecondA() {
        MyDateAxis axis = new MyDateAxis("Second");
        Second s0 = new Second(58, 31, 12, 1, 4, 2007);
        Second s1 = new Second(59, 31, 12, 1, 4, 2007);

        // five dates to check...
        Date d0 = new Date(s0.getFirstMillisecond());
        Date d1 = new Date(s0.getFirstMillisecond() + 50L);
        Date d2 = new Date(s0.getMiddleMillisecond());
        Date d3 = new Date(s0.getMiddleMillisecond() + 50L);
        Date d4 = new Date(s0.getLastMillisecond());

        Date end = new Date(s1.getLastMillisecond());

        DateTickUnit unit = new DateTickUnit(DateTickUnit.SECOND, 1);
        axis.setTickUnit(unit);

        // START: check d0 and d1
View Full Code Here

     * A basic check for the testPreviousStandardDate() method when the
     * tick unit is 5 seconds (just for the sake of having a multiple).
     */
    public void testPreviousStandardDateSecondB() {
        MyDateAxis axis = new MyDateAxis("Second");
        Second s0 = new Second(58, 31, 12, 1, 4, 2007);
        Second s1 = new Second(59, 31, 12, 1, 4, 2007);

        // five dates to check...
        Date d0 = new Date(s0.getFirstMillisecond());
        Date d1 = new Date(s0.getFirstMillisecond() + 50L);
        Date d2 = new Date(s0.getMiddleMillisecond());
        Date d3 = new Date(s0.getMiddleMillisecond() + 50L);
        Date d4 = new Date(s0.getLastMillisecond());

        Date end = new Date(s1.getLastMillisecond());

        DateTickUnit unit = new DateTickUnit(DateTickUnit.SECOND, 5);
        axis.setTickUnit(unit);

        // START: check d0 and d1
View Full Code Here

        for (int i = 0; i < _targets.length; i++) {
            TimeSeries ts = new TimeSeries(_targets[i].getName(), Second.class);
            Date[] times = _xDate[i];
            double[] elevations = _yData[i];
            for (int j = 0; j < numSteps; j++) {
                ts.add(new Second(times[j], _timeZone), elevations[j]);
            }
            tsc.addSeries(ts);
        }
        return tsc;
    }
View Full Code Here

        for (int i = 0; i < _targets.length; i++) {
            TimeSeries ts = new TimeSeries(_targets[i].getName(), Second.class);
            Date[] times = _xDate[i];
            double[] pa = _yDataPa[i];
            for (int j = 0; j < numSteps; j++) {
                ts.add(new Second(times[j], _timeZone), pa[j]);
            }
            tsc.addSeries(ts);
        }
        return tsc;
    }
View Full Code Here

        while (_sampling)
    {
      try
      {
        Second now = new Second(new Date());
        Integer numberOfTransactions = (Integer)TransactionServiceMX.getTransactionServiceMX().getAgentInterface().getAgent().getAttribute(new ObjectName(objectName), "NumberOfTransactions");
              _dataSeries[NUMBER_OF_TRANSACTIONS_SERIES].add(now, numberOfTransactions.intValue());

        Integer numberOfNestedTransactions = (Integer)TransactionServiceMX.getTransactionServiceMX().getAgentInterface().getAgent().getAttribute(new ObjectName(objectName), "NumberOfNestedTransactions");
        _dataSeries[NUMBER_OF_NESTED_TRANSACTIONS_SERIES].add(now, numberOfNestedTransactions.intValue());
View Full Code Here

    private void addMemoryDataPoint()
    {
        MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
        double usedMegabytes = (double) heapUsage.getUsed() / MEGABYTE;
        Second second = new Second();
        memoryUsageSeries.add(second, usedMegabytes);
        heapSizeSeries.add(second, (double) heapUsage.getCommitted() / MEGABYTE);
    }
View Full Code Here

          int groupSize = getGroupSize(node);
          if (groupSize > 1) {
            series.clear();
            updateSeries(series, node, groupSize);
          } else {
            series.addOrUpdate(new Second(new Date(data.getNodeTime())), getSensorDataValue(data));
          }
          chartPanel.repaint();
          break;
        }
      }
View Full Code Here

        if (groupSize > 1) {
          updateSeries(series, node, groupSize);
        } else {
          for (int i = 0, n = node.getSensorDataCount(); i < n; i++) {
            SensorData data = node.getSensorData(i);
            series.addOrUpdate(new Second(new Date(data.getNodeTime())), getSensorDataValue(data));
          }
        }
        timeSeries.addSeries(series);
      }
    }
View Full Code Here

      for (int j = 0; j < groupSize; j++) {
        SensorData data = node.getSensorData(i);
        value += getSensorDataValue(data);
        time += data.getNodeTime() / 1000L;
      }
      series.addOrUpdate(new Second(new Date((time / groupSize) * 1000L)), value / groupSize);
    }
  }
View Full Code Here

TOP

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

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.