|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.newdawn.slick.util.InputAdapter
org.newdawn.slick.gui.AbstractComponent
org.newdawn.slick.gui.MouseOverArea
public class MouseOverArea
A mouse over area that can be used for menus or buttons
| Field Summary |
|---|
| Fields inherited from class org.newdawn.slick.gui.AbstractComponent |
|---|
container, input, listeners |
| Constructor Summary | |
|---|---|
MouseOverArea(GUIContext container,
Image image,
int x,
int y)
Create a new mouse over area |
|
MouseOverArea(GUIContext container,
Image image,
int x,
int y,
ComponentListener listener)
Create a new mouse over area |
|
MouseOverArea(GUIContext container,
Image image,
int x,
int y,
int width,
int height)
Create a new mouse over area |
|
MouseOverArea(GUIContext container,
Image image,
int x,
int y,
int width,
int height,
ComponentListener listener)
Create a new mouse over area |
|
MouseOverArea(GUIContext container,
Image image,
Shape shape)
Create a new mouse over area |
|
| Method Summary | |
|---|---|
int |
getHeight()
Get the height of the component |
int |
getWidth()
Get the width of the component |
int |
getX()
Returns the position in the X coordinate |
int |
getY()
Returns the position in the Y coordinate |
boolean |
isMouseOver()
Check if the mouse is over this area |
void |
mouseDragged(int oldx,
int oldy,
int newx,
int newy)
Notification that mouse cursor was dragged |
void |
mouseMoved(int oldx,
int oldy,
int newx,
int newy)
Notification that mouse cursor was moved |
void |
mousePressed(int button,
int mx,
int my)
Notification that a mouse button was pressed |
void |
mouseReleased(int button,
int mx,
int my)
Gives the focus to this component with a click of the mouse. |
void |
render(GUIContext container,
Graphics g)
Render this component to the screen |
void |
setLocation(float x,
float y)
Moves the component. |
void |
setLocation(int x,
int y)
Set the location of this area |
void |
setMouseDownColor(Color color)
Set the color to be used when the mouse is down the area |
void |
setMouseDownImage(Image image)
Set the image to be used when the mouse is down the area |
void |
setMouseDownSound(Sound sound)
Set the mouse down sound effect |
void |
setMouseOverColor(Color color)
Set the color to be used when the mouse is over the area |
void |
setMouseOverImage(Image image)
Set the image to be used when the mouse is over the area |
void |
setMouseOverSound(Sound sound)
Set the mouse over sound effect |
void |
setNormalColor(Color color)
Set the normal color used on the image in the default state |
void |
setNormalImage(Image image)
Set the normal image used on the image in the default state |
void |
setX(float x)
Set the x coordinate of this area |
void |
setY(float y)
Set the y coordinate of this area |
| Methods inherited from class org.newdawn.slick.gui.AbstractComponent |
|---|
addListener, consumeEvent, hasFocus, notifyListeners, removeListener, setFocus |
| Methods inherited from class org.newdawn.slick.util.InputAdapter |
|---|
controllerButtonPressed, controllerButtonReleased, controllerDownPressed, controllerDownReleased, controllerLeftPressed, controllerLeftReleased, controllerRightPressed, controllerRightReleased, controllerUpPressed, controllerUpReleased, inputEnded, inputStarted, isAcceptingInput, keyPressed, keyReleased, mouseClicked, mouseWheelMoved, setAcceptingInput, setInput |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MouseOverArea(GUIContext container,
Image image,
int x,
int y,
ComponentListener listener)
container - The container displaying the mouse over areaimage - The normalImage to displayx - The position of the areay - the position of the arealistener - A listener to add to the area
public MouseOverArea(GUIContext container,
Image image,
int x,
int y)
container - The container displaying the mouse over areaimage - The normalImage to displayx - The position of the areay - the position of the area
public MouseOverArea(GUIContext container,
Image image,
int x,
int y,
int width,
int height,
ComponentListener listener)
container - The container displaying the mouse over areaimage - The normalImage to displayx - The position of the areay - the position of the areawidth - The width of the areaheight - The height of the arealistener - A listener to add to the area
public MouseOverArea(GUIContext container,
Image image,
int x,
int y,
int width,
int height)
container - The container displaying the mouse over areaimage - The normalImage to displayx - The position of the areay - the position of the areawidth - The width of the areaheight - The height of the area
public MouseOverArea(GUIContext container,
Image image,
Shape shape)
container - The container displaying the mouse over areaimage - The normalImage to displayshape - The shape defining the area of the mouse sensitive zone| Method Detail |
|---|
public void setLocation(float x,
float y)
x - X coordinatey - Y coordinatepublic void setX(float x)
x - The new x coordinate of this areapublic void setY(float y)
y - The new y coordinate of this areapublic int getX()
getX in class AbstractComponentpublic int getY()
getY in class AbstractComponentpublic void setNormalColor(Color color)
color - The color to be usedpublic void setMouseOverColor(Color color)
color - The color to be used when the mouse is over the areapublic void setMouseDownColor(Color color)
color - The color to be used when the mouse is down the areapublic void setNormalImage(Image image)
image - The image to be usedpublic void setMouseOverImage(Image image)
image - The image to be used when the mouse is over the areapublic void setMouseDownImage(Image image)
image - The image to be used when the mouse is down the area
public void render(GUIContext container,
Graphics g)
AbstractComponent
render in class AbstractComponentcontainer - The container displaying this componentg - The graphics context used to render to the displayAbstractComponent.render(org.newdawn.slick.gui.GUIContext,
org.newdawn.slick.Graphics)public void setMouseOverSound(Sound sound)
sound - The mouse over sound effectpublic void setMouseDownSound(Sound sound)
sound - The mouse down sound effect
public void mouseMoved(int oldx,
int oldy,
int newx,
int newy)
MouseListener
mouseMoved in interface MouseListenermouseMoved in class InputAdapteroldx - The old x position of the mouseoldy - The old y position of the mousenewx - The new x position of the mousenewy - The new y position of the mouseInputAdapter.mouseMoved(int, int, int, int)
public void mouseDragged(int oldx,
int oldy,
int newx,
int newy)
MouseListener
mouseDragged in interface MouseListenermouseDragged in class InputAdapteroldx - The old x position of the mouseoldy - The old y position of the mousenewx - The new x position of the mousenewy - The new y position of the mouseInputAdapter.mouseDragged(int, int, int, int)
public void mousePressed(int button,
int mx,
int my)
MouseListener
mousePressed in interface MouseListenermousePressed in class InputAdapterbutton - The index of the button (starting at 0)mx - The x position of the mouse when the button was pressedmy - The y position of the mouse when the button was pressedInputAdapter.mousePressed(int, int, int)
public void mouseReleased(int button,
int mx,
int my)
AbstractComponent
mouseReleased in interface MouseListenermouseReleased in class AbstractComponentbutton - The index of the button (starting at 0)mx - The x position of the mouse when the button was releasedmy - The y position of the mouse when the button was releasedInputAdapter.mouseReleased(int, int, int)public int getHeight()
AbstractComponent
getHeight in class AbstractComponentAbstractComponent.getHeight()public int getWidth()
AbstractComponent
getWidth in class AbstractComponentAbstractComponent.getWidth()public boolean isMouseOver()
public void setLocation(int x,
int y)
setLocation in class AbstractComponentx - The x coordinate of this areay - The y coordiante of this area
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||