JLogView_.datastructs.shapes
Class LGLine

java.lang.Object
  extended by JLogView_.datastructs.LGShape
      extended by JLogView_.datastructs.shapes.LGLine

public class LGLine
extends LGShape

LGLine is a descendant of LGShape. It represents the shape of a line.

See Also:
LGShape

Field Summary
 
Fields inherited from class JLogView_.datastructs.LGShape
colour, coords
 
Constructor Summary
LGLine(float startX, float startY, float endX, float endY)
          This is the constructor of LGLine.
 
Method Summary
protected  void drawShape(java.awt.Graphics gr, int x1, int y1, int x2, int y2)
          This method draws the line itself.
 
Methods inherited from class JLogView_.datastructs.LGShape
draw, setColour
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LGLine

public LGLine(float startX,
              float startY,
              float endX,
              float endY)
This is the constructor of LGLine.

Parameters:
startX - the x graph coordinate of one end of the line
startY - the y graph coordinate of one end of the line
endX - the x graph coordinate of the other end of the line
endY - the y graph coordinate of the other end of the line
Method Detail

drawShape

protected void drawShape(java.awt.Graphics gr,
                         int x1,
                         int y1,
                         int x2,
                         int y2)
This method draws the line itself. It is overriding the definition in LGShape In this case the two pair of coordinates represents the two end points of of the line.

Specified by:
drawShape in class LGShape
Parameters:
gr - a Graphics object, the graphic context to draw on
x1 - the x coordinate in pixels of one end
y1 - the y coordinate in pixels of one end
x2 - the x coordinate in pixels of the other end
y2 - the y coordinate in pixels of the other end
See Also:
Graphics