sk.stuba.fiit.foo07.genex.gui
Class NewTestTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by sk.stuba.fiit.foo07.genex.gui.NewTestTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class NewTestTableModel
extends javax.swing.table.DefaultTableModel

Author:
_mizu_
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
NewTestTableModel(java.sql.Connection c)
           
NewTestTableModel(java.sql.Connection c, Test test)
           
 
Method Summary
 void addQuestion(Question toAdd, java.lang.Float points)
           
 void addQuestions(java.util.ArrayList<Question> toAdd, java.util.ArrayList<java.lang.Float> points)
           
 float getAverageDiff()
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 java.util.ArrayList<java.lang.Float> getPoints()
           
 float getPointsSum()
           
 Question getQuestion(int index)
           
 int getQuestionCount()
           
 java.util.ArrayList<Question> getQuestions()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
 void initColumnNames()
           
 boolean isCellEditable(int row, int col)
           
 void moveDown(int index)
           
 void moveUp(int index)
           
 void removeQuestions(int[] indices)
           
 void reorder()
           
 void setQuestion(Question toSet, int index)
           
 void setQuestions(java.util.ArrayList<Question> questions, java.util.ArrayList<java.lang.Float> points)
           
 void setValueAt(java.lang.Object val, int row, int col)
           
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NewTestTableModel

public NewTestTableModel(java.sql.Connection c)

NewTestTableModel

public NewTestTableModel(java.sql.Connection c,
                         Test test)
                  throws java.sql.SQLException
Throws:
java.sql.SQLException
Method Detail

setQuestions

public void setQuestions(java.util.ArrayList<Question> questions,
                         java.util.ArrayList<java.lang.Float> points)
                  throws java.lang.Exception
Throws:
java.lang.Exception

addQuestion

public void addQuestion(Question toAdd,
                        java.lang.Float points)

addQuestions

public void addQuestions(java.util.ArrayList<Question> toAdd,
                         java.util.ArrayList<java.lang.Float> points)
                  throws java.lang.Exception
Throws:
java.lang.Exception

removeQuestions

public void removeQuestions(int[] indices)

setQuestion

public void setQuestion(Question toSet,
                        int index)

getQuestion

public Question getQuestion(int index)

reorder

public void reorder()

moveUp

public void moveUp(int index)

moveDown

public void moveDown(int index)

initColumnNames

public void initColumnNames()

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel
Overrides:
getColumnCount in class javax.swing.table.DefaultTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel
Overrides:
getRowCount in class javax.swing.table.DefaultTableModel

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.DefaultTableModel

setValueAt

public void setValueAt(java.lang.Object val,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.DefaultTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel
Overrides:
getValueAt in class javax.swing.table.DefaultTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.DefaultTableModel

getQuestionCount

public int getQuestionCount()

getPointsSum

public float getPointsSum()

getAverageDiff

public float getAverageDiff()

getQuestions

public java.util.ArrayList<Question> getQuestions()

getPoints

public java.util.ArrayList<java.lang.Float> getPoints()


Copyright © 2008 Faculty of Informatics and Information Technologies, STU Bratislava. All Rights Reserved.