FrameSet frameSet = null; ArrayList added = new ArrayList(); while (en.hasMoreElements()) { Frame frame = (Frame) en.nextElement(); if (frameSet == null) frameSet = frame.getFrameSet(); if (log.isDebugEnabled()) { log.debug("Observed added "+frame); }  added.add(frame); frameCache.add(frame); newFramesPresent = true;
if (en.hasMoreElements()) { if (log.isDebugEnabled()) log.debug("There are new frames."); processNewFrames(en);
    private void do_execute(BlackboardService bbs)    {        if (!sub.hasChanged()) {            if (log.isDebugEnabled())                log.debug("No Frame changes");            return;        }        if (log.isDebugEnabled())            log.debug("There are changes.");        Enumeration en;        // New Frames        en = sub.getAddedList();        FrameSet frameSet = null;        ArrayList added = new ArrayList();        while (en.hasMoreElements()) {            Frame frame = (Frame) en.nextElement();            if (frameSet == null)                frameSet = frame.getFrameSet();            if (log.isDebugEnabled()) {                log.debug("Observed added "+frame);            }            // Handle new Frame            added.add(frame);            frameCache.add(frame);            newFramesPresent = true;        }        if (helper == null || newFramesPresent) {            if (log.isDebugEnabled())                log.debug("setting frames on the display");            if (helper == null) {                helper = new FrameHelper(frameCache, frameSet);            } else {                helper.setFrames(frameCache, frameSet);                //pluginDisplay.addFrames(added);            }            pluginDisplay.setFrameHelper(helper);            newFramesPresent = false;        }        // Changed Frames        en = sub.getChangedList();        ArrayList transitions = new ArrayList();        while (en.hasMoreElements()) {            Frame frame = (Frame) en.nextElement();            if (log.isDebugEnabled()) {                log.debug("Observed changed "+frame);            }            Collection changes = sub.getChangeReports(frame);            // A collection of Frame.Change instances.            if (changes != null) {                if (frame instanceof RelationFrame) //frame.isa("relationship"))                    transitions.addAll(processRelationshipChanges((RelationFrame)frame, changes.iterator()));            } else {                ShapeGraphic sh = pluginDisplay.findShape(frame);                if (log.isDebugEnabled())                    log.debug("Observed changed "+frame+ "  container="+sh);                if (sh != null) {                    for (Iterator ii=changes.iterator(); ii.hasNext();)                        sh.processFrameChange(frame, (Frame.Change) ii.next());                }            }        }        if (transitions.size() > 0) {            //pluginDisplay.updateFrameView();            pluginDisplay.tickEventOccured(new TickEvent(this, tickNumber++, TICK_EVENT_LABEL, transitions));        }        // Remove Frames.  Won't happen.        en = sub.getRemovedList();        while (en.hasMoreElements()) {            Frame frame = (Frame) en.nextElement();            if (log.isDebugEnabled()) {                log.debug("Observed removed "+frame);            }        }    }