View Javadoc

1   /*
2    * Copyright (c) 2003-2008 by Cosylab d. d.
3    *
4    * This file is part of CosyBeans.
5    *
6    * CosyBeans 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 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.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  
20  package com.cosylab.gui.displayers;
21  
22  /**
23   * A specialization of <code>Displayer</code> interface for Java primitive type
24   * long.
25   *
26   * @author <a href="mailto:igor.kriznar@cosylab.com">Igor Kriznar</a>
27   * @version $id$
28   */
29  public interface LongDisplayer extends Displayer, LongConsumer
30  {
31  	/**
32  	 * Sets the value displayed by the displayer. This method may be invoked
33  	 * only by the adapter delivering a new value from the modeling layer.
34  	 *
35  	 * @param value new value to be displayed
36  	 */
37  	void setValue(long value);
38  
39  	/**
40  	 * Gets the value displayed by the displayer. This method can be invoked by
41  	 * any object and will probably most often be invoked by the GUI rendition
42  	 * code.
43  	 *
44  	 * @return long currently displayed value
45  	 */
46  	public long getValue();
47  
48  	/**
49  	 * Returns the lower limit for the value used to render the display. This
50  	 * lower limit must be lower or equal to the actual limit that the value
51  	 * can take. If may only be lower (and not equal) in order to round the
52  	 * minimum to some easily depictable value.
53  	 *
54  	 * @return long the lower limit for the value rendition
55  	 */
56  	public long getMinimum();
57  
58  	/**
59  	 * Returns the upper limit for the value used to render the display. This
60  	 * upper limit  must be greater or equal to the actual upper limit that
61  	 * the value can take. It may only be greater (and not equal) in order to
62  	 * round the maximum to some easiliy depictable value.
63  	 *
64  	 * @return long the upper limit for the value rendition
65  	 */
66  	public long getMaximum();
67  
68  	/**
69  	 * Returns the physical units of this value represented by a string.
70  	 *
71  	 * @return String the units of the value, to be rendered, if possible, near
72  	 *         the actual value
73  	 */
74  	public String getUnits();
75  
76  	/**
77  	 * Returns the C-style format string that is used to format the
78  	 * <code>long</code> value into text, if the displayer must perform such
79  	 * rendition.
80  	 *
81  	 * @return String printf style format specification
82  	 */
83  	public String getFormat();
84  
85  	/**
86  	 * Sets the minimum value used for graphing. Mainly called by the adapter
87  	 * or user during  design time.
88  	 *
89  	 * @param long new graphing minimum
90  	 *
91  	 * @see #getGraphMin
92  	 */
93  	public void setMinimum(long value);
94  
95  	/**
96  	 * Sets the maximum value used for graphing. Mainly called by the adapter
97  	 * or user during design time.
98  	 *
99  	 * @param long new graphing maximum
100 	 *
101 	 * @see #getGraphMax
102 	 */
103 	public void setMaximum(long value);
104 
105 	/**
106 	 * Sets the physical units for this value. Manly called by the adapter or
107 	 * user during  design time.
108 	 *
109 	 * @param String units for the value
110 	 *
111 	 * @see #getUnits
112 	 */
113 	public void setUnits(String value);
114 
115 	/**
116 	 * Sets the C printf style format specification used to render long value
117 	 * into a String. Mainly called by the adapter or user during design time.
118 	 *
119 	 * @param String C-style format specification
120 	 *
121 	 * @see #getFormat
122 	 */
123 	public void setFormat(String value);
124 }
125 
126 /* __oOo__ */