Design Patterns Java™ Workbook
Chapter 3. Adapter Figure 3.8. A MessageAdapter object is a PrintStream object that forwards messages to a JTextArea object's ap ...
Chapter 3. Adapter with the application it plugs into that the application won't expand its use of a PrintStream object's behavi ...
Chapter 3. Adapter subclass your existing class. Second, the JTable class requires a collection of objects, and only an object a ...
Chapter 4. Facade............................................................................................................... ...
Chapter 4. Facade Figure 4.1. The FlightPanel_1 class displays the flight path of an unexploded shell. Aerial shells are designe ...
Chapter 4. Facade Figure 4.2. The FlightPanel_1 application shows where a dud may land. There is a problem with the FlightPanel_ ...
Chapter 4. Facade See the sidebar Parametric Equations on page 40 for an explanation of how this code establishes the x and y va ...
Chapter 4. Facade the complete equation for y: Figure 4.2 shows the equations for a parabola in action. Another advantage of par ...
Chapter 4. Facade Figure 4.3. Parametric equations simplify the modeling of curves where y is not a single-valued function of x. ...
Chapter 4. Facade x[i] = (int) (w / 2 + r Math.cos(theta)); y[i] = (int) (h / 2 - r Math.sin(theta)); } g.drawPolyline(x, y, n ...
Chapter 4. Facade CHALLENGE 4.1 Complete the diagram in Figure 4.4 to show the code for FlightPanel_1 refactored into three clas ...
Chapter 4. Facade After refactoring, the FlightPanel class is much simpler: package com.oozinoz.applications; import javax.swing ...
Chapter 4. Facade y[i] = (int) (4 apogee (t - .5) * (t - .5)); } return y; } } Most of the code of the main() routine of the i ...
Chapter 4. Facade public static void listen(Frame f) { f.addWindowListener ( new WindowAdapter() { public void windowClosing(Win ...
Chapter 4. Facade The javax.swing package contains JOptionPane, a class that "makes it easy to pop up a standard dialog box," ac ...
Chapter 4. Facade Summary....................................................................................................... ...
Chapter 5. Composite............................................................................................................ ...
Chapter 5. Composite Recursive Behavior in Composites........................................................................... ...
Chapter 5. Composite CHALLENGE 5.3 For each method declared by MachineComponent, give recursive definitions for MachineComposite ...
Chapter 5. Composite There is a path—a series of object references—from a to c because a refers to b and b refers to c. A cycle ...
«
1
2
3
4
5
6
7
8
9
10
»
Free download pdf