Class Level

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--Level
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class Level
extends javax.swing.table.AbstractTableModel

The Level class is a tool used by the user to create custom levels for use in the game.

See Also:
Serialized Form

Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
Level()
          Constructor - initializes the Square[][] board.
 
Method Summary
 int getColumnCount()
          Used by the JTable display to determine the number of columns.
 java.lang.String getLevelName()
          Returns the level name.
 int getRowCount()
          Returns the number of rows in the map.
 java.lang.Object getValueAt(int row, int column)
          Returns the Square located at the row and column passed.
 void setLevelName(java.lang.String name)
          Sets the level name to the parameter passed.
 void setValueAt(Square obj, int row, int col)
          Changes the properties of the input square to whatever object is being assigned to it.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Level

public Level()
Constructor - initializes the Square[][] board.
Method Detail

getLevelName

public java.lang.String getLevelName()
Returns the level name.

setLevelName

public void setLevelName(java.lang.String name)
Sets the level name to the parameter passed.
Parameters:
name - the new name of the level

setValueAt

public void setValueAt(Square obj,
                       int row,
                       int col)
Changes the properties of the input square to whatever object is being assigned to it.
Parameters:
obj - The object being assigned to the square
row - The row position of the object
col - The col position of the object

getRowCount

public int getRowCount()
Returns the number of rows in the map.
Overrides:
getRowCount in class javax.swing.table.AbstractTableModel
Returns:
Returns the number of rows in the map.

getColumnCount

public int getColumnCount()
Used by the JTable display to determine the number of columns. Returns zero because the columns are added manually.
Overrides:
getColumnCount in class javax.swing.table.AbstractTableModel
Returns:
Returns zero.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Returns the Square located at the row and column passed.
Overrides:
getValueAt in class javax.swing.table.AbstractTableModel
Parameters:
row - the row location of the requested square.
column - the column location of the requested square.
Returns:
the Square located at row and column in board[][]