source: lost-haven/gamegui/ProgressBar.java@ a49176d

Last change on this file since a49176d 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: 898 bytes
RevLine 
[8edd04e]1package gamegui;
2
3import java.awt.Color;
4import java.awt.Graphics;
5
6public class ProgressBar extends Member {
7
8 private int max;
9 private int current;
10
11 public ProgressBar(String newName, int newX, int newY, int newWidth, int newHeight) {
12 super(newName, newX, newY, newWidth, newHeight);
13 this.max = 1;
14 this.current = 0;
15 }
16
17 public int getMax() {
18 return this.max;
19 }
20
21 public int getCurrent() {
22 return this.current;
23 }
24
25 public void setMax(int max) {
26 this.max = max;
27 }
28
29 public void setCurrent(int current) {
30 this.current = current;
31 }
32
33 public void draw(Graphics g) {
34 g.setColor(Color.black);
35 g.fillRect(getX(), getY(), getWidth(), getHeight());
36 g.setColor(Color.blue);
37 g.fillRect(getX(), getY(), getWidth() * this.current / this.max, getHeight());
38 g.setColor(Color.red);
39 g.drawRect(getX(), getY(), getWidth(), getHeight());
40 }
41}
Note: See TracBrowser for help on using the repository browser.