Class com.bdnm.mvc.MVCList
All Packages  Class Hierarchy  This Package  Previous  Next  Index
  Class com.bdnm.mvc.MVCList
java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.List
                   |
                   +----com.bdnm.mvc.MVCList
  -  public class MVCList
  -  extends List
  -  implements Observer
   
  -   model model
-  This represents the underlying model for the widget
  
-   objectPrinter objectPrinter
-  This object is responsible for turning the objects in
the list to strings.
   
  -   MVCList() MVCList()
-  Creates a new scrolling list with no visible lines, single selection,
and a default model.
  
-   MVCList(boolean) MVCList(boolean)
-  Creates a new scrolling list with no visible lines and a default model.
  
-   MVCList(SelectionInList, boolean) MVCList(SelectionInList, boolean)
-  Creates a new scrolling list with an initial model and a parameter that
states whether multipleSelections are allowed.
   
  -   getModel() getModel()
-  Retrieve the model.
  
-   handleEvent(Event) handleEvent(Event)
-  We need to trap the LIST_SELECT and LIST_DESELECT events
so we can update the underlying model.
  
-   objectPrinter() objectPrinter()
-  Retrieve the object printer.
  
-   objectPrinter(ObjectPrinter) objectPrinter(ObjectPrinter)
-  Sets a new object printer.
  
-   refreshList() refreshList()
-  Refresh the list's elements, whose print representation may
have changed.
  
-   removeNotify() removeNotify()
-  Before we die, remove dependency on model.
  
-   setModel(SelectionInList) setModel(SelectionInList)
-  Give the widget a new model.
  
-   update(Observable, Object) update(Observable, Object)
-  Called when observers in the observable list need to be
updated.
  
-   updateList() updateList()
-  Update the list behind the widget to match the list
in the model.
  
-   updateSelections() updateSelections()
-  Update the selections on the widget to match the
selections in the model.
   
 model
model
  protected SelectionInList model
  -  This represents the underlying model for the widget
 objectPrinter
objectPrinter
  protected ObjectPrinter objectPrinter
  -  This object is responsible for turning the objects in
the list to strings.
   
 MVCList
MVCList
  public MVCList()
  -  Creates a new scrolling list with no visible lines, single selection,
and a default model.
 MVCList
MVCList
  public MVCList(boolean multipleSelections)
  -  Creates a new scrolling list with no visible lines and a default model.
The parameter states whether multiple selections are allowed.
  
    -  Parameters:
    
-  multipleSelections - if true then multiple selections are allowed
  
 
 MVCList
MVCList
  public MVCList(SelectionInList model,
                 boolean multipleSelections)
  -  Creates a new scrolling list with an initial model and a parameter that
states whether multipleSelections are allowed.
  
    -  Parameters:
    
-  model - the model for the widget
    -  multipleSelections - if true then multiple selections are allowed
  
 
   
 getModel
getModel
  public SelectionInList getModel()
  -  Retrieve the model.
  
    -  Returns:
    
-  the model the widget is using
  
 
 setModel
setModel
  public synchronized void setModel(SelectionInList newModel)
  -  Give the widget a new model.  This will
also update the contents of the field.
  
    -  Parameters:
    
-  newModel - the new model for the widget
  
 
 objectPrinter
objectPrinter
  public synchronized ObjectPrinter objectPrinter()
  -  Retrieve the object printer.  Lazy init one if necessary.
  
    -  Returns:
    
-  the object printer the widget is using
  
 
 objectPrinter
objectPrinter
  public void objectPrinter(ObjectPrinter newObjectPrinter)
  -  Sets a new object printer.  This will also refresh the list.
  
    -  Parameters:
    
-  newObjectPrinter - new object printer to use
  
 
 removeNotify
removeNotify
  public synchronized void removeNotify()
  -  Before we die, remove dependency on model.
  
    -  Overrides:
    
-  removeNotify in class List
  
 
 update
update
  public void update(Observable o,
                     Object arg)
  -  Called when observers in the observable list need to be
updated.  We have two observables: the selection index
holder and the list holder.
  
    -  Parameters:
    
-  o - the observer sending the update
    -  arg - the new value
  
 
 updateSelections
updateSelections
  public synchronized void updateSelections()
  -  Update the selections on the widget to match the
selections in the model.
 updateList
updateList
  public synchronized void updateList()
  -  Update the list behind the widget to match the list
in the model.  Make no attempt to keep the selections.
 refreshList
refreshList
  public void refreshList()
  -  Refresh the list's elements, whose print representation may
have changed.  I assume that I have the same number of elements
in my model as in my view.
 handleEvent
handleEvent
  public boolean handleEvent(Event evt)
  -  We need to trap the LIST_SELECT and LIST_DESELECT events
so we can update the underlying model.
Right now I only know how to deal with select for
single select lists.
  
    -  Overrides:
    
-  handleEvent in class Component
  
 
All Packages  Class Hierarchy  This Package  Previous  Next  Index