Texture
Class TextureAdministrator

java.lang.Object
  |
  +--Texture.TextureAdministrator

public class TextureAdministrator
extends Object

This class provides tools to administrate the textures. The textures are in a vector and we can manipulate them.

Version:
1.0
Author:
Sebastien Baehni
See Also:
Texture, TextureError, TextureAdministratorError

Field Summary
protected  Vector circleTextureVector
          The vector for the circles.
protected  Vector polygonTextureVector
          The vector for the polygons.
protected  Vector rectangleTextureVector
          The vector for the rectangles.
 
Constructor Summary
TextureAdministrator()
          The constructor.
 
Method Summary
 void addCircleTexture(int color)
          This method add a uniform texture to a circle.
 void addCircleTexture(int width, int height, int mode)
          This method add a "true" texture to a circle.
 void addPolygonTexture(int color)
          This method add a uniform texture to a polygon.
 void addPolygonTexture(int width, int height, int mode)
          This method add a "true" texture to a polygon.
 void addRectangleTexture(int color)
          This method add a uniform texture to a rectangle.
 void addRectangleTexture(int width, int height, int mode)
          This method add a "true" texture to a rectangle.
 void clearAll()
          This method removes all the element of the different vectors.
 int indexCircle()
          This method returns the size of the circle vector.
 int indexPolygon()
          This method returns the size of the polygon vector.
 int indexRectangle()
          This method returns the size of the rectangle vector.
 void removeCircleTexture(int indexCircle)
          Removes a texture from the circle vector.
 void removePolygonTexture(int indexPolygon)
          Removes a texture from the polygon vector.
 void removeRectangleTexture(int indexRectangle)
          Removes a texture from the rectangle vector.
 Texture returnCircleTexture(int indexCircle)
          This method return the texture associated to a circle.
 Texture returnPolygonTexture(int indexPolygon)
          This method return the texture associated to a polygon.
 Texture returnRectangleTexture(int indexRectangle)
          This method return the texture associated to a rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

circleTextureVector

protected Vector circleTextureVector
The vector for the circles.

rectangleTextureVector

protected Vector rectangleTextureVector
The vector for the rectangles.

polygonTextureVector

protected Vector polygonTextureVector
The vector for the polygons.
Constructor Detail

TextureAdministrator

public TextureAdministrator()
The constructor. It creates the vectors.
Method Detail

addCircleTexture

public void addCircleTexture(int width,
                             int height,
                             int mode)
This method add a "true" texture to a circle.
Parameters:
width - The width of the texture.
height - The height of the texture.
mode - The mode of the texture.

addCircleTexture

public void addCircleTexture(int color)
This method add a uniform texture to a circle.
Parameters:
color - The color of the texture.

addRectangleTexture

public void addRectangleTexture(int width,
                                int height,
                                int mode)
This method add a "true" texture to a rectangle.
Parameters:
width - The width of the texture.
height - The height of the texture.
mode - The mode of the texture.

addRectangleTexture

public void addRectangleTexture(int color)
This method add a uniform texture to a rectangle.
Parameters:
color - The color of the texture.

addPolygonTexture

public void addPolygonTexture(int width,
                              int height,
                              int mode)
This method add a "true" texture to a polygon.
Parameters:
width - The width of the texture.
height - The height of the texture.
mode - The mode of the texture.

addPolygonTexture

public void addPolygonTexture(int color)
This method add a uniform texture to a polygon.
Parameters:
color - The color of the texture.

removeCircleTexture

public void removeCircleTexture(int indexCircle)
                         throws TextureAdministratorError
Removes a texture from the circle vector.
Parameters:
indexCircle - The index of the vector we want to remove the texture.
Throws:
TextureAdministratorError -  

removeRectangleTexture

public void removeRectangleTexture(int indexRectangle)
                            throws TextureAdministratorError
Removes a texture from the rectangle vector.
Parameters:
indexRectangle - The index of the vector we want to remove the texture.
Throws:
TextureAdministratorError -  

removePolygonTexture

public void removePolygonTexture(int indexPolygon)
                          throws TextureAdministratorError
Removes a texture from the polygon vector.
Parameters:
indexPolygon - The index of the vector we want to remove the texture.
Throws:
TextureAdministratorError -  

clearAll

public void clearAll()
This method removes all the element of the different vectors.

returnCircleTexture

public Texture returnCircleTexture(int indexCircle)
                            throws TextureAdministratorError
This method return the texture associated to a circle.
Parameters:
indexCircle - The index in the circle vector we want to acceed the texture.
Returns:
The texture if the index is in the scope of the circle vector, a TextureAdministratorError otherwise.
Throws:
TextureAdministratorError -  
See Also:
Texture

returnRectangleTexture

public Texture returnRectangleTexture(int indexRectangle)
                               throws TextureAdministratorError
This method return the texture associated to a rectangle.
Parameters:
indexRectangle - The index in the rectangle vector we want to acceed the texture.
Returns:
The texture if the index is in the scope of the rectangle vector, a TextureAdministratorError otherwise.
Throws:
TextureAdministratorError -  
See Also:
Texture

returnPolygonTexture

public Texture returnPolygonTexture(int indexPolygon)
                             throws TextureAdministratorError
This method return the texture associated to a polygon.
Parameters:
indexPolygon - The index in the polygon vector we want to acceed the texture.
Returns:
The texture if the index is in the scope of the polygon vector, a TextureAdministratorError otherwise.
See Also:
Texture, TextureAdministratorError

indexCircle

public int indexCircle()
This method returns the size of the circle vector.
Returns:
The size of the circle vector.

indexRectangle

public int indexRectangle()
This method returns the size of the rectangle vector.
Returns:
The size of the rectangle vector.

indexPolygon

public int indexPolygon()
This method returns the size of the polygon vector.
Returns:
The size of the polygon vector.