fr.ove.openmath.jome.ctrlview.bidim
Class Line

java.lang.Object
  extended byfr.ove.openmath.jome.ctrlview.bidim.Line
All Implemented Interfaces:
java.io.Serializable

public class Line
extends java.lang.Object
implements java.io.Serializable

A line.

Version:
2.0 22/07/1999
Author:
© 1999 DIRAT Laurent
See Also:
Serialized Form

Field Summary
static byte CENTER
          The thickness of the line is distributed in equitably on both sides of the line
static byte LEFT
          The thickness of the line is distributed to the left of the line
static byte RIGHT
          The thickness of the line is distributed to the right of the line
 
Constructor Summary
Line()
          The constructor.
Line(java.awt.Point p1, java.awt.Point p2, int thickness, byte alignment)
          The constructor.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draws the line.
 int getAlignment()
          Returns the alignement of the line.
 java.awt.Polygon getLine()
          Returns the Polygon which represents the line.
 java.awt.Point getP1()
          Returns the starting point of the line.
 java.awt.Point getP2()
          Returns the ending point of the line.
 int getThickness()
          Returns the thickness of the line.
 void setAlignment(byte alignment)
          Sets a new alingment.
 void setP1(java.awt.Point p1)
          Sets a new starting point.
 void setP2(java.awt.Point p2)
          Sets a new ending point.
 void setThickness(int thickness)
          Sets the thickness of the line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT

public static final byte LEFT
The thickness of the line is distributed to the left of the line

See Also:
Constant Field Values

CENTER

public static final byte CENTER
The thickness of the line is distributed in equitably on both sides of the line

See Also:
Constant Field Values

RIGHT

public static final byte RIGHT
The thickness of the line is distributed to the right of the line

See Also:
Constant Field Values
Constructor Detail

Line

public Line()
The constructor.
Constructs the line [(0,0),(0,0)], with a thickness of 1.


Line

public Line(java.awt.Point p1,
            java.awt.Point p2,
            int thickness,
            byte alignment)
The constructor.

Parameters:
p1 - the starting point of the line
p2 - the ending point of the line
thickness - the thickness of the line
alignment - the alignment of the line
Method Detail

setP1

public void setP1(java.awt.Point p1)
Sets a new starting point.

Parameters:
p1 - the starting point of the line

getP1

public java.awt.Point getP1()
Returns the starting point of the line.


setP2

public void setP2(java.awt.Point p2)
Sets a new ending point.

Parameters:
p2 - the ending point of the line

getP2

public java.awt.Point getP2()
Returns the ending point of the line.


setAlignment

public void setAlignment(byte alignment)
Sets a new alingment.

Parameters:
alignment - the alignment of the line

getAlignment

public int getAlignment()
Returns the alignement of the line.


setThickness

public void setThickness(int thickness)
Sets the thickness of the line.

Parameters:
thickness - the thickness of the line

getThickness

public int getThickness()
Returns the thickness of the line.


draw

public void draw(java.awt.Graphics g)
Draws the line.

Parameters:
g - the graphics in which the line has to be drawn.

getLine

public java.awt.Polygon getLine()
Returns the Polygon which represents the line.



Copyright © 1999-2007 Universit?© de Nice Sophia-Antipolis, I3S, Ove SARL, DFKI and Universit?§t des Saarlandes. All Rights Reserved.