1 56 package org.objectstyle.cayenne.modeler.event; 57 58 import java.util.EventObject ; 59 60 import org.objectstyle.cayenne.project.ProjectPath; 61 62 65 public class DisplayEvent extends EventObject { 66 protected boolean refired; 67 protected boolean changed; 68 protected ProjectPath path; 69 70 74 public DisplayEvent(Object source) { 75 super(source); 76 refired = false; 77 changed = true; 78 } 79 80 84 public DisplayEvent(Object source, ProjectPath path) { 85 super(source); 86 refired = false; 87 changed = true; 88 this.path = path; 89 } 90 91 public ProjectPath getPath() { 92 return path; 93 } 94 95 public void setPath(ProjectPath path) { 96 this.path = path; 97 } 98 99 102 public Object getObject() { 103 return (path != null) ? path.getObject() : null; 104 } 105 106 109 public boolean isChanged() { 110 return changed; 111 } 112 113 public void setChanged(boolean changed) { 114 this.changed = changed; 115 } 116 117 120 public boolean isRefired() { 121 return refired; 122 } 123 124 public void setRefired(boolean refired) { 125 this.refired = refired; 126 } 127 128 public boolean pointsTo(Class nodeClass) { 129 if (nodeClass == null) { 130 return false; 131 } 132 133 Object last = getObject(); 134 return (last != null) ? last.getClass() == nodeClass : false; 135 } 136 } 137 | Popular Tags |