Class FeeltraceCircle

  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer,, javax.accessibility.Accessible, TimeHandler

public class FeeltraceCircle
extends javax.swing.JPanel
implements TimeHandler

A Feeltrace circle is part of a Feeltrace target control panel (set at construction). It displays a circle with an X axis and a Y axis through its origin. Emotions consisting of evaluation and activation can be displayed in the circle. The X axis represents evaluation values between -1.0 and +1.0. The Y axis represents activation values between -1.0 and +1.0.

In the circle labels for some predefined emotions will be displayed if the method showLabels() of the parent panel returns true.

Every location within the circle is mapped to a colour using the Feeltrace colour map returned by the method getColourMap() of the Feeltrace annotation layer. The circle itself is white. Emotions will be displayed as a small circle in the emotion colour and a black border for contrast. The cursor will also have this appearance when the user moves the cursor in the circle. If the user is annotating, the cursor will be closed (filled with the emotion colour). Otherwise it will be open (have a thick border in the emotion colour).

If the method clickAnnotation() of the parent panel returns true, the user can start annotating by clicking somewhere in the circle. Annotating ends when the user clicks again. If clickAnnotation returns false, the user should keep the mouse button pressed while annotating.

By default existing annotations will be displayed in the circle. This class is a TimeHandler and it will query the corpus at every time event to display the annotations at the current time or in the current time span. This may be turned off with setReplay().

The panel should have enough space for a circle with diameter 200 plus the axis labels. If the panel is not big enough, it will display the text "panel too small".

See Also:
Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
Field Summary
Fields inherited from class javax.swing.JComponent
Fields inherited from class java.awt.Component
Fields inherited from interface java.awt.image.ImageObserver
Constructor Summary
FeeltraceCircle(FeeltraceTargetControlPanel parent)
          Constructs a new Feeltrace circle to be part of the specified target control panel.
Method Summary
 void acceptTimeChange(double systemTime)
          Accept a new time (generally from another registered TimeHandler).
 void acceptTimeSpanChange(double start, double end)
          Accept a new time span from another registered time handler.
 Clock getClock()
          Return the Clock that is currently syncronising this TimeHandler
 java.awt.geom.Point2D getCurrentEmotion()
          Returns the emotion of the current annotation.
 double getMaxTime()
          find the largest end time handled by this TimeHandler.
 void setClock(Clock clock)
          Set the Clock to which this TimeHandler is registered
 void setReplay(boolean replay)
          Enables or disables the visualisation of existing annotations.
 boolean setTarget(NOMWriteElement annotation)
          Sets the target of the current annotation.
 void setTime(double time)
          Broadcast a new time.
 void setTimeHighlightColor(java.awt.Color color)
          Change the Color used for all registered TimeHandlers to highlight times
 void setTimeSpan(double start, double end)
          Broadcast a new span to all registered TimeHandlers.
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public FeeltraceCircle(FeeltraceTargetControlPanel parent)

Constructs a new Feeltrace circle to be part of the specified target control panel.

parent - the Feeltrace target control panel that will contain this circle
Method Detail


public void setReplay(boolean replay)

Enables or disables the visualisation of existing annotations. As a corpus query is performed at every time event, replay might seriously degrade performance.

replay - true if replay should be enabled, false if it should be disabled


public boolean setTarget(NOMWriteElement annotation)

Sets the target of the current annotation. This method is called in response to the targetSet event. The current emotion will be set in the evaluation and activation attribute of the annotation.

annotation - the current annotation
true if the target was set successfully, false otherwise


public java.awt.geom.Point2D getCurrentEmotion()

Returns the emotion of the current annotation. If there is no current annotation or the emotion has not been set, this method returns null.

the current emotion


public void acceptTimeChange(double systemTime)
Description copied from interface: TimeHandler
Accept a new time (generally from another registered TimeHandler). Do what you have to do in this TimeHandler to represent the fact that the global system time is now 'systemTime' (but don't inform the niteclock to pass it on).

Specified by:
acceptTimeChange in interface TimeHandler


public void setTime(double time)
Description copied from interface: TimeHandler
Broadcast a new time. Implement by sending a setSystemTime call to the current Clock.

Specified by:
setTime in interface TimeHandler


public void acceptTimeSpanChange(double start,
                                 double end)
Description copied from interface: TimeHandler
Accept a new time span from another registered time handler. This may involve changing our on-screen appearance to introduce some new time highlights, or playing a stretch of video, depending on the type of handler.

Specified by:
acceptTimeSpanChange in interface TimeHandler


public void setTimeSpan(double start,
                        double end)
Description copied from interface: TimeHandler
Broadcast a new span to all registered TimeHandlers.

Specified by:
setTimeSpan in interface TimeHandler


public Clock getClock()
Description copied from interface: TimeHandler
Return the Clock that is currently syncronising this TimeHandler

Specified by:
getClock in interface TimeHandler


public void setClock(Clock clock)
Description copied from interface: TimeHandler
Set the Clock to which this TimeHandler is registered

Specified by:
setClock in interface TimeHandler


public void setTimeHighlightColor(java.awt.Color color)
Description copied from interface: TimeHandler
Change the Color used for all registered TimeHandlers to highlight times

Specified by:
setTimeHighlightColor in interface TimeHandler


public double getMaxTime()
Description copied from interface: TimeHandler
find the largest end time handled by this TimeHandler. This is only really applicable to text areas.

Specified by:
getMaxTime in interface TimeHandler