1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.tracecompass
.tmf
.ui
.widgets
.timegraph
;
14 import org
.eclipse
.swt
.graphics
.RGB
;
17 * Class that contains the color of a state and the corresponding state string
21 * @author Bernd Hufmann
23 public class StateItem
{
25 // ------------------------------------------------------------------------
27 // ------------------------------------------------------------------------
29 * Name of state if not known
31 public static final String UNDEFINED_STATE_NAME
= "Undefined"; //$NON-NLS-1$
33 // ------------------------------------------------------------------------
35 // ------------------------------------------------------------------------
39 private RGB fStateColor
;
43 private String fStateString
;
46 // ------------------------------------------------------------------------
48 // ------------------------------------------------------------------------
51 * Creates a state item with given color and unspecified name.
53 * @param stateColor A state color
55 public StateItem(RGB stateColor
) {
56 this(stateColor
, UNDEFINED_STATE_NAME
);
60 * Creates a state color - state string pair.
62 * @param stateColor A state color
63 * @param stateString A state string
65 public StateItem(RGB stateColor
, String stateString
) {
66 fStateColor
= stateColor
;
67 fStateString
= stateString
;
70 // ------------------------------------------------------------------------
72 // ------------------------------------------------------------------------
74 * Returns the state color.
76 * @return Returns the state color.
78 public RGB
getStateColor() {
83 * Sets the state color.
85 * @param stateColor A state color to set
87 public void setStateColor(RGB stateColor
) {
88 fStateColor
= stateColor
;
92 * Returns the state string.
94 * @return the state string.
96 public String
getStateString() {
101 * Sets the state string
102 * @param stateString A state string to set
104 public void setStateString(String stateString
) {
105 fStateString
= stateString
;