Jet.Tipster
Class AnnotationColor

java.lang.Object
  extended byJet.Tipster.AnnotationColor

public class AnnotationColor
extends java.lang.Object

provides a mechanism for associating particular highlighting colors with particular annotation types in Document displays. The color information is retained in a color file.


Field Summary
static java.util.ArrayList colors
           
 
Constructor Summary
AnnotationColor(java.lang.String dataPath)
          initializes the colorFrame -- the menu which is used to choose colors for each annotation type.
AnnotationColor(java.lang.String dataPath, java.lang.String colorFileName)
          initializes the colorFrame -- the menu which is used to choose colors for each annotation type.
 
Method Summary
static void addType(java.lang.String type)
          add a color entry for annotation type 'type'.
static java.awt.Color getColor(Annotation ann)
          returns the Color associated with Annotation ann, or null if there is no Color association for this Annotation.
static void readColors()
          read a table of Annotation type/color pairs, one per line, from 'colorFile'.
static void showColors()
           
static void writeColors()
          write a table of type/color pairs, one per line, to 'colorFile'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colors

public static java.util.ArrayList colors
Constructor Detail

AnnotationColor

public AnnotationColor(java.lang.String dataPath)
initializes the colorFrame -- the menu which is used to choose colors for each annotation type. The color choice is initialized from file 'annColors.clr' in directory 'dataPath'. An application should invoke the constructor once to initialize the color choices.


AnnotationColor

public AnnotationColor(java.lang.String dataPath,
                       java.lang.String colorFileName)
initializes the colorFrame -- the menu which is used to choose colors for each annotation type. The color choice is initialized from file 'colorFileName' in directory 'dataPath'. An application should invoke the constructor once to initialize the color choices.

Method Detail

readColors

public static void readColors()
read a table of Annotation type/color pairs, one per line, from 'colorFile'. Each line should have the form
type color
or
type feature featureValue color
where 'type' is the name of the type, and 'color' is an integer representing a color; if present, 'feature' and 'featureValue' specialize the color to Annotations with that feature/featureValue combination. The color may be optionally followed by a (single-character) field; this character is used by AnnotationTool for annotating text with that type and featureValue.


writeColors

public static void writeColors()
write a table of type/color pairs, one per line, to 'colorFile'.


addType

public static void addType(java.lang.String type)
add a color entry for annotation type 'type'. Initialize it to a random color and then display the color frame to offer the user a choice for changing it.


showColors

public static void showColors()

getColor

public static java.awt.Color getColor(Annotation ann)
returns the Color associated with Annotation ann, or null if there is no Color association for this Annotation.