Bug #2966
closed
Add a 'Preview data' menu to data source actors
Added by ben leinfelder about 17 years ago.
Updated almost 17 years ago.
Description
Add a 'Preview data' menu to data source actors to show the content of data table(s)
a) Only shows the top 20 or so records of the table (easier)
b) maybe only shows user-selected columns (more difficult from UI perspective)
Did an initial pass at this for EML200DataSource actor. Uses a JTable (with simple sorting). Have not tried it with big datasets - might encounter some problem there - all in memory.
Preview is accessed from right-click context menu on actor. The org.kepler.actor.preview.Previewable interface should be implemented by any actor that wishes to expose a "Preview" of some sort. public void preview() method is the only requirement for implementing the interface (thus far).
If there is an attempt to preview a non-Previewable actor, a warning message is displayed indicating that previews are not yet supported for that type of actor.
Ported the PersistentTableModel from Morpho to make use of the [already] ported version of PersistentVector. This supports big big big datatables by using the disk with some records in memory.
Note: this table model uses strings for all attributes. Since this is a "Preview" that may not be the biggest deal, but it does mean numbers may not be sorted as desired (i.e. 100 < 2 when you use string comparison)
Added a recast() method to the PersistentTableModel implementation. This allows us to make an initial pass over the columns to divine the type correctly (which in turn allows the cells to be rendered with right-justified numbers, and left-justified strings and also to be sorted appropriately).
Note: Since there is an initial pass over every cell in the table to divine the type of the column, there could be some overhead when dealing with large datasets.
Note 2: "Missing values" are not really supported in that if a column of numbers includes something like "-" or "N/A" for a missing value then the entire column will be treated as a string (for display and sorting).
this change has been included as part of 1.0.0RC1
additional bugs have been reported in a different bugzilla entry.
Original Bugzilla ID was 2966
Also available in: Atom
PDF