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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddraw(Graphics2D g) Draws the component on the given graphicsbooleangetShape()This method should return aAreathat represents theGFillableE.inthashCode()voidmove(int x, int y) Moves the center of this arc to the given coordinatesvoidtraslate(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-GArcto copy- Throws:
IllegalArgumentException- ifeisnull
-
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: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 -
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:
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
-