Ignore:
Timestamp:
2003-09-23T14:58:18+12:00 (21 years ago)
Author:
mdewsnip
Message:

Partway through tooltip assignment. Made lots of little changes, registered a whole lot more components, removed dead code, fixed help links (with SimpleMenuBars). Lots more of the same to come.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/Filter.java

    r5355 r5527  
    5454    /** The other filters in this run of filters, used to ensure they all show the same thing. */
    5555    private ArrayList others = null;
    56     /** Is this the filter filter of this run of filters created (later filters will share the same information). */
     56    /** Is this the first filter of this run of filters created (later filters will share the same information). */
    5757    private boolean first = true;
    5858    /** Prevent any changes we make in the class from causing events which we then process causing events... */
     
    6060    /** A reference to ourselves so inner classes can refer to us. */
    6161    private Filter this_filter = null;
    62     /** The check box to enabled/diable filter. */
     62    /** The check box to enable/disable filter. */
    6363    private JCheckBox checkbox = null;
    6464    /** The editable combobox where you either choose a predefined filter, or type a new pseudo-regular expression. */
     
    7474    /** Constructor.
    7575     * @param tree A reference to the <strong>JTree</strong> being affected.
    76       */
     76     */
    7777    public Filter(DragTree tree) {
    7878    this(tree, null);
    7979    }
    8080    /** Constructor.
    81       * @param tree A reference to the <strong>JTree</strong> being affected.
    82       * @param others An <strong>ArrayList</strong> of the other Filters already in this run.
    83       */
     81     * @param tree A reference to the <strong>JTree</strong> being affected.
     82     * @param others An <strong>ArrayList</strong> of the other Filters already in this run.
     83     */
    8484    public Filter(DragTree tree, ArrayList others) {
    8585    super();
     
    119119    }
    120120    /** Retrieve the combobox associated with this filter.
    121       * @return A <strong>GComboBox</strong>.
    122       */
     121     * @return A <strong>GComboBox</strong>.
     122     */
    123123    public GComboBox getComboBox() {
    124124    return combobox;
     
    126126
    127127    /** Change the background color of the filter.
    128       * @param color The new background <strong>Color</strong>.
    129       */
     128     * @param color The new background <strong>Color</strong>.
     129     */
    130130    public void setBackground(Color color) {
    131131    super.setBackground(color);
     
    133133
    134134    /** Used to restore the filter state to enabled, the normal state during collection editing.
    135       * @param state The new state for the filter. <i>true</i> for enabled, <i>false</i> otherwise.
    136       */
     135     * @param state The new state for the filter. <i>true</i> for enabled, <i>false</i> otherwise.
     136     */
    137137    public void setEnabled(boolean state) {
    138138    ignore = true;
     
    142142    }
    143143    /** Set the combobox model for this filter.
    144       * @param model The new <strong>ComboBoxModel</strong> to use.
    145       */
     144     * @param model The new <strong>ComboBoxModel</strong> to use.
     145     */
    146146    public void setComboBoxModel(ComboBoxModel model) {
    147147    combobox.setModel(model);
    148148    }
    149149    /** Ensure that a certain entry is selected from the combobox.
    150       * @param selection The <strong>Entry</strong> that should be selected.
    151       */
     150     * @param selection The <strong>Entry</strong> that should be selected.
     151     */
    152152    public void setComboBoxSelection(Entry selection) {
    153153    ignore = true;
     
    156156    }
    157157    /** Set to signify that this filter is the first in a new run of filters.
    158       * @param first <i>true</i> if this is the first filter in a run, <i>false</i> if it will just be added to the current run.
    159       */
     158     * @param first <i>true</i> if this is the first filter in a run, <i>false</i> if it will just be added to the current run.
     159     */
    160160    public void setFirst(boolean first) {
    161161    this.first = first;
    162162    }
    163163    /** Spawn produces a copy of this filter, which has new controls, but shares listeners wih this filter, and vice versa. Thus we can have two synchronized, but differing sets of controls.
    164       * @param tree_spawn The <strong>JTree</strong> this filter will affect.
    165       * @return A new <strong>Filter</strong> which is in the same run as this filter.
    166       */
     164     * @param tree_spawn The <strong>JTree</strong> this filter will affect.
     165     * @return A new <strong>Filter</strong> which is in the same run as this filter.
     166     */
    167167    public Filter spawn(DragTree tree_spawn) {
    168168    Filter filter = new Filter(tree_spawn, others);
     
    173173    }
    174174    /** Retrieve a phrase from the dictionary.
    175       * @param key The unique identification <strong>String</strong> of a phrase from the dictionary.
    176       */
     175     * @param key The unique identification <strong>String</strong> of a phrase from the dictionary.
     176     */
    177177    private String get(String key) {
    178178    return get(key, null);
    179179    }
    180180    /** Retrieve a phrase from the dictionary, augmenting with the given text fragments
    181       * @param key The unique identification <strong>String</strong> of a phrase from the dictionary.
    182       * @param args A <strong>String[]</strong> of arguments to be used to fill out parameter fields in the phrase returned.
    183       * @see org.greenstone.gatherer.Dictionary
    184       * @see org.greenstone.gatherer.Gatherer
    185       */
     181     * @param key The unique identification <strong>String</strong> of a phrase from the dictionary.
     182     * @param args A <strong>String[]</strong> of arguments to be used to fill out parameter fields in the phrase returned.
     183     * @see org.greenstone.gatherer.Dictionary
     184     * @see org.greenstone.gatherer.Gatherer
     185     */
    186186    private String get(String key, String args[]) {
    187187    if(key.indexOf(".") == -1) {
     
    191191    }
    192192    /** Encode an expression in pseudo-regular expression into regular expression.
    193       * @param raw The pseudo-regular expression <strong>String</strong> which includes several characters which differ in meaning from regular expression queries.
    194       * @return A proper regular expression as a <strong>String</strong>.
    195       */
     193     * @param raw The pseudo-regular expression <strong>String</strong> which includes several characters which differ in meaning from regular expression queries.
     194     * @return A proper regular expression as a <strong>String</strong>.
     195     */
    196196    private String encode(String raw) {
    197197    StringBuffer working = new StringBuffer();
     
    234234    private class ComboBoxListener
    235235    implements ActionListener {
    236 /** Called when a new item is selected from the filter combobox, we treat the new entry as a pseudo-regular expression, compile it and then apply it to the tree.
     236    /** Called when a new item is selected from the filter combobox, we treat the new entry as a pseudo-regular expression, compile it and then apply it to the tree.
    237237     * @param event An <strong>ActionEvent</strong> containing more information about the change performed.
    238238     * @see org.greenstone.gatherer.gui.Filter.Entry
     
    297297    }
    298298    /** Constructor.
    299             * @param name The name of this entry as a <strong>String</strong>.
    300             * @param pattern The compiled regular expression as a <strong>Pattern</strong>.
    301             */
     299     * @param name The name of this entry as a <strong>String</strong>.
     300     * @param pattern The compiled regular expression as a <strong>Pattern</strong>.
     301     */
    302302    public Entry(String name, Pattern pattern) {
    303303        this.name = name;
     
    305305    }
    306306    /** Compare two Entrys for ordering.
    307             * @param object The other Entry to compare to, as an <strong>Object</strong>.
    308             * @return An <i>int</i> indicating the respective ordering, as defined in java.lang.String#compareTo
    309             */
     307     * @param object The other Entry to compare to, as an <strong>Object</strong>.
     308     * @return An <i>int</i> indicating the respective ordering, as defined in java.lang.String#compareTo
     309     */
    310310    public int compareTo(Object object) {
    311311        return toString().compareTo(object.toString());
    312312    }
    313313    /** Retrieve the pattern associated with this entry.
    314             * @return The <strong>Pattern</strong>.
    315             */
     314     * @return The <strong>Pattern</strong>.
     315     */
    316316    public Pattern getPattern() {
    317317        return pattern;
    318318    }
    319319    /** Translate this entry into a textual representation.
    320             * @return A <strong>String</strong> containing the representation.
    321             */
     320     * @return A <strong>String</strong> containing the representation.
     321     */
    322322    public String toString() {
    323323        String result = null;
Note: See TracChangeset for help on using the changeset viewer.