source: winedb/src/gamegui/Member.java@ 9b6a069

Last change on this file since 9b6a069 was 9b6a069, checked in by dportnoy <devnull@…>, 13 years ago

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1package gamegui;
2
3import java.awt.*;
4import java.awt.event.*;
5
6public class Member {
7 private String name;
8 private int x;
9 private int y;
10 private int width;
11 private int height;
12 private ScrollBar scrollbar;
13
14 public Member(String newName, int newX, int newY, int newWidth, int newHeight) {
15 name = newName;
16 x = newX;
17 y = newY;
18 width = newWidth;
19 height = newHeight;
20 }
21
22 public void draw(Graphics g) {
23
24 }
25
26 public boolean handleEvent(MouseEvent e) {
27 return false;
28 }
29
30 public boolean isClicked(int xCoord, int yCoord) {
31 return x <= xCoord && xCoord <= x+width && y <= yCoord && yCoord <= y+height;
32 }
33
34 public void clear() {
35
36 }
37
38 public String getName() {
39 return name;
40 }
41
42 public int getX() {
43 return x;
44 }
45
46 public int getY() {
47 return y;
48 }
49
50 public int getWidth() {
51 return width;
52 }
53
54 public int getHeight() {
55 return height;
56 }
57
58 public ScrollBar getScrollBar() {
59 return scrollbar;
60 }
61
62 public void setWidth(int width) {
63 this.width = width;
64 }
65
66 public void setHeight(int height) {
67 this.height = height;
68 }
69
70 public void addScrollBar(ScrollBar newBar) {
71 newBar.offset(x, y);
72 scrollbar = newBar;
73 }
74
75 protected void offset(int xOffset, int yOffset) {
76 x += xOffset;
77 y += yOffset;
78
79 if(scrollbar != null)
80 scrollbar.offset(xOffset, yOffset);
81 }
82}
Note: See TracBrowser for help on using the repository browser.