Package com.dkt.graphics.extras
Class GVectorPolygon
- java.lang.Object
-
- com.dkt.graphics.elements.GraphicE
-
- com.dkt.graphics.extras.GVectorPolygon
-
- All Implemented Interfaces:
java.lang.Cloneable
public class GVectorPolygon extends GraphicE
This class creates a Resultant Vector as a result of the sum of a finite number of vectors.
-
-
Constructor Summary
Constructors Constructor Description GVectorPolygon(GVector... vectors)
Creates a newGVectorPolygon
based on aGVector
arrayGVectorPolygon(GVectorPolygon e)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(GVector... vector)
Appends a finite number of vectors to the Polygon, let it be noted that the order in which the vectors are appended is the same order in which they will be shownGVectorPolygon
clone()
void
draw(java.awt.Graphics2D g)
Draws the component on the given graphicsvoid
traslate(int x, int y)
Traslates this element on X and Y
-
-
-
Constructor Detail
-
GVectorPolygon
public GVectorPolygon(GVectorPolygon e)
Copy constructor.- Parameters:
e
-GVectorPolygon
to copy
-
-
Method Detail
-
append
public void append(GVector... vector) throws java.lang.IllegalArgumentException
Appends a finite number of vectors to the Polygon, let it be noted that the order in which the vectors are appended is the same order in which they will be shown- Parameters:
vector
-GVector
containing the vectors to be added.- Throws:
java.lang.IllegalArgumentException
- ifvector
isnull
-
traslate
public void traslate(int x, int y)
Description copied from class:GraphicE
Traslates this element on X and Y
-
draw
public void draw(java.awt.Graphics2D g)
Description copied from class:GraphicE
Draws the component on the given graphics
-
clone
public GVectorPolygon clone()
-
-