Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

com.arcle.rmt.j2se.swing.ui.ComponentView Class Reference

Base class for View classes that are also swing components. More...

Inheritance diagram for com.arcle.rmt.j2se.swing.ui.ComponentView:

com.arcle.rmt.j2se.swing.ui.View List of all members.

Public Member Functions

 ComponentView ()
void addNotify ()
 Template method that initializes child components when this is first added to a parent component.

JComponent getComponent ()
 Returns this as the primary component of the view.

void update (Observable o, Object param)
 If this is dead and there are still observables notifying, remove this from the list of observers.

void setDocument (Document doc)
 Sets a document into this view, and assigns this as an observer of the document.

Document getDocument ()
 Returns the current document of the view.

Controller getController ()
 Placeholder method that returns null.


Protected Member Functions

boolean addObservable (Object obj)
 Adds this as an oberver to the specified object iff the specified object is an instance of observable.

boolean deleteObservable (Object obj)
 Removes this from the observers of the specified object iff the specified object is an instance of observable.

void showException (Exception e)
 Displays a dialog window showing an exception's exception stack trace.

void setDead (boolean d)
boolean isDead ()
void initChildren ()
 Strategy method to instantiate all child components.

void layoutChildren ()
 Strategy method to add all child components into this.


Private Attributes

Document _document
 The document of this view.

boolean initialized = false
 Whether the child controls had been initialized.

boolean dead = false
 Whether the view is no longer active and should unregister itself from its observables.


Detailed Description

Base class for View classes that are also swing components.

Author:
Sasmito Adibowo
Version:
Id
ComponentView.java,v 1.6 2003/05/15 19:43:46 adib Exp

Definition at line 71 of file ComponentView.java.


Constructor & Destructor Documentation

com.arcle.rmt.j2se.swing.ui.ComponentView.ComponentView  ) 
 

Definition at line 72 of file ComponentView.java.


Member Function Documentation

void com.arcle.rmt.j2se.swing.ui.ComponentView.addNotify  ) 
 

Template method that initializes child components when this is first added to a parent component.

Todo:
Move these method calls to a better place. An ideal place is at just after all constructors in the hierarchy had run.

Definition at line 124 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView.initChildren(), com.arcle.rmt.j2se.swing.ui.ComponentView.initialized, and com.arcle.rmt.j2se.swing.ui.ComponentView.layoutChildren().

boolean com.arcle.rmt.j2se.swing.ui.ComponentView.addObservable Object  obj  )  [protected]
 

Adds this as an oberver to the specified object iff the specified object is an instance of observable.

Parameters:
obj the observable object.
Returns:
true if this was added, false otherwise.

Definition at line 84 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.setDocument().

boolean com.arcle.rmt.j2se.swing.ui.ComponentView.deleteObservable Object  obj  )  [protected]
 

Removes this from the observers of the specified object iff the specified object is an instance of observable.

Parameters:
obj the observable object.
Returns:
true if this was removed, false otherwise.

Definition at line 100 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.setDocument(), and com.arcle.rmt.j2se.swing.ui.ComponentView.update().

JComponent com.arcle.rmt.j2se.swing.ui.ComponentView.getComponent  ) 
 

Returns this as the primary component of the view.

Returns:
this.

Implements com.arcle.rmt.j2se.swing.ui.View.

Definition at line 155 of file ComponentView.java.

Controller com.arcle.rmt.j2se.swing.ui.ComponentView.getController  ) 
 

Placeholder method that returns null.

Implements com.arcle.rmt.j2se.swing.ui.View.

Definition at line 197 of file ComponentView.java.

Document com.arcle.rmt.j2se.swing.ui.ComponentView.getDocument  ) 
 

Returns the current document of the view.

Implements com.arcle.rmt.j2se.swing.ui.View.

Definition at line 190 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView._document.

void com.arcle.rmt.j2se.swing.ui.ComponentView.initChildren  )  [protected]
 

Strategy method to instantiate all child components.

The default implementation does nothing.

Definition at line 208 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.addNotify().

boolean com.arcle.rmt.j2se.swing.ui.ComponentView.isDead  )  [protected]
 

Definition at line 144 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView.dead.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.update().

void com.arcle.rmt.j2se.swing.ui.ComponentView.layoutChildren  )  [protected]
 

Strategy method to add all child components into this.

The default implementation does nothing.

Definition at line 214 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.addNotify().

void com.arcle.rmt.j2se.swing.ui.ComponentView.setDead boolean  d  )  [protected]
 

Definition at line 140 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView.dead.

void com.arcle.rmt.j2se.swing.ui.ComponentView.setDocument Document  doc  ) 
 

Sets a document into this view, and assigns this as an observer of the document.

Afterwards it fires a property change event for the property named document.

Parameters:
doc the document to set.

Implements com.arcle.rmt.j2se.swing.ui.View.

Definition at line 175 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView._document, com.arcle.rmt.j2se.swing.ui.ComponentView.addObservable(), and com.arcle.rmt.j2se.swing.ui.ComponentView.deleteObservable().

void com.arcle.rmt.j2se.swing.ui.ComponentView.showException Exception  e  )  [protected]
 

Displays a dialog window showing an exception's exception stack trace.

Parameters:
e the exception to display.

Definition at line 113 of file ComponentView.java.

void com.arcle.rmt.j2se.swing.ui.ComponentView.update Observable  o,
Object  param
 

If this is dead and there are still observables notifying, remove this from the list of observers.

Definition at line 163 of file ComponentView.java.

References com.arcle.rmt.j2se.swing.ui.ComponentView.deleteObservable(), and com.arcle.rmt.j2se.swing.ui.ComponentView.isDead().


Member Data Documentation

Document com.arcle.rmt.j2se.swing.ui.ComponentView._document [private]
 

The document of this view.

Definition at line 226 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.getDocument(), and com.arcle.rmt.j2se.swing.ui.ComponentView.setDocument().

boolean com.arcle.rmt.j2se.swing.ui.ComponentView.dead = false [private]
 

Whether the view is no longer active and should unregister itself from its observables.

Definition at line 237 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.isDead(), and com.arcle.rmt.j2se.swing.ui.ComponentView.setDead().

boolean com.arcle.rmt.j2se.swing.ui.ComponentView.initialized = false [private]
 

Whether the child controls had been initialized.

Definition at line 231 of file ComponentView.java.

Referenced by com.arcle.rmt.j2se.swing.ui.ComponentView.addNotify().


The documentation for this class was generated from the following file:
Generated on Fri Jun 18 19:53:28 2004 for Arcle Rambutan by doxygen 1.3.5