1 /*******************************************************************************
2 * Copyright (c) 2015, 2016 EfficiOS Inc., Alexandre Montplaisir
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
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.provisional
.analysis
.lami
.core
.module
;
12 import java
.util
.List
;
14 import com
.google
.common
.collect
.ImmutableList
;
17 * UI Model of a LAMI chart. This object should contain all the information
18 * needed to create a chart in the GUI, independently of the actual chart
21 * @author Alexandre Montplaisir
23 public class LamiChartModel
{
26 * Supported types of charts
28 public enum ChartType
{
30 BAR_CHART("Bar"), //$NON-NLS-1$
32 /** XY scatter chart */
33 XY_SCATTER("Scatter"), //$NON-NLS-1$
39 PIE_CHART("Pie"); //$NON-NLS-1$
41 private final String fText
;
43 private ChartType(final String text
) {
48 public String
toString() {
53 private final ChartType fType
;
54 private final String fName
;
55 private final List
<String
> fXSeriesColumns
;
56 private final List
<String
> fYSeriesColumns
;
57 private final boolean fXAxisIsLog
;
58 private final boolean fYAxisIsLog
;
67 * The name of the chart
68 * @param xSeriesColumn
69 * The title of column used for the X axis
70 * @param ySeriesColumns
71 * The titles of the columns used for the series
73 * If the X-axis is log scale or not
75 * If the Y-axis is log scale or not
77 public LamiChartModel(ChartType type
, String name
, List
<String
> xSeriesColumn
, List
<String
> ySeriesColumns
,
78 boolean xAxisIsLog
, boolean yAxisIsLog
) {
81 fXSeriesColumns
= ImmutableList
.copyOf(xSeriesColumn
);
82 fYSeriesColumns
= ImmutableList
.copyOf(ySeriesColumns
);
83 fXAxisIsLog
= xAxisIsLog
;
84 fYAxisIsLog
= yAxisIsLog
;
90 * @return The chart type
92 public ChartType
getChartType() {
97 * Get the chart's name.
99 * @return The chart name
101 public String
getName() {
106 * Get the names of the columns used for the X part of a series.
108 * @return The columns used for the X-axis
110 public List
<String
> getXSeriesColumns() {
111 return fXSeriesColumns
;
115 * Get the names of the columns used for the Y part of a series.
117 * @return The columns used for the series
119 public List
<String
> getYSeriesColumns() {
120 return fYSeriesColumns
;
124 * Return if the X-axis should use a log scale.
126 * @return If the X-axis is log scale
128 public boolean xAxisIsLog() {
133 * Return if the Y-axis should use a log scale.
135 * @return If Y-axis is log scale
137 public boolean yAxisIsLog() {
This page took 0.035259 seconds and 5 git commands to generate.