Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.filter
Class NumericalVisualFilter

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

public class NumericalVisualFilter
extends VisualFilter

A VisualFilter for numeric values.


Field Summary
protected  JTextField expression
          a textfield used to input the number.
protected  JComboBox fieldBoxOptions
          a combobox containing the filter options.
protected  JLabel filterLabel
          the label between the filter options combo box and the expression
protected  NumberFormat nf
          the numberformat instance that is used to format the number shown on the textfield.
protected  NumberFilter numberFilter
          a numeric filter object used to filter Number objects.
 
Fields inherited from class com.sciapp.filter.VisualFilter
anyKey, filterModel
 
Constructor Summary
NumericalVisualFilter(NumberFilter numberFilter)
          Constructs a NumericVisualFilter.
 
Method Summary
 JTextField getExpression()
          Returns a textfield that is used to display and allow input of the numerical pattern.
 JComboBox getFieldBoxOptions()
          Returns a combobox containing the filter options.
 Filter getFilter()
          Returns the filter object that this component uses to filter the values.
 JLabel getFilterLabel()
          Returns a label between the filter options combo box and the expression textfield.
 NumberFormat getNumberFormat()
          Returns the numberformat object associated with this numerical visual filter.
 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 setNumber(Number n)
          Assigns the supplied number to the expression text field and to the number filter of this visual filter.
 void setNumberFormat(NumberFormat numberFormat)
          Assigns a new numberformat.
 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.


numberFilter

protected NumberFilter numberFilter
a numeric filter object used to filter Number objects.


expression

protected JTextField expression
a textfield used to input the number.


filterLabel

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


nf

protected NumberFormat nf
the numberformat instance that is used to format the number shown on the textfield.

Constructor Detail

NumericalVisualFilter

public NumericalVisualFilter(NumberFilter numberFilter)
Constructs a NumericVisualFilter.

Method Detail

getExpression

public JTextField getExpression()
Returns a textfield that is used to display and allow input of the numerical pattern.

Returns:
the 'numerical' text field.

getFieldBoxOptions

public JComboBox getFieldBoxOptions()
Returns a combobox containing the filter options.

Returns:
the 'filter' combobox.

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

getFilterLabel

public JLabel getFilterLabel()
Returns a label between the filter options combo box and the expression textfield.

Returns:
the 'filter' label.

getNumberFormat

public NumberFormat getNumberFormat()
Returns the numberformat object associated with this numerical visual filter.

Returns:
the internal number format object.

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

setNumber

protected void setNumber(Number n)
Assigns the supplied number to the expression text field and to the number filter of this visual filter.

Parameters:
n - the number object to assign

setNumberFormat

public void setNumberFormat(NumberFormat numberFormat)
Assigns a new numberformat.

Parameters:
numberFormat - the new number format to assign

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.

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

Copyright © 2005 Scientific Applications. All Rights Reserved.