Commit | Line | Data |
---|---|---|
fbd124dd | 1 | /******************************************************************************* |
ed902a2b | 2 | * Copyright (c) 2011, 2014 Ericsson |
57a2a5ca | 3 | * |
fbd124dd BH |
4 | * All rights reserved. This program and the accompanying materials are |
5 | * made available under the terms of the Eclipse Public License v1.0 which | |
6 | * accompanies this distribution, and is available at | |
7 | * http://www.eclipse.org/legal/epl-v10.html | |
57a2a5ca | 8 | * |
fbd124dd BH |
9 | * Contributors: |
10 | * Bernd Hufmann - Initial API and implementation | |
e0752744 | 11 | * Francois Chouinard - Moved from LTTng to TMF |
2fc582d2 | 12 | * Xavier Raynaud - Support multi-trace coloring |
fbd124dd | 13 | *******************************************************************************/ |
e0752744 | 14 | |
2bdf0193 | 15 | package org.eclipse.tracecompass.tmf.ui.views.histogram; |
e0752744 | 16 | |
2bdf0193 AM |
17 | import org.eclipse.tracecompass.tmf.core.trace.ITmfTrace; |
18 | import org.eclipse.tracecompass.tmf.ui.views.distribution.model.IBaseDistributionModel; | |
fbd124dd BH |
19 | |
20 | /** | |
b544077e | 21 | * Histogram data model interface. |
57a2a5ca | 22 | * |
b544077e BH |
23 | * @version 1.0 |
24 | * @author Bernd Hufmann | |
fbd124dd | 25 | */ |
fbd124dd BH |
26 | public interface IHistogramDataModel extends IBaseDistributionModel { |
27 | /** | |
28 | * Add event to the correct bucket, compacting the if needed. | |
57a2a5ca BH |
29 | * |
30 | * @param eventCount the event to count | |
fbd124dd | 31 | * @param timestamp the timestamp of the event to count |
2fc582d2 XR |
32 | * @param trace the trace corresponding to given events |
33 | * @since 3.0 | |
fbd124dd | 34 | */ |
2fc582d2 XR |
35 | void countEvent(long eventCount, long timestamp, ITmfTrace trace); |
36 | ||
fbd124dd BH |
37 | /** |
38 | * Scale the model data to the width, height and bar width requested. | |
b544077e BH |
39 | * |
40 | * @param width A width of the histogram canvas | |
41 | * @param height A height of the histogram canvas | |
42 | * @param barWidth A width (in pixel) of a histogram bar | |
43 | * @return the result array of size [width] and where the highest value doesn't exceed [height] | |
44 | * while considering the bar width [barWidth] | |
fbd124dd | 45 | */ |
57a2a5ca | 46 | HistogramScaledData scaleTo(int width, int height, int barWidth); |
e0752744 | 47 | |
fbd124dd | 48 | } |