Clear the tracker data point also when clearing graphs

This commit is contained in:
zzz
2022-01-20 11:03:57 -05:00
parent dc389b6546
commit 80d74fd590
10 changed files with 55 additions and 8 deletions

View File

@ -5,6 +5,8 @@
* Layout fixes and adjustments
* Fixes for long translated strings
* Fixes for i2pd
* Fix IPv6 address host
* Fix tray icon on Gnome
* Graph adjustments
* Localize time format on graphs
* Move Settings from a popup frame to a new tab
@ -15,9 +17,12 @@
* Clear graph after changing router host/port
* Don't clear graph when user closes the window
* Update to jchart2d 3.2.2 2011-09-25
* Disable reseed monitor
* Remove debug output
* Refactoring
* README updates
* Pulled in new and updated translations
* Preliminary changes for plugin version
0.0.3 - 2015-03-02

View File

@ -4,8 +4,6 @@ import java.awt.Color;
import java.awt.EventQueue;
import java.util.EnumMap;
import info.monitorenter.gui.chart.Chart2D;
import info.monitorenter.gui.chart.ITrace2D;
import info.monitorenter.gui.chart.views.ChartPanel;
import javax.swing.BorderFactory;
@ -166,12 +164,8 @@ public class OverviewTab extends TabLogoPanel {
* @since 0.0.4
*/
public void clearGraphs() {
for (ITrace2D trace : bwChart.getTraces()) {
trace.removeAllPoints();
}
for (ITrace2D trace : partTunnelChart.getTraces()) {
trace.removeAllPoints();
}
bwChart.clearData();
partTunnelChart.clearData();
}
private void populateInfo(){

View File

@ -90,6 +90,17 @@ public class BandwidthChart extends Chart2D{
bwOutAdapter = new ObjRecorder2Trace2DAdapter(dataBWOut, bwOutTracker, "m_value", updateInterval/2);
}
/**
* @since 0.0.4
*/
public void clearData() {
bwInTracker.clearData();
bwOutTracker.clearData();
for (ITrace2D trace : getTraces()) {
trace.removeAllPoints();
}
}
@Override
public void destroy() {
bwInTracker.kill();

View File

@ -76,6 +76,16 @@ public class ParticipatingTunnelsChart extends Chart2D {
partTunnelAdapter = new ObjRecorder2Trace2DAdapter(dataPartTunnels, partTunnelTracker, "m_value", updateInterval/2);
}
/**
* @since 0.0.4
*/
public void clearData() {
partTunnelTracker.clearData();
for (ITrace2D trace : getTraces()) {
trace.removeAllPoints();
}
}
@Override
public void destroy() {
partTunnelTracker.kill();

View File

@ -66,4 +66,9 @@ public class DummyDataCollector extends Thread implements Tracker {
* @since 0.0.4
*/
public double getData() { return m_number; }
/**
* @since 0.0.4
*/
public void clearData() { m_number = 0; }
}

View File

@ -71,4 +71,9 @@ public class InboundBandwidthTracker extends Thread implements Tracker {
* @since 0.0.4
*/
public double getData() { return m_value; }
/**
* @since 0.0.4
*/
public void clearData() { m_value = 0; }
}

View File

@ -70,4 +70,9 @@ public class OutboundBandwidthTracker extends Thread implements Tracker {
* @since 0.0.4
*/
public double getData() { return m_value; }
/**
* @since 0.0.4
*/
public void clearData() { m_value = 0; }
}

View File

@ -71,4 +71,9 @@ public class ParticipatingTunnelsTracker extends Thread implements Tracker {
* @since 0.0.4
*/
public double getData() { return m_value; }
/**
* @since 0.0.4
*/
public void clearData() { m_value = 0; }
}

View File

@ -60,4 +60,9 @@ public class RateStatTracker extends Thread implements Tracker {
* @since 0.0.4
*/
public double getData() { return m_value; }
/**
* @since 0.0.4
*/
public void clearData() { m_value = 0; }
}

View File

@ -6,4 +6,6 @@ package net.i2p.itoopie.gui.component.chart;
public interface Tracker {
public double getData();
public void clearData();
}