org.zaval.lw
Class LwWindow

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwPanel
                    |
                    +--org.zaval.lw.LwWindow
All Implemented Interfaces:
Cursorable, Drawable, java.util.EventListener, Layoutable, LayoutContainer, LwActionListener, LwComponent, LwComposite, LwContainer, LwMouseMotionListener, LwWinListener, Validationable
Direct Known Subclasses:
LwBlankDialog

public class LwWindow
extends LwPanel
implements LwMouseMotionListener, LwWinListener, LwComposite, LwActionListener, Cursorable

This class is window lightweight component that can be used as a desktop window. The view of the component is like standard window (java.awt.Frame for example)that contains following elements and features:


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
LwWindow()
          Constructs the window component with empty title.
LwWindow(java.lang.String s)
          Constructs the window component with the specified title.
 
Method Summary
 void actionPerformed(LwActionEvent e)
          Invoked when an action event occured.
 boolean catchInput(LwComponent c)
          Checks if input events for the specified child component should be caught.
 void endDragged(LwMouseMotionEvent e)
          Invoked when the mouse ends dragged.
 int getCursorType(LwComponent target, int x, int y)
          Gets the cursor type for the specified location of the given component.
protected  LwLayout getDefaultLayout()
          Gets the default layout manager that is set with the container during initialization.
 LwContainer getRoot()
          Gets the root container.
 java.lang.String getTitle()
          Gets the window title.
 LwComponent getTitlePanel()
           
 void hideOnClose(boolean b)
          Sets the specified reaction to the close button pressing.
 boolean isHideOnClose()
          Tests if the close window button will hide the window.
 boolean isSizeable()
          Tests if the window component is sizeable.
 void mouseDragged(LwMouseMotionEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseMoved(LwMouseMotionEvent e)
          Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
 void setCaptionColor(boolean state, java.awt.Color c)
          Sets the specified color that will be used as background color of the window caption for the specified window state.
 void setIcon(LwComponent i)
          Sets the specified component as the window icon.
 void setSizeable(boolean b)
          Enables sizing of the window.
 void setTitle(java.lang.String s)
          Sets the specified title.
 void startDragged(LwMouseMotionEvent e)
          Invoked when the mouse starts dragged.
 void winActivated(LwWinEvent e)
          Invoked when the light weight window component has been activated.
 void winClosed(LwWinEvent e)
          Invoked when the light weight window component has been closed.
 void winDeactivated(LwWinEvent e)
          Invoked when the light weight window component has been deactivated.
 void winOpened(LwWinEvent e)
          Invoked when the light weight window component has been opened.
 
Methods inherited from class org.zaval.lw.LwPanel
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, paintOnTop, recalc, remove, remove, removeAll, setBackground, setLwLayout, setOpaque, toFront, updateCashedPs
 
Methods inherited from class org.zaval.lw.LwCanvas
canHaveFocus, 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, insert, paintOnTop, remove, removeAll, setLwLayout
 
Methods inherited from interface org.zaval.lw.LwComponent
canHaveFocus, 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, getLayoutOffset
 

Constructor Detail

LwWindow

public LwWindow()
Constructs the window component with empty title.

LwWindow

public LwWindow(java.lang.String s)
Constructs the window component with the specified title.
Parameters:
s - the specified title.
Method Detail

setTitle

public void setTitle(java.lang.String s)
Sets the specified title.
Parameters:
s - the specified title.

getTitle

public java.lang.String getTitle()
Gets the window title.
Returns:
a window title.

setIcon

public void setIcon(LwComponent i)
Sets the specified component as the window icon.
Parameters:
i - the specified component.

setCaptionColor

public void setCaptionColor(boolean state,
                            java.awt.Color c)
Sets the specified color that will be used as background color of the window caption for the specified window state.
Parameters:
state - the specified window state. true value correspond to active window state and false value correspond to non-active window state.
c - the specified color.

isHideOnClose

public boolean isHideOnClose()
Tests if the close window button will hide the window.
Returns:
true if the close button will hide the window component; otherwise false.

hideOnClose

public void hideOnClose(boolean b)
Sets the specified reaction to the close button pressing.
Parameters:
b - the specified reaction. If the the argumen is true than the window will close by pressing the close button.

isSizeable

public boolean isSizeable()
Tests if the window component is sizeable.
Returns:
true if the window component can be sized; otherwise false.

setSizeable

public void setSizeable(boolean b)
Enables sizing of the window.
Parameters:
b - if the argument is true than the window is sizeable; otherwise false.

getRoot

public LwContainer getRoot()
Gets the root container.
Returns:
a root container.

startDragged

public void startDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse starts dragged.
Specified by:
startDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseDragged

public void mouseDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
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 LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

endDragged

public void endDragged(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse ends dragged.
Specified by:
endDragged in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

mouseMoved

public void mouseMoved(LwMouseMotionEvent e)
Description copied from interface: LwMouseMotionListener
Invoked when the mouse pointer has been moved on a light weight component (with no buttons no down).
Specified by:
mouseMoved in interface LwMouseMotionListener
Following copied from interface: org.zaval.lw.event.LwMouseMotionListener
Parameters:
e - the specified mouse motion event.

winOpened

public void winOpened(LwWinEvent e)
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:
e - the specified window event.

winClosed

public void winClosed(LwWinEvent e)
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:
e - the specified window event.

winActivated

public void winActivated(LwWinEvent e)
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:
e - the specified window event.

winDeactivated

public void winDeactivated(LwWinEvent e)
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:
e - the specified window event.

actionPerformed

public void actionPerformed(LwActionEvent e)
Description copied from interface: LwActionListener
Invoked when an action event occured. The specified action event is passed to the method.
Specified by:
actionPerformed in interface LwActionListener
Following copied from interface: org.zaval.lw.event.LwActionListener
Parameters:
e - the specified action event.

getCursorType

public int getCursorType(LwComponent target,
                         int x,
                         int y)
Description copied from interface: Cursorable
Gets the cursor type for the specified location of the given component. It is supposed to use set of cursors that is provided with java.awt.Cursor class.
Specified by:
getCursorType in interface Cursorable
Following copied from interface: org.zaval.lw.Cursorable
Parameters:
target - the given component.
x - the x coordinate of the location.
y - the y coordinate of the location.
Returns:
a cursor type.

catchInput

public boolean catchInput(LwComponent c)
Description copied from interface: LwComposite
Checks if input events for the specified child component should be caught.
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.

getTitlePanel

public LwComponent getTitlePanel()

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 "layout.raster" key.
Overrides:
getDefaultLayout in class LwPanel
Following copied from class: org.zaval.lw.LwPanel
Returns:
a layout manager.


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