|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
gate.gui.docview.AnnotationStack
public class AnnotationStack
Stack of annotations in a JPanel.
To use, respect this order:
AnnotationStack stackPanel = new AnnotationStack(...);
stackPanel.set...(...);
stackPanel.clearAllRows();
stackPanel.addRow(...);
stackPanel.addAnnotation(...);
stackPanel.drawStack();
| Nested Class Summary | |
|---|---|
private static class |
AnnotationStack.StackAnnotation
Annotation that doesn't belong to an annotation set and with id always equal to -1. |
static class |
AnnotationStack.StackMouseListener
Extension of a MouseInputAdapter that adds a method to create new Listeners from it. |
(package private) class |
AnnotationStack.StackRow
A row of annotations in the stack. |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
(package private) AnnotationStack.StackMouseListener |
annotationMouseListener
|
(package private) int |
contextAfterSize
number of characters after the expression |
(package private) int |
contextBeforeSize
number of characters before the expression |
static int |
CROP_END
|
static int |
CROP_MIDDLE
|
static int |
CROP_START
|
(package private) int |
expressionEndOffset
|
(package private) int |
expressionStartOffset
|
(package private) String |
expressionTooltip
|
(package private) AnnotationStack.StackMouseListener |
headerMouseListener
|
(package private) JButton |
lastRowButton
|
(package private) int |
maxFeatureValueLength
maximum number of characters for a feature value |
(package private) int |
maxTextLength
maximum number of characters for the text, if too long an ellipsis is added in the middle |
(package private) ArrayList<AnnotationStack.StackRow> |
stackRows
rows of annotations that are displayed in the stack |
(package private) String |
text
|
(package private) AnnotationStack.StackMouseListener |
textMouseListener
|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
AnnotationStack()
|
|
AnnotationStack(int maxTextLength,
int maxFeatureValueLength)
|
|
| Method Summary | |
|---|---|
void |
addAnnotation(Annotation annotation)
Add an annotation to the current stack row. |
void |
addAnnotation(int startOffset,
int endOffset,
String type,
FeatureMap features)
Add an annotation to the current stack row. |
void |
addRow(String set,
String type,
String feature,
JButton lastColumnButton,
String shortcut,
int crop)
Add a row to the annotation stack. |
void |
clearAllRows()
Clear all rows in the stack. |
void |
drawStack()
Draw the annotation stack in a JPanel with a GridBagLayout. |
(package private) void |
init()
|
void |
setAnnotationMouseListener(AnnotationStack.StackMouseListener annotationMouseListener)
|
void |
setContextAfterSize(int contextAfterSize)
|
void |
setContextBeforeSize(int contextBeforeSize)
|
void |
setExpressionEndOffset(int expressionEndOffset)
|
void |
setExpressionStartOffset(int expressionStartOffset)
|
void |
setExpressionTooltip(String expressionTooltip)
|
void |
setHeaderMouseListener(AnnotationStack.StackMouseListener headerMouseListener)
|
void |
setLastRowButton(JButton lastRowButton)
|
void |
setText(String text)
|
void |
setTextMouseListener(AnnotationStack.StackMouseListener textMouseListener)
|
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
ArrayList<AnnotationStack.StackRow> stackRows
int maxTextLength
int maxFeatureValueLength
JButton lastRowButton
String text
int expressionStartOffset
int expressionEndOffset
int contextBeforeSize
int contextAfterSize
String expressionTooltip
AnnotationStack.StackMouseListener textMouseListener
AnnotationStack.StackMouseListener headerMouseListener
AnnotationStack.StackMouseListener annotationMouseListener
public static final int CROP_START
public static final int CROP_MIDDLE
public static final int CROP_END
| Constructor Detail |
|---|
public AnnotationStack()
public AnnotationStack(int maxTextLength,
int maxFeatureValueLength)
maxTextLength - maximum number of characters for the text,
if too long an ellipsis is added in the middlemaxFeatureValueLength - maximum number of characters
for a feature value| Method Detail |
|---|
void init()
public void addRow(String set,
String type,
String feature,
JButton lastColumnButton,
String shortcut,
int crop)
set - set name for the annotation, may be nulltype - annotation typefeature - feature name, may be nulllastColumnButton - button at the end of the column, may be nullshortcut - replace the header of the row, may be nullcrop - how to crop the text for the annotation if too long, one of
CROP_START, CROP_MIDDLE or CROP_END
public void addAnnotation(int startOffset,
int endOffset,
String type,
FeatureMap features)
startOffset - document offset where starts the annotationendOffset - document offset where ends the annotationtype - annotation typefeatures - annotation features mappublic void addAnnotation(Annotation annotation)
annotation - annotation to add to the current stack rowpublic void clearAllRows()
public void drawStack()
public void setLastRowButton(JButton lastRowButton)
public void setText(String text)
text - first line of text that contains the expression
and its contextpublic void setExpressionStartOffset(int expressionStartOffset)
expressionStartOffset - document offset where starts the expressionpublic void setExpressionEndOffset(int expressionEndOffset)
expressionEndOffset - document offset where ends the expressionpublic void setContextBeforeSize(int contextBeforeSize)
contextBeforeSize - number of characters before the expressionpublic void setContextAfterSize(int contextAfterSize)
contextAfterSize - number of characters after the expressionpublic void setExpressionTooltip(String expressionTooltip)
expressionTooltip - optional tooltip for the expressionpublic void setTextMouseListener(AnnotationStack.StackMouseListener textMouseListener)
textMouseListener - optional listener for the first line of textpublic void setHeaderMouseListener(AnnotationStack.StackMouseListener headerMouseListener)
headerMouseListener - optional listener for the first columnpublic void setAnnotationMouseListener(AnnotationStack.StackMouseListener annotationMouseListener)
annotationMouseListener - optional listener for the annotations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||