Changeset 4421
- Timestamp:
- 2003-05-30T13:40:17+12:00 (21 years ago)
- 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 44 44 import org.greenstone.gatherer.gui.metaaudit.Filter; 45 45 import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame; 46 import org.greenstone.gatherer.gui.SimpleMenuBar; 47 import org.greenstone.gatherer.gui.ModalDialog; 48 46 49 /** 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. 47 50 * @author John Thompson, Greenstone Digital Library, University of Waikato … … 49 52 */ 50 53 public final class AutofilterDialog 51 extends JDialog {54 extends ModalDialog { 52 55 /** The filter being edited. */ 53 56 private Autofilter filter; … … 89 92 private MetaAuditFrame dialog; 90 93 /** The default size for the autofilter control. */ 91 static final private Dimension SIZE = new Dimension(640, 2 20);94 static final private Dimension SIZE = new Dimension(640, 245); 92 95 /** Constructor. 93 96 * @param dialog A reference to the <strong>MetaAuditFrame</strong> that spawned this dialog. … … 103 106 setSize(SIZE); 104 107 setTitle(get("Title")); 108 setJMenuBar(new SimpleMenuBar("6.7")); 105 109 // Creation 106 110 JPanel content_pane = (JPanel) getContentPane(); … … 294 298 } 295 299 // Display 296 s how();300 setVisible(true); 297 301 dialog.toFront(); 298 302 return this.filter; … … 352 356 filter = null; 353 357 } 354 hide();358 setVisible(false); 355 359 } 356 360 } -
trunk/gli/src/org/greenstone/gatherer/gui/metaaudit/MetaAuditFrame.java
r4366 r4421 45 45 import org.greenstone.gatherer.file.FileNode; 46 46 import org.greenstone.gatherer.util.TreeSynchronizer; 47 import org.greenstone.gatherer.gui.SimpleMenuBar; 48 import org.greenstone.gatherer.gui.ModalDialog; 49 47 50 /** 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> 48 51 * 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> … … 78 81 */ 79 82 public class MetaAuditFrame 80 extends JDialog83 extends ModalDialog 81 84 implements TreeSelectionListener { 82 85 public AutofilterDialog autofilter_dialog; … … 90 93 private MetaAuditTable table; 91 94 /** 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); 93 96 /** The tolerance used to determine between a column resize, and a request for an AutoFilterDialog. */ 94 97 static final private int TOLERANCE = 3; 95 98 /** Constructor.*/ 96 99 public MetaAuditFrame(TreeSynchronizer tree_sync, FileNode records[]) { 97 super( );100 super(Gatherer.g_man); 98 101 // Arguments 99 102 this.autofilter_dialog = new AutofilterDialog(this); … … 105 108 setSize(SIZE); 106 109 setTitle(get("Title")); 107 110 setJMenuBar(new SimpleMenuBar("6.7")); 108 111 JPanel content_pane = (JPanel) getContentPane(); 109 112 JPanel button_pane = new JPanel(); … … 142 145 rebuildModel(); 143 146 } 144 s how();147 setVisible(true); 145 148 } 146 149 /** This method is called whenever the selection within the collection tree changes. This causes the table to be rebuilt with a new model. … … 203 206 */ 204 207 public void actionPerformed(ActionEvent event) { 205 self. hide();208 self.setVisible(false); 206 209 } 207 210 }
Note:
See TracChangeset
for help on using the changeset viewer.