public abstract class Slot extends InterfaceObject implements org.newdawn.slick.MouseListener
Constructor and Description |
---|
Slot(org.newdawn.slick.Image tex,
org.newdawn.slick.GameContainer gc)
Slot constructor
|
Modifier and Type | Method and Description |
---|---|
void |
click(boolean clicked)
Clicks or unclicks slot content
|
void |
dragged(boolean dragged)
Sets whole content in slots as dragged or not
|
void |
draw(float x,
float y,
boolean scaledPos)
Draws object
|
java.util.List<? extends SlotContent> |
getContent()
Returns slot content
|
java.util.Collection<SlotContent> |
getDraggedContent()
Returns whole 'dragged' content from slot
|
void |
inputEnded() |
void |
inputStarted() |
abstract boolean |
insertContent(java.util.Collection<? extends SlotContent> content)
Inserts all content from specified collection to slot
|
abstract boolean |
insertContent(SlotContent content)
Inserts content in slot
|
boolean |
isAcceptingInput() |
boolean |
isContentDragged()
Checks if content tile in slot is dragged
|
boolean |
isEmpty()
Checks if slot is empty
|
boolean |
isFull()
Checks if slot is full
|
void |
mouseClicked(int button,
int x,
int y,
int clickCount) |
void |
mouseDragged(int oldx,
int oldy,
int newx,
int newy) |
void |
mouseMoved(int oldx,
int oldy,
int newx,
int newy) |
void |
mousePressed(int button,
int x,
int y) |
void |
mouseReleased(int button,
int x,
int y) |
void |
mouseWheelMoved(int change) |
void |
removeContent()
Removes whole content from slot
|
void |
removeContent(java.util.Collection<SlotContent> contentToRemove)
Removes all specified content
|
boolean |
removeContent(SlotContent contentToRemove)
Removes specified content from slot
|
void |
setInput(org.newdawn.slick.Input input) |
atCenter, draw, draw, draw, draw, draw, draw, draw, getDis, getPos, getScale, getScaledHeight, getScaledWidth, getSize, isMouseOver, setInfo, setPosition, setSize
bind, clampTexture, copy, destroy, draw, draw, draw, draw, draw, draw, drawCentered, drawEmbedded, drawEmbedded, drawEmbedded, drawFlash, drawFlash, drawFlash, drawSheared, drawSheared, drawWarped, endUse, ensureInverted, flushPixelData, getAlpha, getCenterOfRotationX, getCenterOfRotationY, getColor, getFilter, getFlippedCopy, getGraphics, getHeight, getName, getResourceReference, getRotation, getScaledCopy, getScaledCopy, getSubImage, getTexture, getTextureHeight, getTextureOffsetX, getTextureOffsetY, getTextureWidth, getWidth, isDestroyed, rotate, setAlpha, setCenterOfRotation, setColor, setColor, setFilter, setImageColor, setImageColor, setName, setRotation, setTexture, startUse, toString
public Slot(org.newdawn.slick.Image tex, org.newdawn.slick.GameContainer gc) throws org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
tex
- Texture for slotgc
- Slick game containerorg.newdawn.slick.SlickException
java.io.IOException
java.awt.FontFormatException
public boolean isEmpty()
public boolean isFull()
public abstract boolean insertContent(SlotContent content)
content
- Content for slotpublic abstract boolean insertContent(java.util.Collection<? extends SlotContent> content)
content
- Collection with contentpublic void removeContent()
public boolean removeContent(SlotContent contentToRemove)
contentToRemove
- Slot content to removepublic void removeContent(java.util.Collection<SlotContent> contentToRemove)
contentToRemove
- Collection with slot content to removepublic java.util.List<? extends SlotContent> getContent()
public java.util.Collection<SlotContent> getDraggedContent()
public void draw(float x, float y, boolean scaledPos)
InterfaceObject
draw
in class InterfaceObject
x
- Position on x axisy
- Position on y axisscaledPos
- True if object position should be scaledpublic void click(boolean clicked)
clicked
- True to click, false to unclickpublic void dragged(boolean dragged)
dragged
- True to set whole content in slot as dragged, false to disable dragging in whole slot contentpublic boolean isContentDragged()
public void mousePressed(int button, int x, int y)
mousePressed
in interface org.newdawn.slick.MouseListener
public void mouseClicked(int button, int x, int y, int clickCount)
mouseClicked
in interface org.newdawn.slick.MouseListener
public void mouseDragged(int oldx, int oldy, int newx, int newy)
mouseDragged
in interface org.newdawn.slick.MouseListener
public void mouseMoved(int oldx, int oldy, int newx, int newy)
mouseMoved
in interface org.newdawn.slick.MouseListener
public void mouseReleased(int button, int x, int y)
mouseReleased
in interface org.newdawn.slick.MouseListener
public void mouseWheelMoved(int change)
mouseWheelMoved
in interface org.newdawn.slick.MouseListener
public void inputEnded()
inputEnded
in interface org.newdawn.slick.ControlledInputReciever
public void inputStarted()
inputStarted
in interface org.newdawn.slick.ControlledInputReciever
public boolean isAcceptingInput()
isAcceptingInput
in interface org.newdawn.slick.ControlledInputReciever
public void setInput(org.newdawn.slick.Input input)
setInput
in interface org.newdawn.slick.ControlledInputReciever