JLogView_.datastructs
Class LGAnnotation

java.lang.Object
  extended by JLogView_.datastructs.LGAnnotation

public class LGAnnotation
extends java.lang.Object

LGAnnotation is a class representing the data of an annotation. This includes text of the annotation, the x, y coordinates on the canvas, the rotation of the text, the font and the colour.


Constructor Summary
LGAnnotation(java.awt.Color c, java.awt.Font f, int X, int Y, int ang, java.lang.String s)
          This is the LGAnnotation constructor with all the initials parameters to be given
 
Method Summary
 void draw(java.awt.Graphics2D g)
          This methods draws the annotation on the given graphic context
 java.awt.Color getColour()
          This method returns the annotation colour
 java.awt.Font getFont()
          This method returns all font information, the font face, the style and the font size
 int[] getPos()
          This methods returns the position in pixel coordinates of the annotation
 int getRotation()
          This method returns the rotation angle of the annotation text, in degree.
 java.lang.String getText()
          This method returns the text of the annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LGAnnotation

public LGAnnotation(java.awt.Color c,
                    java.awt.Font f,
                    int X,
                    int Y,
                    int ang,
                    java.lang.String s)
This is the LGAnnotation constructor with all the initials parameters to be given

Parameters:
c - a Color object representing the annotation colour
f - a Font object representing the annotation font (face+style+size)
X - the x coordinate in pixels on the canvas
Y - the y coordinate in pixels on the canvas
ang - the rotation angle of the text in degrees
s - a String object representing the text of the annotation
See Also:
Color, Font, String
Method Detail

draw

public void draw(java.awt.Graphics2D g)
This methods draws the annotation on the given graphic context

Parameters:
g - the graphic context we will draw the annotation on
See Also:
Graphics2D

getPos

public int[] getPos()
This methods returns the position in pixel coordinates of the annotation

Returns:
an array of 2 elements, the pixel coordinates of the annotation

getRotation

public int getRotation()
This method returns the rotation angle of the annotation text, in degree.

Returns:
the rotation angle in degree

getText

public java.lang.String getText()
This method returns the text of the annotation.

Returns:
a String representing the text of the annotation
See Also:
String

getFont

public java.awt.Font getFont()
This method returns all font information, the font face, the style and the font size

Returns:
a Font object containing all font information
See Also:
Font

getColour

public java.awt.Color getColour()
This method returns the annotation colour

Returns:
a Color object representing that colour
See Also:
Color