source: lost-haven/gamegui/Member.java@ b2d7893

Last change on this file since b2d7893 was 8edd04e, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 4 years ago

Make the decompiled game code compile successfully

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