: Download: FAQ: Licensing: Support: Contact ME
LwVCL Home
Introduction
Overview
Screen Shots
On-line Demos
Requirements
Further Plans
Docs
Tutorial
How-to (PDF)
API
FAQ
Download
Latest version

Home > J2SE > API

Overview  Package   Class  Tree  Deprecated  Index  Help 

org.zaval.lw
Class LwAdvViewMan

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

public class LwAdvViewMan
extends LwViewMan

The class extends the basic view manager functionality. It provides ability to bind a view with a given name. The view manager can be used to change standard view faces for some lightweight components. For example, for LwButton component using the view manager it is possible to re-bind "bt.off" and "bt.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("bt.off", LwImgRender("off.gif"));
   man.put("bt.on", LwImgRender("on.gif"));
   button.setViewMan(man);
   ...
 
In the sample above the "off.gif" image will be used when the button is un-pressed and the "on.gif" image when the button is pressed.


Constructor Summary
LwAdvViewMan()
           
 
Method Summary
protected  int getSize()
          Gets a number of views that the manager contains.
protected  LwView getView(int index)
          Returns all views that are provided with the view manager.
protected  LwView getView(java.lang.String key)
          The method is overridden 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, getParent, getPHeight, getPWidth, getView, invalidate, isValid, setBg, setBg, setBorder, setBorder, setParent, setView, setView, 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 overridden to return appropriate view by the specified name basing on the binding hash table. The table content is defined by the put and remove methods of the view manager.
Overrides:
getView in class LwViewMan
Parameters:
key - the name of the view.
Returns:
a view.

getSize

protected int getSize()
Description copied from class: LwViewMan
Gets a number of views that the manager contains.
Overrides:
getSize in class LwViewMan
Following copied from class: org.zaval.lw.LwViewMan
Returns:
the number of views.

getView

protected LwView getView(int index)
Description copied from class: LwViewMan
Returns all views that are provided with the view manager. The method is used with validate method to compute insets and preferred size of the view manager.
Overrides:
getView in class LwViewMan
Following copied from class: org.zaval.lw.LwViewMan
Returns:
an array of views.


: up