public class LockableWorldView extends EventDrivenWorldView implements ILockableWorldView
Modifier and Type | Field and Description |
---|---|
protected List<IWorldChangeEvent> |
eventsToProcess
List of events received when the worldview was locked.
|
protected boolean |
lockEvents
Lock non object update events?
|
static String |
WORLDVIEW_DEPENDENCY |
notifyEventsList, receiveEventProcessing
COMPONENT_ID, control, controller, eventBus, log
Constructor and Description |
---|
LockableWorldView(ComponentDependencies dependencies,
IComponentBus bus,
IAgentLogger log) |
Modifier and Type | Method and Description |
---|---|
boolean |
isLocked()
Whether the worldview is locked.
|
boolean |
isLockEvents() |
void |
lock()
Prevent the WorldView from being changed.
|
void |
notifyEvent(IWorldChangeEvent event)
Store all changes for later processing when the event is received in the
while the world is locked.
|
void |
setLockEvents(boolean lockEvents)
Should the event processing also be locked? The object updating isn't
affected by this switch.
|
void |
unlock()
Unlock the WorldView and process all changes that happened when the world
was locked.
|
innerNotify, notify, notifyAfterPropagation, notifyImmediately, objectCreated, objectDestroyed, objectUpdated, objectUpdatedEvent, raiseEvent
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, addWorldObject, cleanUp, get, get, get, getAll, getAll, getComponentId, getEventBus, getLog, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, isPaused, isRunning, kill, pause, prePause, preStop, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener, removeWorldObject, reset, resume, start, stop, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addEventListener, addObjectListener, addObjectListener, addObjectListener, addObjectListener, get, get, get, getAll, getAll, getEventBus, getSingle, isListening, isListening, isListening, isListening, isListening, isListening, removeEventListener, removeListener, removeObjectListener, removeObjectListener, removeObjectListener, removeObjectListener
notify, notifyAfterPropagation, notifyImmediately
getComponentId
public static final String WORLDVIEW_DEPENDENCY
protected List<IWorldChangeEvent> eventsToProcess
protected boolean lockEvents
@Inject public LockableWorldView(ComponentDependencies dependencies, IComponentBus bus, IAgentLogger log)
public void lock() throws ComponentNotRunningException
lock
in interface ILockableWorldView
ComponentNotRunningException
public void unlock()
unlock
in interface ILockableWorldView
public boolean isLocked()
ILockableWorldView
isLocked
in interface ILockableWorldView
public void setLockEvents(boolean lockEvents)
lockEvents
- public boolean isLockEvents()
public void notifyEvent(IWorldChangeEvent event)
event
- Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.