|
||||||||||
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.LwNotebook
This is notebook container. The main features of the container are shown in the list below:
setTitleAlignment
to define the alignment.
The default tabs alignment is "top".
addPage
method. The library provides standard
tab view - LwTabRender.
add
, insert
, remove
methods can be used to change
the notebook pages components.
enablePage
, isPageEnabled
methods can be used to change
enabled state of the specified page.
addSelectionListener
and removeSelectionListener
methods. The selection event is represented by
the LwActionEvent. Use getData
method of the event to get a page index that
has been selected.
The sample below illustrates the notebook container usage:
... LwNotebook n = new LwNotebook(); n.addPage("Tab 1", new LwPanel()); n.addPage("Tab 2", new LwPanel()); n.addPage("Tab 3", new LwPanel()); ...
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 | |
LwNotebook()
Constructs a notebook container using default (Alignment.TOP) tabs alignment. |
|
LwNotebook(int orient)
Constructs a notebook container using the specified tabs alignment. |
Method Summary | |
void |
addPage(LwView v,
LwComponent c)
Adds the specified component as the notebook page and sets the specified view as. |
void |
addPage(java.lang.String title,
LwComponent c)
Adds the page with the specified title. |
void |
addSelectionListener(LwActionListener l)
Adds the specified selection listener to receive selection events from this notebook container. |
java.awt.Dimension |
calcPreferredSize(LayoutContainer target)
Calculates the preferred size dimension for the layout container. |
boolean |
canHaveFocus()
Specifies if the component can have focus. |
void |
componentAdded(java.lang.Object id,
Layoutable lw,
int index)
Invoked when the specified layoutable component is added to the layout container (that uses the layout manager). |
void |
componentRemoved(Layoutable lw,
int index)
Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager. |
void |
enablePage(int index,
boolean b)
Sets the given enabled state for the specified page. |
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. |
LwView |
getPageView(int i)
Returns the tab view for the specified page. |
int |
getSelectedIndex()
Gets the tab index for the tab that is selected at the moment. |
int |
getTitleAlignment()
Gets the tabs alignment. |
java.awt.Rectangle |
getTitleBounds()
Gets the title size and location. |
boolean |
isPageEnabled(int index)
Tests if the specified page is enabled or not. |
boolean |
isSelected(int i)
Tests if the tab 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 |
layout(LayoutContainer target)
Lays out the child layoutable components inside the layout container. |
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. |
void |
paint(java.awt.Graphics g)
Paints this component. |
protected void |
perform(int index)
Fires appropriate selection event for list of selection listeners. |
protected void |
recalc()
The method is overrided by the component for internal usage. |
void |
remove(int i)
Removes the component at the specified 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 notebook conatiner. |
void |
select(int index)
Selects the tab by the specified index. |
void |
setTitleAlignment(int o)
Sets the specified tabs alignment. |
Methods inherited from class org.zaval.lw.LwPanel |
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, paintOnTop, remove, setBackground, setLwLayout, 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, 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.LwComponent |
getLwParent, getViewMan, getVisiblePart, setEnabled, setLwParent, setViewMan, setVisible |
Methods inherited from interface org.zaval.lw.Drawable |
getBackground, getOrigin, isEnabled, isOpaque, repaint, repaint, update |
Methods inherited from interface org.zaval.util.Validationable |
isValid, validate |
Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
Constructor Detail |
public LwNotebook()
public LwNotebook(int orient)
orient
- the specified tabs alignement.Method Detail |
public boolean canHaveFocus()
LwComponent
canHaveFocus
in class LwCanvas
org.zaval.lw.LwComponent
true
if the component can have the focus.public int getTitleAlignment()
getTitleAlignment
in interface LwTitleInfo
public void setTitleAlignment(int o)
o
- the specified tabs alignement.public boolean isPageEnabled(int index)
index
- the specified page index.true
if the page is enaled;otherwise false
.public void enablePage(int index, boolean b)
index
- the specified page index.b
- the given enabled state.public void addPage(java.lang.String title, LwComponent c)
title
- the specified tab title.c
- the specified page component.public void addPage(LwView v, LwComponent c)
v
- the specified tab view.c
- the specified page component.public LwView getPageView(int i)
i
- the specified page number.public void remove(int i)
LwPanel
componentRemoved
method of the manager.remove
in class LwPanel
org.zaval.lw.LwPanel
i
- the index of the component to be removed.public void removeAll()
LwPanel
componentRemoved
method of the manager for every child that has been
removed.removeAll
in class LwPanel
protected void recalc()
recalc
in class LwPanel
public int getSelectedIndex()
public void paint(java.awt.Graphics g)
paint
in class LwCanvas
g
- the graphics context to be used for painting.public void keyPressed(LwKeyEvent e)
LwKeyListener
keyPressed
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void mousePressed(LwMouseEvent e)
LwMouseListener
mousePressed
in interface LwMouseListener
org.zaval.lw.event.LwMouseListener
e
- the specified mouse event.public void keyReleased(LwKeyEvent e)
LwKeyListener
keyReleased
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void keyTyped(LwKeyEvent e)
LwKeyListener
keyTyped
in interface LwKeyListener
org.zaval.lw.event.LwKeyListener
e
- the specified key event.public void mouseEntered(LwMouseEvent e)
LwMouseListener
mouseEntered
in interface LwMouseListener
org.zaval.lw.event.LwMouseListener
e
- the specified mouse event.public void mouseExited(LwMouseEvent e)
LwMouseListener
mouseExited
in interface LwMouseListener
org.zaval.lw.event.LwMouseListener
e
- the specified mouse event.public void mouseClicked(LwMouseEvent e)
LwMouseListener
mouseClicked
in interface LwMouseListener
org.zaval.lw.event.LwMouseListener
e
- the specified mouse event.public void mouseReleased(LwMouseEvent e)
LwMouseListener
mouseReleased
in interface LwMouseListener
org.zaval.lw.event.LwMouseListener
e
- the specified mouse event.public void componentAdded(java.lang.Object id, Layoutable lw, int index)
LwLayout
componentAdded
in interface LwLayout
org.zaval.lw.LwLayout
id
- the layoutable component constraints.lw
- the layoutable component that has been added.index
- the child index.public void componentRemoved(Layoutable lw, int index)
LwLayout
componentRemoved
in interface LwLayout
org.zaval.lw.LwLayout
lw
- the layoutable component that has been removed.index
- the child component index.public java.awt.Dimension calcPreferredSize(LayoutContainer target)
LwLayout
calcPreferredSize
in interface LwLayout
org.zaval.lw.LwLayout
target
- the layout container.public void layout(LayoutContainer target)
LwLayout
layout
in interface LwLayout
org.zaval.lw.LwLayout
target
- the layout container that needs to be laid out.public void select(int index)
-1
index value to de-select
current selected tab, in this case no one tab will be selected.index
- the specified item index.public boolean isSelected(int i)
true
if the tab with the specified index is selected; otherwise
false
.public void addSelectionListener(LwActionListener l)
l
- the specified listener.public void removeSelectionListener(LwActionListener l)
l
- the specified listener.public java.awt.Rectangle getTitleBounds()
LwTitleInfo
y
coordinate to locate the border and x
coordinate is calculated depending on the title border alignment.
x
coordinate to locate the border and y
coordinate is calculated depending on the title border alignment.
getTitleBounds
in interface LwTitleInfo
org.zaval.lw.LwTitleInfo
public void focusGained(LwFocusEvent e)
LwFocusListener
focusGained
in interface LwFocusListener
org.zaval.lw.event.LwFocusListener
e
- the specified focus event.public void focusLost(LwFocusEvent e)
LwFocusListener
focusLost
in interface LwFocusListener
org.zaval.lw.event.LwFocusListener
e
- the specified focus event.protected void perform(int index)
getData
method
returns the tab index that has been selectedindex
- the tab index that has been selected.protected LwLayout getDefaultLayout()
getDefaultLayout
in class LwPanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |