org.jactr.modules.pm.visual.visicon.encoder
Class AbstractVisualChunkEncoder

java.lang.Object
  extended by org.jactr.modules.pm.common.encoder.AbstractAfferentObjectEncoder
      extended by org.jactr.modules.pm.visual.visicon.encoder.AbstractVisualChunkEncoder
All Implemented Interfaces:
IAfferentObjectListener, IAfferentObjectEncoder, IVisualChunkEncoder
Direct Known Subclasses:
CursorVisualChunkEncoder, EmptySpaceVisualChunkEncoder, GUIVisualChunkEncoder, LineVisualChunkEncoder, TextVisualChunkEncoder

public abstract class AbstractVisualChunkEncoder
extends AbstractAfferentObjectEncoder
implements IVisualChunkEncoder

the abstract visual chunk encoder takes incoming information from common reality checks it against its cache of chunks created for a specific identifier. If it is dirty, it is recreated. removal is handled automatically. this class also handles FINSTs and object tracking. Implementers merely need to implement canEncode(IAfferentObject), isDirty(IChunk,IAfferentObject), and createChunk(IAfferentObject) and setSlotValues()
this also listens to the visual buffer, when a visual chunk is removed it queries the VISUAL_LOCATION_OBJECTS_META_KEY, snags the identifier removes it from the cache so we don't change an encoded chunk

Author:
developer

Field Summary
static org.apache.commons.logging.Log LOGGER
          logger definition
 
Fields inherited from interface org.jactr.modules.pm.visual.visicon.encoder.IVisualChunkEncoder
VISUAL_LOCATION_OBJECTS_META_KEY
 
Fields inherited from interface org.jactr.modules.pm.common.encoder.IAfferentObjectEncoder
COMMONREALITY_IDENTIFIER_META_KEY
 
Constructor Summary
AbstractVisualChunkEncoder(IVisualModule visualModule)
           
 
Method Summary
static void addToObjects(IChunk visualChunk)
           
 void dispose()
           
static org.commonreality.modalities.visual.IVisualPropertyHandler getHandler()
           
 IVisicon getVisicon()
           
static void removeFromObjects(IChunk visualChunk)
           
 void setVisicon(IVisicon visicon)
           
 
Methods inherited from class org.jactr.modules.pm.common.encoder.AbstractAfferentObjectEncoder
afferentObjectAdded, afferentObjectRemoved, afferentObjectUpdated, clear, getEncodedChunkFor, isInterestedIn, isInterestedIn
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.modules.pm.common.encoder.IAfferentObjectEncoder
clear, getEncodedChunkFor
 
Methods inherited from interface org.jactr.modules.pm.common.afferent.IAfferentObjectListener
afferentObjectAdded, afferentObjectRemoved, afferentObjectUpdated, isInterestedIn
 

Field Detail

LOGGER

public static final org.apache.commons.logging.Log LOGGER
logger definition

Constructor Detail

AbstractVisualChunkEncoder

public AbstractVisualChunkEncoder(IVisualModule visualModule)
Method Detail

getHandler

public static org.commonreality.modalities.visual.IVisualPropertyHandler getHandler()

dispose

public void dispose()
Specified by:
dispose in interface IAfferentObjectEncoder
Overrides:
dispose in class AbstractAfferentObjectEncoder
See Also:
IAfferentObjectEncoder.dispose()

setVisicon

public void setVisicon(IVisicon visicon)
Specified by:
setVisicon in interface IVisualChunkEncoder

getVisicon

public IVisicon getVisicon()

addToObjects

public static void addToObjects(IChunk visualChunk)

removeFromObjects

public static void removeFromObjects(IChunk visualChunk)