Class GVectorPolygon

java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.extras.GVectorPolygon
All Implemented Interfaces:
Cloneable

public class GVectorPolygon extends GraphicE
This class creates a Resultant Vector as a result of the sum of a finite number of vectors.
Author:
Federico Vera <[email protected]>
  • Constructor Details

  • Method Details

    • append

      public void append(GVector... vector) throws 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:
      IllegalArgumentException - if vector is null
    • traslate

      public void traslate(int x, int y)
      Description copied from class: GraphicE
      Traslates this element on X and Y
      Specified by:
      traslate in class GraphicE
      Parameters:
      x - size in px of the horizontal translation
      y - size in px of the vertical translation
    • draw

      public void draw(Graphics2D g)
      Description copied from class: GraphicE
      Draws the component on the given graphics
      Specified by:
      draw in class GraphicE
      Parameters:
      g - where to draw
    • clone

      public GVectorPolygon clone()
      Specified by:
      clone in class GraphicE