Class GraphicE

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Stroke STROKE
      Size 1 stroke
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GraphicE()
      Creates a new instance.
        GraphicE​(GraphicE e)
      Copy constructor
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract GraphicE clone()  
      abstract void draw​(java.awt.Graphics2D g)
      Draws the component on the given graphics
      boolean equals​(java.lang.Object obj)  
      java.awt.Paint getPaint()
      The Paint of this component
      java.awt.Stroke getStroke()
      Gets the Stroke used to draw this component
      int hashCode()  
      void setPaint​(java.awt.Paint paint)
      Sets the Paint for this component
      void setStroke​(java.awt.Stroke stroke)
      Sets a new Stroke for this component
      abstract void traslate​(int x, int y)
      Traslates this element on X and Y
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • STROKE

        public static final java.awt.Stroke STROKE
        Size 1 stroke
    • Constructor Detail

      • GraphicE

        public GraphicE​(GraphicE e)
                 throws java.lang.IllegalArgumentException
        Copy constructor
        Parameters:
        e - GraphicE to copy
        Throws:
        java.lang.IllegalArgumentException - if e is null
      • GraphicE

        protected GraphicE()
        Creates a new instance.
    • Method Detail

      • getPaint

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

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

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

        public void setStroke​(java.awt.Stroke stroke)
        Sets a new Stroke for this component
        Parameters:
        stroke - the Stroke to use
        Throws:
        java.lang.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​(java.awt.Graphics2D g)
        Draws the component on the given graphics
        Parameters:
        g - where to draw
      • clone

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

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object