Class powersoft.jcm.ui.Container
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class powersoft.jcm.ui.Container

java.lang.Object
   |
   +----powersoft.jcm.ui.Component
           |
           +----powersoft.jcm.ui.Container

public class Container
extends Component
implements AWTPaintTarget
A component which can contain other components.

Notes: This component is defined as an abstract class. You cannot instantiate a container object, only one of its subclasses, for example, the Panel or PopupWindow components.

Containers define the generic characteristics required by components which contain other components. For example, popup windows and forms, which can contain things like text boxes and command buttons, are special cases of containers.

See Also:
Panel, PopupWindow

Variable Index

 o _defaultFont
 o _paintVector

Constructor Index

 o Container()
Containers are not instantiated directly.

Method Index

 o addComponent(Component)
Adds the given component to the container and its layout manager.
 o addComponent(Component)
Adds the given component to the container and its layout manager.
 o addComponent(Component, int)
Adds the given component to the container and its layout manager.
 o addComponent(Component, int)
Adds the given component to the container and its layout manager.
 o addPaintListener(PaintListener)
 o childLayoutNameChanged(Component)
 o destroy()
 o DUHeight(int)
 o DURectangle(int, int, int, int)
Determines the rectangle in pixels which corresponds to the given rectangle in dialog units.
 o DURectangle(Rectangle)
Determines the rectangle in pixels which corresponds to the given rectangle in dialog units.
 o DUWidth(int)
 o findComponent(Component, boolean)
 o getComponent(int)
Returns the n'th component in the container.
 o getComponentCount()
Gets the number of components being managed by the container.
 o getComponents()
Returns a copy of the container.
 o getDefaultFont()
Gets the default font used for top-level containers.
 o getInsets()
Gets the insets of the container.
 o getLayout()
Gets the layout manager used by the container.
 o getPaintListeners()
 o handleAWTPaint(Graphics)
 o handlePaint(PaintEvent)
 o locateComponent(int, int)
 o paintComponents(Graphics)
Display contents of AWT container on the graphics canvas
 o removeAllComponents()
All components are removed from the container.
 o removeComponent(Component)
The specified component is located and then removed from the container.
 o removePaintListener(PaintListener)
 o setDefaultFont(Font)
Sets the default font used for top-level containers.
 o setLayout(LayoutManager)
Sets the layout manager used by the container.

Variables

 o _paintVector
  protected EventListenerVector _paintVector
 o _defaultFont
  protected static Font _defaultFont

Constructors

 o Container
  public Container()
Containers are not instantiated directly.

Methods

 o getComponentCount
  public synchronized int getComponentCount()
Gets the number of components being managed by the container.

Notes: The ComponentCount property is incremented every time addComponent is invoked and is decremented every time removeComponent is invoked.

Returns:
the current number of components being managed by the container is returned
See Also:
getComponent, addComponent, removeComponent
 o getComponent
  public synchronized Component getComponent(int n)
Returns the n'th component in the container.
Parameters:
n - the zero-based index for the desired component
Returns:
a Component is returned
See Also:
getComponents, addComponent, removeComponent
 o getComponents
  public synchronized Component[] getComponents()
Returns a copy of the container.

Notes: The entire container's contents are duplicated.

Returns:
a copy of the container is returned
See Also:
getComponent, addComponent, removeComponent
 o getDefaultFont
  public static Font getDefaultFont()
Gets the default font used for top-level containers.
Returns:
the default Font is returned.
See Also:
setDefaultFont
 o setDefaultFont
  public static synchronized void setDefaultFont(Font f)
Sets the default font used for top-level containers. Passing in a null font resets the default font to the initial font.
Parameters:
f - the new default Font or null
See Also:
getDefaultFont
 o getInsets
  public Insets getInsets()
Gets the insets of the container.
 o getLayout
  public synchronized LayoutManager getLayout()
Gets the layout manager used by the container.
Returns:
a LayoutManager is returned
See Also:
setLayout
 o setLayout
  public synchronized void setLayout(LayoutManager layout)
Sets the layout manager used by the container. Children of the container are removed from the old layout manager and added to the new one.
Parameters:
layout - The new layout manager, or null if no manager is to be used.
See Also:
getLayout
 o addComponent
  public boolean addComponent(Component comp)
Adds the given component to the container and its layout manager. The underlying AWT component is also added to the AWT container.
Parameters:
comp - the component to be added to the container
Returns:
true if the component was successfully added; false if the component was already present in the container or comp was null
See Also:
removeComponent, removeAllComponents
 o addComponent
  public boolean addComponent(Component comp,
                              int pos)
Adds the given component to the container and its layout manager. The underlying AWT component is also added to the AWT container.

Notes: If the position is negative or exceeds the number of components in the container, the component is simply added to the container in the next available position.

Parameters:
comp - the component to be added to the container
pos - an optional index that indicates the position in which to insert the component. Positions are numbered from 0 on up.
Returns:
true if the component was successfully added; false if the component was already present in the container or comp was null
See Also:
removeComponent, removeAllComponents
 o addComponent
  public boolean addComponent(Component comp)
Adds the given component to the container and its layout manager. The underlying AWT component is also added to the AWT container.
Parameters:
comp - the Component to be added to the container
Returns:
true if the component was successfully added; false if the component was already present in the container or comp was null
See Also:
removeComponent, removeAllComponents
 o addComponent
  public synchronized boolean addComponent(Component comp,
                                           int pos)
Adds the given component to the container and its layout manager. The underlying AWT component is also added to the AWT container.

Notes: If the position is negative or exceeds the number of components in the container, the component is simply added to the container in the next available position.

Parameters:
comp - The component to be added to the container.
pos - An optional index that indicates the position in which to insert the component. Positions are numbered from 0 on up.
Returns:
true if the component was successfully added; false if the component was already present in the container or comp was null.
See Also:
removeComponent, removeAllComponents
 o paintComponents
  public void paintComponents(Graphics g)
Display contents of AWT container on the graphics canvas
Parameters:
g - the Graphics canvas
 o removeAllComponents
  public void removeAllComponents()
All components are removed from the container.
See Also:
addComponent, removeComponent
 o removeComponent
  public boolean removeComponent(Component comp)
The specified component is located and then removed from the container.
Parameters:
comp - the Component to be removed from the container
Returns:
true if the component was found; false if the component was not found.
See Also:
addComponent, removeAllComponents
 o addPaintListener
  public synchronized void addPaintListener(PaintListener l)
 o getPaintListeners
  public synchronized EventListenerVector getPaintListeners()
 o handlePaint
  public synchronized void handlePaint(PaintEvent data)
 o removePaintListener
  public synchronized void removePaintListener(PaintListener l)
 o destroy
  public synchronized boolean destroy()
Overrides:
destroy in class Component
 o DUHeight
  public int DUHeight(int verticalDU)
Overrides:
DUHeight in class Component
 o DUWidth
  public int DUWidth(int horizDU)
Overrides:
DUWidth in class Component
 o DURectangle
  public Rectangle DURectangle(Rectangle r)
Determines the rectangle in pixels which corresponds to the given rectangle in dialog units. Notes: The conversion from dialog units to pixels depends on the current font.
Overrides:
DURectangle in class Component
 o DURectangle
  public Rectangle DURectangle(int x,
                               int y,
                               int w,
                               int h)
Determines the rectangle in pixels which corresponds to the given rectangle in dialog units. Notes: The conversion from dialog units to pixels depends on the current font.
Overrides:
DURectangle in class Component
 o findComponent
  public Component findComponent(Component awtComp,
                                 boolean recurse)
Overrides:
findComponent in class Component
 o locateComponent
  public Component locateComponent(int x,
                                   int y)
Returns:
The component containing the given point or null if no component is found to contain the given point.
Overrides:
locateComponent in class Component
 o childLayoutNameChanged
  public synchronized void childLayoutNameChanged(Component child)
 o handleAWTPaint
  public boolean handleAWTPaint(Graphics g)

All Packages  Class Hierarchy  This Package  Previous  Next  Index