The Design and Implementation of Multimedia Software



Similar documents
The Design and Implementation of Multimedia Software

A Little Set Theory (Never Hurt Anybody)

Construction of classes with classes

API for java.util.iterator. ! hasnext() Are there more items in the list? ! next() Return the next item in the list.

Classes and Objects. Agenda. Quiz 7/1/2008. The Background of the Object-Oriented Approach. Class. Object. Package and import

The Design and Implementation of Multimedia Software

Interactive Programs and Graphics in Java

Homework/Program #5 Solutions

First Java Programs. V. Paúl Pauca. CSC 111D Fall, Department of Computer Science Wake Forest University. Introduction to Computer Science

How Scala Improved Our Java

Fundamentals of Java Programming

CS506 Web Design and Development Solved Online Quiz No. 01

INTRODUCTION TO COMPUTER PROGRAMMING. Richard Pierse. Class 7: Object-Oriented Programming. Introduction

Chapter 2 Introduction to Java programming

ios App Development for Everyone

Moving from CS 61A Scheme to CS 61B Java

The Basic Java Applet and JApplet

Introduction to Java Applets (Deitel chapter 3)

Chapter 2: Algorithm Discovery and Design. Invitation to Computer Science, C++ Version, Third Edition

Week 2 Practical Objects and Turtles

The Interface Concept

CS170 Lab 11 Abstract Data Types & Objects

Programming with Java GUI components

Unit 6. Loop statements

Arrays. Atul Prakash Readings: Chapter 10, Downey Sun s Java tutorial on Arrays:

How To Write A Program For The Web In Java (Java)

How To Program In Java (Ipt) With A Bean And An Animated Object In A Powerpoint (For A Powerbook)

Java Programming Fundamentals

120, 200 x. r1 = 25. virtua void translate (int dx, dy) = 0; virtual void dessiner(graphics &g) = 0;

WRITING DATA TO A BINARY FILE

History OOP languages Year Language 1967 Simula Smalltalk

LAB4 Making Classes and Objects

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Java Interview Questions and Answers

Vim, Emacs, and JUnit Testing. Audience: Students in CS 331 Written by: Kathleen Lockhart, CS Tutor

Association - Multiplicity. UML and Classes, Objects and Relationships [ 2] Notes. Notes. Association - Self. Association - Self

JIDE Action Framework Developer Guide

MiniDraw Introducing a framework... and a few patterns

ios Dev Crib Sheet In the Shadow of C

Lesson: All About Sockets

The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics

Week 1: Review of Java Programming Basics

Introduction to Programming System Design. CSCI 455x (4 Units)

A binary search tree or BST is a binary tree that is either empty or in which the data element of each node has a key, and:

Object-Oriented Design Lecture 4 CSU 370 Fall 2007 (Pucella) Tuesday, Sep 18, 2007

Karsten Lentzsch JGoodies SWING WITH STYLE

CMSC 132: Object-Oriented Programming II. Design Patterns I. Department of Computer Science University of Maryland, College Park

Crop and Frame Your Photos

Lab 9. Spam, Spam, Spam. Handout 11 CSCI 134: Spring, To gain experience with Strings. Objective

Chapter 5 Functions. Introducing Functions

Chapter 1 Java Program Design and Development

>

Lab 1A. Create a simple Java application using JBuilder. Part 1: make the simplest Java application Hello World 1. Start Jbuilder. 2.

J a v a Quiz (Unit 3, Test 0 Practice)

Chulalongkorn University International School of Engineering Department of Computer Engineering Computer Programming Lab.

TECHNOLOGY Computer Programming II Grade: 9-12 Standard 2: Technology and Society Interaction

The Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).

The Smalltalk Programming Language. Beatrice Åkerblom

An Overview of Java. overview-1

ATHLETIC LOGO GRAPHIC STANDARDS GUIDE VOL.1

User Recognition and Preference of App Icon Stylization Design on the Smartphone

DC60 JAVA AND WEB PROGRAMMING JUNE b. Explain the meaning of the following statement public static void main (string args [ ] )

Tradeshow Overview. The Parker identity elements. Color palette. Typography. Graphics and imagery. Product displays. Apparel TRADESHOW BOOTH(S)

Basic Programming and PC Skills: Basic Programming and PC Skills:

1. What are Data Structures? Introduction to Data Structures. 2. What will we Study? CITS2200 Data Structures and Algorithms

CS1002: COMPUTER SCIENCE OO MODELLING & DESIGN: WEEK 5

B.A. ANIMATION & GRAPHIC DESIGN

Class 32: The Java Collections Framework


Java applets. SwIG Jing He

Analysis Of Source Lines Of Code(SLOC) Metric

Approach of Unit testing with the help of JUnit

Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

Java (12 Weeks) Introduction to Java Programming Language

Test-Driven Development

Object Oriented Programming with Java. School of Computer Science University of KwaZulu-Natal

Programming by Contract. Programming by Contract: Motivation. Programming by Contract: Preconditions and Postconditions

Analysis of Micromouse Maze Solving Algorithms

CMSC 202H. ArrayList, Multidimensional Arrays

EPiServer and XForms - The Next Generation of Web Forms

Lithichrome Stone Paint- LT Blue Gallon Lithichrome Stone Paint- Blue 2 oz Lithichrome Stone Paint- Blue 6 oz

Debugging. Common Semantic Errors ESE112. Java Library. It is highly unlikely that you will write code that will work on the first go

El Dorado Union High School District Educational Services

Chapter 2: Entity-Relationship Model

6.1. Example: A Tip Calculator 6-1

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Pantone Matching System Color Chart PMS Colors Used For Printing

Algorithm and Flowchart Structured Programming 1

Collections in Java. Arrays. Iterators. Collections (also called containers) Has special language support. Iterator (i) Collection (i) Set (i),

University of Twente. A simulation of the Java Virtual Machine using graph grammars

paragraph(s). The bottom mark is for all following lines in that paragraph. The rectangle below the marks moves both marks at the same time.

Java CPD (I) Frans Coenen Department of Computer Science

Callbacks. Callbacks Copyright 2007 by Ken Slonneger 1

Transcription:

Chapter 7 A Static Visual Content System The Design and Implementation of Multimedia Software David Bernstein Jones and Bartlett Publishers www.jbpub.com David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 1 / 56

Introduction About this Chapter Consider a comic book character that has one BufferedImage as its head and another as its body: One could create two sampled.content objects and put them in one Visualization. But the character could not be treated as a coherent whole. Consider an illustration of a house using described content in which the door and roof must be different colors: One could create a described.content object for each part of the house and add them all to a single Visualization. Butthehousecouldnotbetreatedasacoherentwhole. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 2 / 56

Introduction Requirements F7.1 Support visual content that has multiple component parts. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 3 / 56

Design Alternatives Ignoring Content Types What s Next We need to consider some high-level design alternatives. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 4 / 56

Design Alternatives Ignoring Content Types A Top-Down Approach 1. Consider design alternatives at a high level of abstraction. Ignore the differences between statik.sampled.content and statik.described.content objects and consider only statik.content objects. 2. Add the details needed to support the differences between statik.sampled.content and statik.described.content. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 5 / 56

Design Alternatives Ignoring Content Types Alternative 1 David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 6 / 56

Design Alternatives Ignoring Content Types Alternative 1 - Shortcomings What are the shortcomings? David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 7 / 56

Design Alternatives Ignoring Content Types Alternative 1 - Shortcomings Both the Visualization and VisualizationView classes must now distinguish between Content objects and AggregateContent objects making them more complicated, more repetitive, and less cohesive. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 7 / 56

Design Alternatives Ignoring Content Types Alternative 2 Use the Composite Pattern David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 8 / 56

Design Alternatives Ignoring Content Types Alternative 2 - Advantages Allows both the Visualization and VisualizationView classes to treat SimpleContent objects and CompositeContent objects in exactly the same way. Enables the creation of content that is very complicated. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 9 / 56

Design Alternatives Incorporating Content Types What s Next We need to consider some lower-level design alternatives. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 10 / 56

Design Alternatives Incorporating Content Types Alternative 2.1 Approach: Make three copies of the design, one for statik.sampled.content, one for statik.described.content, and one for either/both. Shortcomings: What are the shortcomings? David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 11 / 56

Design Alternatives Incorporating Content Types Alternative 2.1 Approach: Make three copies of the design, one for statik.sampled.content, one for statik.described.content, and one for either/both. Shortcomings: The statik.sampled.compositecontent, statik.described.compositecontent, and statik.compositecontent classes all must have add(), remove(), render(), andgetbounds2d() methods that contain (virtually) identical code. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 11 / 56

Design Alternatives Incorporating Content Types Alternative 2.2 What are the shortcomings? David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 12 / 56

Design Alternatives Incorporating Content Types Alternative 2.2 It doesn t allow operations that are either specific to statik.sampled.content or statik.described.content objects to be applied to statik.compositecontent objects. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 12 / 56

Design Alternatives Incorporating Content Types Alternative 2.3 David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 13 / 56

Design Alternatives Incorporating Content Types Alternative 2.3 - Advantages and Disadvantages Advantage: Allows for operations that are specific to statik.sampled.content and statik.described.content Eliminates code duplication by moving the common code to the abstract parent. Disadvantage: Since the abstract parent manages the collection, the collection must contain statik.transformablecontent objects, rather than the more specific statik.sampled.content and statik.described.content objects. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 14 / 56

Design Alternatives Incorporating Content Types Alternative 2.4 David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 15 / 56

Design Alternatives Incorporating Content Types The visual.statik Package AbstractAggregateContent - Structure package visual.statik; import java.awt.*; import java.awt.geom.*; import java.util.*; public abstract class AbstractAggregateContent<C extends TransformableContent> extends AbstractTransformableContent // A LinkedList is used to order the components. // Since we don t expect many components to be removed // this doesn t raise efficiency concerns. // // Alternatively, we could have a z-order. protected LinkedList<C> components; public AbstractAggregateContent() super(); components = new LinkedList<C>(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 16 / 56

Design Alternatives Incorporating Content Types The visual.statik Package AbstractAggregateContent - Content Management public void add(c component) components.add(component); public Iterator<C> iterator() return components.iterator(); public void remove(c component) components.remove(component); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 17 / 56

Design Alternatives Incorporating Content Types The visual.statik Package AbstractAggregateContent - Rendering public void render(graphics g) Iterator<C> i; C component; i = components.iterator(); while (i.hasnext()) component = i.next(); component.setlocation(x, y); component.setrotation(angle, xrotation, yrotation); component.setscale(xscale, yscale); component.render(g); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 18 / 56

Design Alternatives Incorporating Content Types The visual.statik Package AbstractAggregateContent - Bounds public Rectangle2D getbounds2d(boolean oftransformed) double maxx, maxy, minx, miny, rx, ry; Iterator<C> i; Rectangle2D bounds; TransformableContent component; maxx = Double.NEGATIVE_INFINITY; maxy = Double.NEGATIVE_INFINITY; minx = Double.POSITIVE_INFINITY; miny = Double.POSITIVE_INFINITY; i = components.iterator(); while (i.hasnext()) component = i.next(); bounds = component.getbounds2d(oftransformed); if (bounds!= null) rx = bounds.getx(); ry = bounds.gety(); if (rx < minx) minx = rx; if (ry < miny) miny = ry; rx = bounds.getx() + bounds.getwidth(); ry = bounds.gety() + bounds.getheight(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 19 / 56

Design Alternatives Incorporating Content Types The visual.statik Package AbstractAggregateContent - Bounds (cont.) if (rx > maxx) maxx = rx; if (ry > maxy) maxy = ry; // Note: We could, instead, use an object pool return new Rectangle2D.Double(minX, miny, maxx-minx, maxy-miny); For simplicity, this implementation does not store bounds, it calculates them when needed using the getbounds2d() method in the TransformableContent objects. Alternatively, this class could calculate the bounds whenever they change. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 20 / 56

Design Alternatives Incorporating Content Types The visual.statik Package CompositeContent package visual.statik; public class CompositeContent extends AbstractAggregateContent<TransformableContent> implements TransformableContent public CompositeContent() super(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 21 / 56

Design Alternatives Incorporating Content Types The visual.statik.sampled Package CompositeContent - Structure package visual.statik.sampled; import java.awt.composite; import java.awt.image.bufferedimageop; import java.util.iterator; import visual.statik.abstractaggregatecontent; public class CompositeContent extends AbstractAggregateContent<TransformableContent> implements TransformableContent public CompositeContent() super(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 22 / 56

Design Alternatives Incorporating Content Types The visual.statik.sampled Package CompositeContent - setbufferedimageop() public void setbufferedimageop(bufferedimageop op) Iterator<TransformableContent> i; i = iterator(); while (i.hasnext()) i.next().setbufferedimageop(op); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 23 / 56

Design Alternatives Incorporating Content Types The visual.statik.sampled Package CompositeContent - setcomposite() public void setcomposite(composite c) Iterator<TransformableContent> i; i = iterator(); while (i.hasnext()) i.next().setcomposite(c); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 24 / 56

Design Alternatives Incorporating Content Types The visual.statik.described Package CompositeContent - Structure package visual.statik.described; import java.awt.*; import java.util.iterator; import visual.statik.abstractaggregatecontent; public class CompositeContent extends AbstractAggregateContent<TransformableContent> implements TransformableContent public CompositeContent() super(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 25 / 56

Design Alternatives Incorporating Content Types The visual.statik.described Package CompositeContent - setcolor() public void setcolor(color color) Iterator<TransformableContent> i; i = iterator(); while (i.hasnext()) i.next().setcolor(color); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 26 / 56

Design Alternatives Incorporating Content Types The visual.statik.described Package CompositeContent - setpaint() public void setpaint(paint paint) Iterator<TransformableContent> i; i = iterator(); while (i.hasnext()) i.next().setpaint(paint); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 27 / 56

Design Alternatives Incorporating Content Types The visual.statik.described Package CompositeContent - setstroke() public void setstroke(stroke stroke) Iterator<TransformableContent> i; i = iterator(); while (i.hasnext()) i.next().setstroke(stroke); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 28 / 56

Some Examples What s Next We need to consider some examples. David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 29 / 56

Some Examples An Example of described.compositecontent Introducing Buzzy David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 30 / 56

Some Examples An Example of described.compositecontent Introducing Buzzy Demonstration In examples/chapter: Buzzy.html java -cp Buzzy.jar BuzzyApplication David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 31 / 56

Some Examples An Example of described.compositecontent Buzzy - Structure import java.awt.*; import java.awt.geom.*; import javax.swing.*; import visual.statik.described.*; public class BoringBuzzy extends CompositeContent David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 32 / 56

Some Examples An Example of described.compositecontent Buzzy - Constructor public BoringBuzzy() super(); Arc2D.Float BasicStroke Color CompositeContent Content Path2D.Float QuadCurve2D.Float helmetshape, visorshape; stroke; black, gold, gray, purple; head; body, hair, helmet, visor; bodyshape; hairshape; black = Color.BLACK; gold = new Color(0xc2,0xa1,0x4d); gray = new Color(0xaa,0xaa,0xaa); purple = new Color(0x45,0x00,0x84); stroke = new BasicStroke(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 33 / 56

Some Examples An Example of described.compositecontent Buzzy - Body bodyshape = new Path2D.Float(); bodyshape.moveto( 20, 50); bodyshape.lineto( 20, 70); bodyshape.lineto( 20, 90); bodyshape.lineto( 10, 90); bodyshape.lineto( 10,100); bodyshape.lineto( 80,100); bodyshape.lineto( 80, 90); bodyshape.lineto( 40, 90); bodyshape.lineto( 40, 70); bodyshape.lineto( 40, 50); bodyshape.closepath(); body = new Content(bodyShape, black, purple, stroke); add(body); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 34 / 56

Some Examples An Example of described.compositecontent Buzzy - Head head = new CompositeContent(); add(head); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 35 / 56

Some Examples An Example of described.compositecontent Buzzy - Hair (?) hairshape = new QuadCurve2D.Float(10,2,40,10,30,25); hair = new Content(hairShape, purple, null, stroke); head.add(hair); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 36 / 56

Some Examples An Example of described.compositecontent Buzzy - Helmet helmetshape = new Arc2D.Float(2,20,70,40,2,360,Arc2D.OPEN); helmet=new Content(helmetShape, black, gold, stroke); head.add(helmet); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 37 / 56

Some Examples An Example of described.compositecontent Buzzy - Visor visorshape = new Arc2D.Float(40,25,35,30,315,90,Arc2D.PIE); visor=new Content(visorShape, black, gray, stroke); head.add(visor); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 38 / 56

Some Examples An Example of Mixed CompositeContent Buzzy with a Fancy Helmet David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 39 / 56

Some Examples An Example of Mixed CompositeContent Buzzy with a Fancy Helmet - Structure import java.awt.*; import java.awt.geom.*; import javax.swing.*; import io.*; public class FancyBuzzy extends visual.statik.compositecontent David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 40 / 56

Some Examples An Example of Mixed CompositeContent Buzzy with a Fancy Helmet - Declarations ResourceFinder visual.statik.compositecontent visual.statik.described.content visual.statik.sampled.content visual.statik.sampled.contentfactory finder; head; body, hair, helmet, visor; screw; factory; David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 41 / 56

Some Examples An Example of Mixed CompositeContent Buzzy with a Fancy Helmet - Logo finder = ResourceFinder.createInstance(this); factory = new visual.statik.sampled.contentfactory(finder); screw = factory.createcontent("screw.png", 4); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 42 / 56

Some Examples An Example of Mixed CompositeContent Buzzy with a Fancy Helmet - Head head = new visual.statik.compositecontent(); head.add(hair); head.add(helmet); head.add(screw); head.add(visor); add(head); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 43 / 56

Some Examples An Example of a Visualization Buzzy in the Woods David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 44 / 56

Some Examples An Example of a Visualization Buzzy in the Woods Demonstration In examples/chapter: Visualization.html java -cp Visualization.jar VisualizationApplication David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 45 / 56

Some Examples An Example of a Visualization Buzzy in the Woods - The Woods finder = ResourceFinder.createInstance(this); factory = new ContentFactory(finder); opfactory = BufferedImageOpFactory.createFactory(); woods = factory.createcontent("woods.png", 3); woods.setlocation(0,0); woods.setbufferedimageop(opfactory.createblurop(3)); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 46 / 56

Some Examples An Example of a Visualization Buzzy in the Woods - Buzzy buzzy = new FancyBuzzy(); buzzy.setlocation(200, 318); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 47 / 56

Some Examples An Example of a Visualization Buzzy in the Woods - The Visualization visualization = new Visualization(); view = visualization.getview(); view.setbounds(0,0,471,418); view.setsize(471,418); visualization.add(woods); visualization.add(buzzy); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 48 / 56

Some Examples An Example of a Visualization Buzzy in the Woods - The Content Pane // The content pane contentpane = (JPanel)rootPaneContainer.getContentPane(); contentpane.add(view); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 49 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 50 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture Demonstration In examples/chapter: StaticPIP.html java -cp StaticPIP.jar StaticPIPApplication David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 51 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture - Structure import java.awt.*; import java.awt.geom.*; import javax.swing.*; import app.*; import io.*; import visual.*; import visual.statik.sampled.*; public class StaticPIPApp extends AbstractMultimediaApp public void init() BufferedImageOpFactory opfactory; Content woods, house; ContentFactory factory; FancyBuzzy buzzy; JPanel contentpane; ResourceFinder finder; Visualization model1, model2; VisualizationRenderer renderer1, renderer2; VisualizationView view1, view2; finder = ResourceFinder.createInstance(this); factory = new ContentFactory(finder); opfactory = BufferedImageOpFactory.createFactory(); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 52 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture - Structure (cont.) David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 53 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture - One Visualization woods = factory.createcontent("woods.png", 3); woods.setlocation(0,0); woods.setbufferedimageop(opfactory.createblurop(3)); buzzy = new FancyBuzzy(); buzzy.setlocation(200, 318); model1 = new Visualization(); model1.add(woods); model1.add(buzzy); view1 = model1.getview(); renderer1 = view1.getrenderer(); view1.setrenderer(new ScaledVisualizationRenderer(renderer1, 471.0, 418.0)); view1.setbounds(0,0,471,418); view1.setsize(471,418); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 54 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture - The Other Visualization house = factory.createcontent("house.png", 3); house.setlocation(0,0); model2 = new Visualization(); model2.add(house); view2 = model2.getview(); renderer2 = view2.getrenderer(); view2.setrenderer(new ScaledVisualizationRenderer(renderer2, 525.0, 375.0)); view2.setbounds(50,50,160,120); view2.setsize(160,120); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 55 / 56

Some Examples An Example of Multiple Visualizations Picture-in-a-Picture - The Content Pane // The content pane contentpane = (JPanel)rootPaneContainer.getContentPane(); contentpane.add(view2); contentpane.add(view1); David Bernstein (jbpub.com) Multimedia Software Jones and Bartlett 56 / 56