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.
-
Component()
- Constructs a new Component.
-
addFocusListener(FocusListener)
- Adds the specified key listener to receive key events
from this component.
-
addKeyListener(KeyListener)
- Adds the specified key listener to receive key events
from this component.
-
addMouseListener(MouseListener)
- Adds the specified mouse listener to receive mouse events
from this component.
-
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.
-
getBackground()
- Gets the background color.
-
getBounds()
-
Get the bounds of this component.
-
getFont()
- Gets the current font.
-
getFontMetrics()
- Gets the font metrics of the current font.
-
getForeground()
- Gets the foreground color.
-
getGraphics()
- Gets a Graphics context for this component.
-
getLocationOnScreen()
-
Returns the current location of this component in the screen's
coordinate space.
-
getMinHeight()
-
-
getMinimumSize()
- Gets the minimum size of this component.
-
getMinWidth()
-
-
getParent()
- Gets the parent of this component
-
getPreferredSize()
- Gets the preferred size of this component.
-
invalidate()
-
Invalidates the component.
-
isEnabled()
- Checks if this Component is enabled.
-
isVisible()
- Checks if this Component is visible.
-
paint(Graphics)
-
Paints the component.
-
processFocusEvent(FocusEvent)
-
Processes focus events occurring on this component by
dispatching them to any registered FocusListener objects.
-
processKeyEvent(KeyEvent)
-
Processes key events occurring on this component by
dispatching them to any registered KeyListener objects.
-
processMouseEvent(MouseEvent)
-
Processes mouse events occurring on this component by
dispatching them to any registered MouseListener objects.
-
proxyGetFrame()
-
-
removeFocusListener(FocusListener)
-
-
removeKeyListener(KeyListener)
-
-
removeMouseListener(MouseListener)
-
-
repaint()
-
Repaints the component.
-
requestFocus()
-
Requests the input focus.
-
setBackground(Color)
-
Sets the background color.
-
setBounds(int, int, int, int)
-
Reshapes the Component to the specified bounding box.
-
setEnabled(boolean)
- Enables a component.
-
setFont(Font)
- Sets the font for all subsequent text rendering operations.
-
setForeground(Color)
-
Sets the foreground color.
-
setMasterDrawRegion(Rectangle)
-
Set the master drawing region for this component
-
setMinHeight(int)
-
-
setMinWidth(int)
-
-
setVisible(boolean)
- Displays a component.
-
size()
- Gets the size of this component.
-
update(Graphics)
-
Updates the component.
-
validate()
-
Ensures that a component has a valid layout.
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).
addMouseListener
public void addMouseListener(MouseListener l)
- Adds the specified mouse listener to receive mouse events
from this component.
- Parameters:
- l - the mouse listener
removeMouseListener
public void removeMouseListener(MouseListener l)
addKeyListener
public void addKeyListener(KeyListener l)
- Adds the specified key listener to receive key events
from this component.
- Parameters:
- l - the key listener
removeKeyListener
public void removeKeyListener(KeyListener l)
addFocusListener
public void addFocusListener(FocusListener l)
- Adds the specified key listener to receive key events
from this component.
- Parameters:
- l - the key listener
removeFocusListener
public void removeFocusListener(FocusListener l)
getLocationOnScreen
public Point getLocationOnScreen()
- Returns the current location of this component in the screen's
coordinate space.
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
size
public Dimension size()
- Gets the size of this component.
getMinimumSize
public Dimension getMinimumSize()
- Gets the minimum size of this component.
getPreferredSize
public Dimension getPreferredSize()
- Gets the preferred size of this component.
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
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
isEnabled
public boolean isEnabled()
- Checks if this Component is enabled. Components are initially enabled.
- See Also:
- setEnabled
isVisible
public boolean isVisible()
- Checks if this Component is visible. Components are initially visible.
- See Also:
- setVisible
getParent
public Container getParent()
- Gets the parent of this component
setFont
public void setFont(Font font)
- Sets the font for all subsequent text rendering operations.
- Parameters:
- font - the specified font
getFont
public Font getFont()
- Gets the current font.
getFontMetrics
public FontMetrics getFontMetrics()
- Gets the font metrics of the current font.
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
setForeground
public void setForeground(Color c)
- Sets the foreground color.
- Parameters:
- c - the Color
- See Also:
- getForeground
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
setBackground
public void setBackground(Color c)
- Sets the background color.
- Parameters:
- c - the Color
- See Also:
- getBackground
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
getBounds
public Rectangle getBounds()
- Get the bounds of this component.
- Returns:
- the bounds of this component.
setEnabled
public void setEnabled(boolean b)
- Enables a component.
- See Also:
- isEnabled
setVisible
public void setVisible(boolean b)
- Displays a component.
- See Also:
- isVisible
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
proxyGetFrame
public Frame proxyGetFrame()
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.
setMasterDrawRegion
public void setMasterDrawRegion(Rectangle region)
- Set the master drawing region for this component
- Parameters:
- region - the specified master drawing region
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
repaint
public void repaint()
- Repaints the component. This will result in a
call to update as soon as possible.
- See Also:
- paint
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
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
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
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
setMinWidth
public void setMinWidth(int width)
setMinHeight
public void setMinHeight(int height)
getMinWidth
public int getMinWidth()
getMinHeight
public int getMinHeight()
All Packages Class Hierarchy This Package Previous Next Index