source: galactic-heroes/gamegui/Window.java@ 7d9c033

Last change on this file since 7d9c033 was 7d9c033, checked in by Dmitry Portnoy <dmitry.portnoy@…>, 6 years ago

Initial commit, code decompiled from a jar

  • Property mode set to 100644
File size: 1.6 KB
Line 
1package gamegui;
2
3import java.awt.Color;
4import java.awt.Graphics;
5import java.util.ArrayList;
6
7public class Window extends Member {
8 ArrayList members;
9 boolean fullscreen;
10
11 public Window(final String newName, final int newX, final int newY, final int newWidth, final int newHeight) {
12 super(newName, newX, newY, newWidth, newHeight);
13 this.members = new ArrayList();
14 }
15
16 public Window(final String newName, final int newX, final int newY, final int newWidth, final int newHeight, final boolean full) {
17 super(newName, newX, newY, newWidth, newHeight);
18 this.members = new ArrayList();
19 this.fullscreen = full;
20 }
21
22 public void draw(final Graphics g) {
23 g.setColor(Color.black);
24 g.fillRect(this.getX(), this.getY(), this.getWidth(), this.getHeight());
25 if (!this.fullscreen) {
26 g.setColor(Color.red);
27 g.drawRect(this.getX(), this.getY(), this.getWidth(), this.getHeight());
28 }
29 for (int x = 0; x < this.members.size(); ++x) {
30 ((Member)this.members.get(x)).draw(g);
31 }
32 }
33
34 public void clear() {
35 for (int x = 0; x < this.members.size(); ++x) {
36 ((Member)this.members.get(x)).clear();
37 }
38 }
39
40 public void add(final Member aMember) {
41 this.members.add(aMember);
42 }
43
44 public Member getMember(final String aName) {
45 for (int x = 0; x < this.members.size(); ++x) {
46 if (((Member)this.members.get(x)).getName().equals(aName)) {
47 return (Member)this.members.get(x);
48 }
49 }
50 return null;
51 }
52}
Note: See TracBrowser for help on using the repository browser.