CSE1720_F11_Lecture04_Aggregation_Graphics_II.pptx

CSE1720_F11_Lecture04_Aggregation_Graphics_II.pptx -...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 1720 Lecture 4 Aggregation, Graphics II Announcements: labs this week: – preparation for labtest #1; sample problems/tasks – guided demo: gesture tracking (MaxMSP) labs next week: – labtest #1 – given a description of some shape- and string-based images, implement the drawing using the services of Graphics2D – analogous to labtest #2 from cse1710 (which was based on pixel-based image modiFcation) 2 Goals/ To do: How to create, copy, and delegate to aggregates example aggregates: Pixel , Picture , Graphics2D Create, modify, and iterate over collections Implement traversal over a collection Implement search within a collection Use services of Graphics2D for drawing Goals/ To understand: recognize aggregates from their APIs characterize and distinguish between two traversal techniques distinguish between aliases, shallow copies, and deep copies of aggregrates understand the characteristics of the “current settings” graphical model 3 Today’s Topics Java 2D API Concepts Collections, Collection Traversal Aggregations vs Composition 4
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5 2D Graphics The Java 2D API… A Basic Overview 6 apps that use graphics must launch a window – thus, such apps involve the window manager, as discussed last lecture what if the app wants to draw something ? – how can the app do so? – before answering, let’s Frst emphasize AGAIN that the technically correct way to pose this question is: what if the app wants to specify something to be drawn ? the window manager actually does the drawing How to draw something… 7 the app asks the display window to access its Graphics2D object the app uses the Graphics2D object to specify what is to be drawn Coordinate spaces ±rom: http://docs.oracle.com/javase/tutorial/2d/overview/coordinate.html 8 The Java 2D API maintains two coordinate spaces: User space – The space in which graphics primitives are speciFed Device space – The coordinate system of an output device such as a screen, window, or a printer User space is: – a device-independent logical coordinate system. – the coordinate space that your program uses. All geometries passed into Java 2D rendering routines are speciFed in user-space coordinates. When it is time to render the graphics, a transformation is applied to convert from user space to device space. The origin of user space is the upper-left corner of the component’s drawing area.
Background image of page 2
The Graphics2D API 9 a Graphics2D object encapsulates the drawing region (in device space ) and a set of supported drawing
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course CSE 1720 taught by Professor Baljko during the Winter '12 term at York University.

Page1 / 9

CSE1720_F11_Lecture04_Aggregation_Graphics_II.pptx -...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online