Check-in [6a5ff73033]

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

Overview
Comment:Set of current displayable item.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6a5ff73033adb13ead6f14e8ced190d834fb759d
User & Date: stephanie.gawroriski 2019-05-16 17:04:53
Context
2019-05-16
17:29
Width and height of the stuff to draw. check-in: d24b05500f user: stephanie.gawroriski tags: trunk
17:04
Set of current displayable item. check-in: 6a5ff73033 user: stephanie.gawroriski tags: trunk
16:55
Repaint display if a command is added. check-in: 967ae3f5b9 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/apis/midp-lcdui/cc/squirreljme/runtime/lcdui/phoneui/PhoneUI.java.

5
6
7
8
9
10
11

12
13
14
15
16
17
18
..
31
32
33
34
35
36
37






38
39
40
41
42
43
44
..
74
75
76
77
78
79
80















81
82
83
84
85
86
87
88
89










90
91
92
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;


import javax.microedition.lcdui.Graphics;

/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
................................................................................
	public final int screenwidth;
	
	/** The height of the phone screen. */
	public final int screenheight;
	
	/** The backend this UI uses. */
	protected final PhoneDisplayBackend backend;






	
	/**
	 * Initializes the base UI using the default screen size.
	 *
	 * @param __b The display backend to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
................................................................................
	 *
	 * @since 2019/05/16
	 */
	public final void repaint()
	{
		throw new todo.TODO();
	}















	
	/**
	 * Sets the title of what is displayed on the screen.
	 *
	 * @param __t The title to use, {@code null} uses a default title.
	 * @since 2019/05/16
	 */
	public final void setTitle(String __t)
	{










	}
}








>







 







>
>
>
>
>
>







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









>
>
>
>
>
>
>
>
>
>



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
..
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
..
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
// ---------------------------------------------------------------------------
// SquirrelJME is under the GNU General Public License v3+, or later.
// See license.mkd for licensing and copyright information.
// ---------------------------------------------------------------------------

package cc.squirreljme.runtime.lcdui.phoneui;

import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Graphics;

/**
 * This class contains the definition and holders for the phone based user
 * interface.
 *
 * @since 2019/05/16
................................................................................
	public final int screenwidth;
	
	/** The height of the phone screen. */
	public final int screenheight;
	
	/** The backend this UI uses. */
	protected final PhoneDisplayBackend backend;
	
	/** The current displayable to show. */
	private Displayable _current;
	
	/** The title to use. */
	private String _title;
	
	/**
	 * Initializes the base UI using the default screen size.
	 *
	 * @param __b The display backend to use.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
................................................................................
	 *
	 * @since 2019/05/16
	 */
	public final void repaint()
	{
		throw new todo.TODO();
	}
	
	/**
	 * Sets the current displayable to be drawn.
	 *
	 * @param __d The displayable to draw.
	 * @since 2019/05/16
	 */
	public final void setCurrent(Displayable __d)
	{
		// Set
		this._current = __d;
		
		// Repaint
		this.repaint();
	}
	
	/**
	 * Sets the title of what is displayed on the screen.
	 *
	 * @param __t The title to use, {@code null} uses a default title.
	 * @since 2019/05/16
	 */
	public final void setTitle(String __t)
	{
		// Default title?
		if (__t == null)
			__t = "SquirrelJME";
		
		// Set
		this._title = __t;
		
		// Repaint
		if (this._current != null)
			this.repaint();
	}
}

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

761
762
763
764
765
766
767

768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793

794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822

823
824
825
826

827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
....
1248
1249
1250
1251
1252
1253
1254























1255
1256
1257
1258
1259
1260
1261
	 */
	public void setCurrent(Displayable __show)
		throws DisplayCapabilityException, IllegalStateException
	{
		// Enter background state?
		if (__show == null)
		{

			/*head.setState(DisplayState.BACKGROUND);
			return;*/
		}
		
		throw new todo.TODO();
		/*
		// If we are trying to show the same display, do nothing
		Displayable current = this._current;
		if (current == __show)
		{
			// If we just set current with no actual change, just make sure
			// our callback is the one which is registered so that way we
			// take control of the screen
			if (__show != null)
			{
				__EventCallback__._CALLBACK.__register();
				
				// Use the title of this thing
				NativeDisplayAccess.setDisplayTitle(this._state.nativeid,
					__show._dtitle);
				
				// Since we took over, we should recalculate the entire display
				// because we would have missed resize events and other such
				// things
				this.__updateUIStack(this._uipersist, null);
			}

			
			return;
		}
		
		// {@squirreljme.error EB29 The display does not support this type
		// of displayable.}
		if ((this.getCapabilities() & __show.__supportBit()) == 0)
			throw new DisplayCapabilityException("EB29");
		
		// If showing an alert, it gets displayed instead
		if (__show instanceof Alert)
		{
			this.setCurrent((Alert)__show, this.getCurrent());
			return;
		}
		
		// {@squirreljme.error EB28 The displayable to be displayed is already
		// being displayed.}
		if (__show._parent != null)
			throw new IllegalStateException("EB28");
		
		// Clear current's parent
		if (current != null)
		{
			current._parent = null;
			
			// Clear the shown state for this widget
			current._isshown = false;
		}

		// Set new parent
		__show._parent = this;
		this._current = __show;
		

		// For the displayable, inherit the shown state from this display
		// since if the display is not being shown then the widget will not
		// be shown until it happens to be shown.
		__show._isshown = this._isshown;
		
		// Register the callback so events can be executed in the LCDUI event
		// loop, if it is lost then
		__EventCallback__._CALLBACK.__register();
		
		// Use the title of this thing
		NativeDisplayAccess.setDisplayTitle(this._state.nativeid,
			__show._dtitle);
		
		// Update the UI stack
		this.__updateUIStack(this._uipersist, null);
		*/
	}
	
	public void setCurrentItem(Item __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
		// Catch all of these, but keep drawing!
		catch (Throwable t)
		{
			t.printStackTrace();
		}
		*/
	}























	
	/**
	 * Adds the specified listener for changes to displays.
	 *
	 * The order in which listeners are executed in is
	 * implementation specified.
	 *







>
|
|


<
<








<
<
<
<
<
<
<
<
<
<
<
<
>




<
<
<
<
<









|





|
<
<


>

|


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







 







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







761
762
763
764
765
766
767
768
769
770
771
772


773
774
775
776
777
778
779
780












781
782
783
784
785





786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801


802
803
804
805
806
807
808
809
810















811
812
813
814
815
816
817
....
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
	 */
	public void setCurrent(Displayable __show)
		throws DisplayCapabilityException, IllegalStateException
	{
		// Enter background state?
		if (__show == null)
		{
			todo.TODO.note("Enter background state.");
			/*head.setState(DisplayState.BACKGROUND);*/
			return;
		}
		


		// If we are trying to show the same display, do nothing
		Displayable current = this._current;
		if (current == __show)
		{
			// If we just set current with no actual change, just make sure
			// our callback is the one which is registered so that way we
			// take control of the screen
			if (__show != null)












				this.__doShowCurrent(__show);
			
			return;
		}
		





		// If showing an alert, it gets displayed instead
		if (__show instanceof Alert)
		{
			this.setCurrent((Alert)__show, this.getCurrent());
			return;
		}
		
		// {@squirreljme.error EB28 The displayable to be displayed is already
		// being displayed.}
		if (__show._display != null)
			throw new IllegalStateException("EB28");
		
		// Clear current's parent
		if (current != null)
		{
			current._display = null;


			current._isshown = false;
		}
		
		// Set new parent
		__show._display = this;
		this._current = __show;
		
		// Do common showing stuff
		this.__doShowCurrent(__show);















	}
	
	public void setCurrentItem(Item __a)
	{
		throw new todo.TODO();
	}
	
................................................................................
		// Catch all of these, but keep drawing!
		catch (Throwable t)
		{
			t.printStackTrace();
		}
		*/
	}
	
	/**
	 * Do current show logic.
	 *
	 * @param __show The displayable to show.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/05/16
	 */
	final void __doShowCurrent(Displayable __show)
		throws NullPointerException
	{
		// For the displayable, inherit the shown state from this display
		// since if the display is not being shown then the widget will not
		// be shown until it happens to be shown.
		__show._isshown = this._isshown;
		
		// Set title of our display to the title of the Displayable
		PhoneUI phoneui = this._phoneui;
		phoneui.setTitle(__show._dtitle);
		
		// Set current drawn displayable
		phoneui.setCurrent(__show);
	}
	
	/**
	 * Adds the specified listener for changes to displays.
	 *
	 * The order in which listeners are executed in is
	 * implementation specified.
	 *