Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter
Class NumericalVisualFilter

java.lang.Object
  extended by com.citra.filter.VisualFilter
      extended by com.citra.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 expressionBox
          the combo box populated with the available filter values
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.
protected  boolean useComboBox
          flag that controls whether a text field or a combo box is used to enter filter values
protected  boolean useComparisonText
          flag that controls whether to display comparison texts or symbols
 
Fields inherited from class com.citra.filter.VisualFilter
anyKey, filterModel
 
Constructor Summary
NumericalVisualFilter()
          Constructs a NumericalVisualFilter.
NumericalVisualFilter(boolean useComboBox)
          Constructs a NumericalVisualFilter.
NumericalVisualFilter(NumberFilter numberFilter)
          Constructs a NumericalVisualFilter.
NumericalVisualFilter(NumberFilter numberFilter, boolean useComboBox)
          Constructs a NumericalVisualFilter.
 
Method Summary
 void fireFilter()
          Generates and forwards a filter event to the listeners of the filter model.
 JTextField getExpression()
          Returns a textfield that is used to display and allow input of the numerical pattern.
 JComboBox getExpressionBox()
          Retrieves the combo box that provides the available filter values.
 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.
 boolean getUseComboBox()
          Determines whether a text field or a combo box is used to enter filter values.
 boolean getUseComparisonText()
          Determines whether to display comparison texts or symbols.
 void setFilter(Filter filter)
          Assigns a filter object that this component uses to filter the values.
 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.
 void setUseComboBox(boolean useComboBox)
          Determines whether a text field or a combo box is used to enter filter values.
 void setUseComparisonText(boolean useComparisonText)
          Determines whether to display comparison texts or symbols.
 boolean shouldApplyFilter()
          Returns true if the current filter should be applied, false otherwise.
 
Methods inherited from class com.citra.filter.VisualFilter
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.


expressionBox

protected JComboBox expressionBox
the combo box populated with the available filter values


useComboBox

protected boolean useComboBox
flag that controls whether a text field or a combo box is used to enter filter values


useComparisonText

protected boolean useComparisonText
flag that controls whether to display comparison texts or symbols

Constructor Detail

NumericalVisualFilter

public NumericalVisualFilter()
Constructs a NumericalVisualFilter.


NumericalVisualFilter

public NumericalVisualFilter(NumberFilter numberFilter)
Constructs a NumericalVisualFilter.


NumericalVisualFilter

public NumericalVisualFilter(NumberFilter numberFilter,
                             boolean useComboBox)
Constructs a NumericalVisualFilter.


NumericalVisualFilter

public NumericalVisualFilter(boolean useComboBox)
Constructs a NumericalVisualFilter.

Method Detail

fireFilter

public void fireFilter()
Generates and forwards a filter event to the listeners of the filter model. The filter event is initialized with a TableFilter taken by calling the getTableFilter() method.

Overrides:
fireFilter in class VisualFilter

getExpression

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

Returns:
the 'numerical' text field.

getExpressionBox

public JComboBox getExpressionBox()
Retrieves the combo box that provides the available filter values.

Returns:
the combo box populated with the available filter values

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

getUseComparisonText

public boolean getUseComparisonText()
Determines whether to display comparison texts or symbols.

Returns:
true if texts are used, false if symbols

getUseComboBox

public boolean getUseComboBox()
Determines whether a text field or a combo box is used to enter filter values.

Returns:
true, if a combo box is used, or false, in the case of a text field

setUseComboBox

public void setUseComboBox(boolean useComboBox)
Determines whether a text field or a combo box is used to enter filter values.

Parameters:
useComboBox - true if a combo box is used, or false, in the case of a text field

setFilter

public void setFilter(Filter filter)
Assigns a filter object that this component uses to filter the values.

Specified by:
setFilter in class VisualFilter
Parameters:
filter - the filter to assign

setNumber

public 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.

setUseComparisonText

public void setUseComparisonText(boolean useComparisonText)
Determines whether to display comparison texts or symbols.

Parameters:
useComparisonText - true if texts are used, false if symbols

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 © 2011 Citra Technologies. All Rights Reserved.