View Javadoc

1   /*
2    * Copyright (c) 2003-2008 by Cosylab d. d.
3    *
4    * This file is part of CosyBeans-Common.
5    *
6    * CosyBeans-Common is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * CosyBeans-Common is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with CosyBeans-Common.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package com.cosylab.gui.components.table.cells;
21  
22  import java.awt.Color;
23  
24  
25  /**
26   * PatternCell describes pattern of bits.
27   *
28   * @author <a href="mailto:igor.kriznar@cosylab.com">Igor Kriznar</a>
29   * @version $id$
30   */
31  public class PatternCell extends LongCell
32  {
33  	/**
34  	 * Constructs a new PatternCell.
35  	 *
36  	 */
37  	public PatternCell()
38  	{
39  		super();
40  	}
41  
42  	/**
43  	 * Constructs a new PatternCell.
44  	 *
45  	 * @param identifier
46  	 * @param dataSource
47  	 * @param value
48  	 * @param commands
49  	 */
50  	public PatternCell(String identifier, Object dataSource, long value,
51  	    Command[] commands)
52  	{
53  		super(identifier, dataSource, value, commands);
54  	}
55  
56  	/**
57  	 * Characteristic name for array with colors which are used when bit in
58  	 * value is 1.
59  	 */
60  	public static final String COLORS_WHEN_ON = "colorsWhenOn";
61  
62  	/**
63  	 * Characteristic name for array with colors which are used when bit in
64  	 * value is 0.
65  	 */
66  	public static final String COLORS_WHEN_OFF = "colorsWhenOff";
67  
68  	/**
69  	 * Characteristic  name for array with description strings for each pattern
70  	 * bit.
71  	 */
72  	public static final String DESCRIPTIONS = "descriptions";
73  
74  	/**
75  	 * Returns value of COLORS_WHEN_ON characteristic.
76  	 *
77  	 * @return value of COLORS_WHEN_ON characteristic
78  	 */
79  	public Color[] getColorsWhenOn()
80  	{
81  		return (Color[])getCharacteristic(COLORS_WHEN_ON);
82  	}
83  
84  	/**
85  	 * Returns value of COLORS_WHEN_OFF characteristic.
86  	 *
87  	 * @return value of COLORS_WHEN_OFF characteristic
88  	 */
89  	public Color[] getColorsWhenOff()
90  	{
91  		return (Color[])getCharacteristic(COLORS_WHEN_OFF);
92  	}
93  
94  	/**
95  	 * Returns value of DESCRIPTIONS characteristic.
96  	 *
97  	 * @return value of DESCRIPTIONS characteristic
98  	 */
99  	public String[] getDescriptions()
100 	{
101 		return (String[])getCharacteristic(DESCRIPTIONS);
102 	}
103 }
104 
105 /* __oOo__ */