1 package gnu.kawa.models; 2 import java.awt.Color ; 3 4 5 6 public class Button extends Model 7 { 8 boolean disabled; 9 String text; 10 Object action; 11 Color foreground; 13 Color background; 14 Object width; 15 16 public void makeView (Display display, Object where) 17 { 18 display.addButton(this, where); 19 } 20 21 public boolean isDisabled () { return disabled; } 22 public void setDisabled (boolean disabled) { this.disabled = disabled; } 23 24 public String getText () { return text; } 25 public void setText (String text) 26 { 27 this.text = text; 28 notifyListeners("text"); 29 } 30 31 public Object getAction () { return action; } 32 public void setAction (Object action) { this.action = action; } 33 34 public Color getForeground () { return foreground; } 35 public void setForeground (Color fg) 36 { 37 foreground = fg; 38 notifyListeners("foreground"); 39 } 40 41 public Color getBackground () { return background; } 42 public void setBackground (Color bg) 43 { 44 background = bg; 45 notifyListeners("background"); 46 } 47 } 48 | Popular Tags |