fr.orsay.lri.varna.models.annotations
Class TextAnnotation

java.lang.Object
  extended by fr.orsay.lri.varna.models.annotations.TextAnnotation
All Implemented Interfaces:
Serializable

public class TextAnnotation
extends Object
implements Serializable

The annotated text model

Author:
Darty@lri.fr
See Also:
Serialized Form

Field Summary
private  Object _ancrage
           
private  double _angle
           
private  Color _color
           
private  Font _font
           
private  String _texte
           
private  int _typeAncrage
           
static int BASE
          if the annoted text is fixed to a base;
static Color DEFAULTCOLOR
          default text color
static Font DEFAULTFONT
          default text font
static int HELIX
          if the annoted text is fixed to a helix;
static int LOOP
          if the annoted text is fixed to a loop;
static int POSITION
          if the annoted text is located by a static position
private static long serialVersionUID
           
 
Constructor Summary
TextAnnotation(String texte)
          creates an annoted text on a VARNAPanel with the specified text
TextAnnotation(String texte, ArrayList<ModeleBase> listeBase, int type)
          creates an annoted text on a VARNAPanel with the specified text fixed to a helix (if type is HELIX) or to a loop (if type is LOOP)
TextAnnotation(String texte, double x, double y)
          /** creates an annoted text on a VARNAPanel with the specified text and is static position
TextAnnotation(String texte, ModeleBase mb)
          creates an annoted text on a VARNAPanel with the specified text fixed to a base
TextAnnotation(TextAnnotation textAnnotation)
          creates an annoted text from another one
 
Method Summary
private  Point2D.Double calculLoop()
           
private  Point2D.Double calculLoopHelix()
           
 TextAnnotation clone()
          clone a TextAnnotation
 void copy(TextAnnotation textAnnotation)
          copy a textAnnotation
private  ArrayList<ModeleBase> extractedArrayListModeleBaseFromAncrage()
           
 Object getAncrage()
           
 double getAngleInDegres()
           
 double getAngleInRadians()
           
 Point2D.Double getCenterPosition()
           
 Color getColor()
           
 Font getFont()
           
 String getHelixDescription()
           
 String getLoopDescription()
           
 String getTexte()
           
 int getType()
           
 void setAncrage(ArrayList<ModeleBase> list, int type)
           
 void setAncrage(double x, double y)
           
 void setAncrage(ModeleBase mb)
           
 void setAngleInDegres(double _angle)
           
 void setAngleInRadians(double _angle)
           
 void setColor(Color color)
           
 void setFont(Font _font)
           
 void setTexte(String _texte)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

POSITION

public static final int POSITION
if the annoted text is located by a static position

See Also:
Constant Field Values

BASE

public static final int BASE
if the annoted text is fixed to a base;

See Also:
Constant Field Values

HELIX

public static final int HELIX
if the annoted text is fixed to a helix;

See Also:
Constant Field Values

LOOP

public static final int LOOP
if the annoted text is fixed to a loop;

See Also:
Constant Field Values

DEFAULTCOLOR

public static final Color DEFAULTCOLOR
default text color


DEFAULTFONT

public static final Font DEFAULTFONT
default text font


_texte

private String _texte

_font

private Font _font

_ancrage

private Object _ancrage

_typeAncrage

private int _typeAncrage

_color

private Color _color

_angle

private double _angle
Constructor Detail

TextAnnotation

public TextAnnotation(String texte)
creates an annoted text on a VARNAPanel with the specified text

Parameters:
texte - Textual content of the annotation

TextAnnotation

public TextAnnotation(String texte,
                      double x,
                      double y)
/** creates an annoted text on a VARNAPanel with the specified text and is static position

Parameters:
texte -
x -
y -

TextAnnotation

public TextAnnotation(String texte,
                      ModeleBase mb)
creates an annoted text on a VARNAPanel with the specified text fixed to a base

Parameters:
texte -
mb -

TextAnnotation

public TextAnnotation(String texte,
                      ArrayList<ModeleBase> listeBase,
                      int type)
               throws Exception
creates an annoted text on a VARNAPanel with the specified text fixed to a helix (if type is HELIX) or to a loop (if type is LOOP)

Parameters:
texte -
listeBase -
type -
Throws:
Exception

TextAnnotation

public TextAnnotation(TextAnnotation textAnnotation)
creates an annoted text from another one

Parameters:
textAnnotation -
Method Detail

getTexte

public String getTexte()
Returns:
the text

setTexte

public void setTexte(String _texte)

getFont

public Font getFont()
Returns:
the font

setFont

public void setFont(Font _font)

getAncrage

public Object getAncrage()

setAncrage

public void setAncrage(ModeleBase mb)

setAncrage

public void setAncrage(double x,
                       double y)

setAncrage

public void setAncrage(ArrayList<ModeleBase> list,
                       int type)
                throws Exception
Throws:
Exception

getType

public int getType()

getColor

public Color getColor()

setColor

public void setColor(Color color)

getHelixDescription

public String getHelixDescription()

getLoopDescription

public String getLoopDescription()

toString

public String toString()
Overrides:
toString in class Object

getCenterPosition

public Point2D.Double getCenterPosition()
Returns:
the text position center

calculLoop

private Point2D.Double calculLoop()

calculLoopHelix

private Point2D.Double calculLoopHelix()

extractedArrayListModeleBaseFromAncrage

private ArrayList<ModeleBase> extractedArrayListModeleBaseFromAncrage()

clone

public TextAnnotation clone()
clone a TextAnnotation

Overrides:
clone in class Object

copy

public void copy(TextAnnotation textAnnotation)
copy a textAnnotation

Parameters:
textAnnotation -

getAngleInDegres

public double getAngleInDegres()
Returns:
the angle in degrees

getAngleInRadians

public double getAngleInRadians()
Returns:
the angle in radians

setAngleInDegres

public void setAngleInDegres(double _angle)

setAngleInRadians

public void setAngleInRadians(double _angle)