Skip to content

Commit

Permalink
Fix for eclipse-paho#19 - deleting chart series
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilfb committed Nov 10, 2017
1 parent cbb3850 commit defb1d5
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,8 @@ private void removeSeries()
if (itemToDelete != null)
{
seriesTable.getItems().remove(itemToDelete);
allSeries.remove(itemToDelete);
unpopulateTopicToSeries(itemToDelete);
}
else
{
Expand Down Expand Up @@ -1247,6 +1249,14 @@ private void populateTopicToSeries(final ChartSeriesProperties series)
topicToSeries.get(series.getTopic()).add(series);
}

private void unpopulateTopicToSeries(final ChartSeriesProperties series)
{
if (topicToSeries.get(series.getTopic()) != null)
{
topicToSeries.remove(series.getTopic());
}
}

// public void setSubscription(MqttSubscription subscription)
// {
// this.subscription = subscription;
Expand Down

0 comments on commit defb1d5

Please sign in to comment.