Package com.dkt.graphics.extras
Class GClip
java.lang.Object
com.dkt.graphics.elements.GraphicE
com.dkt.graphics.extras.GClip
- All Implemented Interfaces:
Cloneable
- Author:
- Federico Vera <[email protected]>
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(GFillableE e) Adds the given element to the clipping areaclone()voiddraw(Graphics2D g) Draws the component on the given graphicsvoidSubtracts the given element from the clipping areavoidtraslate(int x, int y) Traslates this element on X and Y
-
Constructor Details
-
GClip
Copy constructor- Parameters:
e-GClipto copy- Throws:
IllegalArgumentException- ifeisnull
-
GClip
public GClip()BasicGClipconstructor -
GClip
Constructs aGClipfrom a given area. Please note that when this constructor is used, thentraslate(int, int)won't work.
If you really need to traslate aGClip, then you should previously add aGTransformto the graphic- Parameters:
area-Areaobject to be used as clip- Throws:
IllegalArgumentException- ifareaisnull
-
-
Method Details
-
traslate
public void traslate(int x, int y) Description copied from class:GraphicETraslates this element on X and Y -
add
Adds the given element to the clipping area- Parameters:
e- element to add
-
subtract
Subtracts the given element from the clipping area- Parameters:
e- element to subtract
-
draw
Description copied from class:GraphicEDraws the component on the given graphics -
clone
-