Changeset 4421


Ignore:
Timestamp:
2003-05-30T13:40:17+12:00 (21 years ago)
Author:
kjdon
Message:

the modal dialog now is one of our special ModalDialogs which only block the parent, enabling the use of help files while the dialog is open. A SimpleMenuBar with help on it has been added to the dialog.

Location:
trunk/gli/src/org/greenstone/gatherer/gui/metaaudit
Files:
2 edited

Legend:

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

    r4366 r4421  
    4444import org.greenstone.gatherer.gui.metaaudit.Filter;
    4545import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
     46import org.greenstone.gatherer.gui.SimpleMenuBar;
     47import org.greenstone.gatherer.gui.ModalDialog;
     48
    4649/** The autofilter concept comes from Microsoft Excel spreadsheets that use autofilters to filter to the sheet. When you click on the heading of a column, a new prompt allows you to specify what filter should be acting apon the selected column. Any new filter is conjoined with any previous filters to provide a sheet containing only rows that match all current filters. Each column must also provide an indicator for determining if a filter is set (in this case a special icon) and and a method for removing a filter (use the clear filter button within the autofilter dialog). Having recently discovered that most JVMs aren't very good at recoving memory used by dialog and frame windows, special care must be made to deallocate all references properly, as a user may open several dozen autofilter prompts over the lifetime of a session.
    4750 * @author John Thompson, Greenstone Digital Library, University of Waikato
     
    4952 */
    5053public final class AutofilterDialog
    51     extends JDialog {
     54    extends ModalDialog {
    5255    /** The filter being edited. */
    5356    private Autofilter filter;
     
    8992    private MetaAuditFrame dialog;
    9093    /** The default size for the autofilter control. */
    91     static final private Dimension SIZE = new Dimension(640, 220);
     94    static final private Dimension SIZE = new Dimension(640, 245);
    9295    /** Constructor.
    9396     * @param dialog A reference to the <strong>MetaAuditFrame</strong> that spawned this dialog.
     
    103106    setSize(SIZE);
    104107    setTitle(get("Title"));
     108    setJMenuBar(new SimpleMenuBar("6.7"));
    105109    // Creation
    106110    JPanel content_pane = (JPanel) getContentPane();
     
    294298    }
    295299    // Display   
    296     show();
     300    setVisible(true);
    297301    dialog.toFront();
    298302    return this.filter;
     
    352356        filter = null;
    353357        }
    354         hide();
     358        setVisible(false);
    355359    }
    356360    }
  • trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditFrame.java

    r4366 r4421  
    4545import org.greenstone.gatherer.file.FileNode;
    4646import org.greenstone.gatherer.util.TreeSynchronizer;
     47import org.greenstone.gatherer.gui.SimpleMenuBar;
     48import org.greenstone.gatherer.gui.ModalDialog;
     49
    4750/** The MetaAuditFrame provides a table view of all of the metadata assigned to a selection of FileNodes. All values for a certain file and a certain metadata element appear in the same cell. This table can be sorted by any column, and also has a MS Excel-like AutoFilter allowing you to restrict the rows visible to only those that match a certain set of criteria (applied to each column, and then 'ANDED', or cojoined, to determine the filter). Finally this dialog does not block the Gatherer tool, so the file selection can be changed and the dialog will just generate a new table dynamically.<BR>
    4851 * Much effort has gone into optimizing this table, as it quickly becomes slow and unresponsive to build/filter/sort when the number of records selected is high. However its performance is still nowhere as good as the Excel spreadsheet, and selections of 1000+ records can cause some serious waiting problems. Performance progression, shown in terms of time taken to perform action, are shown below. Note that building includes both the creation of the data model, and/or the time taken to lay out row and column sizes (due to this using multiple entry cells). Also all tables, by default, must be sorted by one column, which is initially the first column in ascending order:<BR><BR>
     
    7881 */
    7982public class MetaAuditFrame
    80     extends JDialog
     83    extends ModalDialog
    8184    implements TreeSelectionListener {
    8285    public AutofilterDialog autofilter_dialog;
     
    9093    private MetaAuditTable table;
    9194    /** The default size for the metaaudit dialog. */
    92     static final private Dimension SIZE = new Dimension(640,480);
     95    static final private Dimension SIZE = new Dimension(640,505);
    9396    /** The tolerance used to determine between a column resize, and a request for an AutoFilterDialog. */
    9497    static final private int TOLERANCE = 3;
    9598    /** Constructor.*/
    9699    public MetaAuditFrame(TreeSynchronizer tree_sync, FileNode records[]) {
    97     super();
     100    super(Gatherer.g_man);
    98101    // Arguments
    99102    this.autofilter_dialog = new AutofilterDialog(this);
     
    105108    setSize(SIZE);
    106109    setTitle(get("Title"));
    107 
     110    setJMenuBar(new SimpleMenuBar("6.7"));
    108111    JPanel content_pane = (JPanel) getContentPane();
    109112    JPanel button_pane = new JPanel();
     
    142145        rebuildModel();
    143146    }
    144     show();
     147    setVisible(true);
    145148    }
    146149    /** This method is called whenever the selection within the collection tree changes. This causes the table to be rebuilt with a new model.
     
    203206     */
    204207    public void actionPerformed(ActionEvent event) {
    205         self.hide();
     208        self.setVisible(false);
    206209    }
    207210    }
Note: See TracChangeset for help on using the changeset viewer.