de.eventhorizongilde.ehfs.milestone
Class AbstractMilestone

java.lang.Object
  extended by de.eventhorizongilde.ehfs.milestone.AbstractMilestone
All Implemented Interfaces:
IMilestone
Direct Known Subclasses:
AbstractFilterMilestone

public abstract class AbstractMilestone
extends Object
implements IMilestone

Convenience milestone implementation handling basic annotation group creation.


Constructor Summary
protected AbstractMilestone()
          Creates a new milestone.
 
Method Summary
protected  void addAnnotation(String title, IAnnotation annotation)
          Adds an annotation to this milestone's annotation group.
protected  void deactivate()
          Deactivates this milestone for the current fight.
 void fightEnded(long time)
          Informs the milestone that parsing of a fight has ended. This implementation does nothing.
 AnnotationGroup getAnnotationGroup()
          Returns an annotation group containing all annotations created by this milestone.
protected  IParseContext getParseContext()
          Returns the parse context for the current fight.
 void setColorKeyId(String colorKeyId)
          Sets the color key to use for creating the annotation group.
 void setParseContext(IParseContext context)
          Sets the parse context for the current fight.
protected  int toSeconds(CombatEvent event)
          Converts the timestamp of an event into seconds into the current fight.
protected  int toSeconds(long time)
          Converts a timestamp into seconds into the current fight.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.eventhorizongilde.ehfs.milestone.IMilestone
eventHappened
 

Constructor Detail

AbstractMilestone

protected AbstractMilestone()
Creates a new milestone.

Method Detail

setParseContext

public void setParseContext(IParseContext context)
Sets the parse context for the current fight.

Specified by:
setParseContext in interface IMilestone

getParseContext

protected IParseContext getParseContext()
Returns the parse context for the current fight.


setColorKeyId

public void setColorKeyId(String colorKeyId)
Sets the color key to use for creating the annotation group. Colors keys are special IDs that describe a color's meaning. This is mainly used for the user interface so that a user can assign a color to a color key.

Specified by:
setColorKeyId in interface IMilestone

addAnnotation

protected void addAnnotation(String title,
                             IAnnotation annotation)

Adds an annotation to this milestone's annotation group.

Note: The title and the result of IAnnotation.isLegendIconAsBox() of the first annotation added are used to create the annotation group when invoking getAnnotationGroup().


getAnnotationGroup

public AnnotationGroup getAnnotationGroup()
Description copied from interface: IMilestone
Returns an annotation group containing all annotations created by this milestone.

Specified by:
getAnnotationGroup in interface IMilestone

toSeconds

protected int toSeconds(CombatEvent event)
Converts the timestamp of an event into seconds into the current fight.


toSeconds

protected int toSeconds(long time)
Converts a timestamp into seconds into the current fight.


fightEnded

public void fightEnded(long time)

Informs the milestone that parsing of a fight has ended.

This implementation does nothing. Subclasses may override.

Specified by:
fightEnded in interface IMilestone

deactivate

protected void deactivate()
Deactivates this milestone for the current fight. Added annotations will be kept, but the milestone will not be considered again for this fight. This may speed up the parsing process.



Event Horizon Fight Statistics