|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.zaval.util.ValidationObject
|
+--org.zaval.lw.LwCanvas
|
+--org.zaval.lw.LwPanel
|
+--org.zaval.lw.LwList
This is list component. The main features of the component are shown in the list below:
add, remove, insert methods to manipulate
the list component content. For example, if it is necessary to add following three
text items: "Item 1", "Item 2", "Item 3", you can use LwLabel component as it is shown
below:
...
LwList list = new LwList();
list.add(new LwLabel("Item 1"));
list.add(new LwLabel("Item 2"));
list.add(new LwLabel("Item 3"));
...
The class has method add that get string as input argument. The method
creates LwLabel object with the string argument as a title. In this case the sample
above can be simplify as follow:
...
LwList list = new LwList();
list.add("Item 1");
list.add("Item 2");
list.add("Item 3");
...
getPosController method. To control selection use select,
getSelected, getSelectedIndex, isSelected methods.
To listen when an item component has been selected use addSelectionListener
and removeSelectionListener methods.
addSelectionListener and removeSelectionListener methods
to listen whenever the selected item has been changed. The selection event is represented
by the LwActionEvent where getData method returns the selected item index.
| Fields inherited from class org.zaval.lw.LwPanel |
children |
| Fields inherited from class org.zaval.lw.LwCanvas |
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y |
| Fields inherited from class org.zaval.util.ValidationObject |
isValidFlag |
| Constructor Summary | |
LwList()
Constructs a list component with no items. |
|
| Method Summary | |
void |
add(java.lang.String s)
Adds an item to the list. |
void |
addSelectionListener(LwActionListener l)
Adds the specified selection listener to receive selection events from this list component. |
boolean |
canHaveFocus()
Specifies if the component can have focus. |
boolean |
catchInput(LwComponent child)
Checks if input events for the specified child component should be caught. |
protected void |
drawPosMarker(java.awt.Graphics g)
Invoked to paint position marker. |
protected void |
drawSelMarker(java.awt.Graphics g)
Invoked to paint selection marker. |
void |
focusGained(LwFocusEvent e)
Invoked when the light weight component gained focus. |
void |
focusLost(LwFocusEvent e)
Invoked when the light weight component lost focus. |
protected LwLayout |
getDefaultLayout()
Gets the default layout manager that is set with the container during initialization. |
java.awt.Point |
getLayoutOffset()
Returns the offset. |
PosController |
getPosController()
Gets the position controller. |
java.awt.Color |
getPosRectColor()
Gets the position rectangle color. |
java.awt.Color |
getSelectColor()
Gets the selection marker color. |
LwComponent |
getSelected()
Gets the selected item component. |
int |
getSelectedIndex()
Gets the selected item index. |
java.awt.Point |
getSOLocation()
Gets the scroll object location. |
java.awt.Dimension |
getSOSize()
Gets the scroll object size. |
void |
insert(int i,
java.lang.Object s,
LwComponent d)
Inserts the specified lightweight component with the specified constraints as a child of this container at the specified position in the container list. |
boolean |
isSelected(int i)
Tests if the item with the specified index is selected or not. |
void |
keyPressed(LwKeyEvent e)
Invoked when a key has been pressed. |
void |
keyReleased(LwKeyEvent e)
Invoked when a key has been released. |
void |
keyTyped(LwKeyEvent e)
Invoked when a key has been typed. |
void |
mouseClicked(LwMouseEvent e)
Invoked when the mouse button has been clicked on a light weight component. |
void |
mouseEntered(LwMouseEvent e)
Invoked when the mouse enters a light weight component. |
void |
mouseExited(LwMouseEvent e)
Invoked when the mouse exits a light weight component. |
void |
mousePressed(LwMouseEvent e)
Invoked when the mouse button has been pressed on a light weight component. |
void |
mouseReleased(LwMouseEvent e)
Invoked when the mouse button has been released on a light weight component. |
boolean |
moveContent()
Tests if the scroll component performs scrolling by changing its location or moving view. |
protected boolean |
notifyScrollMan(int index)
Notifies the scroll manager that an item component at the specified index should be fully visible. |
protected int |
pageSize(int d)
Returns the page size for the specified direction. |
void |
paintOnTop(java.awt.Graphics g)
Paints this component. |
protected void |
perform(int from)
Creates and fires appropriate selection event for list of selection listeners. |
void |
posChanged(PosEvent e)
Invoked when a virtual position has been changed. |
void |
remove(int i)
Removes the component, specified by the index, from this container. |
void |
removeAll()
Removes all child components from this container. |
void |
removeSelectionListener(LwActionListener l)
Removes the specified selection listener so it no longer receives selection events from this list component. |
void |
select(int index)
Selects the item by the specified index. |
void |
setLwLayout(LwLayout l)
Sets the layout manager for this container. |
void |
setPosController(PosController c)
Sets the specified position controller. |
void |
setPosRectColor(java.awt.Color c)
Sets the color for a position rectangle. |
void |
setScrollMan(ScrollMan m)
Sets the specified scroll manager for the scroll object. |
void |
setSelectColor(java.awt.Color c)
Sets the selection marker color. |
void |
setSOLocation(int x,
int y)
Sets the specified scroll object location. |
| Methods inherited from class org.zaval.lw.LwPanel |
add, add, calcPreferredSize, count, get, getLwComponentAt, getLwLayout, indexOf, insert, invalidate, recalc, remove, setBackground, setOpaque, toFront, updateCashedPs |
| Methods inherited from class org.zaval.lw.LwCanvas |
getBackground, getBounds, getHeight, getInsets, getLocation, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isVisible, paint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp |
| Methods inherited from class org.zaval.util.ValidationObject |
isValid |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zaval.lw.LwContainer |
add, add, getLwLayout, indexOf |
| Methods inherited from interface org.zaval.lw.LwComponent |
getLwComponentAt, getLwParent, getViewMan, getVisiblePart, setBackground, setEnabled, setLwParent, setViewMan, setVisible |
| Methods inherited from interface org.zaval.lw.Drawable |
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, setOpaque, update |
| Methods inherited from interface org.zaval.util.Validationable |
invalidate, isValid, validate |
| Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
| Methods inherited from interface org.zaval.lw.LayoutContainer |
count, get |
| Constructor Detail |
public LwList()
| Method Detail |
public boolean canHaveFocus()
LwComponentcanHaveFocus in interface LwComponentcanHaveFocus in class LwCanvasorg.zaval.lw.LwComponenttrue if the component can have the focus.public void setPosController(PosController c)
c - the specified position controller.public void setLwLayout(LwLayout l)
setLwLayout in interface LwContainersetLwLayout in class LwPanell - the specified layout manager.public PosController getPosController()
public java.awt.Color getSelectColor()
public void setSelectColor(java.awt.Color c)
c - the selection marker color.public java.awt.Color getPosRectColor()
public void setPosRectColor(java.awt.Color c)
c - the color.public void add(java.lang.String s)
s - the specified label.public void select(int index)
index - the specified item index.public int getSelectedIndex()
public boolean isSelected(int i)
true if the item with the specified index is selected; otherwise
false.public void addSelectionListener(LwActionListener l)
getData method returns Integer
object that is selection index.l - the specified listener.public void removeSelectionListener(LwActionListener l)
l - the specified listener.public void paintOnTop(java.awt.Graphics g)
paintOnTop in interface LwContainerpaintOnTop in class LwPanelg - the graphics context to be used for painting.protected void drawSelMarker(java.awt.Graphics g)
g - the graphics context to be used for painting.protected void drawPosMarker(java.awt.Graphics g)
g - the graphics context to be used for painting.public void mouseClicked(LwMouseEvent e)
LwMouseListenermouseClicked in interface LwMouseListenerorg.zaval.lw.event.LwMouseListenere - the specified mouse event.public void mouseEntered(LwMouseEvent e)
LwMouseListenermouseEntered in interface LwMouseListenerorg.zaval.lw.event.LwMouseListenere - the specified mouse event.public void mouseExited(LwMouseEvent e)
LwMouseListenermouseExited in interface LwMouseListenerorg.zaval.lw.event.LwMouseListenere - the specified mouse event.public void mousePressed(LwMouseEvent e)
LwMouseListenermousePressed in interface LwMouseListenerorg.zaval.lw.event.LwMouseListenere - the specified mouse event.public void mouseReleased(LwMouseEvent e)
LwMouseListenermouseReleased in interface LwMouseListenerorg.zaval.lw.event.LwMouseListenere - the specified mouse event.public void keyPressed(LwKeyEvent e)
LwKeyListenerkeyPressed in interface LwKeyListenerorg.zaval.lw.event.LwKeyListenere - the specified key event.public void keyReleased(LwKeyEvent e)
LwKeyListenerkeyReleased in interface LwKeyListenerorg.zaval.lw.event.LwKeyListenere - the specified key event.public void keyTyped(LwKeyEvent e)
LwKeyListenerkeyTyped in interface LwKeyListenerorg.zaval.lw.event.LwKeyListenere - the specified key event.public void focusGained(LwFocusEvent e)
LwFocusListenerfocusGained in interface LwFocusListenerorg.zaval.lw.event.LwFocusListenere - the specified focus event.public void focusLost(LwFocusEvent e)
LwFocusListenerfocusLost in interface LwFocusListenerorg.zaval.lw.event.LwFocusListenere - the specified focus event.public boolean catchInput(LwComponent child)
LwCompositecatchInput in interface LwCompositeorg.zaval.lw.LwCompositechild - the specified child component.true if input events for the child component should be caught by this
component; false otherwise.public void posChanged(PosEvent e)
PosListenerposChanged in interface PosListenerorg.zaval.misc.event.PosListenere - the specified pos event.
public void insert(int i,
java.lang.Object s,
LwComponent d)
LwContainercomponentAdded method its layout manager to inform the layout manager
that the new child has been added with the given constraints.insert in interface LwContainerinsert in class LwPanelorg.zaval.lw.LwContaineri - the position in the container list at which to insert
the component.s - the object expressing layout contraints for this.c - the lightweight component to be added.public void remove(int i)
LwContainercomponentRemoved method of the manager.remove in interface LwContainerremove in class LwPanelorg.zaval.lw.LwContainerindex - the index of the component to be removed.public void removeAll()
LwContainercomponentRemoved method of the manager for every child component
that has been removed.removeAll in interface LwContainerremoveAll in class LwPanelpublic java.awt.Point getSOLocation()
ScrollObjgetSOLocation in interface ScrollObjorg.zaval.misc.ScrollObj
public void setSOLocation(int x,
int y)
ScrollObjsetSOLocation in interface ScrollObjorg.zaval.misc.ScrollObjx - the specified x coordinate.y - the specified y coordinate.public java.awt.Dimension getSOSize()
ScrollObjgetSOSize in interface ScrollObjorg.zaval.misc.ScrollObjpublic void setScrollMan(ScrollMan m)
ScrollObjsetScrollMan in interface ScrollObjorg.zaval.misc.ScrollObjm - the specified scroll manager.public boolean moveContent()
ScrollObjmoveContent in interface ScrollObjorg.zaval.misc.ScrollObjtrue if the scroll component organizes scrolling by moving
its view; otherwise false.public java.awt.Point getLayoutOffset()
LayoutContainerx is offset for x-coordinates and y
is offset for y-coordinates. The ability to offset child components with a layout manager
is used with the library to organize scrolling.getLayoutOffset in interface LayoutContainergetLayoutOffset in class LwPanelorg.zaval.lw.LayoutContainerpublic LwComponent getSelected()
protected void perform(int from)
from - the selected item index.protected boolean notifyScrollMan(int index)
index - the specified index.true if the item component has not been fully visible; false
otherwise.protected int pageSize(int d)
d - the specified direction. Use -1 value to specify bottom-up direction and
1 value to specify up-bottom direction.protected LwLayout getDefaultLayout()
LwPanelgetDefaultLayout in class LwPanelorg.zaval.lw.LwPanel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||