com.bbn.openmap.event
Class OMEvent

java.lang.Object
  extended by com.bbn.openmap.event.OMEvent
All Implemented Interfaces:
Attributable

public class OMEvent
extends java.lang.Object
implements Attributable

An OMEvent represents an event that occurs at a certain time. The time is maintained as an offset from the UNIX epoch marker.

Author:
dietrick

Field Summary
protected  boolean atCurrentTime
           
static java.lang.String ATT_KEY_DETAILED_INFORMATION
           
static java.lang.String ATT_KEY_PLAY_FILTER
           
static java.lang.String ATT_KEY_RATING
           
static java.lang.String ATT_KEY_SELECTED
           
static java.lang.String ATT_VAL_BAD_RATING
           
static java.lang.String ATT_VAL_GOOD_RATING
           
static java.lang.String ATT_VAL_SELECTED
           
static java.lang.String ATT_VAL_SELECTED_END_RANGE
           
static java.lang.String ATT_VAL_SELECTED_START_RANGE
           
protected  java.util.Map attributes
           
protected  java.lang.String description
           
protected  java.awt.geom.Point2D location
           
static java.util.logging.Logger logger
           
protected  java.awt.Rectangle range
           
protected  boolean selected
           
protected  boolean sorted
           
protected  java.lang.Object source
           
protected  long timeStamp
          Absolute time, milliseconds from the UNIX epoch.
protected  short timeStampComparator
          Value to assist the OMEventComparator to order OMEvents with the same timeStamp.
 
Constructor Summary
OMEvent(java.lang.Object src, java.lang.String desc, long tStamp)
           
OMEvent(java.lang.Object src, java.lang.String desc, long tStamp, java.awt.geom.Point2D loc)
           
OMEvent(java.lang.Object src, java.lang.String desc, long tStamp, java.awt.geom.Point2D loc, java.awt.Rectangle rect)
           
 
Method Summary
 void clearAttributes()
          Tells the object to clear all of its attributes.
 java.lang.Object getAttribute(java.lang.Object key)
          Get the attribute stored under a key.
 java.util.Map getAttributes()
          Convenience method to allow super class methods access to an attribute table if they are acting as a wrapper.
 java.lang.String getDescription()
           
 java.lang.String getDetailedInformation()
           
 java.awt.geom.Point2D getLocation()
           
 java.awt.Rectangle getRange()
           
 java.lang.Object getSource()
           
 long getTimeStamp()
           
 short getTimeStampComparator()
           
 boolean isAtCurrentTime()
           
 boolean isSelected()
           
protected  boolean isSorted()
           
 boolean passesMacroFilters(java.util.List filters)
          Test whether this event should be displayed, given the provided filter list.
 void putAttribute(java.lang.Object key, java.lang.Object value)
          Put an attribute in the object, the value can be retrieved later via the key.
 void setAtCurrentTime(boolean atCurrentTime)
           
 void setAttributes(java.util.Map map)
          Doesn't set the attribute map on the source, if the source if Attributable.
 void setDescription(java.lang.String desc)
           
 void setDetailedInformation(java.lang.String di)
           
 void setLocation(java.awt.geom.Point2D loc)
           
 void setRange(java.awt.Rectangle rect)
           
 void setSelected(boolean selected)
           
protected  void setSorted(boolean sorted)
           
 void setSource(java.lang.Object src)
           
 void setTimeStamp(long tStamp)
          Assumed to be an offset time (millis) from the initial system time.
 void setTimeStampComparator(short timeStampComparator)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger

ATT_KEY_DETAILED_INFORMATION

public static final java.lang.String ATT_KEY_DETAILED_INFORMATION
See Also:
Constant Field Values

ATT_KEY_SELECTED

public static final java.lang.String ATT_KEY_SELECTED
See Also:
Constant Field Values

ATT_KEY_PLAY_FILTER

public static final java.lang.String ATT_KEY_PLAY_FILTER
See Also:
Constant Field Values

ATT_KEY_RATING

public static final java.lang.String ATT_KEY_RATING
See Also:
Constant Field Values

ATT_VAL_GOOD_RATING

public static final java.lang.String ATT_VAL_GOOD_RATING
See Also:
Constant Field Values

ATT_VAL_BAD_RATING

public static final java.lang.String ATT_VAL_BAD_RATING
See Also:
Constant Field Values

ATT_VAL_SELECTED_START_RANGE

public static final java.lang.String ATT_VAL_SELECTED_START_RANGE
See Also:
Constant Field Values

ATT_VAL_SELECTED_END_RANGE

public static final java.lang.String ATT_VAL_SELECTED_END_RANGE
See Also:
Constant Field Values

ATT_VAL_SELECTED

public static final java.lang.String ATT_VAL_SELECTED
See Also:
Constant Field Values

description

protected java.lang.String description

timeStamp

protected long timeStamp
Absolute time, milliseconds from the UNIX epoch.


timeStampComparator

protected short timeStampComparator
Value to assist the OMEventComparator to order OMEvents with the same timeStamp.


sorted

protected boolean sorted

location

protected java.awt.geom.Point2D location

range

protected java.awt.Rectangle range

source

protected java.lang.Object source

atCurrentTime

protected boolean atCurrentTime

selected

protected boolean selected

attributes

protected java.util.Map attributes
Constructor Detail

OMEvent

public OMEvent(java.lang.Object src,
               java.lang.String desc,
               long tStamp)

OMEvent

public OMEvent(java.lang.Object src,
               java.lang.String desc,
               long tStamp,
               java.awt.geom.Point2D loc)

OMEvent

public OMEvent(java.lang.Object src,
               java.lang.String desc,
               long tStamp,
               java.awt.geom.Point2D loc,
               java.awt.Rectangle rect)
Method Detail

setTimeStamp

public void setTimeStamp(long tStamp)
Assumed to be an offset time (millis) from the initial system time.


getTimeStamp

public long getTimeStamp()

setDescription

public void setDescription(java.lang.String desc)

getDescription

public java.lang.String getDescription()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setLocation

public void setLocation(java.awt.geom.Point2D loc)

getLocation

public java.awt.geom.Point2D getLocation()

setRange

public void setRange(java.awt.Rectangle rect)

getRange

public java.awt.Rectangle getRange()

getSource

public java.lang.Object getSource()

setSource

public void setSource(java.lang.Object src)

getDetailedInformation

public java.lang.String getDetailedInformation()

setDetailedInformation

public void setDetailedInformation(java.lang.String di)

isAtCurrentTime

public boolean isAtCurrentTime()

setAtCurrentTime

public void setAtCurrentTime(boolean atCurrentTime)

isSelected

public boolean isSelected()

setSelected

public void setSelected(boolean selected)

passesMacroFilters

public boolean passesMacroFilters(java.util.List filters)
Test whether this event should be displayed, given the provided filter list. The filter list are those that are turned on, meaning that things contained in the list should be displayed, and should cause this method to return true. This method should be overridden by subclasses. If it isn't then the event will always be shown.

Parameters:
filters -
Returns:
true if this event passes filters

putAttribute

public void putAttribute(java.lang.Object key,
                         java.lang.Object value)
Description copied from interface: Attributable
Put an attribute in the object, the value can be retrieved later via the key.

Specified by:
putAttribute in interface Attributable
Parameters:
key - attribute key
value - attribute value

getAttribute

public java.lang.Object getAttribute(java.lang.Object key)
Description copied from interface: Attributable
Get the attribute stored under a key.

Specified by:
getAttribute in interface Attributable
Parameters:
key - attribute key
Returns:
value if found, null if not.

clearAttributes

public void clearAttributes()
Description copied from interface: Attributable
Tells the object to clear all of its attributes.

Specified by:
clearAttributes in interface Attributable

getAttributes

public java.util.Map getAttributes()
Description copied from interface: Attributable
Convenience method to allow super class methods access to an attribute table if they are acting as a wrapper.

Specified by:
getAttributes in interface Attributable
Returns:
Map of all attributes

setAttributes

public void setAttributes(java.util.Map map)
Doesn't set the attribute map on the source, if the source if Attributable. Just sets the attribute Map on the OMEvent.

Specified by:
setAttributes in interface Attributable
Parameters:
map - Map of all attributes

getTimeStampComparator

public short getTimeStampComparator()

setTimeStampComparator

public void setTimeStampComparator(short timeStampComparator)

isSorted

protected boolean isSorted()

setSorted

protected void setSorted(boolean sorted)


Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details