org.uncommons.watchmaker.swing
Class ObjectSwingRenderer
java.lang.Object
org.uncommons.watchmaker.swing.ObjectSwingRenderer
- All Implemented Interfaces:
- Renderer<Object,JComponent>
public class ObjectSwingRenderer
- extends Object
- implements Renderer<Object,JComponent>
A default Renderer implementation that can display any object
as a Swing component. It simply converts the object into its String
representation (via the Object.toString() method) and shows
that in a text area.
- Author:
- Daniel Dyer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectSwingRenderer
public ObjectSwingRenderer()
render
public JComponent render(Object entity)
- Calls
Object.toString() on the specified entity and creates
a JTextArea containing that text.
- Specified by:
render in interface Renderer<Object,JComponent>
- Parameters:
entity - The evolved entity to render.
- Returns:
- A text area containing the string representation of the entity.