FTP-Server API

graphic.services
Class JQTableData

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--graphic.services.JQTableData
All Implemented Interfaces:
Serializable, TableModel

public class JQTableData
extends AbstractTableModel
implements Serializable

This is JQTables Data core.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JQTableData(String[] names)
          Set-constructor
 
Method Summary
 boolean add(int place, Object[] obj)
          Adds a post to the table at a certain position 0=in front
 boolean add(Object[] obj)
          Adds a post to the table
 int getColumnCount()
          The number of columns.
 String getColumnName(int col)
          Gets columnname
 Object getRow(int row)
          Gets a row in the table
 int getRowCount()
          Number of rows.
protected  int[] getSize()
           
 int getSize(int i)
          The size of a column
 Object getValueAt(int row, int col)
           
 int getVisibleColumnCount()
          Number of visible columns
 boolean isColumnVisible(int column)
          The method only hides the data, it does NOT delete the data from the model.
 void remove(int i)
          Removes a row in the table
 boolean replace(int place, Object[] obj)
          Replaces a row in the table.
 void reset()
          Resets the contens of the table.
 void setSize(int[] i)
          Sets the size of all columns in the table.
protected  void setVisibleColumn(int column, boolean visible)
           
protected  void sortByColumnNr(int columnNr, boolean ascending, JQTableSortMethod ts)
          Sorts all the rows in the dataset after a column ascending or descending.
 void update()
          Updates the table graphically.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JQTableData

public JQTableData(String[] names)
Set-constructor

Parameters:
names - ColumnNames
Method Detail

setSize

public void setSize(int[] i)
Sets the size of all columns in the table.

Parameters:
i - int[0] is the size of column nr. 0.. and so on.

getSize

protected int[] getSize()

setVisibleColumn

protected void setVisibleColumn(int column,
                                boolean visible)

isColumnVisible

public boolean isColumnVisible(int column)
The method only hides the data, it does NOT delete the data from the model.

Parameters:
column - columnnr
Returns:
true/false

getSize

public int getSize(int i)
The size of a column

Parameters:
i - columnr
Returns:
the width

getColumnName

public String getColumnName(int col)
Gets columnname

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
Parameters:
col - columnnr
Returns:
The name of the column

replace

public boolean replace(int place,
                       Object[] obj)
Replaces a row in the table. Starts at 0.

Parameters:
place - The post to replace
obj - The new post.
Returns:
Wether it went well

add

public boolean add(int place,
                   Object[] obj)
Adds a post to the table at a certain position 0=in front

Parameters:
place - the position
obj - the post to insert
Returns:
Wether it went well.

add

public boolean add(Object[] obj)
Adds a post to the table

Parameters:
obj - the post to insert
Returns:
Wether it went well

getColumnCount

public int getColumnCount()
The number of columns.

Specified by:
getColumnCount in interface TableModel
Returns:
column count.

getVisibleColumnCount

public int getVisibleColumnCount()
Number of visible columns

Returns:
visible column count

getRowCount

public int getRowCount()
Number of rows.

Specified by:
getRowCount in interface TableModel
Returns:
row count

getValueAt

public Object getValueAt(int row,
                         int col)
Specified by:
getValueAt in interface TableModel

getRow

public Object getRow(int row)
Gets a row in the table

Parameters:
row - posten der ønskes hentet
Returns:
posten der blev hentet

reset

public void reset()
Resets the contens of the table. All data will be lost!


remove

public void remove(int i)
Removes a row in the table

Parameters:
i - row number

update

public void update()
Updates the table graphically.


sortByColumnNr

protected void sortByColumnNr(int columnNr,
                              boolean ascending,
                              JQTableSortMethod ts)
Sorts all the rows in the dataset after a column ascending or descending.

Parameters:
columnNr - column number
ascending - true=ascending, false=descending.
ts - How to sort the columns

FTP-Server API