|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.dbarnes.sgme.Project
public class Project
Represents a single project.
| Field Summary | |
|---|---|
static java.lang.String |
PROJECT_FILE_EXTENSION
|
| Constructor Summary | |
|---|---|
Project()
Creates and initializes this Project object. |
|
| Method Summary | |
|---|---|
void |
addMap(Map map)
Adds the specified map to the project. |
void |
addTile(Tile tile)
Adds the specified tile to the project. |
void |
addTileImage(TileImage tileImage)
Adds the specified tile image to the project. |
java.util.Collection<TileImage> |
addTileImageFile(TileImageFile tileImageFile)
Adds the specified tile image file to the project, and creates and adds to the project the corresponding tile images. |
void |
addWidget(Widget widget)
Adds the specified widget to the project. |
void |
clearAttributes()
Clears the list of custom attributes. |
void |
clearTiles()
Clears the list of tiles. |
java.util.Collection<Tile> |
createDefaultTiles(java.util.Collection<TileImage> tileImages)
Given the specified collection of TileImage objects, creates a set of default Tile objects. |
java.lang.String |
getAttribute(java.lang.String key)
Returns a custom attribute. |
java.util.Iterator<java.lang.String> |
getAttributeNames()
Returns an iterator containing the names of all the custom attributes. |
java.io.File |
getFile()
Returns a File object representing the main project file. |
int |
getLastMapId()
Returns the highest numbered identifier for a Map object in this project. |
int |
getLastTileId()
Returns the highest numbered identifier for a Tile object in this project. |
protected int |
getLastTileImageId()
Returns the highest numbered identifier for a TileImage object in this project. |
int |
getLastWidgetId()
Returns the highest numbered identifier for a Widget object in this project. |
java.util.Iterator<Map> |
getMaps()
Returns an Iterator containing all the Map objects in this project. |
java.lang.String |
getRelativePath(java.io.File file)
Attempts to resolve the path to the specified file, relative to the main project file. |
Tile |
getTileById(int id)
Returns the Tile object with the specified identifier, or null if no such Tile object exists. |
int |
getTileCount()
Returns a count of all the Tile objects in this project. |
int |
getTileHeight()
Returns the tile height for this project. |
TileImage |
getTileImageById(int id)
Returns the TileImage object with the specified identifier, or null if no such TileImage object exists. |
java.util.Iterator<TileImageFile> |
getTileImageFiles()
Returns a Collection containing all the TileImageFile objects in this project. |
java.util.Iterator<TileImage> |
getTileImages()
Returns a Collection containing all the TileImage objects in this project. |
java.util.Iterator<Tile> |
getTiles()
Returns an Iterator containing all the Tile objects in this project. |
int |
getTileWidth()
Returns the tile width for this project. |
Widget |
getWidgetById(int id)
Returns the Widget object with the specified identifier, or null if no such Widget object exists. |
int |
getWidgetCount()
Returns a count of all the Widget objects in this project. |
java.util.Iterator<Widget> |
getWidgets()
Returns an Iterator containing all the Widget objects in this project. |
boolean |
isNeedsSave()
Returns whether a save of the project is needed. |
void |
load()
Loads this project from a project file. |
void |
removeMap(Map map)
Removes the specified map from the project. |
void |
removeWidget(int id)
Removes the specified widget from the project, and removes any associated MapWidget objects from all maps in the project. |
void |
save()
Saves this project as a project file. |
void |
setAttribute(java.lang.String key,
java.lang.String value)
Sets a custom attribute. |
void |
setFile(java.io.File file)
Sets the File object representing the main project file. |
void |
setNeedsSave(boolean needsSave)
Sets whether a save of the project is needed. |
void |
setTileHeight(int tileHeight)
Sets the tile height for this project. |
void |
setTileWidth(int tileWidth)
Sets the tile width for this project. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROJECT_FILE_EXTENSION
| Constructor Detail |
|---|
public Project()
| Method Detail |
|---|
public java.util.Collection<TileImage> addTileImageFile(TileImageFile tileImageFile)
tileImageFile - Tile image file to add to this project
public void addTileImage(TileImage tileImage)
tileImage - Tile image to add to this projectpublic java.util.Collection<Tile> createDefaultTiles(java.util.Collection<TileImage> tileImages)
tileImages - Collection of TileImage objects.public void addTile(Tile tile)
tile - Tile to add to this projectpublic void addWidget(Widget widget)
widget - Widget to add to this projectpublic void addMap(Map map)
map - Map to add to this projectpublic void removeWidget(int id)
id - ID of the widget to remove from this projectpublic void removeMap(Map map)
public void save()
throws java.io.IOException
java.io.IOException
public void load()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprotected int getLastTileImageId()
public int getLastTileId()
public int getLastMapId()
public int getLastWidgetId()
public int getTileWidth()
public void setTileWidth(int tileWidth)
public int getTileHeight()
public void setTileHeight(int tileHeight)
public java.util.Iterator<TileImage> getTileImages()
public TileImage getTileImageById(int id)
public java.util.Iterator<TileImageFile> getTileImageFiles()
public java.util.Iterator<Tile> getTiles()
public int getTileCount()
public Tile getTileById(int id)
public Widget getWidgetById(int id)
public boolean isNeedsSave()
public void setNeedsSave(boolean needsSave)
public java.io.File getFile()
public void setFile(java.io.File file)
public java.util.Iterator<Map> getMaps()
public java.util.Iterator<Widget> getWidgets()
public int getWidgetCount()
public java.lang.String getRelativePath(java.io.File file)
public void clearTiles()
public void clearAttributes()
public void setAttribute(java.lang.String key,
java.lang.String value)
public java.lang.String getAttribute(java.lang.String key)
public java.util.Iterator<java.lang.String> getAttributeNames()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||