com.tensegrity.graphics
Class Texture

java.lang.Object
  extended bycom.tensegrity.graphics.Texture

public class Texture
extends java.lang.Object

The Texture class represents an image that can be used with a PaintFormat to fill areas.

At the actual state of the graphics API the Texture class supports only custom images. In future it will also provide some default images.

Version:
$Id: Texture.java,v 1.6 2004/07/14 10:12:02 AndreasEbbert Exp $
Author:
MichaelKegel

Field Summary
static int CUSTOM
          constant that tells about a type of texture the Texture class supports
static int UNDEFINED
          constant that tells about a type of texture the Texture class supports
 
Constructor Summary
Texture(Raster raster)
          Constructor that creates a Texture that makes use of the Raster given by raster.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int get(int x, int y)
          Returns the value of the textures raster at the position given by x and y.
 int getHeight()
          Returns the height Raster instance the Texture makes use of.
 int getType()
          Returns the type of the texture.
 int getWidth()
          Returns the width Raster instance the Texture makes use of.
 boolean hasAlpha()
          Returns a boolean that indicates weather this texture uses alpha values or not.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUSTOM

public static final int CUSTOM
constant that tells about a type of texture the Texture class supports

See Also:
Constant Field Values

UNDEFINED

public static final int UNDEFINED
constant that tells about a type of texture the Texture class supports

See Also:
Constant Field Values
Constructor Detail

Texture

public Texture(Raster raster)
Constructor that creates a Texture that makes use of the Raster given by raster.

Parameters:
raster - the Raster instance the Texture should use
Method Detail

getType

public int getType()
Returns the type of the texture.

Returns:
int the texture type

getWidth

public int getWidth()
Returns the width Raster instance the Texture makes use of.

Returns:
int the width of the Raster

getHeight

public int getHeight()
Returns the height Raster instance the Texture makes use of.

Returns:
int the height of the Raster

get

public int get(int x,
               int y)
Returns the value of the textures raster at the position given by x and y.

Parameters:
x - component of the position to return the value for
y - component of the position to return the value for
Returns:
int the value at the given position

hasAlpha

public boolean hasAlpha()
Returns a boolean that indicates weather this texture uses alpha values or not.

Returns:
boolean flag that indicates the usage of alpha values

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.