Closed gmella closed 2 years ago
My current notes:
OIFitsCollection.findOIData(Selector,SelectorResult)
). A unique Selector is therefore incomplete in regards to the SubsetDefinition which can have several SubsetFilters.Let's start supporting multiple selection of table items (same target, same insmode)
GenericJTree
(get all selected paths, select several paths)DataTreePanel.updateOIFitsCollection
is the function that make a tree from an oifitsCollection. It must use all tables of the argument susbset definition, in order to collect all nodes to correctly select all concerned paths.DataTreePanel.valueChanged
is the function that modify the current subset definition, when the user select something on the tree. It must gets all selected paths from GenericJTree
. It must collect all tables then call processSelection
at the end to update the filter of the currentSubsetDefintion.The class that wraps a JTree
CONTIGUOUS_TREE_SELECTION
. Note that this enables targetting of various multiple paths (not only the same instrument with several of its tables). I suggest to not adress this issue as the plan seems to be able to cover multiple paths later.getLastSelectedNode
returns the leafest node of the last of the selected paths. This is typically a SINGLE_TREE_SELECTION
feature. It is called by DataTreePanel.valueChanged
. Another method should be added to return instead TreePath[] JTree.getSelectionPaths()
which gives all the selected paths.selectPath
set the selection to the given path. Can be kept it is used for example to select the root node. BTW addNodeAndRefresh
seems unused code. However I think we need a function to select several paths, see section DataTreePanel below. DIS/CONTIGUOUS_TREE_SELECTION
. Say there is an expanded tree, with INS_MODE_A
which contains TABLE_1
, and INS_MODE_B
which contains TABLE_2
. Left-Clicking on TABLE_1
, then MAJ+Left-Clicking on TABLE_2
gives three selected paths: INS_MODE_A->TABLE_1
, INS_MODE_B
, INS_MODE_B->TABLE_2
. The second path INS_MODE_B
selects every table from INS_MODE_B
. I have a feeling it is going to be weird in the GUI, we will see.The Panel that display and features the selection. It uses GenericJTree
.
updateOIFitsCollection
: uses only the first of the tables of the filter of the current subset definition. It looks for the selected table and store the associated node, then select its path. Just needs to stores several nodes, and then call GenericJTree.selectPaths
(with an s
). TODO comment to remove.valueChanged
: processes tree selection. works with getlastSelectedNode
. Must be changed to work with multiple paths, as multiple selected tables will be represented as multiple paths. Here I will assume that if there is several paths, then they all point to some table belonging to the same target and same instrument mode (see first bullet of GenericJTree section). processSelection
must be called at the end, after collecting all tables.processSelection
: another variation must be added to work with several tables instead of one. easy since it can use the first filter as in the current version. getTables
seemed to behave correctly with several tables. (excluding functions cited here)Starting supporting multiple selection of table items (same target, same insmode), we decide to keep compatible table only from the user selection. After analysis, the software refines a valid selection and sync the tree.
Change proposal:
GenericJTree
to add methods getSelectedNodes()
and selectPaths()
to deal with TreePath[]
valuesDataTreePanel.valueChanged()
to handle tree selections and call processSelection(String targetUID, String insModeUID, List<OITable> oiTables)
to update the single SubsetDefinition
and its single SubsetFilter
with the following rules:
filter.setTargetUID(targetUID)
; other targets are ignored to be unselected.filter.setInsModeUID(insModeUID)
filter.getTables().add(new TableUID(...) )
Is your feature request related to a problem? Please describe. I would like to export a subset of data located under several branches or leafs.
Describe the solution you'd like Support of multiple selection would allow to merge/export data in a much better way.
Describe alternatives you've considered If I need to merge 2 branches over 3, I can export both of interest, then reset the collection, load last 2 exported and export/merge the whole collection.
Additional context please consider ctrl / shift click to facilitate selection :)