package gamegui; import java.awt.event.MouseEvent; import java.awt.Graphics; public class Member { private String name; private int x; private int y; private int width; private int height; private ScrollBar scrollbar; public Member(final String newName, final int newX, final int newY, final int newWidth, final int newHeight) { this.name = newName; this.x = newX; this.y = newY; this.width = newWidth; this.height = newHeight; } public void draw(final Graphics g) { } public boolean handleEvent(final MouseEvent e) { return false; } public boolean isClicked(final int xCoord, final int yCoord) { return this.x <= xCoord && xCoord <= this.x + this.width && this.y <= yCoord && yCoord <= this.y + this.height; } public void clear() { } public String getName() { return this.name; } public int getX() { return this.x; } public int getY() { return this.y; } public int getWidth() { return this.width; } public int getHeight() { return this.height; } public ScrollBar getScrollBar() { return this.scrollbar; } public void setWidth(final int width) { this.width = width; } public void setHeight(final int height) { this.height = height; } public void addScrollBar(final ScrollBar newBar) { newBar.offset(this.x, this.y); this.scrollbar = newBar; } protected void offset(final int xOffset, final int yOffset) { this.x += xOffset; this.y += yOffset; if (this.scrollbar != null) { this.scrollbar.offset(xOffset, yOffset); } } }