|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaer.eventprocessing.EventFilter
public abstract class EventFilter
An abstract class that all event processing methods should subclass.
Subclasses are introspected to build a GUI to control the filter in FilterPanel
.
Filters that are enclosed inside another filter are given a preferences node that is derived from the the chip class that the filter is used on and the enclosing filter class. The same preferences node name is used for FilterChain's that are enclosed inside an EventFilter.
Fires PropertyChangeEvent for the following
which is where EventFilter's GUIs are built.
,
to annotate the graphical output.
,
which processes events.
,
about enclosing filters inside other filters.
Field Summary | |
---|---|
protected boolean |
annotationEnabled
|
protected AEChip |
chip
chip that we are filtering for |
protected EventFilter |
enclosedFilter
The enclosed single filter. |
protected FilterChain |
enclosedFilterChain
An enclosed filterChain - these filters must be manually applied (coded) in the filterPacket method but a GUI for them is automagically built. |
protected boolean |
filterEnabled
Used by filterPacket to say whether to filter events; default false |
java.util.logging.Logger |
log
All filters can log to this logger |
EventProcessingPerformanceMeter |
perf
|
protected java.util.HashMap<java.lang.String,java.lang.String> |
propertyTooltipMap
The key,value table of property tooltip strings |
protected java.beans.PropertyChangeSupport |
support
Can be used to provide change support, e.g. |
Constructor Summary | |
---|---|
EventFilter()
Deprecated. - all filters need an AEChip object |
|
EventFilter(AEChip chip)
Creates a new instance of AbstractEventFilter but does not enable it. |
Method Summary | |
---|---|
AEChip |
getChip()
|
static java.lang.String |
getDescription()
Override this String (can be html formatted) to show it as the filter description in the GUI control FilterPanel. |
EventFilter |
getEnclosedFilter()
Gets the enclosed filter |
FilterChain |
getEnclosedFilterChain()
Returns the enclosed filter chain |
EventFilter |
getEnclosingFilter()
|
abstract java.lang.Object |
getFilterState()
Deprecated. - no one uses this |
java.util.prefs.Preferences |
getPrefs()
Returns the Preferences node for this filter. |
java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Fires PropertyChangeEvents when filter is enabled or disabled with key "filterEnabled" |
protected java.lang.String |
getPropertyTooltip(java.lang.String propertyName)
|
abstract void |
initFilter()
this should allocate and initialize memory: it may be called when the chip e.g. |
boolean |
isAnnotationEnabled()
Each filter has an annotationEnabled flag that is used to graphical annotation of the filter, e.g. |
boolean |
isEnclosed()
Is filter enclosed inside another filter? |
boolean |
isFilterEnabled()
Filters can be enabled for processing. |
java.lang.String |
prefsEnabledKey()
Returns the prefernces key for the filter |
abstract void |
resetFilter()
should reset the filter to initial state |
void |
setAnnotationEnabled(boolean annotationEnabled)
|
void |
setChip(AEChip chip)
|
void |
setEnclosed(boolean enclosed,
EventFilter enclosingFilter)
Sets flag to show this instance is enclosed. |
void |
setEnclosedFilter(EventFilter enclosedFilter,
EventFilter enclosingFilter)
Sets another filter to be enclosed inside this one - this enclosed filter should be applied first and must be applied by the filter. |
void |
setEnclosedFilterChain(FilterChain enclosedFilterChain)
Sets an enclosed filter chain which should by convention be processed first by the filter (but need not be). |
void |
setEnclosingFilter(EventFilter enclosingFilter)
Sets the enclosing filter for this |
void |
setFilterEnabled(boolean enabled)
Filters can be enabled for processing. |
void |
setPreferredEnabledState()
Sets the filter enabled according to the preference for enabled |
void |
setPrefs(java.util.prefs.Preferences prefs)
Sets the preferences node for this filter |
protected void |
setPropertyTooltip(java.lang.String propertyName,
java.lang.String tooltip)
Developers can use this to add an optional tooltip for a filter property so that the tip is shown as the tooltip for the label or checkbox property in the generated GUI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public EventProcessingPerformanceMeter perf
protected java.beans.PropertyChangeSupport support
public java.util.logging.Logger log
protected boolean filterEnabled
protected AEChip chip
protected EventFilter enclosedFilter
protected FilterChain enclosedFilterChain
protected boolean annotationEnabled
protected java.util.HashMap<java.lang.String,java.lang.String> propertyTooltipMap
Constructor Detail |
---|
public EventFilter()
public EventFilter(AEChip chip)
chip
- the chip to filter forsetPreferredEnabledState()
Method Detail |
---|
public java.lang.String prefsEnabledKey()
public abstract java.lang.Object getFilterState()
public abstract void resetFilter()
public abstract void initFilter()
public boolean isFilterEnabled()
public void setFilterEnabled(boolean enabled)
Fires a property change event "filterEnabled" so that GUIs can be updated.
enabled
- true to enable filter. false should have effect that
output events are the same as input.setPreferredEnabledState()
public void setPreferredEnabledState()
public AEChip getChip()
public void setChip(AEChip chip)
chip
- the chip to filterpublic java.beans.PropertyChangeSupport getPropertyChangeSupport()
public EventFilter getEnclosedFilter()
public void setEnclosedFilter(EventFilter enclosedFilter, EventFilter enclosingFilter)
enclosedFilter
- the filter to encloseenclosingFilter
- the filter that is enclosing this filtersetEnclosed(boolean, net.sf.jaer.eventprocessing.EventFilter)
public boolean isAnnotationEnabled()
public void setAnnotationEnabled(boolean annotationEnabled)
annotationEnabled
- true to draw annotationspublic boolean isEnclosed()
public void setEnclosed(boolean enclosed, EventFilter enclosingFilter)
enclosingFilter
- the filter that is enclosing thisenclosed
- true if this filter is enclosedprotected void setPropertyTooltip(java.lang.String propertyName, java.lang.String tooltip)
In netbeans, you can add this macro to ease entering tooltips for filter parameters:
select-word copy-to-clipboard caret-begin-line caret-down "{setPropertyTooltip(\"" paste-from-clipboard "\",\"\");}" insert-break caret-up caret-end-line caret-backward caret-backward caret-backward caret-backward
propertyName
- the name of the property (e.g. an int, float, or boolean, e.g. "dt")tooltip
- the tooltip String to displayprotected java.lang.String getPropertyTooltip(java.lang.String propertyName)
public FilterChain getEnclosedFilterChain()
public void setEnclosedFilterChain(FilterChain enclosedFilterChain)
enclosedFilterChain
- the chainpublic java.util.prefs.Preferences getPrefs()
setEnclosed(boolean, net.sf.jaer.eventprocessing.EventFilter)
public void setPrefs(java.util.prefs.Preferences prefs)
prefs
- the nodepublic EventFilter getEnclosingFilter()
public void setEnclosingFilter(EventFilter enclosingFilter)
public static java.lang.String getDescription()
|
jAER project on SourceForge | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |