com.sciapp.filter
Class DateVisualFilter

java.lang.Object
  extended by com.sciapp.filter.VisualFilter
      extended by com.sciapp.filter.DateVisualFilter

public class DateVisualFilter
extends VisualFilter

A VisualFilter for Date values. A textfield is used to show the date pattern. If the textfield is clicked with the mouse, a dialog is invoked, through which the date pattern can be selected.


Field Summary
protected  JDateChooser dateChooser
          the datechooser that is contained in the dialog
protected  DateFilter dateFilter
          a date filter object used to filter Date values.
protected  Date dateShown
          the selected date
protected  DateFormat df
          the dateformat instance that is used to format the current date shown on the textfield.
protected  JDialog dialog
          the dialog that is invoked for inputting the date pattern
protected  JTextField expression
          a textfield used to show and input the date pattern.
protected  JComboBox fieldBoxOptions
          a combobox containing the filter options.
protected  JLabel filterLabel
          the label between the filter options combo box and the expression
 
Fields inherited from class com.sciapp.filter.VisualFilter
anyKey, filterModel
 
Constructor Summary
DateVisualFilter()
          Constructs a DateVisualFilter.
 
Method Summary
protected  void bringUpDialog()
          Displays the date chooser dialog
 DateFormat getDateFormat()
          Returns the dateformat object associated with this date visual filter.
 Filter getFilter()
          Returns the filter object that this component uses to filter the values.
 JPanel getPanel()
          Returns the panel containing the controls used to manipulate the filter.
 TableFilter getTableFilter()
          Returns a table filter object corresponding to the visual controls of the filter.
protected  void setDate(Date d)
          Assigns the supplied date to the expression text field and to the date filter of this visual filter.
 void setTableFilter(TableFilter tf)
          This method should modify the visual control's values to those corresponding to the supplied TableFilter object.
 boolean shouldApplyFilter()
          Returns true if the current filter should be applied, false otherwise.
 
Methods inherited from class com.sciapp.filter.VisualFilter
fireFilter, getFilterModel, getFilterOnKey, setFilterOnKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldBoxOptions

protected JComboBox fieldBoxOptions
a combobox containing the filter options.


expression

protected JTextField expression
a textfield used to show and input the date pattern.


dateFilter

protected DateFilter dateFilter
a date filter object used to filter Date values.


dateChooser

protected JDateChooser dateChooser
the datechooser that is contained in the dialog


dialog

protected JDialog dialog
the dialog that is invoked for inputting the date pattern


dateShown

protected Date dateShown
the selected date


filterLabel

protected JLabel filterLabel
the label between the filter options combo box and the expression


df

protected DateFormat df
the dateformat instance that is used to format the current date shown on the textfield.

Constructor Detail

DateVisualFilter

public DateVisualFilter()
Constructs a DateVisualFilter.

Method Detail

bringUpDialog

protected void bringUpDialog()
Displays the date chooser dialog


getFilter

public Filter getFilter()
Returns the filter object that this component uses to filter the values.

Specified by:
getFilter in class VisualFilter
Returns:
a filter

getPanel

public JPanel getPanel()
Returns the panel containing the controls used to manipulate the filter.

Specified by:
getPanel in class VisualFilter
Returns:
a panel with controls used in filtering.

getTableFilter

public TableFilter getTableFilter()
Returns a table filter object corresponding to the visual controls of the filter.

Specified by:
getTableFilter in class VisualFilter
Returns:
a table filter

setDate

protected void setDate(Date d)
Assigns the supplied date to the expression text field and to the date filter of this visual filter.

Parameters:
d - the date object to assign.

shouldApplyFilter

public boolean shouldApplyFilter()
Returns true if the current filter should be applied, false otherwise. Sometimes, can opt NOT to filter, e.g. if a number or a date is not parseable.

Specified by:
shouldApplyFilter in class VisualFilter
Returns:
true if the filter should be applied

getDateFormat

public DateFormat getDateFormat()
Returns the dateformat object associated with this date visual filter.

Returns:
the internal date format object.

setTableFilter

public void setTableFilter(TableFilter tf)
This method should modify the visual control's values to those corresponding to the supplied TableFilter object.

Specified by:
setTableFilter in class VisualFilter
Parameters:
tf - the TableFilter to set.