did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

did-you-know? rent-now

Amazon no longer offers textbook rentals. We do!

We're the #1 textbook rental company. Let us show you why.

9780201726275

Object-Oriented Programming Featuring Graphical Applications in Java

by
  • ISBN13:

    9780201726275

  • ISBN10:

    0201726270

  • Edition: 1st
  • Format: Paperback
  • Copyright: 2001-07-12
  • Publisher: Pearson
  • Purchase Benefits
  • Free Shipping Icon Free Shipping On Orders Over $35!
    Your order must be $35 or more to qualify for free economy shipping. Bulk sales, PO's, Marketplace items, eBooks and apparel do not qualify for this offer.
  • eCampus.com Logo Get Rewarded for Ordering Your Textbooks! Enroll Now
List Price: $168.20

Summary

The goal of this book is to explore the principle ideas of object-oriented programming using the Java programming language. It begins teaching the object-oriented power of Java by relying on textual commands instead of emphasizing the AWT or Swing libraries, providing the reader with a simple, generic introduction to the OO concepts using Java (without the language details getting in the way of the concept presentation).The author provides a thorough introduction to the three fundamental concepts of object-oriented programming: Encapsulation, Inheritance, and Polymorphism. The presentation of OO theory is augmented by interleaved examples that illustrate these concepts. Most of these program examples are 2-D graphics programs that provide an intuitive context for the issues that must be addressed when learning OOP. Additionally, since graphics programming is one of the strengths of the Java development environment, the examples produce interesting and unexpected images that engage and motivate the reader. It contains a concise introduction to using Design Patterns particularly the Template Method, Iterator, and Composite design patterns which relate to the graphics examples in the book and uses UML class diagrams to show the static structure of systems and sequence diagrams to show object interactions.This book is appropriate for readers who are new to object-oriented (but have experience with a non-object-oriented language) and for programmers who want to learn the graphical elements and capabilities of Java.

Table of Contents

The Object Model
1(26)
Object Model Concepts
2(20)
Objects
3(2)
Messages
5(1)
Object Interfaces
6(2)
Methods and Procedures
8(1)
Encapsulation
9(1)
Classes and Object Instantiation
10(2)
Classes and Interfaces
12(1)
Associations
13(2)
Composition
15(2)
Inheritance
17(3)
Design Patterns and Frameworks
20(2)
The Object Model and Other Programming Models
22(5)
Procedural Abstraction
27(38)
Abstract Operations and Procedures
28(4)
Specifying Procedures
32(5)
Making Assertions
34(3)
Exceptions
37(9)
Checked and Unchecked Exceptions
39(2)
Throwing Exceptions
41(1)
Catching Exceptions
41(1)
Handling Exceptions
42(2)
Using Exceptions
44(2)
Procedural Decomposition
46(8)
Recursion
54(11)
Summary
63(2)
Data Abstraction
65(44)
Abstract Data Types
66(2)
Specifying and Implementing Data Abstractions
68(21)
Points
68(14)
Rectangles
82(7)
Encapsulation
89(6)
Encapsulation and Class Definitions
90(1)
Information Hiding
91(4)
Java Graphics: Some Background
95(8)
The Java 2D API Rendering Model
95(1)
Acquiring a Rendering Context
96(2)
Constructing a Graphics Object
98(1)
Setting the Attributes of a Rendering Context
99(3)
Rendering
102(1)
Making Graphics
103(6)
Painting a Rectangle
103(3)
A Graphics Program Template
106(2)
Summary
108(1)
Composition
109(70)
Composition and Aggregation
110(1)
Random-Value Generators
111(28)
Java's Random Class
113(3)
Random Integers
116(4)
Random Integers in a Fixed Range
120(2)
Random Points
122(7)
Random Rectangles
129(5)
Painting Many Rectangles
134(5)
Composition of Many Parts
139(11)
Java's Vector Class
139(3)
Polylines
142(8)
Representation Invariants
150(19)
Overview
150(3)
Ellipses
153(8)
Rational Numbers
161(8)
Interacting with Pictures
169(10)
Splattering Points
170(5)
An Interactive Graphics Program Template
175(3)
Summary
178(1)
Inheritance
179(80)
The Uses of Inheritance
180(4)
Inheritance for Extension
184(16)
N-Step Counters
184(3)
Transformable Points
187(8)
Lines
195(5)
Inheritance for Specialization
200(11)
Polygons
201(8)
Tally Counters
209(2)
Inheritance for Specification
211(17)
Interfaces and Abstract Classes
211(3)
Rectangular Geometries
214(5)
Abstract Geometries
219(9)
Polymorphism
228(14)
Java's Mechanism for Polymorphism
228(4)
Java's Comparable Interface and Sorting
232(4)
The Substitution Principle
236(6)
Figures and Painters
242(17)
Figures
243(2)
Painters for Filling and Drawing
245(4)
Combining Painters
249(4)
Polygon Painters
253(5)
Summary
258(1)
Design Patterns
259(94)
The Need for Design Patterns
260(1)
The Iterator Design Pattern
261(40)
Java's Iterator Interface
261(5)
Dynamic Polygons
266(10)
Polygon Iterators
276(23)
Structure and Applicability of the Iterator Pattern
299(2)
The Template Method Design Pattern
301(15)
Boolean Geometries
301(6)
Lunes
307(5)
Constructive Area Geometry
312(3)
Structure and Applicability of the Template Method Pattern
315(1)
The Composite Design Pattern
316(28)
Composite Figures
317(5)
Building a Set of Axes
322(5)
Transformable Composite Figures
327(15)
Structure and Applicability of the Composite Pattern
342(2)
Classifying Design Patterns
344(9)
The Factory Method Pattern
345(2)
The Adapter Pattern
347(2)
The Observer Pattern
349(1)
The Strategy Pattern
350(1)
Summary
351(2)
Object-Oriented Application Frameworks
353(89)
Building GUI-Based Programs in Java Using Frameworks
354(4)
Characteristics of Frameworks
354(3)
Java's AWT and Swing
357(1)
Java's Event Model
358(28)
Overview
358(4)
Creating Point Sets
362(8)
Editing Point Sets
370(5)
Editing Polygons
375(4)
Editing Points revisited
379(7)
Components
386(6)
The Component and Container Classes
386(2)
The JComponent Class
388(1)
The JPanel Class
388(1)
The JButton Class
389(1)
The JLabel Class
389(1)
The JComboBox Class
390(1)
The JColorChooser Class
391(1)
Layout Managers
392(4)
Flow Layouts
393(1)
Grid Layouts
394(1)
Border Layouts
394(2)
Components and Event Listeners
396(8)
Playing with Colors
396(2)
Recording Colors
398(6)
Triangulate: A Point-Set Triangulation Program
404(9)
DrawPad: A Drawing Program
413(29)
DrawPad's Components and Figure Manager
414(9)
DrawPad's Event Listeners
423(11)
DrawPad's Highlighting Strategies
434(7)
Summary
441(1)
Appendix A: Reading and Parsing User Input 442(5)
Appendix B: Our Graphics Program Framework 447(4)
Appendix C: A Notational Summary of UML 451(5)
Appendix D: Structure of the banana Package 456(7)
Bibliography 463(2)
Index 465

Supplemental Materials

What is included with this book?

The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.

The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.

Excerpts

The goal of this book is to explore the principal ideas of object-oriented programming using the Java programming language. Object-oriented programming is based on the object model, under which knowledge and behaviors are encapsulated in objects. This programming model has taken hold in recent years due to its effectiveness for coping with program complexity (when used properly), and due to the proliferation of languages such as Java, C++, and Smalltalk, that support the object model.Although object-oriented programming has been around for several decades, embodied in such early languages as Simula and Smalltalk, new programmers often first encounter the object model while learning Java. We use Java in this book to connect the rich but often-abstract ideas of object-oriented programming to concrete examples. Java provides a clear notation for expressing these ideas, a complement to English prose. Moreover, because you can code, compile, and run Java programs, the language serves as a vehicle for exploring and experimenting. Most of the book's examples and exercises involve two-dimensional computer graphics, and many lead to programs that produce images that are interesting and sometimes unexpected. The book's emphasis on 2-D graphics is intended both to engage the reader and to serve as a concrete setting in which to apply new concepts. New material is put to use in the incremental development, over the course of the book, of a new package of graphics-oriented classes and interfaces.In writing this book, I have assumed that you have a basic knowledge of Java. If this is not the case, you can gain the requisite background by working through any of a number of introductory texts on this programming language. Whereas the present text does not purport to teach Java, it does explain all but the language's most elementary features as each is first used. The book also relies on two additional resources. First, Java's 2D application programming interface (the Java 2D API), which is a part of Java 2, is used to produce two-dimensional graphics. Second, we'll make use of a small subset of the Unified Modeling Language (UML), a notation for representing system designs; specifically, we use class diagrams to show the static structure of systems and sequence diagrams to show object interactions. Features of the Java 2D API and of UML will be introduced as they are needed, and I do not assume that you are familiar with either. Structure of This BookChapter 1 introduces the basic concepts of the object model: objects and classes, message passing and methods, and four fundamental mechanisms for software reuse--composition, inheritance, design patterns, and application frameworks. The object model is also placed in the context of other prominent programming models.Chapter 2 discusses procedural abstraction, whereby a procedure is viewed as an operation whose implementation is hidden. The chapter also covers Java's exception mechanism, and explores two standard programming techniques that rely on procedural abstraction: procedural decomposition (in which a procedure is defined in terms of other operations), and recursion (in which a procedure is defined in terms of the very operation it realizes). Procedures are treated early in this book because of their central role in the object model.Chapter 3 treats data abstraction, which views a data value as a set of associated operations and a protocol for using these operations, while hiding the data value's internal structure. Under the object model, a data value viewed in this way is an object. The chapter also discusses encapsulation--the practice of grouping together related software elements--and information hiding. The chapter concludes by introducing 2-D computer graphics in Java and by developing a program template for computer graphics applications in Java.Chapter 4 covers composition, a primary mechanism for softwar

Rewards Program