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
-
_defaultFont
-
-
_paintVector
-
-
Container()
- Containers are not instantiated directly.
-
addComponent(Component)
- Adds the given component to the container and its layout manager.
-
addComponent(Component)
- Adds the given component to the container and its layout manager.
-
addComponent(Component, int)
- Adds the given component to the container and its layout manager.
-
addComponent(Component, int)
- Adds the given component to the container and its layout manager.
-
addPaintListener(PaintListener)
-
-
childLayoutNameChanged(Component)
-
-
destroy()
- Destroys the container along with its components.
-
DUHeight(int)
- Converts vertical dialog units for the container into
vertical pixels.
-
DURectangle(int, int, int, int)
- Determines the rectangle in pixels which corresponds to the given
rectangle in dialog units.
-
DURectangle(Rectangle)
- Determines the rectangle in pixels which corresponds to the given
rectangle in dialog units.
-
DUWidth(int)
- Converts horizontal dialog units for the container into
horizontal pixels.
-
findComponent(Component, boolean)
-
-
getComponent(int)
- Returns the n'th component in the container.
-
getComponentCount()
- Gets the number of components being managed by the container.
-
getComponents()
- Returns a copy of the container.
-
getDefaultFont()
- Gets the default font used for top-level containers.
-
getInsets()
- Gets the insets of the container.
-
getLayout()
- Gets the layout manager used by the container.
-
getPaintListeners()
-
-
handleAWTPaint(Graphics)
-
-
handlePaint(PaintEvent)
-
-
locateComponent(int, int)
- Locates the component or child component which contains the given point.
-
paintComponents(Graphics)
- Display contents of AWT container on the graphics canvas
-
removeAllComponents()
- All components are removed from the container.
-
removeComponent(Component)
- The specified component is located and then removed from the
container.
-
removePaintListener(PaintListener)
-
-
setDefaultFont(Font)
- Sets the default font used for top-level containers.
-
setLayout(LayoutManager)
- Sets the layout manager used by the container.
_paintVector
protected EventListenerVector _paintVector
_defaultFont
protected static Font _defaultFont
Container
public Container()
- Containers are not instantiated directly.
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
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
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
getDefaultFont
public static Font getDefaultFont()
- Gets the default font used for top-level containers.
- Returns:
- the default Font is returned.
- See Also:
- setDefaultFont
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
getInsets
public Insets getInsets()
- Gets the insets of the container.
getLayout
public synchronized LayoutManager getLayout()
- Gets the layout manager used by the container.
- Returns:
- a LayoutManager is returned
- See Also:
- setLayout
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
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
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
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
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
paintComponents
public void paintComponents(Graphics g)
- Display contents of AWT container on the graphics canvas
- Parameters:
- g - the Graphics canvas
removeAllComponents
public void removeAllComponents()
- All components are removed from the container.
- See Also:
- addComponent, removeComponent
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
addPaintListener
public synchronized void addPaintListener(PaintListener l)
getPaintListeners
public synchronized EventListenerVector getPaintListeners()
handlePaint
public synchronized void handlePaint(PaintEvent data)
removePaintListener
public synchronized void removePaintListener(PaintListener l)
destroy
public synchronized boolean destroy()
- Destroys the container along with its components.
- Returns:
-
true
if the container was successfully
destroyed; false
otherwise
- Overrides:
- destroy in class Component
- See Also:
- create
DUHeight
public int DUHeight(int verticalDU)
- Converts vertical dialog units for the container into
vertical pixels.
Notes:
The top inset for the container is factored in
the pixel value that is returned.
The origin in dialog units is the top left corner of the inset
rectangle, so (0,0) in DUs does not necessarily correspond
to (0,0) in pixels.
- Parameters:
- verticalDU - Specifies the height to be converted, in dialog
units.
- Returns:
- The height in pixels.
- Overrides:
- DUHeight in class Component
- See Also:
- DialogSize, DUWidth, DURectangle
DUWidth
public int DUWidth(int horizDU)
- Converts horizontal dialog units for the container into
horizontal pixels.
Notes:
The left inset for the container is factored in
the pixel value that is returned.
The origin in dialog units is the top left corner of the inset
rectangle, so (0,0) in DUs does not necessarily correspond
to (0,0) in pixels.
- Parameters:
- horizDU - Specifies the width to be converted, in dialog
units.
- Returns:
- The width in pixels.
- Overrides:
- DUWidth in class Component
- See Also:
- DialogSize, DUHeight, DURectangle
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.
The left and top insets for the container are factored in
the pixel Rectangle value that is returned.
- Parameters:
- r - A Rectangle object composed of an X-Y coordinate,
width and height in dialog units.
- Returns:
- A Rectangle object composed of an X-Y coordinate,
width and height in pixels.
- Overrides:
- DURectangle in class Component
- See Also:
- DUHeight, DUWidth
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.
The left and top insets for the container are factored in
the pixel Rectangle value that is returned.
- Parameters:
- x - The X coordinate for the top-left corner of the
container in dialog units.
- y - The Y coordinate for the top-left corner of the
container in dialog units.
- w - The width of the container in dialog units.
- h - The height of the container in dialog units.
- Returns:
- A Rectangle object composed of an X-Y coordinate,
width and height in pixels.
- Overrides:
- DURectangle in class Component
- See Also:
- DUHeight, DUWidth
findComponent
public Component findComponent(Component awtComp,
boolean recurse)
- Overrides:
- findComponent in class Component
locateComponent
public Component locateComponent(int x,
int y)
- Locates the component or child component which contains the given point.
- Returns:
- The component containing the given point or null if no component
is found to contain the given point.
- Overrides:
- locateComponent in class Component
childLayoutNameChanged
public synchronized void childLayoutNameChanged(Component child)
handleAWTPaint
public boolean handleAWTPaint(Graphics g)
All Packages Class Hierarchy This Package Previous Next Index