com.alee.utils.laf
Class Line

java.lang.Object
  extended by com.alee.utils.laf.Line

public class Line
extends java.lang.Object

This class represents a simple line data.

Author:
Mikle Garin

Field Summary
 int x1
          First X coordinate.
 int x2
          Second X coordinate.
 int y1
          First Y coordinate.
 int y2
          Second Y coordinate.
 
Constructor Summary
Line()
          Conscturcts a line using empty coordinates.
Line(int x1, int y1, int x2, int y2)
          Constructs a line using the specifed coordinates.
Line(Line line)
          Constructs a line using coordinates from the specified line.
Line(java.awt.Point p1, java.awt.Point p2)
          Constructs a line using the specifed points.
 
Method Summary
 double getX1()
          Returns first X coordinate.
 double getX2()
          Returns second X coordinate.
 double getY1()
          Returns first Y coordinate.
 double getY2()
          Returns second Y coordinate.
 void setPoint1(java.awt.Point p1)
          Sets first point.
 void setPoint2(java.awt.Point p2)
          Sets second point.
 void setX1(int x1)
          Sets first X coordinate.
 void setX2(int x2)
          Sets second X coordinate.
 void setY1(int y1)
          Sets first Y coordinate.
 void setY2(int y2)
          Sets second Y coordinate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x1

@XStreamAsAttribute
public int x1
First X coordinate.


y1

@XStreamAsAttribute
public int y1
First Y coordinate.


x2

@XStreamAsAttribute
public int x2
Second X coordinate.


y2

@XStreamAsAttribute
public int y2
Second Y coordinate.

Constructor Detail

Line

public Line()
Conscturcts a line using empty coordinates.


Line

public Line(int x1,
            int y1,
            int x2,
            int y2)
Constructs a line using the specifed coordinates.

Parameters:
x1 - first X coordinate
y1 - first Y coordinate
x2 - second X coordinate
y2 - second Y coordinate

Line

public Line(java.awt.Point p1,
            java.awt.Point p2)
Constructs a line using the specifed points.

Parameters:
p1 - first point
p2 - second point

Line

public Line(Line line)
Constructs a line using coordinates from the specified line.

Parameters:
line - line to process
Method Detail

getX1

public double getX1()
Returns first X coordinate.

Returns:
first X coordinate

setX1

public void setX1(int x1)
Sets first X coordinate.

Parameters:
x1 - first X coordinate

getY1

public double getY1()
Returns first Y coordinate.

Returns:
first Y coordinate

setY1

public void setY1(int y1)
Sets first Y coordinate.

Parameters:
y1 - first Y coordinate

getX2

public double getX2()
Returns second X coordinate.

Returns:
second X coordinate

setX2

public void setX2(int x2)
Sets second X coordinate.

Parameters:
x2 - second X coordinate

getY2

public double getY2()
Returns second Y coordinate.

Returns:
second Y coordinate

setY2

public void setY2(int y2)
Sets second Y coordinate.

Parameters:
y2 - second Y coordinate

setPoint1

public void setPoint1(java.awt.Point p1)
Sets first point.

Parameters:
p1 - first point

setPoint2

public void setPoint2(java.awt.Point p2)
Sets second point.

Parameters:
p2 - second point