Presentation is loading. Please wait.

Presentation is loading. Please wait.

2nd Rotor Workshop 20031 Views – an XML-based independent GUI system Judith Bishop University of Pretoria, South Africa Nigel Horspool University of Victoria,

Similar presentations


Presentation on theme: "2nd Rotor Workshop 20031 Views – an XML-based independent GUI system Judith Bishop University of Pretoria, South Africa Nigel Horspool University of Victoria,"— Presentation transcript:

1 2nd Rotor Workshop 20031 Views – an XML-based independent GUI system Judith Bishop University of Pretoria, South Africa Nigel Horspool University of Victoria, Canada http://www.cs.up.ac.za/rotor

2 2nd Rotor Workshop 20032 Motivation  Forward looking –Move to platform independent GUI systems –Integration of XML into languages (cf XEN)  Technical –Rotor does not have a GUI capability –Interesting challenges in Reflection, RegEx etc  Educational –Dissatisfaction with method-oriented or drag and drop GUIs –Separation of concerns

3 2nd Rotor Workshop 20033 The reality of a single cross-language, cross-platform GUI interface programming model is in sight, based on an XML description language supported by fast native runtimes. [Russel Jones, DevX, Nov 2002] Supporting many GUIs isn't just a simple process of including one set of libraries or another; it's often a frustrating and error-prone exercise in writing GUI- specific code. [Russel Jones, DevX, Aug 2003] Where GUIs are going

4 2nd Rotor Workshop 20034 VS.NET Common Language Runtime System System.Data (ADO.NET) System.Xml System.Drawing System.Web (ASP.NET) System.WinForms SDK Tools Rotor CLI Implementation C# JScript Platform Abstraction System.WinForms

5 2nd Rotor Workshop 20035 GUI building today GUI Builder Add Listeners Handlers widget rendering in the OS Visual Studio C# Windows widget calls in a language Application

6 2nd Rotor Workshop 20036 A GUI using XML Application Handlers widget rendering in the OS Control Engine Add Listeners GUI XML Spec GUI XML Spec

7 2nd Rotor Workshop 20037 Example in Views Views.Form f = new Views.Form(@" <PictureBox Name=pic Image='Jacarandas.jpg' Height=175/> " ); string c; for (;;) { c = f.GetControl(); if (c==null) break; PictureBox pb = f["pic"]; switch (c) { case ”Show" : pb.Show(); break; } case ”Hide" : pb.Hide(); break; } No pixel positioning No generated code Separation of concerns XML C#

8 2nd Rotor Workshop 20038 The Views Notation form: controlGroup controlGroup: controlList | controlList controlList:{ control } textItemList: { text } control:controlGroup | | | textItemList | radioButtonList | | radioButtonList:{ }

9 2nd Rotor Workshop 20039 The Eight Handler methods Form(string spec,params) The constructor. void CloseGUI( ) Terminates the execution thread string GetControl( ) Waits for the user to perform an action string GetText(string name) Returns the value of the Text attribute int GetValue(string name) Returns the Value attribute from TrackBar, ProgressBar and CheckBox int GetValue(string name, int index) Returns the status of CheckBox at position index void PutText(string name, string s) Displays the string in a TextBox or ListBox control. void PutValue(string name, int v) Sets an integer value associated with a ProgressBar or CheckBox Essentially five kinds of methods: construct close getControl get put PLUS … direct access

10 2nd Rotor Workshop 200310 Views1 implementation  RegEx API would be nice for normalising XML –If REs fail to match, hard to create a use friendly error message –did not use the RE package.  XML API produces poor error messages when reading XML –implemented our own lexical analyzer for the XML specifications –preprocess the user’s XML then use the XML package,  Views inverts the interaction logic of controls –normally events cause invocation of handling routines asynchronously –our simple interface has the user invoke Views to wait for an event to happen... s = form.GetControl(); switch(s) {... case "Push Me":

11 2nd Rotor Workshop 200311 Views2 implementation  Views2 is a general-purpose tool for creating sophisticated graph structures whose nodes are arbitrary class instances and where the structure layout is defined by a simple XML notation  Correspondence can be made to work with reflection: Views2.Create( " " ) so we can introduce new tags without preprogramming Views for all controls  Views2 can handle asynchronous events c.f. show.Click += new EventHandler(ActionPerformed);

12 2nd Rotor Workshop 200312 Future Work  Completing Views2 and writing it up  Completing the TCL/Tk version and looking at alternative GUI tools  Completing a drag and drop stand-alone tool to emit Views XML  Further investigating the pedagogy  Thinking of asking MS to make Regex available in all operating systems –e.g. “ PDA.NET environment we've seen doesn'tinclude the regexp library, threading, reflection or a full version of collections.”  Long term – XML checking in the language

13 2nd Rotor Workshop 200313 References on www.cs.up.ac.za/rotor  Horspool R N and Bishop J M, Views - and independent GUI development tool for Rotor, 1st Rotor Workshop, Cambridge July 2002.  Bishop J M and Horspool R N, Views - a Vendor Independent Extensible Windowing System, presented at IFIP WG2.4 meeting, Dagstuhl, Germany, November 2002  Bishop J M, Horspool R N and Worrall B G, Experience with integrating Java with C# and.NET, JavaGrande, Seattle, November 2002, and Concurrency and Computation - Practice and Experience, to be published, January 2004  Bishop J M, Tutorial at RISE, University of Linkoping, Sweden, December 2002  Bishop J M and Horspool R N, Views report to Microsoft, January 2003  Bishop J M and Horspool R N, C# - the modular language for the 2000s. Tutorial at JMLC, Klagenfurt, August 2003  Bishop J M and Horspool R N, C# Concisely, Addison Wesley, appear October 2003.  Bishop J M and Horspool, Towards principles of GUI programming using Views, paper submitted to SIGCSE 2004.


Download ppt "2nd Rotor Workshop 20031 Views – an XML-based independent GUI system Judith Bishop University of Pretoria, South Africa Nigel Horspool University of Victoria,"

Similar presentations


Ads by Google