import jalview.datamodel.features.FeatureMatcherI;
import jalview.datamodel.features.FeatureMatcherSet;
import jalview.datamodel.features.FeatureMatcherSetI;
+import jalview.datamodel.ontology.OntologyI;
import jalview.gui.Help.HelpId;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
switch (column)
{
case TYPE_COLUMN:
+ /*
+ * drag to reorder not enabled in Summary View
+ */
tip = summaryView.isSelected()
? MessageManager.getString(
"label.feature_settings_select_columns")
}
});
- summaryView = new JCheckBox("Summary view");
- summaryView.setToolTipText("Show only top level ontology terms");
+ summaryView = new JCheckBox(MessageManager.getString("summary_view"));
+ summaryView
+ .setToolTipText(MessageManager.getString("summary_view_tip"));
summaryView.addActionListener(new ActionListener()
{
@Override
return v == null ? null : v.getClass();
}
+ /**
+ * Answers true for all columns except Feature Type
+ */
@Override
public boolean isCellEditable(int row, int col)
{
- return col == 0 ? false : true;
+ return col != TYPE_COLUMN;
}
+ /**
+ * Sets the value in the model for a given row and column. If Visibility
+ * (Show/Hide) is being set, and the table is in Summary View, then it is
+ * set also on any sub-types of the row's feature type.
+ */
@Override
public void setValueAt(Object value, int row, int col)
{
data[row][col] = value;
fireTableCellUpdated(row, col);
+ if (summaryView.isSelected() && col == SHOW_COLUMN)
+ {
+ String type = (String) data[row][TYPE_COLUMN];
+ OntologyI so = SequenceOntologyFactory.getInstance();
+ for (int r = 0; r < data.length; r++)
+ {
+ if (r != row)
+ {
+ String type2 = (String) data[r][TYPE_COLUMN];
+ if (so.isA(type2, type))
+ {
+ data[r][col] = value;
+ fireTableCellUpdated(r, col);
+ }
+ }
+ }
+ }
+
updateFeatureRenderer(data);
}
List<String> types = fr.getRenderOrder();
subTypes = SequenceOntologyFactory.getInstance()
.getChildTerms(this.featureType, types);
+ Collections.sort(subTypes); // sort for ease of reading in tooltip
/*
* save original colours and filters for this feature type
andOrPanel.add(panel2, BorderLayout.EAST);
StringBuilder sb = new StringBuilder(20 * subTypes.size());
sb.append("Apply filters also to child terms" + ":"); // todo i18n
- Collections.sort(subTypes);
for (String child : subTypes)
{
sb.append("<br>").append(child);