org.scijava.event
Class DefaultEventHistory

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.service.AbstractService
              extended by org.scijava.event.DefaultEventHistory
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, Disposable, EventHistory, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, Service

public class DefaultEventHistory
extends AbstractService
implements EventHistory

Default service for keeping a history of SciJava events.

Author:
Curtis Rueden

Constructor Summary
DefaultEventHistory()
           
 
Method Summary
 void addListener(EventHistoryListener l)
          Adds an event history listener.
 void clear()
          Clears the recorded event history.
 boolean isActive()
          Gets whether event history tracking is currently active.
protected  void onEvent(SciJavaEvent event)
           
 void removeListener(EventHistoryListener l)
          Removes an event history listener.
 void setActive(boolean active)
          Activates or deactivates event history tracking.
 String toHTML(Set<Class<? extends SciJavaEvent>> filtered, Set<Class<? extends SciJavaEvent>> highlighted)
          Gets the recorded event history as an HTML string.
 
Methods inherited from class org.scijava.service.AbstractService
dispose, getContext, initialize, registerEventHandlers, setContext, toString
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority
 
Methods inherited from class org.scijava.AbstractContextual
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Constructor Detail

DefaultEventHistory

public DefaultEventHistory()
Method Detail

setActive

public void setActive(boolean active)
Description copied from interface: EventHistory
Activates or deactivates event history tracking.

Specified by:
setActive in interface EventHistory

isActive

public boolean isActive()
Description copied from interface: EventHistory
Gets whether event history tracking is currently active.

Specified by:
isActive in interface EventHistory

clear

public void clear()
Description copied from interface: EventHistory
Clears the recorded event history.

Specified by:
clear in interface EventHistory

toHTML

public String toHTML(Set<Class<? extends SciJavaEvent>> filtered,
                     Set<Class<? extends SciJavaEvent>> highlighted)
Description copied from interface: EventHistory
Gets the recorded event history as an HTML string.

Specified by:
toHTML in interface EventHistory
Parameters:
filtered - Set of event types to filter out from the history.
highlighted - Set of event types to highlight in the history.
Returns:
An HTML string representing the recorded event history.

addListener

public void addListener(EventHistoryListener l)
Description copied from interface: EventHistory
Adds an event history listener. This mechanism exists (rather than using the event bus) to avoid event feedback loops when reporting history changes.

Specified by:
addListener in interface EventHistory

removeListener

public void removeListener(EventHistoryListener l)
Description copied from interface: EventHistory
Removes an event history listener. This mechanism exists (rather than using the event bus) to avoid event feedback loops when reporting history changes.

Specified by:
removeListener in interface EventHistory

onEvent

protected void onEvent(SciJavaEvent event)


Copyright © 2009–2015 SciJava. All rights reserved.