|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
MovieLibrary.MyTableModel
public class MyTableModel
Custom table model used as main media library table model
| Constructor Summary | |
|---|---|
MyTableModel()
Constructor calls super() and initializes the data array |
|
| Method Summary | |
|---|---|
void |
addValue(VideoObject value)
add given value to the data in the table model |
int |
getColumnCount()
gets the number of columns |
java.lang.String |
getColumnName(int col)
gets column name of given column |
boolean[] |
getColumnsShown()
get the columns shown of this table model |
int[] |
getColumnWidths()
gets the column widths of this table model |
java.lang.Object[][] |
getData()
gets the data from the data model |
int[] |
getDefaultColumnWidths()
gets the default colum widths of the table model |
int |
getRowCount()
gets the number of rows |
boolean[] |
getValidLinks()
get array of link validity for videos in this table model |
java.lang.Object |
getValueAt(int row,
int col)
get value of data in the model at give position |
int |
getVideoID(int row)
get video ID of video on given row |
java.lang.String |
getVideoPath(int row)
gets video path of video on row given |
void |
removeAll()
remove all videos from table model |
void |
setColumnShown(int columnIndex,
boolean columnIsShown)
sets given column shown/hidden |
void |
setColumnsShown(boolean[] reqColumnsShown)
sets the columns shown values to the new values |
void |
setColumnsWidths(int[] reqColumnsWidths)
sets column widths of this table with new given values |
void |
setColumnWidth(int columnIndex,
int columnWidth)
sets column width of given column with given width |
void |
setData(java.lang.Object[][] reqData)
sets the data of the data model |
void |
setRows(int rownumber)
sets the number of rows in the table model |
void |
setValidLinks(boolean[] reqValidLinks)
sets the links validity of the videos in the table model |
void |
setValidLinks(int index,
boolean validity)
set link at given row with validity given (true=link valid) |
void |
setValueAt(java.lang.Object value,
int row,
int col)
sets value of data in the model at given position |
void |
updateValue(VideoObject value,
int row)
update value on 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 |
|---|
public MyTableModel()
| Method Detail |
|---|
public int getColumnCount()
public int getRowCount()
public java.lang.String getColumnName(int col)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModel
public java.lang.Object getValueAt(int row,
int col)
public void setValueAt(java.lang.Object value,
int row,
int col)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelpublic java.lang.String getVideoPath(int row)
row - given row where the video path we want is located
public int getVideoID(int row)
row - row where the video we want the ID from is located
public void addValue(VideoObject value)
value - value to be added to this table model
public void updateValue(VideoObject value,
int row)
value - new value to replace old value on given rowrow - row where old value is to be replaced with new valuepublic void removeAll()
public boolean[] getValidLinks()
public void setValidLinks(int index,
boolean validity)
index - row on which the link validity value is to be updatedvalidity - value of link validity to be updated topublic int[] getColumnWidths()
public boolean[] getColumnsShown()
public void setColumnsShown(boolean[] reqColumnsShown)
reqColumnsShown - new values for columns show to replace old onespublic void setColumnsWidths(int[] reqColumnsWidths)
reqColumnsWidths - new values given to replace the old column widths
public void setColumnWidth(int columnIndex,
int columnWidth)
columnIndex - column index of column to resizecolumnWidth - new width to replace the old width of given columnpublic java.lang.Object[][] getData()
public void setData(java.lang.Object[][] reqData)
reqData - new data to replace data in the data modelpublic void setValidLinks(boolean[] reqValidLinks)
reqValidLinks - links validity values
public void setColumnShown(int columnIndex,
boolean columnIsShown)
columnIndex - column to hide/showcolumnIsShown - columnvisibility value, shown/hiddenpublic int[] getDefaultColumnWidths()
public void setRows(int rownumber)
rownumber - new number of rows in table model
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||