org.ka2ddo.yaac.gui.filter
Class LastDigipeatFilterUI

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.ka2ddo.yaac.gui.filter.LastDigipeatFilterUI
All Implemented Interfaces:
java.io.Closeable, java.io.Serializable, javax.swing.table.TableModel, DigipeatListener, FilterChangeListener, SaveableFilter

public class LastDigipeatFilterUI
extends javax.swing.table.AbstractTableModel
implements DigipeatListener, SaveableFilter, java.io.Closeable, FilterChangeListener

This filter accepts or rejects messages based on the last station to transmit the message.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
LastDigipeatFilterUI(Filter myFilter)
          Create a UI for controlling a LastDigipeatFilter
 
Method Summary
 void close()
          Closes this stream and releases any system resources associated with it.
 void digipeaterAdded(java.lang.String digipeat, int index)
           
 void digipeaterUsedAgain(java.lang.String digipeat)
           
 void filterSettingsChanged(Filter changedFilter, boolean changedByUser)
          Called when the specified Filter's matching criteria have been changed.
 java.lang.Class<?> getColumnClass(int columnIndex)
          Returns the data Class for the specified column.
 int getColumnCount()
          Returns the number of columns in the model.
 java.lang.String getColumnName(int column)
          Returns the localized name for the column.
 javax.swing.filechooser.FileNameExtensionFilter getPreferredFileType()
          Specify the preferred filetype for files saving this Filter's data set.
 int getRowCount()
          Returns the number of rows in the model.
 java.lang.Object getValueAt(int rowIndex, int columnIndex)
          Returns the value for the cell at columnIndex and rowIndex.
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isSaveable()
          Indicate if this Filter is saveable.
 void saveFilterToFile(java.io.BufferedOutputStream out)
          Save the contents of the Filter to the specified DataOutput object.
 void setValueAt(java.lang.Object aValue, int rowIndex, int columnIndex)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastDigipeatFilterUI

public LastDigipeatFilterUI(Filter myFilter)
Create a UI for controlling a LastDigipeatFilter

Parameters:
myFilter - the LastDigipeatFilter instance to control
See Also:
LastDigipeatFilter
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in the model.

Specified by:
getColumnCount in interface javax.swing.table.TableModel
Returns:
the number of columns in the model
See Also:
getRowCount()

getRowCount

public int getRowCount()
Returns the number of rows in the model.

Specified by:
getRowCount in interface javax.swing.table.TableModel
Returns:
the number of rows in the model
See Also:
getColumnCount()

getValueAt

public java.lang.Object getValueAt(int rowIndex,
                                   int columnIndex)
Returns the value for the cell at columnIndex and rowIndex.

Specified by:
getValueAt in interface javax.swing.table.TableModel
Parameters:
rowIndex - the row whose value is to be queried
columnIndex - the column whose value is to be queried
Returns:
the value Object at the specified cell

getColumnClass

public java.lang.Class<?> getColumnClass(int columnIndex)
Returns the data Class for the specified column.

Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel
Parameters:
columnIndex - the column being queried
Returns:
the Class object for the column's data

getColumnName

public java.lang.String getColumnName(int column)
Returns the localized name for the column.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - the column being queried
Returns:
a string containing the name of column

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

digipeaterAdded

public void digipeaterAdded(java.lang.String digipeat,
                            int index)
Specified by:
digipeaterAdded in interface DigipeatListener

digipeaterUsedAgain

public void digipeaterUsedAgain(java.lang.String digipeat)
Specified by:
digipeaterUsedAgain in interface DigipeatListener

isSaveable

public boolean isSaveable()
Indicate if this Filter is saveable. Meant for use by combining filters whose sub-Filters may not all be savable.

Specified by:
isSaveable in interface SaveableFilter
Returns:
boolean true if the current Filter can be saved

getPreferredFileType

public javax.swing.filechooser.FileNameExtensionFilter getPreferredFileType()
Specify the preferred filetype for files saving this Filter's data set.

Specified by:
getPreferredFileType in interface SaveableFilter
Returns:
FileNameExtensionFilter that will be used in the saving JFileChooser

saveFilterToFile

public void saveFilterToFile(java.io.BufferedOutputStream out)
                      throws java.io.IOException
Save the contents of the Filter to the specified DataOutput object.

Specified by:
saveFilterToFile in interface SaveableFilter
Parameters:
out - DataOutput implementing object for writing the file contents in its preferred format
Throws:
java.io.IOException - if the write failed for some reason

close

public void close()
           throws java.io.IOException
Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect.

Specified by:
close in interface java.io.Closeable
Throws:
java.io.IOException - if an I/O error occurs

filterSettingsChanged

public void filterSettingsChanged(Filter changedFilter,
                                  boolean changedByUser)
Called when the specified Filter's matching criteria have been changed.

Specified by:
filterSettingsChanged in interface FilterChangeListener
Parameters:
changedFilter - Filter that has changed
changedByUser - boolean true if change was manually made by user, false if change was made automatically by dynamic filter logic