1 package jimm.datavision; 2 import jimm.util.XMLWriter; 3 import java.util.Observer ; 4 import java.util.Observable ; 5 6 12 13 public abstract class Element 14 extends Observable 15 implements Writeable, Observer 16 { 17 18 protected Report report; 19 protected Section section; 20 protected boolean visible; 21 22 30 public Element(Report report, Section section, boolean visible) { 31 this.report = report; 32 this.section = section; 33 this.visible = visible; 34 } 35 36 public void update(Observable o, Object arg) { 37 setChanged(); 38 notifyObservers(arg); 39 } 40 41 46 public Section getSection() { return section; } 47 48 53 public Report getReport() { return report; } 54 55 61 public void setSection(Section s) { 62 if (s != section) { 63 section = s; 64 setChanged(); 65 notifyObservers(); 66 } 67 } 68 69 74 public boolean isVisible() { return visible; } 75 76 81 public void setVisible(boolean newVisible) { 82 if (visible != newVisible) { 83 visible = newVisible; 84 setChanged(); 85 notifyObservers(); 86 } 87 } 88 89 95 public abstract void writeXML(XMLWriter out); 96 97 } 98 | Popular Tags |