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
-
name
- The name of the document.
-
views
- A list of all the TViews of this document.
-
TDocument(String)
- Constructor.
-
addView(TView)
- Add a new view to the list of views.
-
getName()
- Return the name of the document.
-
keyDown(TView, Event, int)
-
-
removeView(TView)
- Remove a view from the list of views.
-
updateAllViews()
- Update all views of the document.
-
updateAllViews(Object)
- Update all views of the document.
views
protected Vector views
- A list of all the TViews of this document.
name
protected String name
- The name of the document.
TDocument
public TDocument(String name)
- Constructor.
- Parameters:
- name - The name of the document.
getName
public String getName()
- Return the name of the document.
updateAllViews
public void updateAllViews()
- Update all views of the document.
Called when the whole document (or a large part) has changed.
updateAllViews
public void updateAllViews(Object o)
- Update all views of the document.
Called when a single item in the document has changed.
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.
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.
keyDown
public boolean keyDown(TView v,
Event e,
int key)
All Packages Class Hierarchy This Package Previous Next Index