de.enough.polish.ui
Class ClippingRegion

java.lang.Object
  extended by de.enough.polish.ui.ClippingRegion

public class ClippingRegion
extends java.lang.Object

Manages a region that is increased when further regions are added.

Copyright Enough Software 2007 - 2008

 history
        Aug 18, 2007 - rob creation
 

Author:
Robert Virkus, j2mepolish@enough.de

Constructor Summary
ClippingRegion()
           
 
Method Summary
 void addRegion(int x, int y, int width, int height)
          Adds a clipping region.
 boolean containsRegion()
          Determines whether a region has been added since the last reset.
 int getHeight()
          Retrieves the height of this region.
 int getWidth()
          Retrieves the width of this region.
 int getX()
          Retrieves the horizontal start of this region
 int getY()
          Retrieves the vertical start of this region
 void reset()
          Resets this clipping region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClippingRegion

public ClippingRegion()
Method Detail

reset

public void reset()
Resets this clipping region.


addRegion

public void addRegion(int x,
                      int y,
                      int width,
                      int height)
Adds a clipping region.

Parameters:
x - horizontal start
y - vertical start
width - width of the region
height - height of the region

containsRegion

public boolean containsRegion()
Determines whether a region has been added since the last reset.

Returns:
true when a region has been added since the last reset.

getX

public int getX()
Retrieves the horizontal start of this region

Returns:
the left x coordinate

getY

public int getY()
Retrieves the vertical start of this region

Returns:
the top y coordinate

getWidth

public int getWidth()
Retrieves the width of this region.

Returns:
the width, 0 when no region has been added

getHeight

public int getHeight()
Retrieves the height of this region.

Returns:
the height, 0 when no region has been added