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).
-
ContainerGadget()
- Constructs a new Container.
-
add(Gadget)
- Adds the specified gadget to this container, and
returns the Gadget being added.
-
add(Gadget, int)
- Adds the specified gadget to this container at the given position.
-
add(String, Gadget)
- Adds the specified gadget to this container.
-
addPaintIdx(int)
- addPaintIdx
-
bringForward(Gadget)
- brings the gadget forward
-
bringToFront(Gadget)
- brings the gadget to the front
-
childrenCanOverlap()
- returns true if children can overlap each other.
-
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.
-
doLayout()
- Does a layout on this Container.
-
findNextFocusGadget()
- findNExtFocusGadget
-
fontChanged()
- fontChanged
-
getGadget(int)
- Gets the nth gadget in this container.
-
getGadgetAt(int, int)
- Locates the gadget that contains the x,y position.
-
getGadgetAt(int, int, Gadget)
- Locates the gadget that contains the x,y position.
-
getGadgetCount()
- Returns the number of gadgets in this panel.
-
getGadgetIndex(Gadget)
- Gets the index of the specified gadget.
-
getGadgets()
- Gets all the gadgets in this container.
-
getInsets()
- gets the insets of the gadget
-
getLastGroupedFocus()
- getLastGroupedFocus
-
getLayout()
- Gets the layout manager for this container.
-
getMinimumSize()
- Returns the minimum size of this container.
-
getPaintAnyOrder()
- getPaintAnyOrder
-
getPaintEndIdx()
- getPaintEndIdx
-
getPaintStartIdx()
- getPaintStartIdx
-
getPreferredSize()
- Returns the preferred size of this container.
-
getSaveGraphicsForChildren()
- getSaveGraphicsForChildren
-
getSavePicture()
- return flag, save the picture for refreshes, in an offscreen image
-
getTranslatedGraphics(Rectangle)
- Returns the graphics to use.
-
getVisibleGadgets()
- Gets all the visible gadgets in this container.
-
notifyInvalid()
- notifyInvalid
-
notifySomeDamage()
- notifySomeDamage
-
notifyStateChange()
- notifyStateChange
-
paintAllChildrenAfter(Gadget)
- Paints all children after the gadget.
-
paintChildren(boolean, GadgetGraphics, Rectangle)
- paintChildren
-
processEvent(AWTEvent)
- Processes events occurring on this component.
-
remove(Gadget)
- Removes the specified gadget from this container.
-
remove(Gadget, int)
- Removes the specified gadget from this container.
-
remove(int)
- Removes the gadget at the specified index from this container.
-
removeAll()
- Removes all the gadgets from this container.
-
repaint(int, int, int, int, boolean, boolean)
- Repaints part of the component.
-
replace(Gadget, int)
- Replaces the specified gadget in this container at the given position.
-
sendBackward(Gadget)
- sens the gadget backward
-
sendToBack(Gadget)
- sends the gadget to the back
-
setBounds(int, int, int, int, boolean)
- setBounds reshapes the Component to the specified bounding box.
-
setGadgetHelp(GadgetHelp)
- setGadgetHelp
-
setLastGroupedFocus(Gadget)
- setLastGroupedFocus
-
setLayout(GadgetLayoutManager)
- Sets the layout manager for this container.
-
setPaintAnyOrder(boolean)
- setPaintAnyOrder
-
setSaveGraphicsForChildren(boolean)
- setSaveGraphicsForChildren
-
setSavePicture(boolean)
- if true, save the picture for refreshes, in an offscreen image
-
setShell(GadgetShell)
- sets the shell of the component.
-
thaw()
- thaw
-
update(GadgetGraphics)
- Paints the gadget.
-
validate()
- Validates this Container and all of the gadgets contained within it.
ContainerGadget
protected ContainerGadget()
- Constructs a new Container. Containers should not be subclassed or
instantiated directly.
addPaintIdx
public void addPaintIdx(int idx)
- addPaintIdx
- Parameters:
- idx - index of a new Gadget to be painted.
getPaintStartIdx
public int getPaintStartIdx()
- getPaintStartIdx
- Returns:
- int
getPaintEndIdx
public int getPaintEndIdx()
- getPaintEndIdx
- Returns:
- int
setSaveGraphicsForChildren
public void setSaveGraphicsForChildren(boolean saveGraphicsForChildren)
- setSaveGraphicsForChildren
- Parameters:
- saveGraphicsForChildren - new boolean value for variable
getSaveGraphicsForChildren
public boolean getSaveGraphicsForChildren()
- getSaveGraphicsForChildren
- Returns:
- boolean
setSavePicture
public void setSavePicture(boolean savePicture)
- if true, save the picture for refreshes, in an offscreen image
- Parameters:
- savePicture - new boolean value for variable
getSavePicture
public boolean getSavePicture()
- return flag, save the picture for refreshes, in an offscreen image
- Returns:
- boolean
setPaintAnyOrder
public void setPaintAnyOrder(boolean paintAnyOrder)
- setPaintAnyOrder
- Parameters:
- paintAnyOrder - new boolean value for variable
getPaintAnyOrder
public boolean getPaintAnyOrder()
- getPaintAnyOrder
- Returns:
- boolean
setLastGroupedFocus
protected void setLastGroupedFocus(Gadget lastGroupedFocus)
- setLastGroupedFocus
- Parameters:
- lastGroupedFocus - new value for variable
getLastGroupedFocus
protected Gadget getLastGroupedFocus()
- getLastGroupedFocus
- Returns:
- gadget
setShell
protected void setShell(GadgetShell shell)
- sets the shell of the component.
- Parameters:
- shell - a GadgetShell
- Overrides:
- setShell in class Gadget
setGadgetHelp
public void setGadgetHelp(GadgetHelp gadgetHelp)
- setGadgetHelp
- Parameters:
- gadgetHelp - a GadgetHelp
- Overrides:
- setGadgetHelp in class Gadget
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
notifySomeDamage
protected void notifySomeDamage()
- notifySomeDamage
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
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
getTranslatedGraphics
protected GadgetGraphics getTranslatedGraphics(Rectangle clip)
- Returns the graphics to use.
- Returns:
- GadgetGraphics
- Overrides:
- getTranslatedGraphics in class Gadget
update
public void update(GadgetGraphics g)
- Paints the gadget.
- Parameters:
- g - the specified GadgetGraphics window
- Overrides:
- update in class Gadget
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
paintAllChildrenAfter
public void paintAllChildrenAfter(Gadget g)
- Paints all children after the gadget.
- Parameters:
- g - the specified Gadget
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
getGadgetCount
public final int getGadgetCount()
- Returns the number of gadgets in this panel.
- Returns:
- int
- See Also:
- getGadget
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.
getGadgets
public final Gadget[] getGadgets()
- Gets all the gadgets in this container.
- Returns:
- Gadget[]
getVisibleGadgets
public final Gadget[] getVisibleGadgets()
- Gets all the visible gadgets in this container.
- Returns:
- Gadget[]
getGadgetIndex
public int getGadgetIndex(Gadget gadget)
- Gets the index of the specified gadget.
- Parameters:
- gadget - which Gadget's index to get
- Returns:
- int
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
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
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
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
remove
public void remove(Gadget gadget)
- Removes the specified gadget from this container.
- Parameters:
- gadget - the gadget to be removed
- See Also:
- add
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
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
removeAll
public void removeAll()
- Removes all the gadgets from this container.
- See Also:
- add, remove
bringToFront
public void bringToFront(Gadget gadget)
- brings the gadget to the front
- Parameters:
- gadget - the Gadget to bring to the front
sendToBack
public void sendToBack(Gadget gadget)
- sends the gadget to the back
- Parameters:
- gadget - the Gadget to sent to the back
bringForward
public void bringForward(Gadget gadget)
- brings the gadget forward
- Parameters:
- gadget - the Gadget to bring forward
sendBackward
public void sendBackward(Gadget gadget)
- sens the gadget backward
- Parameters:
- gadget - the Gadget to send backward
getLayout
public final GadgetLayoutManager getLayout()
- Gets the layout manager for this container.
- Returns:
- the GadgetLayoutManager layoutMgr
- See Also:
- setLayout
setLayout
public void setLayout(GadgetLayoutManager mgr)
- Sets the layout manager for this container.
- Parameters:
- mgr - the specified layout manager
- See Also:
- getLayout
doLayout
public void doLayout()
- Does a layout on this Container.
- Overrides:
- doLayout in class Gadget
- See Also:
- setLayout
validate
protected void validate()
- Validates this Container and all of the gadgets contained within it.
- Overrides:
- validate in class Gadget
- See Also:
- validate, invalidate
thaw
public void thaw()
- thaw
- Overrides:
- thaw in class Gadget
notifyInvalid
public void notifyInvalid()
- notifyInvalid
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
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
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
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
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
getInsets
public Insets getInsets()
- gets the insets of the gadget
- Returns:
- Insets
findNextFocusGadget
public Gadget findNextFocusGadget()
- findNExtFocusGadget
- Returns:
- Gadget
- Overrides:
- findNextFocusGadget in class Gadget
fontChanged
protected void fontChanged()
- fontChanged
- Overrides:
- fontChanged in class Gadget
notifyStateChange
public void notifyStateChange()
- notifyStateChange
- Overrides:
- notifyStateChange in class Gadget
All Packages Class Hierarchy This Package Previous Next Index