custom charts: Add classes for describing a chart
[deliverable/tracecompass.git] / tmf / org.eclipse.tracecompass.tmf.chart.core / src / org / eclipse / tracecompass / internal / provisional / tmf / chart / core / chart / ChartModel.java
1 /*******************************************************************************
2 * Copyright (c) 2016 École Polytechnique de Montréal
3 *
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 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.provisional.tmf.chart.core.chart;
11
12 /**
13 * This object should contain all the information needed to create a chart in
14 * the GUI, independently of the actual chart implementation.
15 *
16 * @author Gabriel-Andrew Pollo-Guilbert
17 */
18 public class ChartModel {
19
20 // ------------------------------------------------------------------------
21 // Members
22 // ------------------------------------------------------------------------
23
24 private final ChartType fType;
25 private final String fTitle;
26 private final boolean fXLogscale;
27 private final boolean fYLogscale;
28
29 // ------------------------------------------------------------------------
30 // Constructors
31 // ------------------------------------------------------------------------
32
33 /**
34 * Constructor.
35 *
36 * @param type
37 * The type of the chart
38 * @param title
39 * The title of the chart
40 * @param xlog
41 * Whether X axis is logarithmic
42 * @param ylog
43 * Whether Y axis is logarithmic
44 */
45 public ChartModel(ChartType type, String title, boolean xlog, boolean ylog) {
46 fType = type;
47 fTitle = title;
48 fXLogscale = xlog;
49 fYLogscale = ylog;
50 }
51
52 // ------------------------------------------------------------------------
53 // Accessors
54 // ------------------------------------------------------------------------
55
56 /**
57 * Accessor that returns the type of the chart.
58 *
59 * @return The chart type
60 */
61 public ChartType getChartType() {
62 return fType;
63 }
64
65 /**
66 * Accessor that returns the title of the chart.
67 *
68 * @return The title of the chart
69 */
70 public String getTitle() {
71 return fTitle;
72 }
73
74 /**
75 * Accessor that returns whether X axis is logarithmic.
76 *
77 * @return Whether X axis is logarithmic
78 */
79 public boolean isXLogscale() {
80 return fXLogscale;
81 }
82
83 /**
84 * Accessor that returns whether Y axis is logarithmic.
85 *
86 * @return Whether Y axis is logarithmic
87 */
88 public boolean isYLogscale() {
89 return fYLogscale;
90 }
91
92 }
This page took 0.042032 seconds and 5 git commands to generate.