edu.uchsc.ccp.knowtator.ui
Class TextViewer
java.lang.Object
edu.uchsc.ccp.knowtator.ui.TextViewer
- All Implemented Interfaces:
- FilterChangedListener, TextSourceChangeListener, EventListener
public class TextViewer
- extends Object
- implements TextSourceChangeListener, FilterChangedListener
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextViewer
public TextViewer(KnowtatorTextPane textPane,
KnowtatorManager manager)
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)