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
ConstructorsConstructorDescriptionGOval(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-GOvalto copy- Throws:
IllegalArgumentException- ifeisnull
-
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 < 0orw < 0
-
-
Method Details
-
draw
Description copied from class:GraphicEDraws the component on the given graphics -
traslate
public void traslate(int x, int y) Description copied from class:GraphicETraslates this element on X and Y -
clone
- Specified by:
clonein classGFillableE
-
hashCode
public int hashCode()- Overrides:
hashCodein classGFillableE
-
equals
- Overrides:
equalsin classGFillableE
-
getShape
Description copied from class:GFillableEThis method should return aAreathat represents theGFillableE. Since this is not always possible, and the implementation ofAreaisn't always easy, it should returnnullotherwise.
InjDrawingLibs implementation we use the default shapes for this. Note that this method is only called to create clips forGraphicobjects- Specified by:
getShapein classGFillableE- Returns:
- Shape
-