Sweet Home 3D 4.1

com.eteks.sweethome3d.model
Class CatalogTexture

java.lang.Object
  extended by com.eteks.sweethome3d.model.CatalogTexture
All Implemented Interfaces:
TextureImage, Serializable, Comparable<CatalogTexture>

public class CatalogTexture
extends Object
implements TextureImage, Comparable<CatalogTexture>

A texture in textures catalog.

Author:
Emmanuel Puybaret
See Also:
Serialized Form

Constructor Summary
CatalogTexture(String name, Content image, float width, float height)
          Creates an unmodifiable catalog texture.
CatalogTexture(String name, Content image, float width, float height, boolean modifiable)
          Creates a catalog texture.
CatalogTexture(String id, String name, Content image, float width, float height, String creator)
          Creates a catalog texture.
CatalogTexture(String id, String name, Content image, float width, float height, String creator, boolean modifiable)
           
 
Method Summary
 int compareTo(CatalogTexture texture)
          Compares the names of this texture and the one in parameter.
 boolean equals(Object obj)
          Returns true if this texture and the one in parameter are the same objects.
 TexturesCategory getCategory()
          Returns the category of this texture.
 String getCreator()
          Returns the creator of this texture or null.
 float getHeight()
          Returns the height of the image in centimeters.
 String getId()
          Returns the ID of this texture or null.
 Content getImage()
          Returns the content of the image used for this texture.
 String getName()
          Returns the name of this texture.
 float getWidth()
          Returns the width of the image in centimeters.
 int hashCode()
          Returns default hash code.
 boolean isModifiable()
          Returns true if this texture is modifiable (not read from resources).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CatalogTexture

public CatalogTexture(String name,
                      Content image,
                      float width,
                      float height)
Creates an unmodifiable catalog texture.

Parameters:
name - the name of this texture
image - the content of the image used for this texture
width - the width of the texture in centimeters
height - the height of the texture in centimeters

CatalogTexture

public CatalogTexture(String id,
                      String name,
                      Content image,
                      float width,
                      float height,
                      String creator)
Creates a catalog texture.

Parameters:
id - the id of the texture
name - the name of this texture
image - the content of the image used for this texture
width - the width of the texture in centimeters
height - the height of the texture in centimeters
creator - the creator of this texture

CatalogTexture

public CatalogTexture(String name,
                      Content image,
                      float width,
                      float height,
                      boolean modifiable)
Creates a catalog texture.

Parameters:
name - the name of this texture
image - the content of the image used for this texture
width - the width of the texture in centimeters
height - the height of the texture in centimeters
modifiable - true if this texture can be modified

CatalogTexture

public CatalogTexture(String id,
                      String name,
                      Content image,
                      float width,
                      float height,
                      String creator,
                      boolean modifiable)
Method Detail

getId

public String getId()
Returns the ID of this texture or null.

Since:
2.3

getName

public String getName()
Returns the name of this texture.

Specified by:
getName in interface TextureImage

getImage

public Content getImage()
Returns the content of the image used for this texture.

Specified by:
getImage in interface TextureImage

getWidth

public float getWidth()
Returns the width of the image in centimeters.

Specified by:
getWidth in interface TextureImage

getHeight

public float getHeight()
Returns the height of the image in centimeters.

Specified by:
getHeight in interface TextureImage

getCreator

public String getCreator()
Returns the creator of this texture or null.

Since:
2.3

isModifiable

public boolean isModifiable()
Returns true if this texture is modifiable (not read from resources).


getCategory

public TexturesCategory getCategory()
Returns the category of this texture.


equals

public boolean equals(Object obj)
Returns true if this texture and the one in parameter are the same objects. Note that, from version 3.6, two textures can have the same name.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns default hash code.

Overrides:
hashCode in class Object

compareTo

public int compareTo(CatalogTexture texture)
Compares the names of this texture and the one in parameter.

Specified by:
compareTo in interface Comparable<CatalogTexture>

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License