Class GClip

All Implemented Interfaces:

public class GClip extends GraphicE
This class wraps an Area in a GraphicE, in order to create a clipping area from GFillableE.
Federico Vera <[email protected]>
  • Constructor Details

    • GClip

      public GClip(GClip e)
      Copy constructor
      e - GClip to copy
      IllegalArgumentException - if e is null
    • GClip

      public GClip()
      Basic GClip constructor
    • GClip

      public GClip(Area area)
      Constructs a GClip from a given area. Please note that when this constructor is used, then traslate(int, int) won't work.
      If you really need to traslate a GClip, then you should previously add a GTransform to the graphic
      area - Area object to be used as clip
      IllegalArgumentException - if area is null
  • Method Details

    • traslate

      public void traslate(int x, int y)
      Description copied from class: GraphicE
      Traslates this element on X and Y
      Specified by:
      traslate in class GraphicE
      x - size in px of the horizontal translation
      y - size in px of the vertical translation
    • add

      public void add(GFillableE e)
      Adds the given element to the clipping area
      e - element to add
    • subtract

      public void subtract(GFillableE e)
      Subtracts the given element from the clipping area
      e - element to subtract
    • draw

      public void draw(Graphics2D g)
      Description copied from class: GraphicE
      Draws the component on the given graphics
      Specified by:
      draw in class GraphicE
      g - where to draw
    • clone

      public GraphicE clone()
      Specified by:
      clone in class GraphicE