All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.trumphurst.controls.TDocument

java.lang.Object
   |
   +----com.trumphurst.controls.TDocument

public class TDocument
extends Object
Document/View architecture - a Document. The document maintains a list of all active views, and informs them if something in the document has changed. The Document/View architecture allows the same document to be displayed in multiple different Views (representations). This implementation is sufficiently light to be efficient even if there is only one View of each Document.

See Also:
TView, TRowDocument, TTreeListDocument

Variable Index

 o name
The name of the document.
 o views
A list of all the TViews of this document.

Constructor Index

 o TDocument(String)
Constructor.

Method Index

 o addView(TView)
Add a new view to the list of views.
 o getName()
Return the name of the document.
 o keyDown(TView, Event, int)
 o removeView(TView)
Remove a view from the list of views.
 o updateAllViews()
Update all views of the document.
 o updateAllViews(Object)
Update all views of the document.

Variables

 o views
 protected Vector views
A list of all the TViews of this document.

 o name
 protected String name
The name of the document.

Constructors

 o TDocument
 public TDocument(String name)
Constructor.

Parameters:
name - The name of the document.

Methods

 o getName
 public String getName()
Return the name of the document.

 o updateAllViews
 public void updateAllViews()
Update all views of the document. Called when the whole document (or a large part) has changed.

 o updateAllViews
 public void updateAllViews(Object o)
Update all views of the document. Called when a single item in the document has changed.

 o addView
 public void addView(TView v)
Add a new view to the list of views. Note that this calls the TView's attach method if it isn't already attached.

 o removeView
 public void removeView(TView v)
Remove a view from the list of views. Note that this calls the TView's detach method if it was indeed in the list of views for this document.

 o keyDown
 public boolean keyDown(TView v,
                        Event e,
                        int key)

All Packages  Class Hierarchy  This Package  Previous  Next  Index