All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.gui.Component

java.lang.Object
   |
   +----com.bulletproof.gui.Component

public abstract class Component
extends Object
A generic GUI component.


Constructor Index

 o Component()
Constructs a new Component.

Method Index

 o addFocusListener(FocusListener)
Adds the specified key listener to receive key events from this component.
 o addKeyListener(KeyListener)
Adds the specified key listener to receive key events from this component.
 o addMouseListener(MouseListener)
Adds the specified mouse listener to receive mouse events from this component.
 o contains(int, int)
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 getBackground()
Gets the background color.
 o getBounds()
Get the bounds of this component.
 o getFont()
Gets the current font.
 o getFontMetrics()
Gets the font metrics of the current font.
 o getForeground()
Gets the foreground color.
 o getGraphics()
Gets a Graphics context for this component.
 o getLocationOnScreen()
Returns the current location of this component in the screen's coordinate space.
 o getMinHeight()
 o getMinimumSize()
Gets the minimum size of this component.
 o getMinWidth()
 o getParent()
Gets the parent of this component
 o getPreferredSize()
Gets the preferred size of this component.
 o invalidate()
Invalidates the component.
 o isEnabled()
Checks if this Component is enabled.
 o isVisible()
Checks if this Component is visible.
 o paint(Graphics)
Paints the component.
 o processFocusEvent(FocusEvent)
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects.
 o processKeyEvent(KeyEvent)
Processes key events occurring on this component by dispatching them to any registered KeyListener objects.
 o processMouseEvent(MouseEvent)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects.
 o proxyGetFrame()
 o removeFocusListener(FocusListener)
 o removeKeyListener(KeyListener)
 o removeMouseListener(MouseListener)
 o repaint()
Repaints the component.
 o requestFocus()
Requests the input focus.
 o setBackground(Color)
Sets the background color.
 o setBounds(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setEnabled(boolean)
Enables a component.
 o setFont(Font)
Sets the font for all subsequent text rendering operations.
 o setForeground(Color)
Sets the foreground color.
 o setMasterDrawRegion(Rectangle)
Set the master drawing region for this component
 o setMinHeight(int)
 o setMinWidth(int)
 o setVisible(boolean)
Displays a component.
 o size()
Gets the size of this component.
 o update(Graphics)
Updates the component.
 o validate()
Ensures that a component has a valid layout.

Constructors

 o Component
 public Component()
Constructs a new Component. Components can be extended directly, but are lightweight in this case and must be hosted by a native container somewhere higher up in the component tree (such as a Frame for example).

Methods

 o addMouseListener
 public void addMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.

Parameters:
l - the mouse listener
 o removeMouseListener
 public void removeMouseListener(MouseListener l)
 o addKeyListener
 public void addKeyListener(KeyListener l)
Adds the specified key listener to receive key events from this component.

Parameters:
l - the key listener
 o removeKeyListener
 public void removeKeyListener(KeyListener l)
 o addFocusListener
 public void addFocusListener(FocusListener l)
Adds the specified key listener to receive key events from this component.

Parameters:
l - the key listener
 o removeFocusListener
 public void removeFocusListener(FocusListener l)
 o getLocationOnScreen
 public Point getLocationOnScreen()
Returns the current location of this component in the screen's coordinate space.

 o getGraphics
 public Graphics getGraphics()
Gets a Graphics context for this component. This method will return null if the component is currently not on the screen.

See Also:
paint
 o size
 public Dimension size()
Gets the size of this component.

 o getMinimumSize
 public Dimension getMinimumSize()
Gets the minimum size of this component.

 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this component.

 o contains
 public boolean contains(int x,
                         int y)
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
 o invalidate
 public void invalidate()
Invalidates the component. The component and all parents above it are marked as needing to be laid out. This method can be called often, so it needs to execute quickly.

See Also:
validate, LayoutManager
 o isEnabled
 public boolean isEnabled()
Checks if this Component is enabled. Components are initially enabled.

See Also:
setEnabled
 o isVisible
 public boolean isVisible()
Checks if this Component is visible. Components are initially visible.

See Also:
setVisible
 o getParent
 public Container getParent()
Gets the parent of this component

 o setFont
 public void setFont(Font font)
Sets the font for all subsequent text rendering operations.

Parameters:
font - the specified font
 o getFont
 public Font getFont()
Gets the current font.

 o getFontMetrics
 public FontMetrics getFontMetrics()
Gets the font metrics of the current font.

 o getForeground
 public Color getForeground()
Gets the foreground color. If the component does not have a foreground color, the foreground color of its parent is returned.

See Also:
setForeground
 o setForeground
 public void setForeground(Color c)
Sets the foreground color.

Parameters:
c - the Color
See Also:
getForeground
 o getBackground
 public Color getBackground()
Gets the background color. If the component does not have a background color, the background color of its parent is returned.

See Also:
setBackground
 o setBackground
 public void setBackground(Color c)
Sets the background color.

Parameters:
c - the Color
See Also:
getBackground
 o setBounds
 public void setBounds(int x,
                       int y,
                       int width,
                       int height)
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
See Also:
getBounds
 o getBounds
 public Rectangle getBounds()
Get the bounds of this component.

Returns:
the bounds of this component.
 o setEnabled
 public void setEnabled(boolean b)
Enables a component.

See Also:
isEnabled
 o setVisible
 public void setVisible(boolean b)
Displays a component.

See Also:
isVisible
 o paint
 public void paint(Graphics g)
Paints the component. This method is called when the contents of the component should be painted in response to the component first being shown or damage needing repair. The clip rectangle in the Graphics parameter will be set to the area which needs to be painted.

Parameters:
g - the specified Graphics window
See Also:
update
 o proxyGetFrame
 public Frame proxyGetFrame()
 o requestFocus
 public void requestFocus()
Requests the input focus. A FocusGained event will be delivered if this request succeeds. The component must be visible on the screen for this request to be granted.

 o setMasterDrawRegion
 public void setMasterDrawRegion(Rectangle region)
Set the master drawing region for this component

Parameters:
region - the specified master drawing region
 o update
 public void update(Graphics g)
Updates the component. This method is called in response to a call to repaint. You can assume that the background is not cleared.

Parameters:
g - the specified Graphics window
See Also:
paint, repaint
 o repaint
 public void repaint()
Repaints the component. This will result in a call to update as soon as possible.

See Also:
paint
 o processMouseEvent
 public void processMouseEvent(MouseEvent me)
Processes mouse events occurring on this component by dispatching them to any registered MouseListener objects. NOTE: This method will not be called unless mouse events are enabled for this component; this happens when one of the following occurs: a) A MouseListener object is registered via addMouseListener() Classes overriding this method should call super.processMouseEvent() to ensure default event processing continues normally.

Parameters:
e - the mouse event
 o processKeyEvent
 public void processKeyEvent(KeyEvent e)
Processes key events occurring on this component by dispatching them to any registered KeyListener objects. NOTE: This method will not be called unless key events are enabled for this component; this happens when one of the following occurs: a) A KeyListener object is registered via addKeyListener() Classes overriding this method should call super.processKeyEvent() to ensure default event processing continues normally.

Parameters:
e - the key event
 o processFocusEvent
 public void processFocusEvent(FocusEvent e)
Processes focus events occurring on this component by dispatching them to any registered FocusListener objects. NOTE: This method will not be called unless focus events are enabled for this component; this happens when one of the following occurs: a) A FocusListener object is registered via addKeyListener() Classes overriding this method should call super.processFocusEvent() to ensure default event processing continues normally.

Parameters:
e - the focus event
 o validate
 public void validate()
Ensures that a component has a valid layout. This method is primarily intended to operate on Container instances.

See Also:
invalidate, LayoutManager, validate
 o setMinWidth
 public void setMinWidth(int width)
 o setMinHeight
 public void setMinHeight(int height)
 o getMinWidth
 public int getMinWidth()
 o getMinHeight
 public int getMinHeight()

All Packages  Class Hierarchy  This Package  Previous  Next  Index