Check-in [ff7bfc2079]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Initialization of enough objects to start the MicroEmu demo.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:ff7bfc2079ad587fb54dbe9cc23719164c978dff
User & Date: stephanie.gawroriski 2019-05-17 23:31:04
Context
2019-05-18
12:32
Implement drawing of ticker (if there is any). check-in: e12cb29f01 user: stephanie.gawroriski tags: trunk
2019-05-17
23:31
Initialization of enough objects to start the MicroEmu demo. check-in: ff7bfc2079 user: stephanie.gawroriski tags: trunk
23:10
Initialization of some item types. check-in: 359a924923 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/common/CommonMetrics.java.

11
12
13
14
15
16
17

18
19
20

21
22
23
24

25
26
27
28

29
30
31
32
package cc.squirreljme.runtime.lcdui.common;

/**
 * Common widget metrics.
 *
 * @since 2018/12/02
 */

public interface CommonMetrics
{
	/** Width of the scroll bar. */

	public static final int SCROLLBAR_WIDTH =
		8;
	
	/** Command bar height. */

	public static final int COMMANDBAR_HEIGHT =
		18;
	
	/** Command bar font size. */

	public static final int COMMANDBAR_FONT_SIZE =
		16;
}








>



>




>




>




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
package cc.squirreljme.runtime.lcdui.common;

/**
 * Common widget metrics.
 *
 * @since 2018/12/02
 */
@Deprecated
public interface CommonMetrics
{
	/** Width of the scroll bar. */
	@Deprecated
	public static final int SCROLLBAR_WIDTH =
		8;
	
	/** Command bar height. */
	@Deprecated
	public static final int COMMANDBAR_HEIGHT =
		18;
	
	/** Command bar font size. */
	@Deprecated
	public static final int COMMANDBAR_FONT_SIZE =
		16;
}

Changes to runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/common/EditableText.java.

218
219
220
221
222
223
224



































225
226
227
228

		// Empty strings are always valid because otherwise constructing
		// objects would always fail with illegal values
		int type = (__c & TextField.CONSTRAINT_MASK),
			n = __cs.length();
		if (type == TextField.ANY || n == 0)
			return true;
		



































		throw new todo.TODO();
	}
}









>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
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
		// Empty strings are always valid because otherwise constructing
		// objects would always fail with illegal values
		int type = (__c & TextField.CONSTRAINT_MASK),
			n = __cs.length();
		if (type == TextField.ANY || n == 0)
			return true;
		
		// Depends on the type
		switch (type)
		{
				// Decimal value
			case TextField.CURRENCY:
			case TextField.DECIMAL:
				try
				{
					Double.valueOf(__cs.toString());
					return true;
				}
				catch (NumberFormatException e)
				{
					return false;
				}
				
				// Integer values only
			case TextField.NUMERIC:
				try
				{
					Integer.parseInt(__cs.toString());
					return true;
				}
				catch (NumberFormatException e)
				{
					return false;
				}
				
				// E-mail addresses and URLs allow everything
			case TextField.EMAILADDR:
			case TextField.URL:
				return true;
			
				// Unknown
			default:
				throw new todo.TODO();
		}
	}
}

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Displayable.java.

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
...
260
261
262
263
264
265
266
267
268
269
270


271
272
273

274
275

















276

277
278
279
280
281
282
283
	 * Gets the ticker which is being shown on this displayable.
	 *
	 * @return The ticker being shown or {@code null} if there is none.
	 * @since 2018/03/26
	 */
	public Ticker getTicker()
	{
		throw new todo.TODO();
		/*
		return __Queue__.INSTANCE.<Ticker>__get(Ticker.class,
			LcdServiceCall.<Integer>call(Integer.class,
			LcdFunction.WIDGET_GET_TICKER, this._handle));
		*/
	}
	
	/**
	 * Returns the title of this displayable.
	 *
	 * @return The title of this displayable.
	 * @since 2016/10/08
................................................................................
	 *
	 * @param __t The ticker to be shown on the displayable or {@code null}
	 * to clear it.
	 * @since 2018/03/26
	 */
	public void setTicker(Ticker __t)
	{
		if (true)
			throw new todo.TODO();
		/*
		LcdServiceCall.<VoidType>call(VoidType.class,


			LcdFunction.WIDGET_SET_TICKER, this._handle, (__t == null ?
				Integer.MIN_VALUE : __t._handle));
		*/

		
		// Cache it

















		this._ticker = __t;

	}
	
	/**
	 * Sets the title of this displayable.
	 *
	 * @param __t The title to use, {@code null} clears it.
	 * @since 2016/10/08







|
<
<
<
<
<







 







|
|
<
<
>
>
|
|
<
>
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>







153
154
155
156
157
158
159
160





161
162
163
164
165
166
167
...
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
289
290
291
292
293
294
295
296
	 * Gets the ticker which is being shown on this displayable.
	 *
	 * @return The ticker being shown or {@code null} if there is none.
	 * @since 2018/03/26
	 */
	public Ticker getTicker()
	{
		return this._ticker;





	}
	
	/**
	 * Returns the title of this displayable.
	 *
	 * @return The title of this displayable.
	 * @since 2016/10/08
................................................................................
	 *
	 * @param __t The ticker to be shown on the displayable or {@code null}
	 * to clear it.
	 * @since 2018/03/26
	 */
	public void setTicker(Ticker __t)
	{
		// Removing old ticker?
		Ticker old = this._ticker;


		if (__t == null)
		{
			// Nothing to do?
			if (old == null)

				return;
			
			// Clear
			this._ticker = null;
			
			// Remove from display list
			old._displayables.remove(this);
		}
		
		// Setting the same ticker?
		else if (old == __t)
			return;
		
		// Add new ticker, note they can be associated with many displays
		else
		{
			// Add to displayable list
			__t._displayables.addUniqueObjRef(this);
			
			// Set
			this._ticker = __t;
		}
	}
	
	/**
	 * Sets the title of this displayable.
	 *
	 * @param __t The title to use, {@code null} clears it.
	 * @since 2016/10/08

Changes to runt/apis/midp-lcdui/javax/microedition/lcdui/Ticker.java.

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
 * they will be shown at the top of the screen accordingly. As such these can
 * be used to convey information as needed.
 *
 * @since 2018/03/26
 */
public class Ticker
{







	/**
	 * Initializes the ticker with the given string.
	 *
	 * @param __s The string to use for the ticker.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/26
	 */
................................................................................
	public Ticker(String __s)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		// Use internal title set
		this.setString(__s);
	}
	
	/**
	 * Returns the string which is currently being displayed in the ticker.
	 *
	 * @return The string contained within the ticker.
	 * @since 2018/03/26
	 */
	public String getString()
	{
		throw new todo.TODO();
		/*
		return LcdServiceCall.<String>call(String.class,
			LcdFunction.TICKER_GET_STRING, this._handle);*/
	}
	
	/**
	 * Sets the string that is displayed within the ticker.
	 *
	 * @param __s The string to use for the ticker.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/26
	 */
	public void setString(String __s)
		throws NullPointerException
	{
		throw new todo.TODO();
		/*LcdServiceCall.<VoidType>call(VoidType.class,
			LcdFunction.TICKER_SET_STRING, this._handle, __s);*/











	}
}









>
>
>
>
>
>
>







 







|










|
<
<
<












|
|
<
>
>
>
>
>
>
>
>
>
>
>




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
 * they will be shown at the top of the screen accordingly. As such these can
 * be used to convey information as needed.
 *
 * @since 2018/03/26
 */
public class Ticker
{
	/** Displayables this ticker is attached to. */
	final __VolatileList__<Displayable> _displayables =
		new __VolatileList__<>();
	
	/** The text used. */
	volatile String _text;
	
	/**
	 * Initializes the ticker with the given string.
	 *
	 * @param __s The string to use for the ticker.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/26
	 */
................................................................................
	public Ticker(String __s)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");
		
		// Use internal title set
		this._text = __s;
	}
	
	/**
	 * Returns the string which is currently being displayed in the ticker.
	 *
	 * @return The string contained within the ticker.
	 * @since 2018/03/26
	 */
	public String getString()
	{
		return this._text;



	}
	
	/**
	 * Sets the string that is displayed within the ticker.
	 *
	 * @param __s The string to use for the ticker.
	 * @throws NullPointerException On null arguments.
	 * @since 2018/03/26
	 */
	public void setString(String __s)
		throws NullPointerException
	{
		if (__s == null)
			throw new NullPointerException("NARG");

		
		// Set new
		this._text = __s;
		
		// Repaint for any displays which are using this ticker
		for (Displayable di : this._displayables)
		{
			Display d = di._display;
			if (d != null)
				d._phoneui.repaint();
		}
	}
}