net.sourceforge.nite.tools.videolabeler
Class FeeltraceColourMap

java.lang.Object
  extended by net.sourceforge.nite.tools.videolabeler.FeeltraceColourMap

public class FeeltraceColourMap
extends java.lang.Object

A Feeltrace colour map maps emotions to colours. It contains various methods to facilitate processes where emotion colours are involved.

The hue of an emotion colour is determined by the clockwise angle between the line through the origin and (-1,0) and the line through the origin and the emotion point. The colours vary from red (angle 0) to yellow (angle 0.5*PI) to green (angle PI) to blue (angle 1.5*PI) to red again (angle 2*PI).

The saturation of an emotion colour is determined by the distance of the emotion point from the origin (saturation 0 for distance 0, saturation 1 for distance 1).


Constructor Summary
FeeltraceColourMap()
          Constructs a new Feeltrace colour map.
 
Method Summary
 java.awt.Color getEmotionColour(double evaluation, double activation)
          Returns the colour for the specified emotion.
 double getEmotionHue(double evaluation, double activation)
          Returns the hue for the specified emotion.
 java.util.HashMap getStyleMap()
          Returns a style map that can be added to a text area to display text in the colour of an emotion.
 java.lang.String getStyleName(double evaluation, double activation)
          Returns the style name for the specified emotion.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeeltraceColourMap

public FeeltraceColourMap()

Constructs a new Feeltrace colour map.

Method Detail

getStyleMap

public java.util.HashMap getStyleMap()

Returns a style map that can be added to a text area to display text in the colour of an emotion. The ColourFactory is used to get text colours that contrast with a white background. Call getStyleName() to get the style name for a certain emotion colour.

Returns:
a style map

getStyleName

public java.lang.String getStyleName(double evaluation,
                                     double activation)

Returns the style name for the specified emotion. The returned name is one of the names in the style map (see getStyleMap(). If evaluation and activation are 0 (no angle can be determined), this method returns an empty string.

Parameters:
evaluation - the evaluation of the emotion
activation - the activation of the emotion
Returns:
a style name or an empty string

getEmotionHue

public double getEmotionHue(double evaluation,
                            double activation)

Returns the hue for the specified emotion. If evaluation and activation are 0 (no angle can be determined), this method returns Double.NaN.

Parameters:
evaluation - the evaluation of the emotion
activation - the activation of the emotion
Returns:
the hue or Double.NaN

getEmotionColour

public java.awt.Color getEmotionColour(double evaluation,
                                       double activation)

Returns the colour for the specified emotion.

Parameters:
evaluation - the evaluation of the emotion
activation - the activation of the emotion
Returns:
a colour