: Download: FAQ: Licensing: Support: Contact ME
LwVCL Home
Introduction
Overview
Screen Shots
On-line Demos
Requirements
Further Plans
Docs
Tutorial
How-to (PDF)
API
FAQ
Download
Latest version

Home > J2SE > API

Overview  Package   Class  Tree  Deprecated  Index  Help 

org.zaval.lw
Class LwExtender

java.lang.Object
  |
  +--org.zaval.lw.LwCanvas
        |
        +--org.zaval.lw.LwPanel
              |
              +--org.zaval.lw.LwExtender
All Implemented Interfaces:
java.util.EventListener, Layoutable, LayoutContainer, LwComponent, LwContainer, LwLayout, LwMouseListener, Validationable

public class LwExtender
extends LwPanel
implements LwLayout, LwMouseListener

This is extender container component. Using the component you can show or hide an component by the clicking the special element.


Fields inherited from class org.zaval.lw.LwPanel
children
 
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
LwExtender(LwComponent content, LwComponent title)
          Constructs the class instance with the specified content component and the givent title.
LwExtender(LwComponent content, java.lang.String title)
          Constructs the class instance with the specified content component and the givent title.
 
Method Summary
 java.awt.Dimension calcPreferredSize(LayoutContainer target)
          Calculates the preferred size dimension for the layout container.
 void componentAdded(java.lang.Object id, Layoutable lw, int index)
          Invoked when the specified layoutable component was added to the layout container (that uses the layout manager).
 void componentRemoved(Layoutable lw, int index)
          Invoked when the specified layoutable component was removed from the layout container, that uses the layout manager.
protected  LwLayout getDefaultLayout()
          Gets the default layout manager that is set with the container during initialization.
 LwView getView(boolean b)
          Gets the toggle element view for the given state.
 boolean isCollapsed()
          Tests if the content component is hidden or shown.
 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 recalc()
          Invoked with validate method only if the component is not valid.
 void setGaps(int gx, int gy)
          Sets the specified horizontal and vertical gaps.
 void setView(boolean b, LwView v)
          Sets the specified view for the given state of the toggle element.
 void toggle()
          Hides or shows the content component.
 
Methods inherited from class org.zaval.lw.LwPanel
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, getPreferredSize, indexOf, insert, insert, invalidate, isInvalidatedByChild, laidout, paintOnTop, remove, remove, removeAll, setBackground, setLwLayout, setOpaque, setSize, toFront, updateCashedPs, validate
 
Methods inherited from class org.zaval.lw.LwCanvas
calcInsets, canHaveFocus, 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, 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
canHaveFocus, getBackground, getLwParent, getOrigin, getViewMan, getVisiblePart, isEnabled, isOpaque, repaint, repaint, repaint, setEnabled, setInsets, setLwParent, setViewMan, setVisible, update
 
Methods inherited from interface org.zaval.lw.Layoutable
getBounds, getHeight, getInsets, getLocation, getSize, getWidth, getX, getY, isVisible, setLocation
 
Methods inherited from interface org.zaval.util.Validationable
isValid
 

Constructor Detail

LwExtender

public LwExtender(LwComponent content,
                  java.lang.String title)
Constructs the class instance with the specified content component and the givent title.
Parameters:
content - the specified content component.
title - the given title string.

LwExtender

public LwExtender(LwComponent content,
                  LwComponent title)
Constructs the class instance with the specified content component and the givent title.
Parameters:
content - the specified content component.
title - the given title component.
Method Detail

toggle

public void toggle()
Hides or shows the content component.

isCollapsed

public boolean isCollapsed()
Tests if the content component is hidden or shown.
Returns:
true if the content component is hidden; false otherwise.

setView

public void setView(boolean b,
                    LwView v)
Sets the specified view for the given state of the toggle element.
Parameters:
b - the toggle element state. Use true value for the opened and false value for the collapsed toogle element state.
v - the given toggle element view.

getView

public LwView getView(boolean b)
Gets the toggle element view for the given state.
Parameters:
b - the toggle element state. Use true value for the opened and false value for the collapsed toogle element state.
Returns:
a toggle element view.

setGaps

public void setGaps(int gx,
                    int gy)
Sets the specified horizontal and vertical gaps. The horizontal gap specifies an indent between the toggle element and the label component. The vertical gap specifies an indent between the content component and the toggle element/label component area.
Parameters:
gx - the horizontal gap.
gy - the vertical gap.

paint

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

componentAdded

public void componentAdded(java.lang.Object id,
                           Layoutable lw,
                           int index)
Description copied from interface: LwLayout
Invoked when the specified layoutable component was 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 was 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 container insets should not be taken into account.
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.

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.

recalc

protected void recalc()
Description copied from class: LwCanvas
Invoked with validate method only if the component is not valid. The method should be overridden to calculate metrical characteristics of the component to minimize computation time of the preferred size for the component. For example, you can calculate a preferred size inside the method and just return it by calcPreferredSize method.
Overrides:
recalc in class LwCanvas

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.


: up