Skip to content
Snippets Groups Projects
Commit 76ca5c23 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

display duration bug correction (CONTROLGUI-390)

parent 7a00f856
No related branches found
No related tags found
No related merge requests found
......@@ -74,13 +74,9 @@ public class CometeTrendController {
keyMap = new ConcurrentHashMap<>();
refreshingMap = new HashMap<>();
colorRotationTool = new ColorUtils();
chartProperties = new ChartProperties();
chartProperties.setAutoHighlightOnLegend(true);
chartProperties.setLegendVisible(true);
chartProperties.setDisplayDuration(AbstractHistoryDataSource.DEFAULT_HISTORY_DEPTH);
refreshingPeriod = TrendFile.DEFAULT_REFRESHING_PERIOD;
historyDepth = AbstractHistoryDataSource.DEFAULT_HISTORY_DEPTH;
chartProperties = generateChartProperties();
refreshingPeriod = TrendFile.DEFAULT_REFRESHING_PERIOD;
attributeList = new ArrayList<>();
defaultTrendFile = new TrendFile(ObjectUtils.EMPTY_STRING, this);
trendFile = new TrendFile(ObjectUtils.EMPTY_STRING, this);
......@@ -91,7 +87,7 @@ public class CometeTrendController {
ChartProperties chartProperties = new ChartProperties();
chartProperties.setAutoHighlightOnLegend(true);
chartProperties.setLegendVisible(true);
chartProperties.setDisplayDuration(AbstractHistoryDataSource.DEFAULT_HISTORY_DEPTH);
chartProperties.setDisplayDuration(getHistoryDepth(Double.NaN));
return chartProperties;
}
......@@ -437,7 +433,7 @@ public class CometeTrendController {
public long getHistoryDepth(double displayDuration) {
long depth;
if (displayDuration <= 0 || Double.isNaN(displayDuration) || Double.isInfinite(displayDuration)) {
if (Double.isNaN(displayDuration) || displayDuration <= 0 || Double.isInfinite(displayDuration)) {
depth = historyDepth;
} else {
depth = (long) displayDuration;
......
......@@ -55,20 +55,21 @@ public class ChartPanel extends JPanel implements ITrendFileListener, IChartView
public ChartPanel(CometeTrendController controller) {
super(new BorderLayout());
this.controller = controller;
controller.addTrendFileListener(this);
dataAccumulator = new DataAccumulator();
groupListener = new AttributeGroupListener();
controller.registerGroupListener(groupListener);
chart = new TrendChart();
chart.setAutoHighlightOnLegend(true);
chart.addChartViewerListener(this);
chartBox = new ChartViewerBox();
if (CometeTrendController.GROUPED_REFRESHING) {
chartBox.setSynchronTransmission(dataAccumulator, true);
}
// listeners (especially TrendFileListener) must be registered after Chart creation (see CONTROLGUI-390)
controller.registerGroupListener(groupListener);
controller.addTrendFileListener(this);
add(chart, BorderLayout.CENTER);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment