edu.uchsc.ccp.knowtator.ui
Class TextViewer

java.lang.Object
  extended by edu.uchsc.ccp.knowtator.ui.TextViewer
All Implemented Interfaces:
FilterChangedListener, TextSourceChangeListener, EventListener

public class TextViewer
extends Object
implements TextSourceChangeListener, FilterChangedListener


Constructor Summary
TextViewer(KnowtatorTextPane textPane, KnowtatorManager manager)
           
 
Method Summary
 Comparator<SimpleInstance> comparator(SimpleInstance annotation)
           
 void filterChanged(FilterChangedEvent event)
           
 JPanel getContentPane()
           
 Color getSelectedTextColor()
           
 KnowtatorTextPane getTextPane()
           
 int getVerticalDistance(SimpleInstance annotation1, SimpleInstance annotation2)
          Calculates the verticle distance in pixels between annotation1 and annotation2 as they appear in the text.
 Span getVisibleSpan()
           
 void initialize()
           
 boolean isVisible(SimpleInstance annotation)
           
 void setTextSourceDisplayText(String textSourceDisplayText)
           
 void textSourceChanged(TextSourceChangeEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextViewer

public TextViewer(KnowtatorTextPane textPane,
                  KnowtatorManager manager)
Method Detail

getSelectedTextColor

public Color getSelectedTextColor()

initialize

public void initialize()

filterChanged

public void filterChanged(FilterChangedEvent event)
Specified by:
filterChanged in interface FilterChangedListener

getContentPane

public JPanel getContentPane()

textSourceChanged

public void textSourceChanged(TextSourceChangeEvent event)
Specified by:
textSourceChanged in interface TextSourceChangeListener

setTextSourceDisplayText

public void setTextSourceDisplayText(String textSourceDisplayText)

getTextPane

public KnowtatorTextPane getTextPane()

getVerticalDistance

public int getVerticalDistance(SimpleInstance annotation1,
                               SimpleInstance annotation2)
Calculates the verticle distance in pixels between annotation1 and annotation2 as they appear in the text. If annotation1 comes before annotation2 in the text, then the vertical distance will be a positive number. The spans compared are the spans returned from SpanUtil.getFirstSpan()

Parameters:
annotation1 -
annotation2 -
Returns:
the calculated vertical distance or if spans do not exist, then Integer.MIN_VALUE
See Also:
SpanUtil.getFirstSpan(SimpleInstance)

isVisible

public boolean isVisible(SimpleInstance annotation)

getVisibleSpan

public Span getVisibleSpan()

comparator

public Comparator<SimpleInstance> comparator(SimpleInstance annotation)