public class AnnotationListModel extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AnnotationListModel.Bias |
Modifier and Type | Field and Description |
---|---|
static int |
NO_ANNOTATION
Return value of
findAnnotationIndex if no annotation is found. |
Constructor and Description |
---|
AnnotationListModel(List<Element> _annoElements) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationFor(Element annoElement)
Add an annotation node for an annotation element newly inserted into the JGloss HTML
document.
|
void |
addAnnotationListener(AnnotationListener l) |
int |
findAnnotationIndex(int pos,
AnnotationListModel.Bias bias)
Find the index of the annotation at a given position in the document.
|
void |
fireAnnotationChanged(Annotation anno) |
void |
fireReadingChanged(Annotation anno,
int readingIndex) |
Annotation |
getAnnotation(int index) |
int |
getAnnotationCount() |
int |
indexOf(Annotation anno) |
void |
removeAnnotationFor(Element annoElement)
Remove the annotation node which represents an annotation element removed from the
JGloss HTML document.
|
void |
removeAnnotationListener(AnnotationListener l) |
public static final int NO_ANNOTATION
findAnnotationIndex
if no annotation is found.public int getAnnotationCount()
public Annotation getAnnotation(int index)
public int indexOf(Annotation anno)
public int findAnnotationIndex(int pos, AnnotationListModel.Bias bias)
pos
- Position in the JGloss html document.bias
- Controls what will be returned if the position is not in an annotation.
BIAS_NONE
will return NO_ANNOTATION
, BIAS_LEFT
will return the
index of the annotation left of the position (-1
if the position is
left of the first annotation) and BIAS_RIGHT
will return the
index of the annotation right of the position
(getAnnotationCount
if the position is
right of the last annotation). In all cases, NO_ANNOTATION
will be returned
if there are no annoations in the model.public void addAnnotationFor(Element annoElement)
public void removeAnnotationFor(Element annoElement)
public void addAnnotationListener(AnnotationListener l)
public void removeAnnotationListener(AnnotationListener l)
public void fireAnnotationChanged(Annotation anno)
public void fireReadingChanged(Annotation anno, int readingIndex)
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.