org.zaval.lw
Class LwCombo
java.lang.Object
|
+--org.zaval.lw.LwCanvas
|
+--org.zaval.lw.LwPanel
|
+--org.zaval.lw.LwCombo
- All Implemented Interfaces:
- java.util.EventListener, Layoutable, LayoutContainer, LwActionListener, LwComponent, LwComposite, LwContainer, LwKeyListener, LwMouseListener, LwWinListener, Validationable
- public class LwCombo
- extends LwPanel
- implements LwActionListener, LwWinListener, LwMouseListener, LwKeyListener, LwComposite
This is combobox component. The component uses the LwAList component to store and show its item.
Use the getList and setList methods to work with the list. For example:
...
LwCombo combo = new LwCombo();
LwAList list = combo.getList();
list.addItem("Item 1");
list.addItem("Item 2");
list.addItem("Item 3");
...
By default the combo box component uses LwCompList as the list, so you can have any light-weight
component as the combo list item.
The component uses the special pad window to show the combo list. The window height can be
fixed by the setMaxPadHeight. In this case, if the list cannot be placed inside
the window wholly the scroll bar panel will appear.
The component uses the following resources:
-
"br.sunken" - as the border view of the component;
-
"br.plain" - as the popup window border view;
-
"cbt.out","cbt.over","cbt.pressed","cbt.disabled" - as the combo component button views;
-
"cbt.ps" - to fix the combo button size;
-
"cbt.ag" - to customize the combo button arrow glyph view;
-
"cb.lay" - to customize the combo component default layout;
| Fields inherited from class org.zaval.lw.LwCanvas |
bits, bottom, height, isValidValue, left, parent, psHeight, psWidth, right, skins, temporary, top, width, x, y |
|
Constructor Summary |
LwCombo()
Constructs a combobox component with no items. |
LwCombo(LwAList list)
Constructs a combobox component with no items and the given list as the combo list. |
| Methods inherited from class org.zaval.lw.LwPanel |
add, add, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, getPreferredSize, indexOf, insert, invalidate, isInvalidatedByChild, laidout, remove, setBackground, setLwLayout, setOpaque, setSize, toFront, updateCashedPs, validate |
| Methods inherited from class org.zaval.lw.LwCanvas |
calcInsets, customize, cvp, getBackground, getBottom, getBounds, getHeight, getInsets, getLeft, getLocation, getLwParent, getOrigin, getPSImpl, getRight, getSize, getTop, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isValid, isVisible, paint, recalc, repaint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setViewMan, setVisible, update, viewManChanged, vrp |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.zaval.lw.LwComponent |
getBackground, getLwComponentAt, getLwParent, getOrigin, getViewMan, getVisiblePart, isEnabled, isOpaque, paint, repaint, repaint, repaint, setBackground, setEnabled, setInsets, setLwParent, setOpaque, setViewMan, setVisible, update |
| Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
LwCombo
public LwCombo()
- Constructs a combobox component with no items. The constructor creates LwCompList as
the combo list element.
LwCombo
public LwCombo(LwAList list)
- Constructs a combobox component with no items and the given list as the combo list.
- Parameters:
list - the specified list component that has to be used as the combo list element.
setArrowGlyph
public void setArrowGlyph(LwView v)
canHaveFocus
public boolean canHaveFocus()
- Description copied from interface:
LwComponent
- Specifies if the component can have focus.
- Specified by:
canHaveFocus in interface LwComponent- Overrides:
canHaveFocus in class LwCanvas
- Following copied from interface:
org.zaval.lw.LwComponent
- Returns:
true if the component can have the focus.
getComboButton
public LwStButton getComboButton()
- Gets the combo button.
- Returns:
- a combo button.
insert
public void insert(int index,
java.lang.Object s,
LwComponent c)
- Description copied from interface:
LwContainer
- Inserts the specified lightweight component with the specified constraints as a child
of this container at the specified position in the container list. The method should call
the
componentAdded method its layout manager to inform the layout manager
that the new child has been added with the given constraints.
- Specified by:
insert in interface LwContainer- Overrides:
insert in class LwPanel
- Following copied from interface:
org.zaval.lw.LwContainer
- Parameters:
i - the position in the container list at which to insert
the component.s - the object expressing layout constraints for this.c - the lightweight component to be added.
remove
public void remove(int index)
- Description copied from interface:
LwContainer
- Removes the component, specified by the index, from this container.
The layout manager of this container should be informed by calling
the
componentRemoved method of the manager.
- Specified by:
remove in interface LwContainer- Overrides:
remove in class LwPanel
- Following copied from interface:
org.zaval.lw.LwContainer
- Parameters:
i - the index of the component to be removed.
removeAll
public void removeAll()
- Description copied from interface:
LwContainer
- Removes all child components from this container.
The layout manager of this container should be informed by calling
the
componentRemoved method of the manager for every child component
that has been removed.
- Specified by:
removeAll in interface LwContainer- Overrides:
removeAll in class LwPanel
getMaxPadHeight
public int getMaxPadHeight()
- Gets the max pad height.
- Returns:
- a max pad height.
setMaxPadHeight
public void setMaxPadHeight(int h)
- Sets the max pad height.
- Parameters:
h - the max pad height.
getList
public LwAList getList()
- Gets the list component that is used as the combo list to store and show the combo box content.
Use the list to modify the combobox content.
- Returns:
- a list component.
setList
public void setList(LwAList l)
- Sets the specified list component that will be used the combo list.
- Parameters:
l - the specified list component.
keyPressed
public void keyPressed(LwKeyEvent e)
- Description copied from interface:
LwKeyListener
- Invoked when a key has been pressed.
- Specified by:
keyPressed in interface LwKeyListener
- Following copied from interface:
org.zaval.lw.event.LwKeyListener
- Parameters:
e - the specified key event.
keyTyped
public void keyTyped(LwKeyEvent e)
- Description copied from interface:
LwKeyListener
- Invoked when a key has been typed.
- Specified by:
keyTyped in interface LwKeyListener
- Following copied from interface:
org.zaval.lw.event.LwKeyListener
- Parameters:
e - the specified key event.
keyReleased
public void keyReleased(LwKeyEvent e)
- Description copied from interface:
LwKeyListener
- Invoked when a key has been released.
- Specified by:
keyReleased in interface LwKeyListener
- Following copied from interface:
org.zaval.lw.event.LwKeyListener
- Parameters:
e - the specified key event.
actionPerformed
public void actionPerformed(java.lang.Object src,
java.lang.Object data)
- Description copied from interface:
LwActionListener
- Invoked when an action event occurred.
- Specified by:
actionPerformed in interface LwActionListener
- Following copied from interface:
org.zaval.lw.event.LwActionListener
- Parameters:
src - the specified source where the event has been originated.data - the event data.
winOpened
public void winOpened(LwLayer winLayer,
LwComponent target)
- Description copied from interface:
LwWinListener
- Invoked when the light weight window component has been opened.
- Specified by:
winOpened in interface LwWinListener
- Following copied from interface:
org.zaval.lw.event.LwWinListener
- Parameters:
winLayer - the specified window layer where the window resided.target - the specified window component.
winActivated
public void winActivated(LwLayer winLayer,
LwComponent target)
- Description copied from interface:
LwWinListener
- Invoked when the light weight window component has been activated.
- Specified by:
winActivated in interface LwWinListener
- Following copied from interface:
org.zaval.lw.event.LwWinListener
- Parameters:
winLayer - the specified window layer where the window resided.target - the specified window component.
winClosed
public void winClosed(LwLayer winLayer,
LwComponent target)
- Description copied from interface:
LwWinListener
- Invoked when the light weight window component has been closed.
- Specified by:
winClosed in interface LwWinListener
- Following copied from interface:
org.zaval.lw.event.LwWinListener
- Parameters:
winLayer - the specified window layer where the window resided.target - the specified window component.
winDeactivated
public void winDeactivated(LwLayer winLayer,
LwComponent target)
- Description copied from interface:
LwWinListener
- Invoked when the light weight window component has been deactivated.
- Specified by:
winDeactivated in interface LwWinListener
- Following copied from interface:
org.zaval.lw.event.LwWinListener
- Parameters:
winLayer - the specified window layer where the window resided.target - the specified window component.
mouseClicked
public void mouseClicked(LwMouseEvent e)
- Description copied from interface:
LwMouseListener
- Invoked when the mouse button has been clicked on a light weight component.
- Specified by:
mouseClicked in interface LwMouseListener
- Following copied from interface:
org.zaval.lw.event.LwMouseListener
- Parameters:
e - the specified mouse event.
mouseEntered
public void mouseEntered(LwMouseEvent e)
- Description copied from interface:
LwMouseListener
- Invoked when the mouse enters a light weight component.
- Specified by:
mouseEntered in interface LwMouseListener
- Following copied from interface:
org.zaval.lw.event.LwMouseListener
- Parameters:
e - the specified mouse event.
mouseExited
public void mouseExited(LwMouseEvent e)
- Description copied from interface:
LwMouseListener
- Invoked when the mouse exits a light weight component.
- Specified by:
mouseExited in interface LwMouseListener
- Following copied from interface:
org.zaval.lw.event.LwMouseListener
- Parameters:
e - the specified mouse event.
mouseReleased
public void mouseReleased(LwMouseEvent e)
- Description copied from interface:
LwMouseListener
- Invoked when the mouse button has been released on a light weight component.
- Specified by:
mouseReleased in interface LwMouseListener
- Following copied from interface:
org.zaval.lw.event.LwMouseListener
- Parameters:
e - the specified mouse event.
mousePressed
public void mousePressed(LwMouseEvent e)
- Description copied from interface:
LwMouseListener
- Invoked when the mouse button has been pressed on a light weight component.
- Specified by:
mousePressed in interface LwMouseListener
- Following copied from interface:
org.zaval.lw.event.LwMouseListener
- Parameters:
e - the specified mouse event.
paintOnTop
public void paintOnTop(java.awt.Graphics g)
- Description copied from interface:
LwContainer
- Paints additional elements (for example marker) after the container and its child components
have been rendered.
- Specified by:
paintOnTop in interface LwContainer- Overrides:
paintOnTop in class LwPanel
- Following copied from interface:
org.zaval.lw.LwContainer
- Parameters:
g - the graphics context.
catchInput
public boolean catchInput(LwComponent child)
- Description copied from interface:
LwComposite
- Checks if the input event for the specified child component should be caught by the parent.
- Specified by:
catchInput in interface LwComposite
- Following copied from interface:
org.zaval.lw.LwComposite
- Parameters:
child - the specified child component.- Returns:
true if input events for the child component should be caught by this
component; false otherwise.
getWinpad
public LwComponent getWinpad()
- Gets the combo pad window.
- Returns:
- a combo pad window.
getDefaultLayout
protected LwLayout getDefaultLayout()
- Description copied from class:
LwPanel
- Gets the default layout manager that is set with the container during initialization.
This implementation of the method returns LwRastLayout as the default layout manager, the
layout manager is got as a static object by "def.lay" key.
- Overrides:
getDefaultLayout in class LwPanel
- Following copied from class:
org.zaval.lw.LwPanel
- Returns:
- a layout manager.
calcPreferredSize
protected java.awt.Dimension calcPreferredSize()
- Description copied from class:
LwPanel
- Gets the "pure" preferred size for this component. The method has not be overridden,
because it determines the preferred size by the layout manager.
- Overrides:
calcPreferredSize in class LwPanel
- Following copied from class:
org.zaval.lw.LwPanel
- Returns:
- a "pure" preferred size.
|