Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
  
  
  package org.apache.cayenne.modeler;
  
  
  
A controller that works with the project tree, tracking selection and dispatching project events.

TODO: Refactor the event model, so that events are generic and contain "path" to a project node in question. After this is done, EventController should no longer maintain the selection model (currentXYZ ivars), rather it should update internal model.

 
 public class ProjectController extends CayenneController {
 
     /*
      * A snapshot of the current state of the project controller. This was added so that
      * we could support history of recent objects.
      */
     public class ControllerState {
 
         private boolean isRefiring;
         private DisplayEvent event;
         private DataDomain domain;
         private DataNode node;
         private DataMap map;
         private ObjEntity objEntity;
         private DbEntity dbEntity;
         private ObjAttribute objAttr;
         private DbAttribute dbAttr;
         private ObjRelationship objRel;
         private DbRelationship dbRel;
         private Procedure procedure;
         private ProcedureParameter procedureParameter;
         private Query query;
 
         public ControllerState() {
              = null;
              = null;
              = null;
 
              = null;
              = null;
              = null;
 
              = null;
              = null;
              = null;
 
              = null;
              = null;
 
              = null;
 
              = null;
              = false;
         }
 
         /*
          * Used to determine if the val ControllerState is equivalent, which means if the
          * event is refired again, will it end up in the same place on the screen. This
          * get's a bit messy at the end, because of inheritance heirarchy issues.
          */
         public boolean isEquivalent(ControllerState val) {
             if (val == null)
                 return false;
 
             if ( instanceof EntityDisplayEvent
                     && val.event instanceof EntityDisplayEvent) {
                 if (((EntityDisplayEventval.event).getEntity() instanceof ObjEntity) {
                     return  == val.objEntity;
                 }
                 else {
                     return  == val.dbEntity;
                 }
             }
             else if ( instanceof ProcedureDisplayEvent
                     && val.event instanceof ProcedureDisplayEvent) {
                 return  == val.procedure;
             }
             else if ( instanceof QueryDisplayEvent
                     && val.event instanceof QueryDisplayEvent) {
                 return  == val.query;
             }
             else if (.getClass() == DataMapDisplayEvent.class
                     && .getClass() == val.event.getClass()) {
                 return  == val.map;
             }
             else if (.getClass() == DataNodeDisplayEvent.class
                     && .getClass() == val.event.getClass()) {
                 return  == val.node;
             }
             else if (.getClass() == DomainDisplayEvent.class
                     && .getClass() == val.event.getClass()) {
                 return  == val.domain;
             }
             return false;
         }
     }
 
     protected EventListenerList listenerList;
     protected boolean dirty;
 
     protected Project project;
     protected Domain projectPreferences;
 
     protected ControllerState currentState;
     protected int maxHistorySize = 20;
 
     public ProjectController(CayenneModelerController parent) {
         super(parent);
         this. = new EventListenerList();
          = new ControllerState();
     }
 
     public Component getView() {
         return .getView();
     }
 
     public Project getProject() {
         return ;
     }
 
     public void setProject(Project currentProject) {
         this. = currentProject;
         this. = null;
     }

    
Returns top preferences Domain for the application.
 
         return getApplication().getPreferenceDomain();
     }

    
Returns top preferences Domain for the current project, throwing an exception if no project is selected.
 
         if (getProject() == null) {
             throw new CayenneRuntimeException("No Project selected");
         }
 
         if ( == null) {
             String key = getProject().isLocationUndefined() ? new String(IDUtil
                     .pseudoUniqueByteSequence16()) : 
                     .getMainFile()
                     .getAbsolutePath();
 
                     Project.class).getSubdomain(key);
         }
 
         return ;
     }

    
Returns top preferences Domain for the current project, throwing an exception if no project is selected.
 
         DataDomain dataDomain = getCurrentDataDomain();
         if (dataDomain == null) {
             throw new CayenneRuntimeException("No DataDomain selected");
         }
 
         return getPreferenceDomainForProject()
                 .getSubdomain(DataDomain.class)
                 .getSubdomain(dataDomain.getName());
     }

    
Returns preferences object for the current DataMap. If no preferences exist for the current DataMap, a new Preferences object is created. If no DataMap is currently selected, an exception is thrown. An optional nameSuffix allows to address more than one defaults instance for a single DataMap.
 
     public DataMapDefaults getDataMapPreferences(String nameSuffix) {
         DataMap map = getCurrentDataMap();
         if (map == null) {
             throw new CayenneRuntimeException("No DataMap selected");
         }
 
         if (nameSuffix == null) {
             nameSuffix = "";
         }
 
                 map.getName() + nameSuffix,
                 DataMapDefaults.class,
                 true);
     }

    
Returns preferences object for the current DataMap, throwing an exception if no DataMap is selected.
 
         DataNode node = getCurrentDataNode();
         if (node == null) {
             throw new CayenneRuntimeException("No DataNode selected");
         }
 
                 node.getName(),
                 DataNodeDefaults.class,
                 true);
     }
 
     public void projectOpened() {
         CayenneModelerFrame frame = (CayenneModelerFramegetView();
         addDataNodeDisplayListener(frame);
         addDataMapDisplayListener(frame);
         addObjEntityDisplayListener(frame);
         addDbEntityDisplayListener(frame);
         addQueryDisplayListener(frame);
         addProcedureDisplayListener(frame);
     }
 
     public void reset() {
         clearState();
         setDirty(false);
          = new EventListenerList();
         .clear();
     }
 
     /*
      * Allow the user to change the default history size. TODO When a user changes their
      * preferences it should call this method. I don't know how the preferences work, so I
      * will leave this to someone else to do. Garry
      */
     public void setHistorySize(int newSize) {
         .resize(newSize);
     }
 
     public boolean isDirty() {
         return ;
     }

    
Resets all current models to null.
 
     private void clearState() {
         // don't clear if we are refiring events for history navigation
         if (.)
             return;
 
          = new ControllerState();
     }
 
     private void saveState(DisplayEvent e) {
         if (!.contains()) {
             . = e;
             .add();
         }
     }
 
     protected void refreshNamespace() {
         DataDomain domain = getCurrentDataDomain();
         if (domain != null) {
             domain.getEntityResolver().clearCache();
         }
     }
 
     private void removeFromHistory(EventObject e) {
 
         synchronized () {
             int count = .size();
             ArrayList removeList = new ArrayList();
 
             for (int i = 0; i < counti++) {
                 ControllerState cs = (ControllerState.get(i);
 
                 EventObject csEvent = cs.event;
 
                 if (csEvent == null) {
                     continue;
                 }
 
                 if (e instanceof EntityEvent && csEvent instanceof EntityDisplayEvent) {
                     if (((EntityEvente).getEntity() == ((EntityDisplayEventcsEvent)
                             .getEntity()) {
                         removeList.add(cs);
                     }
                 }
                 else if (e instanceof ProcedureEvent
                         && csEvent instanceof ProcedureDisplayEvent) {
                     if (((ProcedureEvente).getProcedure() == ((ProcedureDisplayEventcsEvent)
                             .getProcedure()) {
                         removeList.add(cs);
                     }
                 }
                 else if (e instanceof QueryEvent && csEvent instanceof QueryDisplayEvent) {
                     if (((QueryEvente).getQuery() == ((QueryDisplayEventcsEvent)
                             .getQuery()) {
                         removeList.add(cs);
                     }
                 }
                 else if (e instanceof DataMapEvent
                         && csEvent instanceof DataMapDisplayEvent) {
                     if (((DataMapEvente).getDataMap() == ((DataMapDisplayEventcsEvent)
                             .getDataMap()) {
                         removeList.add(cs);
                     }
                 }
                 else if (e instanceof DataNodeEvent
                         && csEvent instanceof DataNodeDisplayEvent) {
                     if (((DataNodeEvente).getDataNode() == ((DataNodeDisplayEventcsEvent)
                             .getDataNode()) {
                         removeList.add(cs);
                     }
                 }
                 else if (e instanceof DomainEvent
                         && csEvent instanceof DomainDisplayEvent) {
                     if (((DomainEvente).getDomain() == ((DomainDisplayEventcsEvent)
                             .getDomain()) {
                         removeList.add(cs);
                     }
                 }
             }
             Iterator it = removeList.iterator();
             while (it.hasNext()) {
                 .remove(it.next());
             }
 
         }
     }
 
     public DataNode getCurrentDataNode() {
         return .;
     }
 
     public DataDomain getCurrentDataDomain() {
         return .;
     }
 
     public DataMap getCurrentDataMap() {
         return .;
     }
 
     public ObjEntity getCurrentObjEntity() {
         return .;
     }
 
     public DbEntity getCurrentDbEntity() {
         return .;
     }
 
     public ObjAttribute getCurrentObjAttribute() {
         return .;
     }
 
     public DbAttribute getCurrentDbAttribute() {
         return .;
     }
 
         return .;
     }
 
         return .;
     }
 
     public Query getCurrentQuery() {
         return .;
     }
 
     public Procedure getCurrentProcedure() {
         return .;
     }
 
         return .;
     }
 
     public void addDomainDisplayListener(DomainDisplayListener listener) {
         .add(DomainDisplayListener.classlistener);
     }
 
     public void addDomainListener(DomainListener listener) {
         .add(DomainListener.classlistener);
     }
 
     public void addDataNodeDisplayListener(DataNodeDisplayListener listener) {
         .add(DataNodeDisplayListener.classlistener);
     }
 
     public void addDataNodeListener(DataNodeListener listener) {
         .add(DataNodeListener.classlistener);
     }
 
     public void addDataMapDisplayListener(DataMapDisplayListener listener) {
         .add(DataMapDisplayListener.classlistener);
     }
 
     public void addDataMapListener(DataMapListener listener) {
         .add(DataMapListener.classlistener);
     }
 
     public void addDbEntityListener(DbEntityListener listener) {
         .add(DbEntityListener.classlistener);
     }
 
     public void addObjEntityListener(ObjEntityListener listener) {
         .add(ObjEntityListener.classlistener);
     }
 
     public void addDbEntityDisplayListener(DbEntityDisplayListener listener) {
         .add(DbEntityDisplayListener.classlistener);
     }
 
     public void addObjEntityDisplayListener(ObjEntityDisplayListener listener) {
         .add(ObjEntityDisplayListener.classlistener);
     }
 
     public void addDbAttributeListener(DbAttributeListener listener) {
         .add(DbAttributeListener.classlistener);
     }
 
     public void addDbAttributeDisplayListener(DbAttributeDisplayListener listener) {
         .add(DbAttributeDisplayListener.classlistener);
     }
 
     public void addObjAttributeListener(ObjAttributeListener listener) {
         .add(ObjAttributeListener.classlistener);
     }
 
         .add(ObjAttributeDisplayListener.classlistener);
     }
 
     public void addDbRelationshipListener(DbRelationshipListener listener) {
         .add(DbRelationshipListener.classlistener);
     }
 
         .add(DbRelationshipDisplayListener.classlistener);
     }
 
     public void addObjRelationshipListener(ObjRelationshipListener listener) {
         .add(ObjRelationshipListener.classlistener);
     }
 
         .add(ObjRelationshipDisplayListener.classlistener);
     }
 
     public void addQueryDisplayListener(QueryDisplayListener listener) {
         .add(QueryDisplayListener.classlistener);
     }
 
     public void addQueryListener(QueryListener listener) {
         .add(QueryListener.classlistener);
     }
 
     public void addProcedureDisplayListener(ProcedureDisplayListener listener) {
         .add(ProcedureDisplayListener.classlistener);
     }
 
     public void addProcedureListener(ProcedureListener listener) {
         .add(ProcedureListener.classlistener);
     }
 
     public void addProcedureParameterListener(ProcedureParameterListener listener) {
         .add(ProcedureParameterListener.classlistener);
     }
 
             ProcedureParameterDisplayListener listener) {
         .add(ProcedureParameterDisplayListener.classlistener);
     }
 
     public void fireDomainDisplayEvent(DomainDisplayEvent e) {
         boolean changed = e.getDomain() != .;
         if (!changed) {
             changed = . != null
                     || . != null
                     || . != null
                     || . != null
                     || . != null
                     || . != null;
         }
 
         if (!e.isRefired()) {
             e.setDomainChanged(changed);
             if (changed) {
                 clearState();
                 . = e.getDomain();
             }
         }
 
         if (changed) {
             saveState(e);
         }
 
         EventListener[] list = .getListeners(DomainDisplayListener.class);
         for (int i = 0; i < list.lengthi++) {
             DomainDisplayListener temp = (DomainDisplayListenerlist[i];
             temp.currentDomainChanged(e);
         }
 
         // call different methods depending on whether domain was opened or closed
         if (e.getDomain() == null) {
             getApplication().getActionManager().projectOpened();
         }
         else {
             getApplication().getActionManager().domainSelected();
         }
     }

    
Informs all listeners of the DomainEvent. Does not send the event to its originator.
 
     public void fireDomainEvent(DomainEvent e) {
         setDirty(true);
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(DomainListener.class);
         for (int i = 0; i < list.lengthi++) {
             DomainListener temp = (DomainListenerlist[i];
             switch (e.getId()) {
                 case .:
                     temp.domainAdded(e);
                     break;
                 case .:
                     temp.domainChanged(e);
                     break;
                 case .:
                     temp.domainRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid DomainEvent type: "
                             + e.getId());
             }
         }
     }
 
     public void fireDataNodeDisplayEvent(DataNodeDisplayEvent e) {
         boolean changed = e.getDataNode() != .;
 
         if (!changed) {
             changed = . != null
                     || . != null
                     || . != null
                     || . != null
                     || . != null;
         }
 
         if (!e.isRefired()) {
             e.setDataNodeChanged(changed);
 
             if (changed) {
                 clearState();
                 . = e.getDomain();
                 . = e.getDataNode();
             }
         }
 
         if (changed) {
             saveState(e);
         }
 
         for (int i = 0; i < list.lengthi++) {
             ((DataNodeDisplayListenerlist[i]).currentDataNodeChanged(e);
         }
     }

    
Informs all listeners of the DataNodeEvent. Does not send the event to its originator.
 
     public void fireDataNodeEvent(DataNodeEvent e) {
         setDirty(true);
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(DataNodeListener.class);
         for (int i = 0; i < list.lengthi++) {
             DataNodeListener temp = (DataNodeListenerlist[i];
             switch (e.getId()) {
                 case .:
                     temp.dataNodeAdded(e);
                     break;
                 case .:
                     temp.dataNodeChanged(e);
                     break;
                 case .:
                     temp.dataNodeRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid DataNodeEvent type: "
                             + e.getId());
             }
         }
     }
 
     public void fireDataMapDisplayEvent(DataMapDisplayEvent e) {
         boolean changed = e.getDataMap() != .;
         if (!changed) {
             changed = . != null
                     || . != null
                     || . != null
                     || . != null;
         }
 
         if (!e.isRefired()) {
             e.setDataMapChanged(changed);
 
             if (changed) {
                 clearState();
                 . = e.getDomain();
                 . = e.getDataNode();
                 . = e.getDataMap();
             }
         }
 
         if (changed) {
             saveState(e);
         }
 
         for (int i = 0; i < list.lengthi++) {
             DataMapDisplayListener temp = (DataMapDisplayListenerlist[i];
             temp.currentDataMapChanged(e);
         }
     }

    
Informs all listeners of the DataMapEvent. Does not send the event to its originator.
 
     public void fireDataMapEvent(DataMapEvent e) {
         setDirty(true);
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(DataMapListener.class);
         for (int i = 0; i < list.lengthi++) {
             DataMapListener listener = (DataMapListenerlist[i];
             switch (e.getId()) {
                 case .:
                     listener.dataMapAdded(e);
                     break;
                 case .:
                     listener.dataMapChanged(e);
                     break;
                 case .:
                     listener.dataMapRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid DataMapEvent type: "
                             + e.getId());
             }
         }
     }

    
Informs all listeners of the EntityEvent. Does not send the event to its originator.
 
     public void fireObjEntityEvent(EntityEvent e) {
         setDirty(true);
 
         if (. != null && e.getId() == .) {
             ..objEntityChanged(e);
         }
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(ObjEntityListener.class);
         for (int i = 0; i < list.lengthi++) {
             ObjEntityListener temp = (ObjEntityListenerlist[i];
             switch (e.getId()) {
                 case .:
                     temp.objEntityAdded(e);
                     break;
                 case .:
                     temp.objEntityChanged(e);
                     break;
                 case .:
                     temp.objEntityRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid EntityEvent type: "
                             + e.getId());
             }
         }
     }

    
Informs all listeners of the EntityEvent. Does not send the event to its originator.
 
     public void fireDbEntityEvent(EntityEvent e) {
         setDirty(true);
 
         if (. != null && e.getId() == .) {
             ..dbEntityChanged(e);
         }
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(DbEntityListener.class);
         for (int i = 0; i < list.lengthi++) {
             DbEntityListener temp = (DbEntityListenerlist[i];
             switch (e.getId()) {
                 case .:
                     temp.dbEntityAdded(e);
                     break;
                 case .:
                     temp.dbEntityChanged(e);
                     break;
                 case .:
                     temp.dbEntityRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid EntityEvent type: "
                             + e.getId());
             }
         }
     }

    
Informs all listeners of the ProcedureEvent. Does not send the event to its originator.
 
     public void fireQueryEvent(QueryEvent e) {
         setDirty(true);
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(QueryListener.class);
         for (int i = 0; i < list.lengthi++) {
             QueryListener listener = (QueryListenerlist[i];
             switch (e.getId()) {
                 case .:
                     listener.queryAdded(e);
                     break;
                 case .:
                     listener.queryChanged(e);
                     break;
                 case .:
                     listener.queryRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid ProcedureEvent type: "
                             + e.getId());
             }
         }
     }

    
Informs all listeners of the ProcedureEvent. Does not send the event to its originator.
 
     public void fireProcedureEvent(ProcedureEvent e) {
         setDirty(true);
 
         if (e.getId() == .) {
             refreshNamespace();
             removeFromHistory(e);
         }
 
         EventListener[] list = .getListeners(ProcedureListener.class);
         for (int i = 0; i < list.lengthi++) {
             ProcedureListener listener = (ProcedureListenerlist[i];
             switch (e.getId()) {
                 case .:
                     listener.procedureAdded(e);
                     break;
                 case .:
                     listener.procedureChanged(e);
                     break;
                 case .:
                     listener.procedureRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException("Invalid ProcedureEvent type: "
                             + e.getId());
             }
         }
     }

    
Informs all listeners of the ProcedureEvent. Does not send the event to its originator.
 
         setDirty(true);
 
         EventListener[] list = 
                 .getListeners(ProcedureParameterListener.class);
         for (int i = 0; i < list.lengthi++) {
             ProcedureParameterListener listener = (ProcedureParameterListenerlist[i];
             switch (e.getId()) {
                 case .:
                     listener.procedureParameterAdded(e);
                     break;
                 case .:
                     listener.procedureParameterChanged(e);
                     break;
                 case .:
                     listener.procedureParameterRemoved(e);
                     break;
                 default:
                     throw new IllegalArgumentException(
                             "Invalid ProcedureParameterEvent type: " + e.getId());
             }
         }
     }
 
     public void fireNavigationEvent(EventObject e) {
         Object source = e.getSource();
         if (source == null)
             return;
 
         int size = .size();
         if (size == 0)
             return;
 
         int i = .indexOf();
         ControllerState cs = null;
         if (size == 1) {
             cs = (ControllerState.get(0);
         }
         else if (source instanceof NavigateForwardAction) {
             int counter = 0;
             while (true) {
                 if (i < 0) {
                     // a new state got created without it being saved.
                     // just move to the beginning of the list
                     cs = (ControllerState.get(0);
                 }
                 else if (i + 1 < size) {
                     // move forward
                     cs = (ControllerState.get(i + 1);
                 }
                 else {
                     // wrap around
                     cs = (ControllerState.get(0);
                 }
                 if (!cs.isEquivalent()) {
                     break;
                 }
 
                 // if it doesn't find it within 5 tries it is probably stuck in a loop
                 if (++counter > 5) {
                     break;
                 }
                 i++;
             }
         }
         else if (source instanceof NavigateBackwardAction) {
             int counter = 0;
             while (true) {
                 if (i < 0) {
                     // a new state got created without it being saved.
                     try {
                         cs = (ControllerState.get(size - 2);
                     }
                     catch (ArrayIndexOutOfBoundsException ex) {
                         cs = (ControllerState.get(size - 1);
                     }
                 }
                 else if (i - 1 >= 0) {
                     // move to the previous one
                     cs = (ControllerState.get(i - 1);
                 }
                 else {
                     // wrap around
                     cs = (ControllerState.get(size - 1);
                 }
                 if (!cs.isEquivalent()) {
                     break;
                 }
                 // if it doesn't find it within 5 tries it is probably stuck in a loop
                 if (++counter > 5) {
                     break;
                 }
                 i--;
             }
         }
        // reset the current state to the one we just navigated to
         = cs;
        DisplayEvent de = cs.event;
        if (de == null)
            return;
        // make sure that isRefiring is turned off prior to exiting this routine
        // this flag is used to tell the controller to not create new states
        // when we are refiring the event that we saved earlier
        . = true;
        // the order of the following is checked in most specific to generic because
        // of the inheritance heirarchy
        de.setRefired(true);
        if (de instanceof EntityDisplayEvent) {
            EntityDisplayEvent ede = (EntityDisplayEventde;
            ede.setEntityChanged(true);
            if (ede.getEntity() instanceof ObjEntity) {
                fireObjEntityDisplayEvent(ede);
            }
            else if (ede.getEntity() instanceof DbEntity) {
                fireDbEntityDisplayEvent(ede);
            }
        }
        else if (de instanceof ProcedureDisplayEvent) {
            ProcedureDisplayEvent pde = (ProcedureDisplayEventde;
            pde.setProcedureChanged(true);
            fireProcedureDisplayEvent(pde);
        }
        else if (de instanceof QueryDisplayEvent) {
            QueryDisplayEvent qde = (QueryDisplayEventde;
            qde.setQueryChanged(true);
            fireQueryDisplayEvent(qde);
        }
        else if (de instanceof DataMapDisplayEvent) {
            DataMapDisplayEvent dmde = (DataMapDisplayEventde;
            dmde.setDataMapChanged(true);
            fireDataMapDisplayEvent(dmde);
        }
        else if (de instanceof DataNodeDisplayEvent) {
            DataNodeDisplayEvent dnde = (DataNodeDisplayEventde;
            dnde.setDataNodeChanged(true);
            fireDataNodeDisplayEvent(dnde);
        }
        else if (de instanceof DomainDisplayEvent) {
            DomainDisplayEvent dde = (DomainDisplayEventde;
            dde.setDomainChanged(true);
            fireDomainDisplayEvent(dde);
        }
        // turn off refiring
        . = false;
    }
        boolean changed = e.getEntity() != .;
        if (!e.isRefired()) {
            e.setEntityChanged(changed);
            if (changed) {
                clearState();
                . = e.getDomain();
                . = e.getDataNode();
                . = e.getDataMap();
                . = (ObjEntitye.getEntity();
            }
        }
        if (changed) {
            saveState(e);
        }
        for (int i = 0; i < list.lengthi++) {
            ObjEntityDisplayListener temp = (ObjEntityDisplayListenerlist[i];
            temp.currentObjEntityChanged(e);
        }
    }
    public void fireQueryDisplayEvent(QueryDisplayEvent e) {
        boolean changed = e.