Package com.projity.pm.graphic.model.event

Examples of com.projity.pm.graphic.model.event.CacheEvent


      removeList=new ArrayList();
      removeNodeList=new ArrayList();
      createRemoveDiff(o,n,removeNodeList,removeList,updates);
      if (removeList.size()>0){
        //removeFunctor.execute(removeNodeList,removeList);
          events.add(new CacheEvent(source,CacheEvent.NODES_REMOVED,(List)removeNodeList.clone(),(List)removeList.clone()));
      }
    //}
//      long t1=System.currentTimeMillis();
//      System.out.println("\t\t\tcache applyUpdates#1 ran in "+(t1-t0)+"ms");
   
    ArrayList insertList=null;
    ArrayList insertNodeList=null;
    //if (insertFunctor!=null){
      insertList=new ArrayList();
      insertNodeList=new ArrayList();
      createRemoveDiff(n,o,insertNodeList,insertList,updates);
      if (insertList.size()>0){
          events.add(new CacheEvent(source,CacheEvent.NODES_INSERTED,(List)insertNodeList.clone(),(List)insertList.clone()));
        //insertFunctor.execute(insertNodeList,insertList);
      }
    //}
//      t0=System.currentTimeMillis();
//      System.out.println("\t\t\tcache applyUpdates#2 ran in "+(t0-t1)+"ms");
   
    //if (removeFunctor!=null&&insertFunctor!=null){
      removeList.clear();
      removeNodeList.clear();
      insertList.clear();
      insertNodeList.clear();
      createPermutationDiff(o,n,removeNodeList,insertNodeList,removeList,insertList,updates);
      if (removeList.size()>0){
          events.add(new CacheEvent(source,CacheEvent.NODES_REMOVED,removeNodeList,removeList));
        //removeFunctor.execute(removeNodeList,removeList);
      }
      if (insertList.size()>0){
          events.add(new CacheEvent(source,CacheEvent.NODES_INSERTED,(List)insertNodeList.clone(),(List)insertList.clone()));
        //insertFunctor.execute(insertNodeList,insertList);
      }
//      t1=System.currentTimeMillis();
//      System.out.println("\t\t\tcache applyUpdates#3 ran in "+(t1-t0)+"ms");
    //}
   
    //if (updateFunctor!=null){
      insertList.clear();
      insertNodeList.clear();
      createUpdateDiff(newList,insertNodeList,insertList,updates);
      if (insertList.size()>0){
          events.add(new CacheEvent(source,CacheEvent.NODES_CHANGED,insertNodeList,insertList));
          //updateFunctor.execute(insertNodeList,insertList);
      }
    //}
//      t0=System.currentTimeMillis();
//      System.out.println("\t\t\tcache applyUpdates#4 ran in "+(t0-t1)+"ms");
View Full Code Here


      ArrayList removed=new ArrayList();
    ArrayList inserted=new ArrayList();
    ArrayList changed=new ArrayList();
    changed.addAll(change);
        updateVisibleElements(v.getElements(),visibleNodes,removed,inserted,changed);
    if (removed.size()>0) v.addEvent(new CacheEvent(this,CacheEvent.NODES_REMOVED,removed,null));
    if (inserted.size()>0) v.addEvent(new CacheEvent(this,CacheEvent.NODES_INSERTED,inserted,null));
    if (changed.size()>0) v.addEvent(new CacheEvent(this,CacheEvent.NODES_CHANGED,changed,null));
  }
View Full Code Here

    fireTableDataChanged();

  }
    public void graphicNodesCompositeEvent(CompositeCacheEvent compositeEvent){
        for (Iterator i=compositeEvent.getNodeEvents().iterator();i.hasNext();){
            final CacheEvent e=(CacheEvent)i.next();
            e.forIntervals(new Closure() {
                public void execute(Object obj) {
                    CacheInterval i = (CacheInterval) obj;
                     if (e.getType()==CacheEvent.NODES_CHANGED)
                        fireTableRowsUpdated(i.getStart(), i.getEnd());
                    else if (e.getType()==CacheEvent.NODES_INSERTED)
                        fireTableRowsInserted(i.getStart(), i.getEnd());
                    else if (e.getType()==CacheEvent.NODES_REMOVED)
                        fireTableRowsDeleted(i.getStart(), i.getEnd());
                }
            });
        }
    }
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.model.event.CacheEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.