summaryrefslogtreecommitdiff
path: root/NET/worlds/console/ColorFiller.java
blob: 37496783d8fb25adf656ea55ba483f20d9c15d00 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package NET.worlds.console;

import java.awt.Dimension;
import java.awt.Panel;
import java.awt.Rectangle;

class ColorFiller extends Panel {
   private static final long serialVersionUID = 7047615493861713512L;
   private int w;
   private int h;

   ColorFiller(int width, int height) {
      this.w = width;
      this.h = height;
   }

   public void setHeight(int newH) {
      this.h = newH;
   }

   public void setWidth(int newW) {
      this.w = newW;
   }

   @Override
   public Dimension preferredSize() {
      return new Dimension(this.w, this.h);
   }

   @Override
   public Dimension getMaximumSize() {
      return this.preferredSize();
   }

   @Override
   public void setBounds(Rectangle r) {
      r.width = this.w;
      r.height = this.h;
      super.setBounds(r);
   }
}