use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.
the class SimilarProbeListsDialog method mouseClicked.
public void mouseClicked(MouseEvent me) {
// We're only interested in double clicks
if (me.getClickCount() != 2)
return;
// If the table hasn't been drawn yet then bail out
if (table == null)
return;
// Get the selected row
int selectedRow = table.getSelectedRow();
if (selectedRow < 0)
return;
ProbeList newActiveList = (ProbeList) table.getModel().getValueAt(selectedRow, 0);
try {
collection.probeSet().setActiveList(newActiveList);
} catch (SeqMonkException e) {
throw new IllegalStateException(e);
}
}
use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.
the class DataViewer method mousePressed.
/* (non-Javadoc)
* @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
*/
public void mousePressed(MouseEvent me) {
JTree tree = (JTree) me.getSource();
tree.setSelectionRow(tree.getRowForLocation(me.getX(), me.getY()));
// Check if they right-clicked
if ((me.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) {
// I'm not sure if this is a timing issue, but we can get the selection path being null
if (tree.getSelectionPath() == null)
return;
Object clickedItem = tree.getSelectionPath().getLastPathComponent();
if (clickedItem instanceof DataSet) {
new DataPopupMenu((DataSet) clickedItem).show(dataTree, me.getX(), me.getY());
} else if (clickedItem instanceof DataGroup) {
new GroupPopupMenu((DataGroup) clickedItem).show(dataTree, me.getX(), me.getY());
} else if (clickedItem instanceof ReplicateSet) {
new ReplicatePopupMenu((ReplicateSet) clickedItem).show(dataTree, me.getX(), me.getY());
} else if (clickedItem instanceof ProbeList) {
new ProbePopupMenu((ProbeList) clickedItem).show(probeSetTree, me.getX(), me.getY());
} else if (clickedItem instanceof AnnotationSet) {
new AnnotationPopupMenu((AnnotationSet) clickedItem).show(dataTree, me.getX(), me.getY());
}
} else // Check if they double clicked
if (me.getClickCount() == 2) {
// I'm not sure if this is a timing issue, but we can get the selection path being null
if (tree.getSelectionPath() == null)
return;
Object clickedItem = tree.getSelectionPath().getLastPathComponent();
if (clickedItem instanceof DataSet) {
new DataPopupMenu((DataSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
} else if (clickedItem instanceof DataGroup) {
new GroupPopupMenu((DataGroup) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
} else if (clickedItem instanceof ReplicateSet) {
new ReplicatePopupMenu((ReplicateSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
} else if (clickedItem instanceof ProbeList) {
new ProbePopupMenu((ProbeList) clickedItem).actionPerformed(new ActionEvent(this, 0, "view"));
} else if (clickedItem instanceof AnnotationSet) {
new AnnotationPopupMenu((AnnotationSet) clickedItem).actionPerformed(new ActionEvent(this, 0, "properties"));
}
}
}
use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.
the class CisTransScatterPlotPanel method getFilteredProbes.
/**
* Gets the filtered probes.
*
* @param probeset the probeset
* @return the filtered probes
*/
public ProbeList getFilteredProbes(ProbeSet probeset) {
double minDiff = Math.min(diffStart, diffEnd);
double maxDiff = Math.max(diffStart, diffEnd);
ProbeList list = new ProbeList(probeList, "Difference between " + df.format(minDiff) + " and " + df.format(maxDiff), "Cis/Trans difference in " + store.name() + " between " + df.format(minDiff) + " and " + df.format(maxDiff), null);
if (madeSelection) {
Probe[] probes = probeList.getAllProbes();
Arrays.sort(probes);
for (int p = 0; p < probes.length; p++) {
double diff = xData[p] - yData[p];
if (diff < minDiff)
continue;
if (diff > maxDiff)
continue;
list.addProbe(probes[p], null);
}
}
return list;
}
use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.
the class ProbeSetTreeModel method probeSetReplaced.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.DataTypes.DataChangeListener#probeSetReplaced(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeSet)
*/
public void probeSetReplaced(ProbeSet probes) {
if (this.probes != null) {
this.probes.removeProbeSetChangeListener(this);
}
this.probes = probes;
if (probes != null) {
probes.addProbeSetChangeListener(this);
}
Enumeration<TreeModelListener> e = listeners.elements();
while (e.hasMoreElements()) {
e.nextElement().treeStructureChanged(new TreeModelEvent(rootNode, new ProbeList[] { probes }));
}
}
use of uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList in project SeqMonk by s-andrews.
the class ProbeSetTreeModel method probeListRemoved.
/* (non-Javadoc)
* @see uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeSetChangeListener#probeListRemoved(uk.ac.babraham.SeqMonk.DataTypes.Probes.ProbeList)
*/
public void probeListRemoved(ProbeList l) {
TreeModelEvent me;
if (l instanceof ProbeSet) {
me = new TreeModelEvent(l, getPathToRoot(l.parent()), new int[] { 0 }, new ProbeList[] { l });
} else {
me = new TreeModelEvent(l, getPathToRoot(l.parent()), new int[] { getIndexOfChild(l.parent(), l) }, new ProbeList[] { l });
}
Enumeration<TreeModelListener> e = listeners.elements();
while (e.hasMoreElements()) {
e.nextElement().treeNodesRemoved(me);
}
}
Aggregations