net.sourceforge.nite.gui.transcriptionviewer
Class OntologyColourDisplayStrategy

java.lang.Object
  extended by net.sourceforge.nite.gui.transcriptionviewer.AbstractDisplayStrategy
      extended by net.sourceforge.nite.gui.transcriptionviewer.OntologyColourDisplayStrategy
All Implemented Interfaces:
DisplayStrategy

public class OntologyColourDisplayStrategy
extends AbstractDisplayStrategy

SLIGHTLY GENERIC A trick: given an ontology, an element is displayed in the colour determined by its first pointer to an element in that ontology. This displaystrategy can be shared for many annotation element types. Basic: the colour is determined `randomly' from the ontology. Extension: maybe we want to have some conttrol over the colours? for now, using this for more than one ontology will cause extreme confusion wrt what ontology. within ontology, colour means ONE elemtn....


Constructor Summary
OntologyColourDisplayStrategy(NTranscriptionView ntv, java.lang.String role)
          Initialize a OntologyColourDisplayStrategy that uses the given template style for display.
 
Method Summary
 boolean display(NOMElement element)
          Display annotation element by changing the text style of all text for all relevant transcription elements.
 void undisplay(NOMElement element)
          Undisplay annotation elements by removing the relevant styles from the style chain for the appropriate transcription elements.
 
Methods inherited from class net.sourceforge.nite.gui.transcriptionviewer.AbstractDisplayStrategy
init, setTransToAnnoMap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyColourDisplayStrategy

public OntologyColourDisplayStrategy(NTranscriptionView ntv,
                                     java.lang.String role)
Initialize a OntologyColourDisplayStrategy that uses the given template style for display.

Method Detail

display

public boolean display(NOMElement element)
Display annotation element by changing the text style of all text for all relevant transcription elements.

Returns:
true if displayed successfully, i.e. if the text to which given element relates was actually visible in the NTranscriptionView.

undisplay

public void undisplay(NOMElement element)
Undisplay annotation elements by removing the relevant styles from the style chain for the appropriate transcription elements.