com.dbarnes.sgme
Class TileImageFile

java.lang.Object
  extended by com.dbarnes.sgme.TileImageFile

public class TileImageFile
extends java.lang.Object

Represents an image file which can be used for a single TileImage object or broken up into multiple TileImage objects.

See Also:
TileImage

Constructor Summary
TileImageFile(Project project)
          Creates a TileImageFile object.
 
Method Summary
protected  java.util.Collection<TileImage> createTileImages()
          Creates a set of one or more TileImage objects from this TileImageFile.
 java.io.File getFile()
          Returns the File object for this TileImageFile.
 int getFirstTileImageId()
          Returns the first TileImage identitier to be associated with this TileImageFile.
 java.awt.image.BufferedImage getImage()
          Returns the Image object for this TileImageFile.
 int getNumberOfTiles()
          Returns the number of tile images contained in the TileImageFile.
protected  Project getProject()
          Returns the project to which this TileImageFile belongs.
 void setFile(java.io.File file)
          Sets the File object for this TileImageFile, and loads the corresponding Image object.
 void setFirstTileImageId(int firstTileImageId)
          Sets the first TileImage identitier to be associated with this TileImageFile.
 void setImage(java.awt.image.BufferedImage image)
          Sets the Image object for this TileImageFile.
protected  void setProject(Project project)
          Sets the project to which this TileImageFile belongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TileImageFile

public TileImageFile(Project project)
Creates a TileImageFile object.

Parameters:
project - The project which this TileImageFile belongs to.
Method Detail

createTileImages

protected java.util.Collection<TileImage> createTileImages()
Creates a set of one or more TileImage objects from this TileImageFile. The image for this TileImageFile is broken up based on the tileWidth and tileHeight attributes of the project. The tiles are automatically assigned identifiers, starting from the highest numbered TileImage identifier plus one.

Returns:
A Vector of TileImage objects.

getNumberOfTiles

public int getNumberOfTiles()
Returns the number of tile images contained in the TileImageFile.


getFile

public java.io.File getFile()
Returns the File object for this TileImageFile.


setFile

public void setFile(java.io.File file)
             throws java.io.IOException
Sets the File object for this TileImageFile, and loads the corresponding Image object.

Throws:
java.io.IOException

getFirstTileImageId

public int getFirstTileImageId()
Returns the first TileImage identitier to be associated with this TileImageFile.


setFirstTileImageId

public void setFirstTileImageId(int firstTileImageId)
Sets the first TileImage identitier to be associated with this TileImageFile.


getImage

public java.awt.image.BufferedImage getImage()
Returns the Image object for this TileImageFile.


setImage

public void setImage(java.awt.image.BufferedImage image)
Sets the Image object for this TileImageFile.


getProject

protected Project getProject()
Returns the project to which this TileImageFile belongs.


setProject

protected void setProject(Project project)
Sets the project to which this TileImageFile belongs.



Copyright 2006-2009 Don Barnes. All Rights Reserved.