Package com.dkt.graphics.elements
Class GOval
java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.elements.GFillableE
com.dkt.graphics.elements.GOval
- All Implemented Interfaces:
Cloneable
- Author:
- Federico Vera <[email protected]>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGOval
(int x, int y, int w, int h) Constructs an oval inscribed in a rectangleCopy constructorGOval
(GRectangle r) Constructs an oval inscribed in a given rectangle -
Method Summary
Methods inherited from class com.dkt.graphics.elements.GFillableE
fill, getFillPaint, setFill, setFillPaint
-
Constructor Details
-
GOval
Copy constructor- Parameters:
e
-GOval
to copy- Throws:
IllegalArgumentException
- ife
isnull
-
GOval
Constructs an oval inscribed in a given rectangle- Parameters:
r
- rectangle that will contain the oval- Throws:
IllegalArgumentException
- if the rectangle isnull
-
GOval
Constructs an oval inscribed in a rectangle- Parameters:
x
- x coordinate of the center of the rectangley
- x coordinate of the center of the rectanglew
- horizontal size of the rectangleh
- vertical size of the rectangle- Throws:
InvalidArgumentException
- if eitherh < 0
orw < 0
-
-
Method Details
-
draw
Description copied from class:GraphicE
Draws the component on the given graphics -
traslate
public void traslate(int x, int y) Description copied from class:GraphicE
Traslates this element on X and Y -
clone
- Specified by:
clone
in classGFillableE
-
hashCode
public int hashCode()- Overrides:
hashCode
in classGFillableE
-
equals
- Overrides:
equals
in classGFillableE
-
getShape
Description copied from class:GFillableE
This method should return aArea
that represents theGFillableE
. Since this is not always possible, and the implementation ofArea
isn't always easy, it should returnnull
otherwise.
InjDrawingLib
s implementation we use the default shapes for this. Note that this method is only called to create clips forGraphic
objects- Specified by:
getShape
in classGFillableE
- Returns:
- Shape
-