All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dtai.gwt.ContainerGadget

java.lang.Object
   |
   +----dtai.gwt.Gadget
           |
           +----dtai.gwt.ContainerGadget

public class ContainerGadget
extends Gadget
A generic GWT container object is a component that can contain other GWT components.

Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).


Constructor Index

 o ContainerGadget()
Constructs a new Container.

Method Index

 o add(Gadget)
Adds the specified gadget to this container, and returns the Gadget being added.
 o add(Gadget, int)
Adds the specified gadget to this container at the given position.
 o add(String, Gadget)
Adds the specified gadget to this container.
 o addPaintIdx(int)
addPaintIdx
 o bringForward(Gadget)
brings the gadget forward
 o bringToFront(Gadget)
brings the gadget to the front
 o childrenCanOverlap()
returns true if children can overlap each other.
 o contains(int, int, Gadget)
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.
 o doLayout()
Does a layout on this Container.
 o findNextFocusGadget()
findNExtFocusGadget
 o fontChanged()
fontChanged
 o getGadget(int)
Gets the nth gadget in this container.
 o getGadgetAt(int, int)
Locates the gadget that contains the x,y position.
 o getGadgetAt(int, int, Gadget)
Locates the gadget that contains the x,y position.
 o getGadgetCount()
Returns the number of gadgets in this panel.
 o getGadgetIndex(Gadget)
Gets the index of the specified gadget.
 o getGadgets()
Gets all the gadgets in this container.
 o getInsets()
gets the insets of the gadget
 o getLastGroupedFocus()
getLastGroupedFocus
 o getLayout()
Gets the layout manager for this container.
 o getMinimumSize()
Returns the minimum size of this container.
 o getPaintAnyOrder()
getPaintAnyOrder
 o getPaintEndIdx()
getPaintEndIdx
 o getPaintStartIdx()
getPaintStartIdx
 o getPreferredSize()
Returns the preferred size of this container.
 o getSaveGraphicsForChildren()
getSaveGraphicsForChildren
 o getSavePicture()
return flag, save the picture for refreshes, in an offscreen image
 o getTranslatedGraphics(Rectangle)
Returns the graphics to use.
 o getVisibleGadgets()
Gets all the visible gadgets in this container.
 o notifyInvalid()
notifyInvalid
 o notifySomeDamage()
notifySomeDamage
 o notifyStateChange()
notifyStateChange
 o paintAllChildrenAfter(Gadget)
Paints all children after the gadget.
 o paintChildren(boolean, GadgetGraphics, Rectangle)
paintChildren
 o processEvent(AWTEvent)
Processes events occurring on this component.
 o remove(Gadget)
Removes the specified gadget from this container.
 o remove(Gadget, int)
Removes the specified gadget from this container.
 o remove(int)
Removes the gadget at the specified index from this container.
 o removeAll()
Removes all the gadgets from this container.
 o repaint(int, int, int, int, boolean, boolean)
Repaints part of the component.
 o replace(Gadget, int)
Replaces the specified gadget in this container at the given position.
 o sendBackward(Gadget)
sens the gadget backward
 o sendToBack(Gadget)
sends the gadget to the back
 o setBounds(int, int, int, int, boolean)
setBounds reshapes the Component to the specified bounding box.
 o setGadgetHelp(GadgetHelp)
setGadgetHelp
 o setLastGroupedFocus(Gadget)
setLastGroupedFocus
 o setLayout(GadgetLayoutManager)
Sets the layout manager for this container.
 o setPaintAnyOrder(boolean)
setPaintAnyOrder
 o setSaveGraphicsForChildren(boolean)
setSaveGraphicsForChildren
 o setSavePicture(boolean)
if true, save the picture for refreshes, in an offscreen image
 o setShell(GadgetShell)
sets the shell of the component.
 o thaw()
thaw
 o update(GadgetGraphics)
Paints the gadget.
 o validate()
Validates this Container and all of the gadgets contained within it.

Constructors

 o ContainerGadget
 protected ContainerGadget()
Constructs a new Container. Containers should not be subclassed or instantiated directly.

Methods

 o addPaintIdx
 public void addPaintIdx(int idx)
addPaintIdx

Parameters:
idx - index of a new Gadget to be painted.
 o getPaintStartIdx
 public int getPaintStartIdx()
getPaintStartIdx

Returns:
int
 o getPaintEndIdx
 public int getPaintEndIdx()
getPaintEndIdx

Returns:
int
 o setSaveGraphicsForChildren
 public void setSaveGraphicsForChildren(boolean saveGraphicsForChildren)
setSaveGraphicsForChildren

Parameters:
saveGraphicsForChildren - new boolean value for variable
 o getSaveGraphicsForChildren
 public boolean getSaveGraphicsForChildren()
getSaveGraphicsForChildren

Returns:
boolean
 o setSavePicture
 public void setSavePicture(boolean savePicture)
if true, save the picture for refreshes, in an offscreen image

Parameters:
savePicture - new boolean value for variable
 o getSavePicture
 public boolean getSavePicture()
return flag, save the picture for refreshes, in an offscreen image

Returns:
boolean
 o setPaintAnyOrder
 public void setPaintAnyOrder(boolean paintAnyOrder)
setPaintAnyOrder

Parameters:
paintAnyOrder - new boolean value for variable
 o getPaintAnyOrder
 public boolean getPaintAnyOrder()
getPaintAnyOrder

Returns:
boolean
 o setLastGroupedFocus
 protected void setLastGroupedFocus(Gadget lastGroupedFocus)
setLastGroupedFocus

Parameters:
lastGroupedFocus - new value for variable
 o getLastGroupedFocus
 protected Gadget getLastGroupedFocus()
getLastGroupedFocus

Returns:
gadget
 o setShell
 protected void setShell(GadgetShell shell)
sets the shell of the component.

Parameters:
shell - a GadgetShell
Overrides:
setShell in class Gadget
 o setGadgetHelp
 public void setGadgetHelp(GadgetHelp gadgetHelp)
setGadgetHelp

Parameters:
gadgetHelp - a GadgetHelp
Overrides:
setGadgetHelp in class Gadget
 o paintChildren
 protected void paintChildren(boolean paintAll,
                              GadgetGraphics g,
                              Rectangle clip)
paintChildren

Parameters:
paintAll - paint all children or not
g - GadgetGraphics for graphics
clip - clip rectangle
 o notifySomeDamage
 protected void notifySomeDamage()
notifySomeDamage

 o repaint
 public void repaint(int x,
                     int y,
                     int width,
                     int height,
                     boolean setPaintFlag,
                     boolean forced)
Repaints part of the component. This will result in a call to paint as soon as possible. Notifies the GadgetShell of a damaged area to repair.

Parameters:
x - - the x coordinate
y - - the y coordinate
width - - the width
height - - the height
setPaintFlag - - TBD
forced - - TBD
Overrides:
repaint in class Gadget
See Also:
repaint
 o setBounds
 public void setBounds(int x,
                       int y,
                       int width,
                       int height,
                       boolean invalidateParent)
setBounds reshapes the Component to the specified bounding box.

Parameters:
x - - the x coordinate
y - - the y coordinate
width - - the width of the component
height - - the height of the component
invalidateParent - - TBD
Overrides:
setBounds in class Gadget
 o getTranslatedGraphics
 protected GadgetGraphics getTranslatedGraphics(Rectangle clip)
Returns the graphics to use.

Returns:
GadgetGraphics
Overrides:
getTranslatedGraphics in class Gadget
 o update
 public void update(GadgetGraphics g)
Paints the gadget.

Parameters:
g - the specified GadgetGraphics window
Overrides:
update in class Gadget
 o childrenCanOverlap
 public boolean childrenCanOverlap()
returns true if children can overlap each other. The default is taken from the layout manager, or if null, true.

Returns:
the flag
 o paintAllChildrenAfter
 public void paintAllChildrenAfter(Gadget g)
Paints all children after the gadget.

Parameters:
g - the specified Gadget
 o processEvent
 protected void processEvent(AWTEvent e)
Processes events occurring on this component. By default this method will call the appropriate "handleXXX" method for the type of event.

Parameters:
e - an AWTEvent
Overrides:
processEvent in class Gadget
 o getGadgetCount
 public final int getGadgetCount()
Returns the number of gadgets in this panel.

Returns:
int
See Also:
getGadget
 o getGadget
 public final Gadget getGadget(int n)
Gets the nth gadget in this container.

Parameters:
n - the number of the gadget to get
Returns:
Gadget
Throws: ArrayIndexOutOfBoundsException
If the nth value does not exist.
 o getGadgets
 public final Gadget[] getGadgets()
Gets all the gadgets in this container.

Returns:
Gadget[]
 o getVisibleGadgets
 public final Gadget[] getVisibleGadgets()
Gets all the visible gadgets in this container.

Returns:
Gadget[]
 o getGadgetIndex
 public int getGadgetIndex(Gadget gadget)
Gets the index of the specified gadget.

Parameters:
gadget - which Gadget's index to get
Returns:
int
 o add
 public final Gadget add(Gadget gadget)
Adds the specified gadget to this container, and returns the Gadget being added.

Parameters:
gadget - the gadget to be added
Returns:
the gadget to be added
 o add
 public Gadget add(Gadget gadget,
                   int pos)
Adds the specified gadget to this container at the given position.

Parameters:
gadget - the gadget to be added
pos - the position at which to insert the gadget. -1 means insert at the end.
Returns:
the gadget being added
See Also:
remove
 o replace
 public Gadget replace(Gadget gadget,
                       int pos)
Replaces the specified gadget in this container at the given position.

Parameters:
gadget - the gadget to be replaced
pos - the position at which to replace the gadget.
Returns:
the gadget being replaced.
See Also:
add, remove
 o add
 public Gadget add(String name,
                   Gadget gadget)
Adds the specified gadget to this container. The gadget is also added to the layout manager of this container using the name specified

Parameters:
name - the gadget name
gadget - the gadget to be added
Returns:
the gadget being added.
See Also:
remove, GadgetLayoutManager
 o remove
 public void remove(Gadget gadget)
Removes the specified gadget from this container.

Parameters:
gadget - the gadget to be removed
See Also:
add
 o remove
 public void remove(int i)
Removes the gadget at the specified index from this container.

Parameters:
index - the index of the gadget to be removed
See Also:
add
 o remove
 protected void remove(Gadget gadget,
                       int i)
Removes the specified gadget from this container.

Parameters:
gadget - the gadget to be removed
i - the index of the gadget to be removed
 o removeAll
 public void removeAll()
Removes all the gadgets from this container.

See Also:
add, remove
 o bringToFront
 public void bringToFront(Gadget gadget)
brings the gadget to the front

Parameters:
gadget - the Gadget to bring to the front
 o sendToBack
 public void sendToBack(Gadget gadget)
sends the gadget to the back

Parameters:
gadget - the Gadget to sent to the back
 o bringForward
 public void bringForward(Gadget gadget)
brings the gadget forward

Parameters:
gadget - the Gadget to bring forward
 o sendBackward
 public void sendBackward(Gadget gadget)
sens the gadget backward

Parameters:
gadget - the Gadget to send backward
 o getLayout
 public final GadgetLayoutManager getLayout()
Gets the layout manager for this container.

Returns:
the GadgetLayoutManager layoutMgr
See Also:
setLayout
 o setLayout
 public void setLayout(GadgetLayoutManager mgr)
Sets the layout manager for this container.

Parameters:
mgr - the specified layout manager
See Also:
getLayout
 o doLayout
 public void doLayout()
Does a layout on this Container.

Overrides:
doLayout in class Gadget
See Also:
setLayout
 o validate
 protected void validate()
Validates this Container and all of the gadgets contained within it.

Overrides:
validate in class Gadget
See Also:
validate, invalidate
 o thaw
 public void thaw()
thaw

Overrides:
thaw in class Gadget
 o notifyInvalid
 public void notifyInvalid()
notifyInvalid

 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred size of this container.

Returns:
the preferred size as a Dimension
Overrides:
getPreferredSize in class Gadget
See Also:
getMinimumSize
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this container.

Returns:
the minimum size as a Dimension
Overrides:
getMinimumSize in class Gadget
See Also:
getPreferredSize
 o getGadgetAt
 public Gadget getGadgetAt(int x,
                           int y)
Locates the gadget that contains the x,y position.

Parameters:
x - the x coordinate
y - the y coordinate
Returns:
null if the gadget is not within the x and y coordinates; returns the gadget otherwise.
Overrides:
getGadgetAt in class Gadget
See Also:
contains
 o getGadgetAt
 public Gadget getGadgetAt(int x,
                           int y,
                           Gadget exclude)
Locates the gadget that contains the x,y position.

Parameters:
x - the x coordinate
y - the y coordinate
exclude - the gadget to ignore (if not null)
Returns:
null if the gadget is not within the x and y coordinates; returns the gadget otherwise.
See Also:
contains
 o contains
 public boolean contains(int x,
                         int y,
                         Gadget exclude)
Checks whether this component "contains" the specified (x, y) location, where x and y are defined to be relative to the coordinate system of this component.

Parameters:
x - the x coordinate
y - the y coordinate
exclude - the gadget to ignore (if not null)
Returns:
boolean is/is not inside
Overrides:
contains in class Gadget
See Also:
getGadgetAt
 o getInsets
 public Insets getInsets()
gets the insets of the gadget

Returns:
Insets
 o findNextFocusGadget
 public Gadget findNextFocusGadget()
findNExtFocusGadget

Returns:
Gadget
Overrides:
findNextFocusGadget in class Gadget
 o fontChanged
 protected void fontChanged()
fontChanged

Overrides:
fontChanged in class Gadget
 o notifyStateChange
 public void notifyStateChange()
notifyStateChange

Overrides:
notifyStateChange in class Gadget

All Packages  Class Hierarchy  This Package  Previous  Next  Index