1 /**********************************************************************
2 * Copyright (c) 2012 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
.linuxtools
.tmf
.ui
.widgets
.timegraph
;
14 import org
.eclipse
.swt
.graphics
.RGB
;
18 * Class that contains the color of a state and the corresponding state string to display.
21 public class StateItem
{
23 // ------------------------------------------------------------------------
25 // ------------------------------------------------------------------------
27 * Name of state if not known
29 public static final String UNDEFINED_STATE_NAME
= "Undefined"; //$NON-NLS-1$
31 // ------------------------------------------------------------------------
33 // ------------------------------------------------------------------------
37 private RGB fStateColor
;
41 private String fStateString
;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
49 * Creates a state item with given color and unspecified name.
51 * @param stateColor A state color
53 public StateItem(RGB stateColor
) {
54 this(stateColor
, UNDEFINED_STATE_NAME
);
58 * Creates a state color - state string pair.
60 * @param stateColor A state color
61 * @param stateString A state string
63 public StateItem(RGB stateColor
, String stateString
) {
64 fStateColor
= stateColor
;
65 fStateString
= stateString
;
68 // ------------------------------------------------------------------------
70 // ------------------------------------------------------------------------
72 * Returns the state color.
74 * @return Returns the state color.
76 public RGB
getStateColor() {
81 * Sets the state color.
83 * @param stateColor A state color to set
85 public void setStateColor(RGB stateColor
) {
86 fStateColor
= stateColor
;
90 * Returns the state string.
92 * @return the state string.
94 public String
getStateString() {
99 * Sets the state string
100 * @param stateString A state string to set
102 public void setStateString(String stateString
) {
103 fStateString
= stateString
;