tmf: Rename packages to org.eclipse.tracecompass.*
[deliverable/tracecompass.git] / org.eclipse.tracecompass.tmf.ui / src / org / eclipse / tracecompass / tmf / ui / widgets / timegraph / StateItem.java
1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
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 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org.eclipse.tracecompass.tmf.ui.widgets.timegraph;
13
14 import org.eclipse.swt.graphics.RGB;
15
16 /**
17 * Class that contains the color of a state and the corresponding state string
18 * to display.
19 *
20 * @version 1.0
21 * @author Bernd Hufmann
22 */
23 public class StateItem {
24
25 // ------------------------------------------------------------------------
26 // Constants
27 // ------------------------------------------------------------------------
28 /**
29 * Name of state if not known
30 */
31 public static final String UNDEFINED_STATE_NAME = "Undefined"; //$NON-NLS-1$
32
33 // ------------------------------------------------------------------------
34 // Attributes
35 // ------------------------------------------------------------------------
36 /**
37 * The State color
38 */
39 private RGB fStateColor;
40 /**
41 * The State string.
42 */
43 private String fStateString;
44
45
46 // ------------------------------------------------------------------------
47 // Constructors
48 // ------------------------------------------------------------------------
49
50 /**
51 * Creates a state item with given color and unspecified name.
52 *
53 * @param stateColor A state color
54 */
55 public StateItem(RGB stateColor) {
56 this(stateColor, UNDEFINED_STATE_NAME);
57 }
58
59 /**
60 * Creates a state color - state string pair.
61 *
62 * @param stateColor A state color
63 * @param stateString A state string
64 */
65 public StateItem(RGB stateColor, String stateString) {
66 fStateColor = stateColor;
67 fStateString = stateString;
68 }
69
70 // ------------------------------------------------------------------------
71 // Accessors
72 // ------------------------------------------------------------------------
73 /**
74 * Returns the state color.
75 *
76 * @return Returns the state color.
77 */
78 public RGB getStateColor() {
79 return fStateColor;
80 }
81
82 /**
83 * Sets the state color.
84 *
85 * @param stateColor A state color to set
86 */
87 public void setStateColor(RGB stateColor) {
88 fStateColor = stateColor;
89 }
90
91 /**
92 * Returns the state string.
93 *
94 * @return the state string.
95 */
96 public String getStateString() {
97 return fStateString;
98 }
99
100 /**
101 * Sets the state string
102 * @param stateString A state string to set
103 */
104 public void setStateString(String stateString) {
105 fStateString = stateString;
106 }
107 }
This page took 0.034858 seconds and 6 git commands to generate.