|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--java.awt.Component
A generic Abstract Window Toolkit component.
| Field Summary |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Method Summary | |
boolean |
action(Event evt,
Object what)
Called if an action occurs in the Component. |
void |
addNotify()
Notifies the Component to create a peer. |
Rectangle |
bounds()
Returns the current bounds of this component. |
int |
checkImage(Image image,
java.awt.image.ImageObserver observer)
Returns the status of the construction of a screen representation of the specified image. |
int |
checkImage(Image image,
int width,
int height,
java.awt.image.ImageObserver observer)
Returns the status of the construction of a scaled screen representation of the specified image. |
Image |
createImage(java.awt.image.ImageProducer producer)
Creates an image from the specified image producer. |
Image |
createImage(int width,
int height)
Creates an off-screen drawable Image to be used for double buffering. |
void |
deliverEvent(Event e)
Delivers an event to this component or one of its sub components. |
void |
disable()
Disables a component. |
void |
enable()
Enables a component. |
void |
enable(boolean cond)
Conditionally enables a component. |
Color |
getBackground()
Gets the background color. |
java.awt.image.ColorModel |
getColorModel()
Gets the ColorModel used to display the component on the output device. |
Font |
getFont()
Gets the font of the component. |
FontMetrics |
getFontMetrics(Font font)
Gets the font metrics for this component. |
Color |
getForeground()
Gets the foreground color. |
Graphics |
getGraphics()
Gets a Graphics context for this component. |
Container |
getParent()
Gets the parent of the component. |
java.awt.peer.ComponentPeer |
getPeer()
Gets the peer of the component. |
Toolkit |
getToolkit()
Gets the toolkit of the component. |
boolean |
gotFocus(Event evt,
Object what)
Indicates that this component has received the input focus. |
boolean |
handleEvent(Event evt)
Handles the event. |
void |
hide()
Hides the component. |
boolean |
imageUpdate(Image img,
int flags,
int x,
int y,
int w,
int h)
Repaints the component when the image has changed. |
boolean |
inside(int x,
int y)
Checks whether a specified x,y location is "inside" this Component, where x and y are defined to be relative to the coordinate system of this component. |
void |
invalidate()
Invalidates the component. |
boolean |
isEnabled()
Checks if this Component is enabled. |
boolean |
isShowing()
Checks if this Component is showing on screen. |
boolean |
isValid()
Checks if this Component is valid. |
boolean |
isVisible()
Checks if this Component is visible. |
boolean |
keyDown(Event evt,
int key)
Called if a character is pressed. |
boolean |
keyUp(Event evt,
int key)
Called if a character is released. |
void |
layout()
Lays out the component. |
void |
list()
Prints a listing to a print stream. |
void |
list(PrintStream out)
Prints a listing to the specified print out stream. |
void |
list(PrintStream out,
int indent)
Prints out a list, starting at the specified indention, to the specified print stream. |
Component |
locate(int x,
int y)
Returns the component or subcomponent that contains the x,y location. |
Point |
location()
Returns the current location of this component. |
boolean |
lostFocus(Event evt,
Object what)
Indicates that this component has lost the input focus. |
Dimension |
minimumSize()
Returns the minimum size of this component. |
boolean |
mouseDown(Event evt,
int x,
int y)
Called if the mouse is down. |
boolean |
mouseDrag(Event evt,
int x,
int y)
Called if the mouse is dragged (the mouse button is down). |
boolean |
mouseEnter(Event evt,
int x,
int y)
Called when the mouse enters the component. |
boolean |
mouseExit(Event evt,
int x,
int y)
Called when the mouse exits the component. |
boolean |
mouseMove(Event evt,
int x,
int y)
Called if the mouse moves (the mouse button is up). |
boolean |
mouseUp(Event evt,
int x,
int y)
Called if the mouse is up. |
void |
move(int x,
int y)
Moves the Component to a new location. |
void |
nextFocus()
Moves the focus to the next component. |
void |
paint(Graphics g)
Paints the component. |
void |
paintAll(Graphics g)
Paints the component and its subcomponents. |
protected String |
paramString()
Returns the parameter String of this Component. |
boolean |
postEvent(Event e)
Posts an event to this component. |
Dimension |
preferredSize()
Returns the preferred size of this component. |
boolean |
prepareImage(Image image,
java.awt.image.ImageObserver observer)
Prepares an image for rendering on this Component. |
boolean |
prepareImage(Image image,
int width,
int height,
java.awt.image.ImageObserver observer)
Prepares an image for rendering on this Component at the specified width and height. |
void |
print(Graphics g)
Prints this component. |
void |
printAll(Graphics g)
Prints the component and its subcomponents. |
void |
removeNotify()
Notifies the Component to destroy the peer. |
void |
repaint()
Repaints the component. |
void |
repaint(int x,
int y,
int width,
int height)
Repaints part of the component. |
void |
repaint(long tm)
Repaints the component. |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Repaints part of the component. |
void |
requestFocus()
Requests the input focus. |
void |
reshape(int x,
int y,
int width,
int height)
Reshapes the Component to the specified bounding box. |
void |
resize(Dimension d)
Resizes the Component to the specified dimension. |
void |
resize(int width,
int height)
Resizes the Component to the specified width and height. |
void |
setBackground(Color c)
Sets the background color. |
void |
setFont(Font f)
Sets the font of the component. |
void |
setForeground(Color c)
Sets the foreground color. |
void |
show()
Shows the component. |
void |
show(boolean cond)
Conditionally shows the component. |
Dimension |
size()
Returns the current size of this component. |
String |
toString()
Returns the String representation of this Component's values. |
void |
update(Graphics g)
Updates the component. |
void |
validate()
Validates a component. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
public Container getParent()
public java.awt.peer.ComponentPeer getPeer()
public Toolkit getToolkit()
public boolean isValid()
validate(),
invalidate()public boolean isVisible()
show(),
hide()public boolean isShowing()
show(),
hide()public boolean isEnabled()
enable(),
disable()public Point location()
move(int, int)public Dimension size()
resize(int, int)public Rectangle bounds()
reshape(int, int, int, int)public void enable()
isEnabled(),
disable()public void enable(boolean cond)
cond - if true, enables component; disables otherwise.enable(),
disable()public void disable()
isEnabled(),
enable()public void show()
isVisible(),
hide()public void show(boolean cond)
cond - if true, it shows the component; hides otherwise.show(),
hide()public void hide()
isVisible(),
hide()public Color getForeground()
setForeground(java.awt.Color)public void setForeground(Color c)
c - the ColorgetForeground()public Color getBackground()
setBackground(java.awt.Color)public void setBackground(Color c)
c - the ColorgetBackground()public Font getFont()
setFont(java.awt.Font)public void setFont(Font f)
f - the fontgetFont()public java.awt.image.ColorModel getColorModel()
ColorModel
public void move(int x,
int y)
x - the x coordinatey - the y coordinatelocation(),
reshape(int, int, int, int)
public void resize(int width,
int height)
width - the width of the componentheight - the height of the componentsize(),
reshape(int, int, int, int)public void resize(Dimension d)
d - the component dimensionsize(),
reshape(int, int, int, int)
public void reshape(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the width of the componentheight - the height of the componentbounds(),
move(int, int),
resize(int, int)public Dimension preferredSize()
minimumSize(),
LayoutManagerpublic Dimension minimumSize()
preferredSize(),
LayoutManagerpublic void layout()
validate(),
LayoutManagerpublic void validate()
invalidate(),
layout(),
LayoutManagerpublic void invalidate()
validate(),
layout(),
LayoutManagerpublic Graphics getGraphics()
paint(java.awt.Graphics)public FontMetrics getFontMetrics(Font font)
font - the fontgetFont()public void paint(Graphics g)
g - the specified Graphics windowupdate(java.awt.Graphics)public void update(Graphics g)
g - the specified Graphics windowpaint(java.awt.Graphics),
repaint()public void paintAll(Graphics g)
g - the specified Graphics windowpaint(java.awt.Graphics)public void repaint()
paint(java.awt.Graphics)public void repaint(long tm)
tm - maximum time in milliseconds before updatepaint(java.awt.Graphics)
public void repaint(int x,
int y,
int width,
int height)
x - the x coordinatey - the y coordinatewidth - the widthheight - the heightrepaint()
public void repaint(long tm,
int x,
int y,
int width,
int height)
tm - maximum time in milliseconds before updatex - the x coordinatey - the y coordinatewidth - the widthheight - the heightrepaint()public void print(Graphics g)
g - the specified Graphics windowpaint(java.awt.Graphics)public void printAll(Graphics g)
g - the specified Graphics windowprint(java.awt.Graphics)
public boolean imageUpdate(Image img,
int flags,
int x,
int y,
int w,
int h)
imageUpdate in interface java.awt.image.ImageObserverpublic Image createImage(java.awt.image.ImageProducer producer)
producer - the image producer
public Image createImage(int width,
int height)
width - the specified widthheight - the specified height
public boolean prepareImage(Image image,
java.awt.image.ImageObserver observer)
image - the Image to prepare a screen representation forobserver - the ImageObserver object to be notified as the
image is being prepared
ImageObserver
public boolean prepareImage(Image image,
int width,
int height,
java.awt.image.ImageObserver observer)
image - the Image to prepare a screen representation forwidth - the width of the desired screen representationheight - the height of the desired screen representationobserver - the ImageObserver object to be notified as the
image is being prepared
ImageObserver
public int checkImage(Image image,
java.awt.image.ImageObserver observer)
image - the Image to check the status ofobserver - the ImageObserver object to be notified as the
image is being prepared
ImageObserver,
prepareImage(java.awt.Image, java.awt.image.ImageObserver)
public int checkImage(Image image,
int width,
int height,
java.awt.image.ImageObserver observer)
image - the Image to check the status ofwidth - the width of the scaled version to check the status ofheight - the height of the scaled version to check the status ofobserver - the ImageObserver object to be notified as the
image is being prepared
ImageObserver,
prepareImage(java.awt.Image, java.awt.image.ImageObserver)
public boolean inside(int x,
int y)
x - the x coordinatey - the y coordinatelocate(int, int)
public Component locate(int x,
int y)
x - the x coordinatey - the y coordinateinside(int, int)public void deliverEvent(Event e)
e - the eventhandleEvent(java.awt.Event),
postEvent(java.awt.Event)public boolean postEvent(Event e)
e - the eventhandleEvent(java.awt.Event),
deliverEvent(java.awt.Event)public boolean handleEvent(Event evt)
evt - the eventmouseEnter(java.awt.Event, int, int),
mouseExit(java.awt.Event, int, int),
mouseMove(java.awt.Event, int, int),
mouseDown(java.awt.Event, int, int),
mouseDrag(java.awt.Event, int, int),
mouseUp(java.awt.Event, int, int),
keyDown(java.awt.Event, int),
action(java.awt.Event, java.lang.Object)
public boolean mouseDown(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean mouseDrag(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean mouseUp(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean mouseMove(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean mouseEnter(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean mouseExit(Event evt,
int x,
int y)
evt - the eventx - the x coordinatey - the y coordinatehandleEvent(java.awt.Event)
public boolean keyDown(Event evt,
int key)
evt - the eventkey - the key that's pressedhandleEvent(java.awt.Event)
public boolean keyUp(Event evt,
int key)
evt - the eventkey - the key that's releasedhandleEvent(java.awt.Event)
public boolean action(Event evt,
Object what)
evt - the eventwhat - the action that's occuringhandleEvent(java.awt.Event)public void addNotify()
getPeer(),
removeNotify()public void removeNotify()
getPeer(),
addNotify()
public boolean gotFocus(Event evt,
Object what)
requestFocus(),
lostFocus(java.awt.Event, java.lang.Object)
public boolean lostFocus(Event evt,
Object what)
requestFocus(),
gotFocus(java.awt.Event, java.lang.Object)public void requestFocus()
gotFocus(java.awt.Event, java.lang.Object)public void nextFocus()
requestFocus(),
gotFocus(java.awt.Event, java.lang.Object)protected String paramString()
public String toString()
toString in class Objectpublic void list()
public void list(PrintStream out)
out - the Stream name
public void list(PrintStream out,
int indent)
out - the Stream nameindent - the start of the list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||