Class GraphicE

java.lang.Object
com.dkt.graphics.elements.GraphicE
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
AbstractTimer, GAxis, GClip, GFillableE, GGrid, GImage, GLine, GPixMap, GPoint, GPVector, Graphic, GSprite, GString, GTransform, GVector, GVectorPolygon

public abstract class GraphicE extends Object implements Cloneable
This class represents an abstract Graphical Element
Author:
Federico Vera <[email protected]>
  • Field Details

    • STROKE

      public static final Stroke STROKE
      Size 1 stroke
  • Constructor Details

  • Method Details

    • getPaint

      public Paint getPaint()
      The Paint of this component
      Returns:
      Paint the Paint used to render this GraphicE
    • setPaint

      public void setPaint(Paint paint)
      Sets the Paint for this component
      Parameters:
      paint - the paint use to render this GraphicE
      Throws:
      IllegalArgumentException - if paint is null
    • getStroke

      public Stroke getStroke()
      Gets the Stroke used to draw this component
      Returns:
      stroke used for this GraphicE
    • setStroke

      public void setStroke(Stroke stroke)
      Sets a new Stroke for this component
      Parameters:
      stroke - the Stroke to use
      Throws:
      IllegalArgumentException - if stroke is null
    • traslate

      public abstract void traslate(int x, int y)
      Traslates this element on X and Y
      Parameters:
      x - size in px of the horizontal translation
      y - size in px of the vertical translation
    • draw

      public abstract void draw(Graphics2D g)
      Draws the component on the given graphics
      Parameters:
      g - where to draw
    • clone

      public abstract GraphicE clone()
      Overrides:
      clone in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object