01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.common;
05:
06: import org.jfree.data.time.Second;
07:
08: import com.tc.admin.ConnectionContext;
09: import com.tc.stats.statistics.DoubleStatistic;
10: import com.tc.stats.statistics.Statistic;
11:
12: import java.util.Date;
13:
14: public class DoubleStatisticPanel extends StatisticPanel {
15: private Date date = new Date();
16:
17: public DoubleStatisticPanel(ConnectionContext cc) {
18: super (cc);
19: }
20:
21: public void setStatistic(Statistic stat) {
22: super .setStatistic(stat);
23:
24: DoubleStatistic doubleStat = (DoubleStatistic) stat;
25: long ts = doubleStat.getLastSampleTime();
26: double value = doubleStat.getDoubleValue();
27:
28: date.setTime(ts);
29:
30: getTimeSeries().addOrUpdate(new Second(date), value);
31: }
32:
33: public void tearDown() {
34: super.tearDown();
35: date = null;
36: }
37: }
|