org.zaval.lw
Class LwRoot

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--org.zaval.lw.LwRoot
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ComponentListener, Drawable, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, Layoutable, LayoutContainer, LwComponent, LwContainer, LwDesktop, LwLayout, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, Validationable

public class LwRoot
extends java.awt.Panel
implements LwDesktop, java.awt.event.ComponentListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.FocusListener, LwLayout

This class is a root light weight component that implements LwDesktop interface. The main purpose of the class to provide connection between native Java AWT library implementation and light weight components hierarchy. So, on the one hand the class is light weight components (implements LwContainer interface) and on the other hand this class inherits Java AWT component (java.awt.Panel). Using the class the light weight library:

Basing on the description above, to create own lightweight application you have to use the class as a root light weight container. The sample below shows the root component usage:
   ...
   LwContainer root = new LwRoot();
   root.getRootLayer().setLwLayout(new LwBorderLayout());
   LwButton button = new LwButton("Ok");
   root.getRootLayer().add(LwBorderLayout.CENTER, button);
   ...
   java.awt.Frame frame = java.awt.Frame();
   frame.setSize(400, 400);
   frame.setLayout(new BorderLayout());
   frame.add("Center", root);
   frame.setVisible(true);
   ...
   OR
   ...
   Applet applet = new Applet();
   applet.setLayout(new BorderLayout());
   applet.add("Center", root);
   ...
 
First of all the sample above uses the root layer component as a light weight container for creating the light weight hierarchy. The second part shows the usage of the root as a part of Java AWT frame component and a java applet.

More easy way is using of LwFrame class that inherits java.awt.Frame and provides the lightweight top-level container ready to create lightweight hierarchy:

   ...
   LwFrame frame = LwFrame();
   LwContainer root = frame.getRoot();
   root.setLwLayout(new LwBorderLayout());
   LwButton button = new LwButton("Ok");
   root.add(LwBorderLayout.CENTER, button);
   frame.setSize(400, 400);
   frame.setVisible(true);
   ...
 

See Also:
Serialized Form

Inner classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int CURSOR_PROPERTY
          Defines cursor property id.
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LwRoot()
          Constructs the class instance.
 
Method Summary
 void add(LwComponent c)
          Adds the specified lightweight component as a child of this container.
 void add(java.lang.Object s, LwComponent c)
          Adds the specified lightweight component with the specified constraints as a child of this 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 componentHidden(java.awt.event.ComponentEvent e)
          Invoked when component has been hidden.
 void componentMoved(java.awt.event.ComponentEvent e)
          Invoked when component has been moved.
 void componentRemoved(Layoutable lw, int index)
          Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager.
 void componentResized(java.awt.event.ComponentEvent e)
          Invoked when component has been resized.
 void componentShown(java.awt.event.ComponentEvent e)
          Invoked when component has been shown.
 int count()
          Returns the number of child elements in this container.
 void focusGained(java.awt.event.FocusEvent e)
          Invoked when a component gains the keyboard focus.
 void focusLost(java.awt.event.FocusEvent e)
          Invoked when a component loses the keyboard focus.
 Layoutable get(int index)
          Gets a child element at the given index.
 int getHeight()
          Gets the height of this component.
 java.awt.Insets getInsets()
          Determines the insets of this component.
 LwLayer getLayer(java.lang.Object id)
          Gets the layer by the specified id.
 java.lang.Object[] getLayersIDs()
          Gets the list of available layers' IDs.
 java.awt.Point getLayoutOffset()
          Returns the offset.
 LwComponent getLwComponentAt(int x, int y)
          Determines if the component or an immediate child component contains the (x, y) location in its visible part and if so, returns the component.
 LwLayout getLwLayout()
          Gets a layout manager for this container.
 LwComponent getLwParent()
          Gets the lightweight parent of this component.
 java.awt.Point getOrigin()
          Returns an origin of the drawable component.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this component.
 java.lang.Object getProperty(int id)
          Gets the value for the specified property.
 LwLayer getRootLayer()
          Gets the root layer that should be used to add a light weight component on the desktop surface.
 LwViewMan getViewMan(boolean b)
          Returns a view manager of the component.
 java.awt.Rectangle getVisiblePart()
          Returns the bounding rectangle of the visible part for the component.
 int getWidth()
          Gets the width of this component.
 int getX()
          Gets the x location of this component specifying the component top-left corner.
 int getY()
          Gets the y location of this component specifying the component top-left corner.
 int indexOf(LwComponent c)
          Searches the specified component among this container children and returns an index of the component in the child list.
 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 isFocusTraversable()
          Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal.
 boolean isOpaque()
          Gets the opaque of this component.
 void keyPressed(java.awt.event.KeyEvent e)
          Invoked when a key has been pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          Invoked when a key has been released.
 void keyTyped(java.awt.event.KeyEvent e)
          Invoked when a key has been typed.
 void layout(LayoutContainer target)
          Lays out the child layoutable components inside the layout container.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons no down).
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void paint(java.awt.Graphics g)
          Paints this drawable component.
 void paintOnTop(java.awt.Graphics g)
          Paints additional elements (for example, marker) after the container and its child components have been rendered.
 void remove(int i)
          Removes the component, specified by the index, from this container.
 void removeAll()
          Removes all child components from this container.
 void reshape(int x, int y, int w, int h)
           
 void setEnabled(boolean b)
          Enables or disables this component.
 void setLwLayout(LwLayout l)
          Sets the layout manager for this container.
 void setLwParent(LwComponent p)
          Sets the lightweight parent of this component.
 void setOpaque(boolean b)
          Sets the opaque of this component.
 void setProperty(int id, java.lang.Object value)
          Sets the value for the specified property.
 void setViewMan(LwViewMan v)
          Sets the specified view manager for the component.
 void update(java.awt.Graphics g)
          Updates this drawable component.
 void validate()
          Validates this object.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getListeners, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, removeNotify, setFont, setLayout, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.lw.LwDesktop
createImage, getGraphics
 
Methods inherited from interface org.zaval.lw.LwComponent
setBackground, setVisible
 
Methods inherited from interface org.zaval.lw.Drawable
getBackground, isEnabled, repaint, repaint
 
Methods inherited from interface org.zaval.util.Validationable
invalidate, isValid
 
Methods inherited from interface org.zaval.lw.Layoutable
getBounds, getLocation, getSize, isVisible, setLocation, setSize
 

Field Detail

CURSOR_PROPERTY

public static final int CURSOR_PROPERTY
Defines cursor property id. The id should be used as an argument for getProperty and setProperty method to control native cursor state.
Constructor Detail

LwRoot

public LwRoot()
Constructs the class instance.
Method Detail

setLwLayout

public void setLwLayout(LwLayout l)
Description copied from interface: LwContainer
Sets the layout manager for this container.
Specified by:
setLwLayout in interface LwContainer
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
m - the specified layout manager.

getX

public int getX()
Description copied from interface: Layoutable
Gets the x location of this component specifying the component top-left corner. The location is relative to the parent component coordinate space.
Specified by:
getX in interface Layoutable
Overrides:
getX in class java.awt.Component
Following copied from interface: org.zaval.lw.Layoutable
Returns:
an x coordinate representing the top-left corner of the component bounds in the coordinate space of the component parent.

getY

public int getY()
Description copied from interface: Layoutable
Gets the y location of this component specifying the component top-left corner. The location is relative to the parent component coordinate space.
Specified by:
getY in interface Layoutable
Overrides:
getY in class java.awt.Component
Following copied from interface: org.zaval.lw.Layoutable
Returns:
an y coordinate representing the top-left corner of the component bounds in the coordinate space of the component parent.

getWidth

public int getWidth()
Description copied from interface: Layoutable
Gets the width of this component.
Specified by:
getWidth in interface Layoutable
Overrides:
getWidth in class java.awt.Component
Following copied from interface: org.zaval.lw.Layoutable
Returns:
a width of the component.

getHeight

public int getHeight()
Description copied from interface: Layoutable
Gets the height of this component.
Specified by:
getHeight in interface Layoutable
Overrides:
getHeight in class java.awt.Component
Following copied from interface: org.zaval.lw.Layoutable
Returns:
a height of the component.

getLwLayout

public LwLayout getLwLayout()
Description copied from interface: LwContainer
Gets a layout manager for this container.
Specified by:
getLwLayout in interface LwContainer
Following copied from interface: org.zaval.lw.LwContainer
Returns:
a layout manager.

getLwParent

public LwComponent getLwParent()
Gets the lightweight parent of this component. The method always returns null, since the root component cannot have a light weight component as a parent, because this component should be used as a top-level light weight component.
Specified by:
getLwParent in interface LwComponent
Returns:
null.

setLwParent

public void setLwParent(LwComponent p)
Sets the lightweight parent of this component. It is impossible to use the method to define the parent component, because the class is used as a top-level parent component. The method will throw RuntimeException if you try to call it.
Specified by:
setLwParent in interface LwComponent
Parameters:
p - the parent component of this lightweight component.

getViewMan

public LwViewMan getViewMan(boolean b)
Description copied from interface: LwComponent
Returns a view manager of the component. The view manager can be null. The input argument autoCreate defines if the view manager has to be created automatically in a case if it has not been determined before. It means, if the argument is true and the view manager is null, than the component will try to create and initialize its view manager by a default view manager. If the argument is false than the method returns the component view manager as is.
Specified by:
getViewMan in interface LwComponent
Following copied from interface: org.zaval.lw.LwComponent
Parameters:
autoCreate - the flag defines if the view manager should be created automatically.
Returns:
a view manager for the component.

setViewMan

public void setViewMan(LwViewMan v)
Description copied from interface: LwComponent
Sets the specified view manager for the component. The view manager defines set of views that are used as a part of the component face.
Specified by:
setViewMan in interface LwComponent
Following copied from interface: org.zaval.lw.LwComponent
Parameters:
man - the view manager to set for the component.

getVisiblePart

public java.awt.Rectangle getVisiblePart()
Description copied from interface: LwComponent
Returns the bounding rectangle of the visible part for the component.
Specified by:
getVisiblePart in interface LwComponent
Following copied from interface: org.zaval.lw.LwComponent
Returns:
a visible part bounding rectangle.

getLwComponentAt

public LwComponent getLwComponentAt(int x,
                                    int y)
Description copied from interface: LwComponent
Determines if the component or an immediate child component contains the (x, y) location in its visible part and if so, returns the component.
Specified by:
getLwComponentAt in interface LwComponent
Following copied from interface: org.zaval.lw.LwComponent
Parameters:
x - the x coordinate.
y - the y coordinate.
Returns:
the component or subcomponent that contains the (x, y) location; null if the location is outside this component.

isOpaque

public boolean isOpaque()
Gets the opaque of this component. If the method returns false than the component is transparent, in this case update method has not be called during painting process. The method allways returns true as result, because this is root component.
Specified by:
isOpaque in interface Drawable
Overrides:
isOpaque in class java.awt.Component
Returns:
true if the component is opaque; otherwise false.

get

public Layoutable get(int index)
Description copied from interface: LayoutContainer
Gets a child element at the given index.
Specified by:
get in interface LayoutContainer
Following copied from interface: org.zaval.lw.LayoutContainer
Parameters:
index - the index of a child to be returned.
Returns:
a child element at the specified index.

count

public int count()
Description copied from interface: LayoutContainer
Returns the number of child elements in this container.
Specified by:
count in interface LayoutContainer
Following copied from interface: org.zaval.lw.LayoutContainer
Returns:
a number of child elements in this container.

add

public void add(LwComponent c)
Description copied from interface: LwContainer
Adds the specified lightweight component as a child of this container. The method should call componentAdded method its layout manager to inform the layout manager that the new child has been added.
Specified by:
add in interface LwContainer
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
c - the lightweight component to be added.

add

public void add(java.lang.Object s,
                LwComponent c)
Description copied from interface: LwContainer
Adds the specified lightweight component with the specified constraints as a child of this container. The method should call componentAdded method its layout manager to inform the layout manager that the new child has been added.
Specified by:
add in interface LwContainer
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
s - the object expressing layout contraints for this.
c - the lightweight component to be added.

insert

public void insert(int i,
                   java.lang.Object s,
                   LwComponent d)
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 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
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 contraints for this.
c - the lightweight component to be added.

remove

public void remove(int i)
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 componentRemoved method of the manager.
Specified by:
remove in interface LwContainer
Overrides:
remove in class java.awt.Container
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
index - 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 componentRemoved method of the manager for every child component that has been removed.
Specified by:
removeAll in interface LwContainer
Overrides:
removeAll in class java.awt.Container

indexOf

public int indexOf(LwComponent c)
Description copied from interface: LwContainer
Searches the specified component among this container children and returns an index of the component in the child list. If the component has not been found than the method returns -1.
Specified by:
indexOf in interface LwContainer
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
c - the component to get index.
Returns:
a child component index inside the container children list.

validate

public void validate()
Description copied from interface: Validationable
Validates this object.
Specified by:
validate in interface Validationable
Overrides:
validate in class java.awt.Container

setEnabled

public void setEnabled(boolean b)
Description copied from interface: LwComponent
Enables or disables this component. An enabled component can participate in events handling and performing processes. Component is enabled initially by default.
Specified by:
setEnabled in interface LwComponent
Overrides:
setEnabled in class java.awt.Component
Following copied from interface: org.zaval.lw.LwComponent
Parameters:
b - if the value is true - enables the component; otherwise disables this component.

getPreferredSize

public java.awt.Dimension getPreferredSize()
Description copied from interface: Layoutable
Gets the preferred size of this component.
Specified by:
getPreferredSize in interface Layoutable
Overrides:
getPreferredSize in class java.awt.Container
Following copied from interface: org.zaval.lw.Layoutable
Returns:
a dimension object indicating this component preferred size.

getInsets

public java.awt.Insets getInsets()
Description copied from interface: Layoutable
Determines the insets of this component. Take care that insets for lightweight components differ from Java AWT components. The lightweight insets defines indents from "left", "top", "right" and "bottom" of the component view.
Specified by:
getInsets in interface Layoutable
Overrides:
getInsets in class java.awt.Container
Following copied from interface: org.zaval.lw.Layoutable
Returns:
an insets of this component.

update

public void update(java.awt.Graphics g)
Description copied from interface: Drawable
Updates this drawable component. The calling of the method precedes the calling of paint method and it is performed with repaint method. The method can be used to fill the drawable component with the background color if the component is opaque.
Specified by:
update in interface Drawable
Overrides:
update in class java.awt.Container
Following copied from interface: org.zaval.lw.Drawable
Parameters:
g - the specified context to be used for updating.

paint

public void paint(java.awt.Graphics g)
Description copied from interface: Drawable
Paints this drawable component.
Specified by:
paint in interface Drawable
Overrides:
paint in class java.awt.Container
Following copied from interface: org.zaval.lw.Drawable
Parameters:
g - the graphics context to be used for painting.

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
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
g - the graphics context.

getRootLayer

public LwLayer getRootLayer()
Description copied from interface: LwDesktop
Gets the root layer that should be used to add a light weight component on the desktop surface.
Specified by:
getRootLayer in interface LwDesktop
Following copied from interface: org.zaval.lw.LwDesktop
Returns:
a root layer.

getLayer

public LwLayer getLayer(java.lang.Object id)
Description copied from interface: LwDesktop
Gets the layer by the specified id. There are two layers available by the "root" and "win" IDs.
Specified by:
getLayer in interface LwDesktop
Following copied from interface: org.zaval.lw.LwDesktop
Parameters:
id - by the specified id.
Returns:
a layer.

getLayersIDs

public java.lang.Object[] getLayersIDs()
Description copied from interface: LwDesktop
Gets the list of available layers' IDs.
Specified by:
getLayersIDs in interface LwDesktop
Following copied from interface: org.zaval.lw.LwDesktop
Returns:
a list of the layers' IDs.

componentHidden

public void componentHidden(java.awt.event.ComponentEvent e)
Invoked when component has been hidden.
Specified by:
componentHidden in interface java.awt.event.ComponentListener

componentMoved

public void componentMoved(java.awt.event.ComponentEvent e)
Invoked when component has been moved.
Specified by:
componentMoved in interface java.awt.event.ComponentListener

reshape

public void reshape(int x,
                    int y,
                    int w,
                    int h)
Overrides:
reshape in class java.awt.Component

componentResized

public void componentResized(java.awt.event.ComponentEvent e)
Invoked when component has been resized.
Specified by:
componentResized in interface java.awt.event.ComponentListener

componentShown

public void componentShown(java.awt.event.ComponentEvent e)
Invoked when component has been shown.
Specified by:
componentShown in interface java.awt.event.ComponentListener

isFocusTraversable

public boolean isFocusTraversable()
Returns whether this component can be traversed using Tab or Shift-Tab keyboard focus traversal. If this method returns "false", this component may still request the keyboard focus using requestFocus(), but it will not automatically be assigned focus during tab traversal.
Overrides:
isFocusTraversable in class java.awt.Component

setOpaque

public void setOpaque(boolean b)
Sets the opaque of this component. Use false argument value to make a transparent component from this component. The method usage has not any effect, because the root component has to be always opaque.
Specified by:
setOpaque in interface Drawable
Parameters:
b - the opaque flag.

getOrigin

public java.awt.Point getOrigin()
Description copied from interface: Drawable
Returns an origin of the drawable component. The origin defines an offset of the component view relatively the component point of origin. The method can be implemented to organize scrolling of the drawable component view.
Specified by:
getOrigin in interface Drawable
Following copied from interface: org.zaval.lw.Drawable
Returns:
an origin of the component.

getLayoutOffset

public java.awt.Point getLayoutOffset()
Description copied from interface: LayoutContainer
Returns the offset. The offset can be used with a layout manager to offset child components locations of the container according to the offset values. The offset is represented with java.awt.Point class, the x 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.
Specified by:
getLayoutOffset in interface LayoutContainer
Following copied from interface: org.zaval.lw.LayoutContainer
Returns:
an offset to move children.

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Invoked when a component gains the keyboard focus.
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus.
Specified by:
focusLost in interface java.awt.event.FocusListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.
Specified by:
mouseReleased in interface java.awt.event.MouseListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Invoked when a key has been pressed.
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Invoked when a key has been released.
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Invoked when a key has been typed. This event occurs when a key press is followed by a key release.
Specified by:
keyTyped in interface java.awt.event.KeyListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down).
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

componentAdded

public void componentAdded(java.lang.Object id,
                           Layoutable lw,
                           int index)
Description copied from interface: LwLayout
Invoked when the specified layoutable component is added to the layout container (that uses the layout manager). The specified constraints, layoutable component and child index are passed as arguments into the method.
Specified by:
componentAdded in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
id - the layoutable component constraints.
lw - the layoutable component that has been added.
index - the child index.

componentRemoved

public void componentRemoved(Layoutable lw,
                             int index)
Description copied from interface: LwLayout
Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager.
Specified by:
componentRemoved in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
lw - the layoutable component that has been removed.
index - the child component index.

calcPreferredSize

public java.awt.Dimension calcPreferredSize(LayoutContainer target)
Description copied from interface: LwLayout
Calculates the preferred size dimension for the layout container. The method has to calculate "pure" preferred size, it means that an insets of the container should not be considered.
Specified by:
calcPreferredSize in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
target - the layout container.
Returns:
a "pure" preferred size.

layout

public void layout(LayoutContainer target)
Description copied from interface: LwLayout
Lays out the child layoutable components inside the layout container.
Specified by:
layout in interface LwLayout
Following copied from interface: org.zaval.lw.LwLayout
Parameters:
target - the layout container that needs to be laid out.

getProperty

public java.lang.Object getProperty(int id)
Description copied from interface: LwDesktop
Gets the value for the specified property.
Specified by:
getProperty in interface LwDesktop
Following copied from interface: org.zaval.lw.LwDesktop
Parameters:
id - the specified property id.
Returns:
a value of the property.

setProperty

public void setProperty(int id,
                        java.lang.Object value)
Description copied from interface: LwDesktop
Sets the value for the specified property.
Specified by:
setProperty in interface LwDesktop
Following copied from interface: org.zaval.lw.LwDesktop
Parameters:
id - the specified property id.
value - the specified property value.

canHaveFocus

public boolean canHaveFocus()
Description copied from interface: LwComponent
Specifies if the component can have focus.
Specified by:
canHaveFocus in interface LwComponent
Following copied from interface: org.zaval.lw.LwComponent
Returns:
true if the component can have the focus.


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