|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
com.arsdigita.toolbox.rebop.GenericComponent
Root of all rebop components. Takes care of double-buffering. Typically, only the "root" component need have its double-buffer flag set to true, as all sub-components will automatically be double-buffered.
Nested Class Summary |
Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.arsdigita.toolbox.rebop.GenericDrawable |
versionId |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
GenericComponent()
|
Method Summary | |
void |
addNotify()
Called when the native peer is available, Double-buffer image is automatically created if required. |
void |
componentReshape(int x,
int y,
int width,
int height)
|
protected void |
draw(Graphics g)
Draw this component to a Graphics context. |
void |
draw(Graphics g,
int x,
int y,
int width,
int height)
Implementation of the GenericDrawable interface. |
protected void |
drawDebug(Graphics g)
Draws the outer edge of the component's rectangle in red, and the component's preferred size in blue. |
void |
forceInvalid()
|
static boolean |
getDebugPaint()
|
boolean |
getDoubleBuffered()
|
GenericDrawable |
getDrawable()
|
int |
getXOffset()
|
int |
getYOffset()
|
void |
mouseClicked(MouseEvent e)
Invoked when the mouse has been clicked on a component. |
void |
mouseEntered(MouseEvent e)
Invoked when the mouse enters a component. |
void |
mouseExited(MouseEvent e)
Invoked when the mouse exits a component. |
void |
mousePressed(MouseEvent e)
Invoked when a mouse button has been pressed on a component. |
void |
mouseReleased(MouseEvent e)
Invoked when a mouse button has been released on a component. |
void |
paint(Graphics g)
paints the component by calling the draw method. |
void |
reshape(int x,
int y,
int width,
int height)
Called whenever a component is resized. |
void |
setBounds(int x,
int y,
int width,
int height)
Called whenever a component is resized. |
static void |
setDebugPaint(boolean debug)
Toggles debug component painting for ALL components |
void |
setDoubleBuffered(boolean db)
if db is set to true, then this component will paint using standard double-buffered techniques |
void |
setDrawable(GenericDrawable drawable)
Sets the object that will draw this component. |
void |
setXOffset(int xOffset)
The X and Y offsets are used to offset a drawable from the location where it is told to draw. |
void |
setYOffset(int yOffset)
|
protected void |
validateTree()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GenericComponent()
Method Detail |
public void setDrawable(GenericDrawable drawable)
drawable
- Object that will be drawn in this
component's paint() methodpublic GenericDrawable getDrawable()
public void setDoubleBuffered(boolean db)
db
- double buffer flagpublic boolean getDoubleBuffered()
public void addNotify()
public void setBounds(int x, int y, int width, int height)
x
- new x coordinatey
- new y coordinatewidth
- new widthheight
- new heightpublic void reshape(int x, int y, int width, int height)
x
- new x coordinatey
- new y coordinatewidth
- new widthheight
- new heightpublic void componentReshape(int x, int y, int width, int height)
public void paint(Graphics g)
g
- Graphics to draw inprotected void validateTree()
public void forceInvalid()
protected void draw(Graphics g)
g
- Graphics to draw inpublic void draw(Graphics g, int x, int y, int width, int height)
draw
in interface GenericDrawable
g
- Graphics to draw onx
- horizontal location to begin drawingy
- vertical location to begin drawingwidth
- width of area to draw inheight
- height of area to draw inpublic void setXOffset(int xOffset)
GenericDrawable
setXOffset
in interface GenericDrawable
xOffset
- number of horizontal pixels to offset this
drawable before drawing it.public int getXOffset()
getXOffset
in interface GenericDrawable
public int getYOffset()
getYOffset
in interface GenericDrawable
public void setYOffset(int yOffset)
setYOffset
in interface GenericDrawable
yOffset
- number of vertical pixels to offset thisGenericDrawable.setXOffset(int)
protected void drawDebug(Graphics g)
g
- Graphics to draw inpublic static void setDebugPaint(boolean debug)
debug
- if true, then drawDebug will be called from
the draw method.public static boolean getDebugPaint()
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |