}
}
public void updateButtons() {
Axis timeAxis = plot.getPlotAbstraction().getTimeAxis();
Axis nonTimeAxis = plot.getNonTimeAxis();
Axis xAxis;
Axis yAxis;
if(plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
xAxis = timeAxis;
yAxis = nonTimeAxis;
} else {
xAxis = nonTimeAxis;
yAxis = timeAxis;
}
List<AbstractPlottingPackage> plots = plot.getPlotAbstraction().getSubPlots();
// Only show the top right reset button on the top plot.
if(plots.get(0) == plot) {
// This was changed to fix MCT-2613: [Plot] Top right corner button appears briefly in jump and scrunch modes, between the time that the plot line hits the end of the time axis and when the jump
// The problem was that the jump occurs based on the maximum time plotted, which due to compression, is not the same as the current MCT time.
// As an easy fix, the button is always hidden when the time axis is not pinned.
// Assuming that data should never appear off the right of a jump plot, this works well enough.
// If that assumption breaks, the code should be modified to check against the maximum plotted time instead of the current MCT time.
long now = plot.getPlotAbstraction().getCurrentMCTTime();
if(!timeAxis.isPinned()) {
plot.localControlsManager.setJumpToCurrentTimeButtonVisible(false);
} else if(plot.getMaxTime() < now || plot.getMinTime() > now) {
plot.localControlsManager.setJumpToCurrentTimeButtonAlarm(true);
} else {
plot.localControlsManager.setJumpToCurrentTimeButtonAlarm(false);
}
} else {
plot.localControlsManager.setJumpToCurrentTimeButtonVisible(false);
}
// Only show the time axis reset button on the bottom plot.
boolean enableX = true;
boolean enableY = true;
if(plots.get(plots.size() - 1) != plot) {
if(plot.getAxisOrientationSetting() == AxisOrientationSetting.X_AXIS_AS_TIME) {
enableX = false;
} else {
enableY = false;
}
}
plot.localControlsManager.setXAxisCornerResetButtonVisible(enableX && !xAxis.isInDefaultState());
plot.localControlsManager.setYAxisCornerResetButtonVisible(enableY && !yAxis.isInDefaultState());
plot.localControlsManager.setXAndYAxisCornerResetButtonVisible(!xAxis.isInDefaultState() && !yAxis.isInDefaultState());
}