Package com.dkt.graphics.extras
Class GVectorPolygon
java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.extras.GVectorPolygon
- All Implemented Interfaces:
Cloneable
This class creates a Resultant Vector as a result of the sum of a finite
number of vectors.
- Author:
- Federico Vera <[email protected]>
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionGVectorPolygon(GVector... vectors) Creates a newGVectorPolygonbased on aGVectorarray -
Method Summary
Modifier and TypeMethodDescriptionvoidAppends 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 shownclone()voiddraw(Graphics2D g) Draws the component on the given graphicsvoidtraslate(int x, int y) Traslates this element on X and Y
-
Constructor Details
-
GVectorPolygon
-
GVectorPolygon
Creates a newGVectorPolygonbased on aGVectorarray- Parameters:
vectors- that form the vector polygon- Throws:
IllegalArgumentException- ifvectorsisnull
-
-
Method Details
-
append
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-GVectorcontaining the vectors to be added.- Throws:
IllegalArgumentException- ifvectorisnull
-
traslate
public void traslate(int x, int y) Description copied from class:GraphicETraslates this element on X and Y -
draw
Description copied from class:GraphicEDraws the component on the given graphics -
clone
-