Class TGLineOp

java.lang.Object
  extended by TGLineOp
All Implemented Interfaces:
TGGraphicsOp

public class TGLineOp
extends java.lang.Object
implements TGGraphicsOp

TGLineOp provides a TurtleGraphics Line graphics Operation. A line of a specified penWidth is drawn between two TurtleSpace points.


Field Summary
 TGPoint endPt1
           
 TGPoint endPt2
           
 
Constructor Summary
TGLineOp(TGPoint pt1, TGPoint pt2, java.awt.Color color, int width)
          Return a TGLineOp, a line drawing operation.
TGLineOp(TGPoint pt1, TGPoint pt2, java.awt.Color color, int width, float[] pattern)
          Return a TGLineOp, a line drawing operation.
TGLineOp(TGPoint pt1, TGPoint pt2, java.awt.Color color, int width, float[] pattern, int lineCap)
          Return a TGLineOp, a line drawing operation.
TGLineOp(TGPoint pt1, TGPoint pt2, java.awt.Color color, int width, int lineCap)
          Return a TGLineOp, a line drawing operation.
 
Method Summary
 java.awt.Rectangle doIt(java.awt.image.BufferedImage inMemoryImage)
          Draw the line defined by this TGLineOp object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

endPt1

public final TGPoint endPt1

endPt2

public final TGPoint endPt2
Constructor Detail

TGLineOp

public TGLineOp(TGPoint pt1,
                TGPoint pt2,
                java.awt.Color color,
                int width)
Return a TGLineOp, a line drawing operation. Input points in the object may be swapped

Parameters:
pt1 - one end TGPoint of the line
pt2 - other end TGPoint of the line
color - AWT Color for line's pixels
width - number of pixels for width of the line

TGLineOp

public TGLineOp(TGPoint pt1,
                TGPoint pt2,
                java.awt.Color color,
                int width,
                int lineCap)
Return a TGLineOp, a line drawing operation. Input points in the object may be swapped

Parameters:
pt1 - one end TGPoint of the line
pt2 - other end TGPoint of the line
color - AWT Color for line's pixels
width - number of pixels for width of the line
lineCap - type of endcaps on the line

TGLineOp

public TGLineOp(TGPoint pt1,
                TGPoint pt2,
                java.awt.Color color,
                int width,
                float[] pattern)
Return a TGLineOp, a line drawing operation. Input points in the object may be swapped

Parameters:
pt1 - one end TGPoint of the line
pt2 - other end TGPoint of the line
color - AWT Color for line's pixels
width - number of pixels for width of the line
pattern - dashed line pattern. even elements are draw amounts, odd elements are skip amounts

TGLineOp

public TGLineOp(TGPoint pt1,
                TGPoint pt2,
                java.awt.Color color,
                int width,
                float[] pattern,
                int lineCap)
Return a TGLineOp, a line drawing operation. Input points in the object may be swa

Parameters:
pt1 - one end TGPoint of the line
pt2 - other end TGPoint of the line
color - AWT Color for line's pixels
width - number of pixels for width of the line
pattern - dashed line pattern. even elements are draw amounts, odd elements are skip amounts
lineCap - type of endcaps on the line
Method Detail

doIt

public java.awt.Rectangle doIt(java.awt.image.BufferedImage inMemoryImage)
Draw the line defined by this TGLineOp object.

Specified by:
doIt in interface TGGraphicsOp
Parameters:
inMemoryImage - where to draw
Returns:
Rectangle bounds of the pixels in the Image that were changed

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object