com.swfm.mica.core
Class MiEditorIterator

java.lang.Object
  extended bycom.swfm.mica.core.MiEditorIterator
All Implemented Interfaces:
MiiIterator

public class MiEditorIterator
extends java.lang.Object
implements MiiIterator

This class implements an iterator that iterates through MiEditors, correctly handling any multiple layers.

Version:
%I% %G%
Author:
Michael L. Davis

Constructor Summary
MiEditorIterator(MiEditor editor)
          Contructs a new MiEditorIterator.
MiEditorIterator(MiEditor editor, boolean startAtTop)
          Contructs a new MiEditorIterator.
MiEditorIterator(MiEditor editor, boolean startAtTop, boolean iterateIntoPartsOfParts)
           
MiEditorIterator(MiEditor editor, boolean startAtTop, boolean iterateIntoPartsOfParts, boolean iterateIntoAttachmentsOfParts)
           
 
Method Summary
 MiEditorFilter getFilter()
           
 boolean getIterateIntoAttachmentsOfParts()
          Gets whether the iterator will iterate through all attachments of all parts encountered.
 boolean getIterateIntoPartsOfParts()
          Gets whether the iterator will iterate through all parts of all parts of the assigned container or will just iterate through the parts of the container.
 boolean getIterateThroughAllLayers()
          Gets whether the iterator will iterate through all layers or just the editor's current layer.
 MiPart getNext()
          Gets the next part.
 MiPart getPrevious()
          Gets the previous part.
 void reset()
           
 void resetIteratorToLast()
           
 void setFilter(MiEditorFilter filter)
           
 void setIterateIntoAttachmentsOfParts(boolean flag)
          Sets whether the iterator will iterate through all attachments of all parts that are encountered.
 void setIterateIntoPartsOfParts(boolean flag)
          Sets whether the iterator will iterate through all parts of all parts of the assigned container or will just iterate through the parts of the container.
 void setIterateThroughAllLayers(boolean flag)
          Sets whether the iterator will iterate through all layers or just the editor's current layer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MiEditorIterator

public MiEditorIterator(MiEditor editor)
Contructs a new MiEditorIterator. This will iterate starting at the first part of the first layer.

Parameters:
editor - the editor to iterate through

MiEditorIterator

public MiEditorIterator(MiEditor editor,
                        boolean startAtTop)
Contructs a new MiEditorIterator. This will iterate into parts of parts of the editor as mandated by the given editor's getIterateIntoPartsOfParts() method. If iterateThroughAllLayers is false (the default) then only the editor's current layer is iterated through.

Parameters:
editor - the editor to iterate through
startAtTop - true if the iteration is to start at the last part of the last layer (which is the top-most part). false if the iteration is to start at the first part of the first, bottom-most layer).
See Also:
MiEditor#getIterateIntoPartsOfParts

MiEditorIterator

public MiEditorIterator(MiEditor editor,
                        boolean startAtTop,
                        boolean iterateIntoPartsOfParts)

MiEditorIterator

public MiEditorIterator(MiEditor editor,
                        boolean startAtTop,
                        boolean iterateIntoPartsOfParts,
                        boolean iterateIntoAttachmentsOfParts)
Method Detail

setFilter

public void setFilter(MiEditorFilter filter)

getFilter

public MiEditorFilter getFilter()

setIterateIntoPartsOfParts

public void setIterateIntoPartsOfParts(boolean flag)
Sets whether the iterator will iterate through all parts of all parts of the assigned container or will just iterate through the parts of the container.

Parameters:
flag - true if iterate through whole tree of parts

getIterateIntoPartsOfParts

public boolean getIterateIntoPartsOfParts()
Gets whether the iterator will iterate through all parts of all parts of the assigned container or will just iterate through the parts of the container.

Returns:
true if iterate through whole tree of parts

setIterateIntoAttachmentsOfParts

public void setIterateIntoAttachmentsOfParts(boolean flag)
Sets whether the iterator will iterate through all attachments of all parts that are encountered.

Parameters:
flag - true if iterate through attachments too

getIterateIntoAttachmentsOfParts

public boolean getIterateIntoAttachmentsOfParts()
Gets whether the iterator will iterate through all attachments of all parts encountered.

Returns:
true if iterate through attachments too

setIterateThroughAllLayers

public void setIterateThroughAllLayers(boolean flag)
Sets whether the iterator will iterate through all layers or just the editor's current layer.

Parameters:
flag - true if iterate through all layers

getIterateThroughAllLayers

public boolean getIterateThroughAllLayers()
Gets whether the iterator will iterate through all layers or just the editor's current layer.

Returns:
true if iterate through all layers

getNext

public MiPart getNext()
Gets the next part. Null is returned if there are no more parts.

Specified by:
getNext in interface MiiIterator
Returns:
the next part

getPrevious

public MiPart getPrevious()
Gets the previous part. Null is returned if there are no previous parts.

Specified by:
getPrevious in interface MiiIterator
Returns:
the previous part

reset

public void reset()

resetIteratorToLast

public void resetIteratorToLast()