Name in
Design Pattern |
Actual Name
(Icon->Component) |
Adaptee |
Icon |
Target |
JComponent |
Adapter |
IconAdapter |
Client |
The class that wants to add
icons into a container |
targetMethod() |
paintComponent(), getPreferredSize() |
adapteeMethod() |
paintIcon(), getIconWidth(), getIconHeight() |
Name in
Design Pattern |
Actual Name
(Stream->Reader) |
Adaptee |
InputStream |
Target |
Reader |
Adapter |
InputStreamReader |
Client |
The class that wants to read
text from an input stream |
targetMethod() |
read
(reading a character) |
adapteeMethod() |
read (reading a byte) |
Name in
Design Pattern |
Actual Name
(Swing actions) |
Command |
Action |
ConcreteCommand |
subclass of AbstractAction |
execute() |
actionPerformed() |
state |
name and icon |
Name in
Design Pattern |
Actual Name
(iterator) |
Creator |
Collection |
ConcreteCreator |
A subclass of Collection |
factoryMethod() |
iterator() |
Product |
Iterator |
ConcreteProduct |
A subclass of Iterator
(which is often anonymous) |
Name in
Design Pattern |
Actual Name
(image proxy) |
Subject |
Icon |
RealSubject |
ImageIcon |
Proxy |
ImageProxy |
request() |
The methods of the Icon
interface type |
Client |
JLabel |
Name in
Design Pattern |
Actual Name (file system
visitor) |
Element |
FileSystemNode |
ConcreteElement |
FileNode, DirectoryNode |
Visitor |
FileSystemVisitor |
ConcreteVisitor |
PrintVisitor |