Package org.jfree.data.time

Examples of org.jfree.data.time.Millisecond


        return chart;
    }

    public void updateMonitorGraph(double pulse) {
        pulseTimeSeries.removeAgedItems(false);
        pulseTimeSeries.addOrUpdate(new Millisecond(), pulse);
    }
View Full Code Here


    private void createChart(UsageDataFrame points, String title) {
        series = new TimeSeries(title);

        for (UsageData d : points.getData()) {
            Date resultdate = d.getDateTime();
            Millisecond ms_read = new Millisecond(resultdate);
            int poweredValue = -1;
            if (d.getObjBehavior().equalsIgnoreCase("powered")) {
                poweredValue = d.getObjValue().equalsIgnoreCase("true") ? 1 : 0;
            } else if (d.getObjBehavior().equalsIgnoreCase("brigthness")) {
                try {
View Full Code Here

    }

    public void addDataFromEvent(EventTemplate ev) {
        Date d = new Date(ev.getCreation());
        Millisecond ms_read = new Millisecond(d);
        int valut = ev.getProperty("object.behavior.powered").equalsIgnoreCase("true") ? 1 : 0;
        series.addOrUpdate(ms_read, valut);
        chart.fireChartChanged();

    }
View Full Code Here

            final TimeSeries series = new TimeSeries("Data1", Millisecond.class);


            while (rs.next()) {
                Date resultdate = new Date(rs.getLong("date") * 1000);
                Millisecond ms_read = new Millisecond(resultdate);
                series.addOrUpdate(ms_read, rs.getDouble("value"));
                //series.add((Millisecond)rs.getLong("date"),(double)rs.getLong("value"));
            }
            XYDataset xyDataset = new TimeSeriesCollection(series);

View Full Code Here

    public EmptyDatasetPlaceholder() {
        TimeSeriesEx timeSeries = new TimeSeriesEx("");
        Daytime endTime = new Daytime(new Date());
        Daytime startTime = endTime.addMinute(-5);
        timeSeries.add(new Millisecond(startTime.usec / 1000, startTime.second, startTime.minute, startTime.hour, startTime.date, startTime.month, startTime.year), 0);
        timeSeries.add(new Millisecond(endTime.usec / 1000, endTime.second, endTime.minute, endTime.hour, endTime.date, endTime.month, endTime.year), 1000);
        addSeries(timeSeries);
    }
View Full Code Here

    @Override
    public void addDataPointToSeries(SeriesDefinition seriesDefinition, SeriesRow row)
    {
        Date x = row.dimensionAsDate(0);
        double y = row.dimensionAsDouble(1);
        RegularTimePeriod jfreeChartDate = new Millisecond(x);
        _timeSeries.add(jfreeChartDate, y);
    }
View Full Code Here

        public StatisticsData call() {
            int i = 0;
            DebugTimespend.start("prepare dataset for" + pointData.getName() + " " + timespan + this.hashCode());
            for (int value : values) {
                Daytime tmpTime = startTime.addMillisec(i * timespan);
                Millisecond millis = new Millisecond(tmpTime.usec / 1000, tmpTime.second, tmpTime.minute, tmpTime.hour, tmpTime.date, tmpTime.month, tmpTime.year);
                timeSeries.add(millis, value, false);
                i++;
            }
            DebugTimespend.end("prepare dataset for" + pointData.getName() + " " + timespan + this.hashCode());
            return pointData;
View Full Code Here

   *
   * @param
   */
  public void addObservation(double y, int series_nr) {
           
    series[series_nr].addOrUpdate(new Millisecond(), y);
               
              
  }
View Full Code Here

               
              
  }
  public void addObservations(double par_value[], int nr_values) {
              for(int i=0; i<nr_values; i++){
    series[i].addOrUpdate(new Millisecond(), par_value[i]);

              }
               
              //  series[0].setNotify(true);
               // series[0].fireSeriesChanged();
View Full Code Here

    /**
     * Some checks for the getFirstMillisecond(TimeZone) method.
     */
    public void testGetFirstMillisecondWithCalendar() {
        Millisecond m = new Millisecond(500, 55, 40, 2, 15, 4, 2000);
        GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
        calendar.setTimeZone(TimeZone.getTimeZone("Europe/Frankfurt"));
        assertEquals(955766455500L, m.getFirstMillisecond(calendar));

        // try null calendar
        boolean pass = false;
        try {
            m.getFirstMillisecond((Calendar) null);
        }
        catch (NullPointerException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

TOP

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

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.