public class CatalogTexture extends java.lang.Object implements TextureImage, CatalogItem, java.lang.Comparable<CatalogTexture>
Constructor and Description |
---|
CatalogTexture(java.lang.String name,
Content image,
float width,
float height)
Creates an unmodifiable catalog texture.
|
CatalogTexture(java.lang.String name,
Content image,
float width,
float height,
boolean modifiable)
Creates a catalog texture.
|
CatalogTexture(java.lang.String id,
java.lang.String name,
Content image,
float width,
float height,
java.lang.String creator)
Creates a catalog texture.
|
CatalogTexture(java.lang.String id,
java.lang.String name,
Content image,
float width,
float height,
java.lang.String creator,
boolean modifiable)
Creates a catalog texture.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(CatalogTexture texture)
Compares the names of this texture and the one in parameter.
|
boolean |
equals(java.lang.Object obj)
Returns true if this texture and the one in parameter are the same objects.
|
TexturesCategory |
getCategory()
Returns the category of this texture.
|
java.lang.String |
getCreator()
Returns the creator of this texture or
null . |
float |
getHeight()
Returns the height of the image in centimeters.
|
Content |
getIcon()
Returns the icon of this texture.
|
java.lang.String |
getId()
Returns the ID of this texture or
null . |
Content |
getImage()
Returns the content of the image used for this texture.
|
java.lang.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). |
boolean |
matchesFilter(java.lang.String filter)
Returns
true if this texture matches the given filter text. |
public CatalogTexture(java.lang.String name, Content image, float width, float height)
name
- the name of this textureimage
- the content of the image used for this texturewidth
- the width of the texture in centimetersheight
- the height of the texture in centimeterspublic CatalogTexture(java.lang.String id, java.lang.String name, Content image, float width, float height, java.lang.String creator)
id
- the id of the texturename
- the name of this textureimage
- the content of the image used for this texturewidth
- the width of the texture in centimetersheight
- the height of the texture in centimeterscreator
- the creator of this texturepublic CatalogTexture(java.lang.String name, Content image, float width, float height, boolean modifiable)
name
- the name of this textureimage
- the content of the image used for this texturewidth
- the width of the texture in centimetersheight
- the height of the texture in centimetersmodifiable
- true
if this texture can be modifiedpublic CatalogTexture(java.lang.String id, java.lang.String name, Content image, float width, float height, java.lang.String creator, boolean modifiable)
id
- the ID of this texturename
- the name of this textureimage
- the content of the image used for this texturewidth
- the width of the texture in centimetersheight
- the height of the texture in centimetersmodifiable
- true
if this texture can be modifiedpublic java.lang.String getId()
null
.public java.lang.String getName()
getName
in interface CatalogItem
getName
in interface TextureImage
public Content getImage()
getImage
in interface TextureImage
public Content getIcon()
getIcon
in interface CatalogItem
public float getWidth()
getWidth
in interface TextureImage
public float getHeight()
getHeight
in interface TextureImage
public java.lang.String getCreator()
null
.getCreator
in interface CatalogItem
getCreator
in interface TextureImage
public boolean isModifiable()
true
if this texture is modifiable (not read from resources).public TexturesCategory getCategory()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int compareTo(CatalogTexture texture)
compareTo
in interface java.lang.Comparable<CatalogTexture>
public boolean matchesFilter(java.lang.String filter)
true
if this texture matches the given filter
text.
Each substring of the filter
is considered as a search criterion that can match
the name, the category name or the creator of this texture.
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License