use of org.apache.cayenne.modeler.event.DbRelationshipDisplayListener in project cayenne by apache.
the class ProjectController method fireDbRelationshipDisplayEvent.
public void fireDbRelationshipDisplayEvent(RelationshipDisplayEvent e) {
boolean changed = !Arrays.equals(e.getRelationships(), currentState.dbRels);
if (changed) {
if (e.getEntity() != currentState.dbEntity) {
clearState();
currentState.domain = e.getDomain();
currentState.map = e.getDataMap();
currentState.dbEntity = (DbEntity) e.getEntity();
}
currentState.dbRels = new DbRelationship[e.getRelationships().length];
System.arraycopy(e.getRelationships(), 0, currentState.dbRels, 0, currentState.dbRels.length);
}
for (EventListener listener : listenerList.getListeners(DbRelationshipDisplayListener.class)) {
DbRelationshipDisplayListener temp = (DbRelationshipDisplayListener) listener;
temp.currentDbRelationshipChanged(e);
}
}
Aggregations