org.zaval.lw
Class LwAdvViewMan

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwViewMan
              |
              +--org.zaval.lw.LwAdvViewMan
All Implemented Interfaces:
Validationable

public class LwAdvViewMan
extends LwViewMan

The class extends the basic view manager fuctionality. It provides ability to bind a view with a given name. The view manager can be used to change standard view faces for lightweight components. For example, for LwButton component using the view manager it is possible to re-bind "button.off" and "button.on" face views to some custom views, by put method of the view manager. The sample below illustrates the usage:

   ...
   LwButton button = new LwButton("Ok");
   LwAdvViewMan man = new LwAdvViewMan();
   man.put("button.off", LwImgRender("off.gif"));
   man.put("button.on", LwImgRender("on.gif"));
   button.setViewMan(man);
   ...
 
In the sample above the "off.gif" image will be used when the button is unpressed and the "on.gif" image when the button is pressed.


Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwAdvViewMan()
           
 
Method Summary
protected  LwView[] getAllViews()
          The method is overrided to return all views that have been stored in the binding hash table.
protected  LwView getView(java.lang.String key)
          The method is overrided to return appropriate view by the specified name basing on the binding hash table.
 void put(java.lang.String id, LwView s)
          Binds the specified name with the given view.
 void remove(java.lang.String id)
          Removes the specified binding.
 
Methods inherited from class org.zaval.lw.LwViewMan
getBg, getBorder, getInsets, getParent, getPreferredSize, getView, invalidate, recalc, setBg, setBg, setBorder, setBorder, setParent, setView, setView
 
Methods inherited from class org.zaval.util.ValidationObject
isValid, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LwAdvViewMan

public LwAdvViewMan()
Method Detail

put

public void put(java.lang.String id,
                LwView s)
Binds the specified name with the given view.
Parameters:
id - the name to bind with the view.
s - the view to be bound.

remove

public void remove(java.lang.String id)
Removes the specified binding.
Parameters:
id - the name to remove the view binding.

getView

protected LwView getView(java.lang.String key)
The method is overrided to return appropriate view by the specified name basing on the binding hash table. The table content is defined with put and remove methods of the view manager.
Overrides:
getView in class LwViewMan
Parameters:
key - the name of the view.
Returns:
a view.

getAllViews

protected LwView[] getAllViews()
The method is overrided to return all views that have been stored in the binding hash table. The returned array is used to calculate preferred size and insets basing on the view set.
Overrides:
getAllViews in class LwViewMan
Returns:
an array of views.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org