Eclipse Platform
2.0

org.eclipse.jface.text.source
Class Annotation

java.lang.Object
  |
  +--org.eclipse.jface.text.source.Annotation
Direct Known Subclasses:
DefaultRangeIndicator, MarkerAnnotation

public abstract class Annotation
extends Object

Abstract graphical annotation used in a vertical ruler. Annotations are considered being located at layers. The vertical ruler paints annotations starting with layer 0 upwards. Thus an annotation of layer 5 will be drawn on top of all co-located annotations at the layers 4 - 0. Subclasses must provide the annotations paint method.

See Also:
IVerticalRuler

Constructor Summary
protected Annotation()
          Creates a new annotation.
 
Method Summary
protected static void drawImage(Image image, GC gc, Canvas canvas, Rectangle r, int align)
          Convenience method for drawing an image aligned inside a rectangle.
protected static void drawImage(Image image, GC gc, Canvas canvas, Rectangle r, int halign, int valign)
          Convenience method for drawing an image aligned inside a rectangle.
 int getLayer()
           
abstract  void paint(GC gc, Canvas canvas, Rectangle bounds)
          Implement this method to draw a graphical representation of this annotation within the given bounds.
protected  void setLayer(int layer)
          Sets the layer of this annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Annotation

protected Annotation()
Creates a new annotation.

Method Detail

setLayer

protected void setLayer(int layer)
Sets the layer of this annotation.

Parameters:
layer - the layer of this annotation

drawImage

protected static void drawImage(Image image,
                                GC gc,
                                Canvas canvas,
                                Rectangle r,
                                int halign,
                                int valign)
Convenience method for drawing an image aligned inside a rectangle.

Parameters:
image - the image to be drawn
canvas - the canvas on which to draw
r - the clipping rectangle
halign - the horizontal alignment of the image to be drawn
valign - the vertical alignment of the image to be drawn

drawImage

protected static void drawImage(Image image,
                                GC gc,
                                Canvas canvas,
                                Rectangle r,
                                int align)
Convenience method for drawing an image aligned inside a rectangle.

Parameters:
image - the image to be drawn
canvas - the canvas on which to draw
r - the clipping rectangle
align - the alignment of the image to be drawn

getLayer

public int getLayer()

paint

public abstract void paint(GC gc,
                           Canvas canvas,
                           Rectangle bounds)
Implement this method to draw a graphical representation of this annotation within the given bounds.

Parameters:
canvas - the canvas to draw on
bounds - the bounds inside the canvas to draw on

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.