Package com.dkt.graphics.elements
Class GArc
java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.elements.GFillableE
com.dkt.graphics.elements.GArc
- All Implemented Interfaces:
Cloneable
- Author:
- Federico Vera <[email protected]>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
void
draw
(Graphics2D g) Draws the component on the given graphicsboolean
getShape()
This method should return aArea
that represents theGFillableE
.int
hashCode()
void
move
(int x, int y) Moves the center of this arc to the given coordinatesvoid
traslate
(int x, int y) Traslates this element on X and YMethods inherited from class com.dkt.graphics.elements.GFillableE
fill, getFillPaint, setFill, setFillPaint
-
Constructor Details
-
GArc
Copy constructor- Parameters:
e
-GArc
to copy- Throws:
IllegalArgumentException
- ife
isnull
-
GArc
public GArc(int x, int y, int r, int a, int o) Generates an arc of a circle- Parameters:
x
- x coordinate of the center of the circley
- y coordinate of the center of the circler
- radius of the circlea
- angle of the arc (in degrees)o
- offset of the arc (in degrees)
-
GArc
public GArc(int x, int y, int w, int h, int a, int o) Generates an arc of an oval- Parameters:
x
- x coordinate of the lower left cornery
- y coordinate of the lower left cornerw
- width of the rectangleh
- height of the rectanglea
- angle of the arc (in degrees)o
- offset of the arc (in degrees)
-
-
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 -
move
public void move(int x, int y) Moves the center of this arc to the given coordinates- Parameters:
x
- new x coordinatey
- new y coordinate
-
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
-