Size plotsSize = new Size(
Math.max(deckPanelSize.width, 0),
Math.max(deckPanelSize.height - Toolbar.DEFAULT_HEIGHT, 0));
WorkbenchMetrics metrics = WorkbenchMetrics.create(consoleWidth,
plotsSize.width,
plotsSize.height);
// make sure we don't send very similar metrics values twice (it is
// an expensive operation since it involves at least 2 http requests)
if (!metrics.closeEnoughToPrevious(lastMetrics_))
{
lastMetrics_ = metrics;
eventBus_.fireEvent(new WorkbenchMetricsChangedEvent(metrics));
}