|
|||||||||
| Home >> All >> org >> greenstone >> gatherer >> [ gui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.greenstone.gatherer.gui
Class Filter

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.greenstone.gatherer.gui.Filter
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable
- public class Filter
- extends javax.swing.JPanel
This object allows the user to set a filter on one of the workspace trees, specifying a preset type, or a regular expression that a files must match to be in the tree. Note that all directories are included. This class includes the controls for editing the filter. The trick is that several instances of the Filter class can share the same internal data (termed a 'run' of filters), so that the filter set on the CollectionPane and the MetaEditPane are virtually the same.
The regular expression typed uses '*' as a wildcard character (equivalent to '.*'), and does not use '.' to match any single character (use '?' instead).
- Version:
- 2.3
| Nested Class Summary | |
private class |
Filter.ComboBoxListener
Listens for changes in the combobox as when one is detected attempts to compile a regular expression from whatever text was entered. |
private class |
Filter.Entry
An object that holds a filter entry. |
| Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private javax.swing.JCheckBox |
checkbox
The check box to enable/disable filter. |
private GComboBox |
combobox
The editable combobox where you either choose a predefined filter, or type a new pseudo-regular expression. |
private static java.lang.String[] |
DEFAULTS
Preprogrammed default filters. |
private boolean |
first
Is this the first filter of this run of filters created (later filters will share the same information). |
private boolean |
ignore
Prevent any changes we make in the class from causing events which we then process causing events... |
private javax.swing.JLabel |
label
The label shown on the filter controls. |
private java.util.ArrayList |
others
The other filters in this run of filters, used to ensure they all show the same thing. |
private static java.awt.Dimension |
SIZE
The default size for the label. |
private Filter |
this_filter
A reference to ourselves so inner classes can refer to us. |
private org.greenstone.gatherer.gui.tree.DragTree |
tree
A reference to the tree this filter is being applied to. |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
Filter(org.greenstone.gatherer.gui.tree.DragTree tree)
Constructor. |
|
Filter(org.greenstone.gatherer.gui.tree.DragTree tree,
java.util.ArrayList others)
Constructor. |
|
| Method Summary | |
private java.lang.String |
encode(java.lang.String raw)
Encode an expression in pseudo-regular expression into regular expression. |
GComboBox |
getComboBox()
Retrieve the combobox associated with this filter. |
void |
setComboBoxModel(javax.swing.ComboBoxModel model)
Set the combobox model for this filter. |
void |
setComboBoxSelection(Filter.Entry selection)
Ensure that a certain entry is selected from the combobox. |
void |
setEnabled(boolean state)
Used to restore the filter state to enabled, the normal state during collection editing. |
private void |
setFilter(java.util.regex.Pattern pattern)
This method applies the given pattern to the tree registered as belonging to this filter. |
void |
setFirst(boolean first)
Set to signify that this filter is the first in a new run of filters. |
Filter |
spawn(org.greenstone.gatherer.gui.tree.DragTree tree_spawn)
Spawn produces a copy of this filter, which has new controls, but shares listeners with this filter, and vice versa. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
others
private java.util.ArrayList others
- The other filters in this run of filters, used to ensure they all show the same thing.
first
private boolean first
- Is this the first filter of this run of filters created (later filters will share the same information).
ignore
private boolean ignore
- Prevent any changes we make in the class from causing events which we then process causing events...
this_filter
private Filter this_filter
- A reference to ourselves so inner classes can refer to us.
checkbox
private javax.swing.JCheckBox checkbox
- The check box to enable/disable filter.
combobox
private GComboBox combobox
- The editable combobox where you either choose a predefined filter, or type a new pseudo-regular expression.
label
private javax.swing.JLabel label
- The label shown on the filter controls.
tree
private org.greenstone.gatherer.gui.tree.DragTree tree
- A reference to the tree this filter is being applied to.
SIZE
private static final java.awt.Dimension SIZE
- The default size for the label.
DEFAULTS
private static final java.lang.String[] DEFAULTS
- Preprogrammed default filters.
| Constructor Detail |
Filter
public Filter(org.greenstone.gatherer.gui.tree.DragTree tree)
- Constructor.
Filter
public Filter(org.greenstone.gatherer.gui.tree.DragTree tree, java.util.ArrayList others)
- Constructor.
| Method Detail |
getComboBox
public GComboBox getComboBox()
- Retrieve the combobox associated with this filter.
setEnabled
public void setEnabled(boolean state)
- Used to restore the filter state to enabled, the normal state during collection editing.
setComboBoxModel
public void setComboBoxModel(javax.swing.ComboBoxModel model)
- Set the combobox model for this filter.
setComboBoxSelection
public void setComboBoxSelection(Filter.Entry selection)
- Ensure that a certain entry is selected from the combobox.
setFirst
public void setFirst(boolean first)
- Set to signify that this filter is the first in a new run of filters.
spawn
public Filter spawn(org.greenstone.gatherer.gui.tree.DragTree tree_spawn)
- Spawn produces a copy of this filter, which has new controls, but shares listeners with this filter, and vice versa. Thus we can have two synchronized, but differing sets of controls.
encode
private java.lang.String encode(java.lang.String raw)
- Encode an expression in pseudo-regular expression into regular expression.
setFilter
private void setFilter(java.util.regex.Pattern pattern)
- This method applies the given pattern to the tree registered as belonging to this filter.
|
|||||||||
| Home >> All >> org >> greenstone >> gatherer >> [ gui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC