MovieLibrary
Class MergeTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by MovieLibrary.MergeTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class MergeTableModel
extends javax.swing.table.AbstractTableModel

table model for the merge avi tool

Author:
Alex Della-Croce
See Also:
Serialized Form

Constructor Summary
MergeTableModel()
          constructor for table model.
calls super() and initializes the data array
 
Method Summary
 void addValue(java.lang.String value)
          adds a video to this table if it does not already exists
 int getColumnCount()
          gets the number of columns
 java.lang.String getColumnName(int col)
          gets the column name of the chosen column
 int[] getColumnWidths()
          gets the columns widths for the columns in this table
 int getRowCount()
          gets the number of rows
 java.lang.Object getValueAt(int row, int col)
          gets the value of the object in the table model at position specified
 java.lang.String getVideoPath(int row)
          gets the video path of the video on row selected
 java.lang.String[] getVideosPaths()
          gets the paths of the videos in this table model
 void moveSelectedDown(int selectedIndex)
          moves the value of the selected row down in the table
 void moveSelectedUp(int selectedIndex)
          moves the value of the selected row up in the table
 void removeAll()
          remove all values from table mdoel
 void removeValue(int index)
          remove value at selected index
 void setColumnsWidths(int[] reqColumnsWidths)
          sets the column widths of this table model to the given column widths
 void setColumnWidth(int columnIndex, int columnWidth)
          sets the columns widths for the given column
 void setData(java.lang.Object[][] reqData)
          sets the data in this table model with the given data array
 void setValueAt(java.lang.Object value, int row, int col)
          sets the value of the object in the table at position specified
 void updateValue(VideoObject value, int row)
          replace value at given row with given value
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeTableModel

public MergeTableModel()
constructor for table model.
calls super() and initializes the data array

Method Detail

getColumnCount

public int getColumnCount()
gets the number of columns


getRowCount

public int getRowCount()
gets the number of rows


getColumnName

public java.lang.String getColumnName(int col)
gets the column name of the chosen column

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
gets the value of the object in the table model at position specified


setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
sets the value of the object in the table at position specified

Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getVideoPath

public java.lang.String getVideoPath(int row)
gets the video path of the video on row selected

Parameters:
row - row of the video to get the path
Returns:
the video path of the video on the selected row

moveSelectedUp

public void moveSelectedUp(int selectedIndex)
moves the value of the selected row up in the table

Parameters:
selectedIndex - index of the selected row

moveSelectedDown

public void moveSelectedDown(int selectedIndex)
moves the value of the selected row down in the table

Parameters:
selectedIndex - index of the selected row

removeValue

public void removeValue(int index)
remove value at selected index

Parameters:
index - index of value to be removed

getVideosPaths

public java.lang.String[] getVideosPaths()
gets the paths of the videos in this table model

Returns:
a string array of video paths of the videos in this table model

addValue

public void addValue(java.lang.String value)
adds a video to this table if it does not already exists

Parameters:
value - video file to be added

updateValue

public void updateValue(VideoObject value,
                        int row)
replace value at given row with given value

Parameters:
value - new value to replace the old value at given row
row - row where the value to be replaced is located

removeAll

public void removeAll()
remove all values from table mdoel


getColumnWidths

public int[] getColumnWidths()
gets the columns widths for the columns in this table

Returns:
array of column widths

setColumnsWidths

public void setColumnsWidths(int[] reqColumnsWidths)
sets the column widths of this table model to the given column widths

Parameters:
reqColumnsWidths - column widths to replace the old ones

setData

public void setData(java.lang.Object[][] reqData)
sets the data in this table model with the given data array

Parameters:
reqData - array of data to replace the old data

setColumnWidth

public void setColumnWidth(int columnIndex,
                           int columnWidth)
sets the columns widths for the given column

Parameters:
columnIndex - column index of the column to resize
columnWidth - new width of the column to be resized