university of waterloo faculty of engineering - star - home · event handling mechanism...

26
ECE 750T11 ComponentBased Software Systems Project Presentation I Nilam Kaushik (Group 7) University of Waterloo Faculty of Engineering

Upload: others

Post on 16-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

ECE 750‐T11 Component‐Based Software SystemsProject Presentation ‐I

Nilam Kaushik (Group 7)University of Waterloo ‐ Faculty of Engineering

Page 2: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Outline

Introduction to SVGIntroduction to SVGProposed projectApproach Expected results and performance metrics References/Questions

27/13/2009 ECE 750-T11 Project Presentation-I

Page 3: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Introduction

Scalable Vector Graphics• based on paths • XML language describing two‐dimensional graphics• open standard developed by the W3C consortium 

Raster graphics• based on pixels • bitmap graphics: jpg, gif, bmp• used for pictures [1]

37/13/2009 ECE 750-T11 Project Presentation-I

Page 4: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Visual Difference? 

4

Bitmap image Vector  image

7/13/2009 ECE 750-T11 Project Presentation-I

Page 5: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Advantages of SVG 

open standard zoom without loss of quality scalable, smaller and more compressible than jpg, gifcreate dynamic content 

animations database integration

support for multiple programming/scripting languages – Javascript, Java etc 

7/13/2009 ECE 750-T11 Project Presentation-I 5

Page 6: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Outline

Introduction to SVG Proposed projectProposed projectApproach Expected results and performance metrics References/Questions 

67/13/2009 ECE 750-T11 Project Presentation-I

Page 7: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Proposed project 

Motivationday to day problem at work

The problemexploring the challenges involved with creating a specific genre of interactive mapping applications with SVG for resource constrained devices in areas where a GPS cannot be used

Other possible areas of application maps of zoos, parks, museums (web and mobile based)

77/13/2009 ECE 750-T11 Project Presentation-I

Page 8: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

8

Map of the Toronto zoo[2] 

7/13/2009 ECE 750-T11 Project Presentation-I

Page 9: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

SVG and JSR 287SVG is a recommendation of the W3CSVG 1.0 (mainly for the web) SVG 1.1 (also called SVG Basic)SVG 1.2 (also called SVG Tiny)

for devices with limited memory, small display size

JSR 287specification of a Java ME API for rendering 2D vector graphics and rich media content based on SVG Tiny 1.2[3]

97/13/2009 ECE 750-T11 Project Presentation-I

Page 10: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

SVG 1.2 uDOM

The Document Object Model(uDOM)Compatible with Javascript, Java and other languagesRelevant Packages 

org.w3c.dom: a subset of DOM Level 3 Core APIs. DOM Level 3 Core is the normative specification for this package. The subset is designed to be appropriate for small footprint devices, yet retain compatibility to the full DOM Core implementations.org.w3c.dom.events: contains the necessary event handling interfaces that are a subset of DOM Level 3 Events APIs.org.w3c.dom.svg: contains a proper subset of W3C SVG Tiny 1.2 uDOM APIs necessary for interacting and manipulating SVG Tiny 1.2 content.

107/13/2009 ECE 750-T11 Project Presentation-I

Page 11: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Outline

Introduction to SVG Proposed projectApproachApproachExpected results and performance metrics References/Questions 

117/13/2009 ECE 750-T11 Project Presentation-I

Page 12: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

3‐tiered application 

127/13/2009 ECE 750-T11 Project Presentation-I

Page 13: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Tiers in detail 

Presentation tier : the UI • component  to access the application (as a downloadable jad file) on mobile device 

• component  to render the map on mobile device Business logic tier• component to handle the user events e.g touch events• zooming, panning, searching for text, annotationsDatabase tier • server from which user can download the application

137/13/2009 ECE 750-T11 Project Presentation-I

Page 14: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Tools Used 

Plazmic Content Developer Kittransconding capability compatible with SVG 1.2 [4]

BlackBerry Java Development Environment (4.7)BlackBerry Storm simulator 

Images from OpenClipart 

147/13/2009 ECE 750-T11 Project Presentation-I

Page 15: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

7/13/2009 ECE 750-T11 Project Presentation-I 15

Plazmic Composer  4.7

Page 16: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Snippet from SVG document

<g id="Room208_grp" transform="translate(276 ‐21.5)">

<!‐‐ pz:tag type="group" ‐‐>

<rect id="Room208" style="opacity:0.6;fill:#cccccc; stroke:#000000; stroke‐width:1;"

x="‐31" y="‐109" width="92" height="78"

transform="translate(‐223.826 121.91) scale(0.521739 0.448718)"/>

<text id="Text_44" font‐size="16"  style="font‐family:BBCasual;font‐weight:bold; fill:#071727; stroke:none; text‐rendering:geometricPrecision; "

transform="translate(‐63 89)" x="‐167" y="6">

<tspan id="Text_44_1_0" xml:space="preserve"  font‐size="16"  style="font‐family:BBCasual;font‐weight:bold; fill:#071727; stroke:none; text‐rendering:geometricPrecision; ">208</tspan>

<!‐‐ pz:tag anti‐aliasing="1" ‐‐>

</text>

</g>

<g id="staircase" transform="translate(141.647 193.951) scale(0.921569 0.756098)">

<!‐‐ pz:tag type="group" ‐‐>

<rect id=“rect" style="opacity:0.6;fill:#cccccc; stroke:#000000; stroke‐width:1;“

x="‐31" y="‐109" width="92" height="78“ transform="translate(‐216.815 81.5897) scale(0.554348 1.05128)"/><image id="stairs” x="‐40" y="‐82" width="80" height="164"

xlink:href="stairs.jpg" transform="translate(‐208.5 9) scale(0.5625 0.47561)"/></g>

7/13/2009 ECE 750-T11 Project Presentation-I 16

Page 17: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Event handling in SVG apps Event: a message about a user or system input that notifies state changes or user input within an application[5]UI Events

Focusin Focus outActivate 

Mouse Eventsmouse overclick 

SVGEvents SVGLoadSVGZoom

7/13/2009 ECE 750-T11 Project Presentation-I 17

Page 18: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Event handling mechanism 

Application implements org.w3c.dom.events.EventListener interfacePublish‐subscribe communication 

7/13/2009 ECE 750-T11 Project Presentation-I 18

_myRect =(SVGElement)_document.getElementById("Room208”); _myRect.addEventListener("DOMActivate", this, false);_myRect.addEventListener("DOMFocusIn", this, false);_myRect.addEventListener("DOMFocusOut", this, false);

public void handleEvent(Event evt){ if(evt.getType().equals("DOMFocusIn")){

_currentFocusInElement = (SVGElement)evt.getCurrentTarget();if(_currentFocusInElement == _myRect){

_animator.invokeLater( new Runnable(){public void run(){

_currentFocusInElement.setFloatTrait("fill-opacity", 0.25f);_currentFocusInElement.setFloatTrait("stroke-opacity", 0.1f);

_display.setTrait("display", "inline"); _displayName.setTrait("#text", "Room#");

}

Page 19: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Outline

Introduction to SVG Proposed projectApproach Expected results and performance metrics Expected results and performance metrics References/Questions 

197/13/2009 ECE 750-T11 Project Presentation-I

Page 20: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Results so far 

Chose the development platform touch device (pointer events)

Chose between ECMAscript and Java Evaluated toolkits 

Batik, Plazmic, Inkscape Assessed supported attributes/limitations 

207/13/2009 ECE 750-T11 Project Presentation-I

Page 21: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Goals/Expectations

Short term:  explore the level of interactivity  that can be achieved with the attributes  available Long term: establish a way to evaluate the usability of the application 

Expectation from project: illustrate that interactive maps provide a better user experience than raster images 

217/13/2009 ECE 750-T11 Project Presentation-I

Page 22: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Performance metrics

size of the end deliverable(cod/jad file) generated with all the code, graphics, images and videosextent of platform dependency: how easily can this be ported to another J2ME device overall usability

7/13/2009 ECE 750-T11 Project Presentation-I 22

Page 23: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Related work 

SVG Open conferencehttp://www.svgopen.org/2009/

Other interesting areas Mobile Ajax and SVGSVG 2.0 specification 

237/13/2009 ECE 750-T11 Project Presentation-I

Page 24: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

Outline

Introduction to SVG Proposed projectApproach Expected results and performance metrics References/QuestionsReferences/Questions

247/13/2009 ECE 750-T11 Project Presentation-I

Page 25: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

References

[1] Doughty Mike, “Two Kinds of Computer graphics”, 1998. [Online] . Available: http://www.sketchpad.net/basics1.htm [July 11]

[2] Toronto Zoo, “TorontoZoo_Map2008”, 2008. [Online]. Available: http://www.torontozoo.com/pdfs/TorontoZoo_Map2008.jpg

[3] World Wide Web Consortium, “Mobile SVG Profiles: SVG Tiny and SVG Basic”, W3C Recommendation, 2003. Available: http://www.w3.org/TR/SVGMobile12/

[4] Plazmic Inc., “ SVG for BlackBerry SmartPhones”, October , 2008. Available: http://www.plazmic.com/en/pdfs/SVG_for_BlackBerry_Smartphones.pdf.

[5] Carto:net, “Event Handling in SVG Applications”, 2007. Available: http://www.carto.net/papers/svg/eventhandling/index.shtml

[6] E.Gamma, R. Helm, R. Johnson, and J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software. Boston, MA: Addison-Wesley, 1995.

[7] Olsen Dan, Developing User Interfaces. San Fransisco, CA: Morgan Kauffman, 1998

257/13/2009 ECE 750-T11 Project Presentation-I

Page 26: University of Waterloo Faculty of Engineering - STAR - Home · Event handling mechanism yApplication implements org.w3c.dom.events.EventListener interface yPublish‐subscribe communication

7/13/2009 ECE 750-T11 Project Presentation-I 26