summaryrefslogtreecommitdiffstats
path: root/kdejava/koala/org/kde/koala/KLed.java
blob: 7ff61c08befb4e86643b2524b38d1af852b9e0ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
//Auto-generated by kalyptus. DO NOT EDIT.
package org.kde.koala;

import org.kde.qt.Qt;
import org.kde.qt.TQColor;
import org.kde.qt.TQMetaObject;
import org.kde.qt.QtSupport;
import org.kde.qt.TQPaintEvent;
import org.kde.qt.TQSize;
import org.kde.qt.TQWidget;
import org.kde.qt.TQWidget;

/**

 Displays a round  or rectangular light emitting diode.
 It is configurable to five colors, the two on/off states and three
 styles (or "looks");
 It may display itself in a performant flat view, a round view with
 light spot or a round view sunken in the screen.
 \image html kled.png "KDE LED Widget"
		@author Joerg Habenicht, Richard J. Moore (rich@kde.org) 1998, 1999
 
		@short An LED widget.

*/
public class KLed extends TQWidget  {
	protected KLed(Class dummy){super((Class) null);}
	/**	
		 Status of the light is on/off.
				@short LED on/off.
	*/
	public static final int Off = 0;
	public static final int On = 1;

	/**	
		 Shades of the lamp.
				@short LED shape.
	*/
	public static final int Rectangular = 0;
	public static final int Circular = 1;

	/**	
		 Displays a flat, round or sunken LED.
			 Displaying the LED flat is less time and color consuming,
		 but not so nice to see.
			 The sunken LED itself is (certainly) smaller than the round LED
		 because of the 3 shading circles and is
		 most time consuming. Makes sense for LED > 15x15 pixels.
			 <b></b>imings: \n
		 ( AMD K5/133, Diamond Stealth 64 PCI Graphics, widgetsize 29x29 )
		
			<li>
			flat Approximately 0.7 msec per paint
			</li>
			
			<li>
			round Approximately 2.9 msec per paint
			</li>
			
			<li>
			sunken Approximately 3.3 msec per paint
			</li>
				 The widget will be updated on the next repaining event.
				@short LED look.
	*/
	public static final int Flat = 0;
	public static final int Raised = 1;
	public static final int Sunken = 2;

	public native TQMetaObject metaObject();
	public native String className();
	/**	
		 Constructs a green, round LED widget which will initially
		 be turned on.
		   		@short    Constructs a green, round LED widget which will initially  be turned on.
	*/
	public KLed(TQWidget parent, String name) {
		super((Class) null);
		newKLed(parent,name);
	}
	private native void newKLed(TQWidget parent, String name);
	public KLed(TQWidget parent) {
		super((Class) null);
		newKLed(parent);
	}
	private native void newKLed(TQWidget parent);
	public KLed() {
		super((Class) null);
		newKLed();
	}
	private native void newKLed();
	/**	
		 Constructor with the ledcolor, the parent widget, and the name.
			 The State will be defaulted On and the Look round.
			@param col Initial color of the LED.
			@param parent Will be handed over to TQWidget.
			@param name Will be handed over to TQWidget.
				@short Constructor.
	*/
	public KLed(TQColor col, TQWidget parent, String name) {
		super((Class) null);
		newKLed(col,parent,name);
	}
	private native void newKLed(TQColor col, TQWidget parent, String name);
	public KLed(TQColor col, TQWidget parent) {
		super((Class) null);
		newKLed(col,parent);
	}
	private native void newKLed(TQColor col, TQWidget parent);
	public KLed(TQColor col) {
		super((Class) null);
		newKLed(col);
	}
	private native void newKLed(TQColor col);
	/**	
		 Constructor with the ledcolor, ledstate, ledlook,
		 the parent widget, and the name.
			 Differs from above only in the parameters, which configure all settings.
			@param col Initial color of the LED.
			@param state Sets the State.
			@param look Sets the Look.
			@param shape Sets the Shape (rectangular or circular)
			@param parent Will be handed over to TQWidget.
			@param name Will be handed over to TQWidget.
				@short Constructor.
	*/
	public KLed(TQColor col, int state, int look, int shape, TQWidget parent, String name) {
		super((Class) null);
		newKLed(col,state,look,shape,parent,name);
	}
	private native void newKLed(TQColor col, int state, int look, int shape, TQWidget parent, String name);
	public KLed(TQColor col, int state, int look, int shape, TQWidget parent) {
		super((Class) null);
		newKLed(col,state,look,shape,parent);
	}
	private native void newKLed(TQColor col, int state, int look, int shape, TQWidget parent);
	public KLed(TQColor col, int state, int look, int shape) {
		super((Class) null);
		newKLed(col,state,look,shape);
	}
	private native void newKLed(TQColor col, int state, int look, int shape);
	/**	
		 Returns the current state of the widget (on/off).
				@short Returns LED state.    
		@see State
	*/
	public native int state();
	public native int shape();
	/**	
		 Returns the color of the widget
				@short Returns LED color.    
		@see Color
	*/
	public native TQColor color();
	/**	
		 Returns the look of the widget.
				@short Returns LED look.    
		@see Look
	*/
	public native int look();
	/**	
		 Returns the factor to darken the LED.
				@short Returns dark factor.
		@see #setDarkFactor
	*/
	public native int darkFactor();
	/**	
		 Sets the state of the widget to On or Off.
			 The widget will be painted immediately.
			@param state The LED state: on or off.
				@short Set LED state.    
		@see #on
		@see #off
		@see #toggle
		@see #toggleState
	*/
	public native void setState(int state);
	/**	
		 Set the shape of the LED to <code>s.</code>
		   		@short    Set the shape of the LED to <code>s.</code>
	*/
	public native void setShape(int s);
	/**	
		 Set the color of the widget.
		 The Color is shown with the KLed.On state.
		 The KLed.Off state is shown with TQColor.dark() method
			 The widget calls the update() method, so it will
		 be updated when entering the main event loop.
			@param color New color of the LED.
				@short Sets the LED color.    
		@see Color
	*/
	public native void setColor(TQColor color);
	/**	
		 Sets the factor to darken the LED in OFF state.
		 Same as TQColor.dark().
		 "darkfactor should be greater than 100, else the LED gets lighter
		 in OFF state.
		 Defaults to 300.
			@param darkfactor sets the factor to darken the LED.
				@short sets the factor to darken the LED.    
		@see org.kde.qt.TQColor
	*/
	public native void setDarkFactor(int darkfactor);
	/**	
		 Sets the look of the widget.
			 The look may be flat, round or sunken.
		 The widget calls the update() method, so it will
		 be updated when entering the main event loop.
			@param look New look of the LED.
				@short Sets LED look.    
		@see Look
	*/
	public native void setLook(int look);
	public native TQSize sizeHint();
	public native TQSize minimumSizeHint();
	/**	
		 Toggles the state of the led from Off to On or vice versa.
			 The widget repaints itself immediately.
		   		@short    Toggles the state of the led from Off to On or vice versa.
	*/
	public native void toggle();
	/**	
		 Sets the state of the widget to On.
			 The widget will be painted immediately.
				@short    Sets the state of the widget to On.
		@see #off
		@see #toggle
		@see #toggleState
		@see #setState
	*/
	public native void on();
	/**	
		 Sets the state of the widget to Off.
			 The widget will be painted immediately.
				@short    Sets the state of the widget to Off.
		@see #on
		@see #toggle
		@see #toggleState
		@see #setState
	*/
	public native void off();
	/**	
		 Paints a circular, flat LED.
		   		@short    Paints a circular, flat LED.
	*/
	protected native void paintFlat();
	/**	
		 Paints a circular, raised LED.
		   		@short    Paints a circular, raised LED.
	*/
	protected native void paintRound();
	/**	
		 Paints a circular, sunken LED.
		   		@short    Paints a circular, sunken LED.
	*/
	protected native void paintSunken();
	/**	
		 Paints a rectangular, flat LED.
		   		@short    Paints a rectangular, flat LED.
	*/
	protected native void paintRect();
	/**	
		 Paints a rectangular LED, either raised or
		 sunken, depending on its argument.
		   		@short    Paints a rectangular LED, either raised or  sunken, depending on its argument.
	*/
	protected native void paintRectFrame(boolean raised);
	protected native void paintEvent(TQPaintEvent arg1);
	/**	
		 Compute LED width
		   		@short    Compute LED width
	*/
	protected native int ensureRoundLed();
	/**	
		 Paint the cached antialiased pixmap corresponding to the state if any
				@return true if the pixmap was painted, false if it hasn't been created yet
   
		@short    Paint the cached antialiased pixmap corresponding to the state if any
	*/
	protected native boolean paintCachedPixmap();
	/** Deletes the wrapped C++ instance */
	protected native void finalize() throws InternalError;
	/** Delete the wrapped C++ instance ahead of finalize() */
	public native void dispose();
	/** Has the wrapped C++ instance been deleted? */
	public native boolean isDisposed();
}