use of net.sf.mzmine.util.components.PeakSummaryComponent in project mzmine2 by mzmine.
the class ScatterPlotChart method getCustomToolTipComponent.
public JComponent getCustomToolTipComponent(MouseEvent event) {
String index = this.getToolTipText(event);
if (index == null) {
return null;
}
String[] indexSplit = index.split(":");
int series = Integer.parseInt(indexSplit[0]);
int item = Integer.parseInt(indexSplit[1]);
PeakListRow row = mainDataSet.getRow(series, item);
PeakSummaryComponent newSummary = new PeakSummaryComponent(row, peakList.getRawDataFiles(), true, true, true, true, false, ComponentToolTipManager.bg);
double xValue = mainDataSet.getXValue(series, item);
double yValue = mainDataSet.getYValue(series, item);
newSummary.setRatio(xValue, yValue);
return newSummary;
}
use of net.sf.mzmine.util.components.PeakSummaryComponent in project mzmine2 by mzmine.
the class PeakListTable method getCustomToolTipComponent.
public JComponent getCustomToolTipComponent(MouseEvent event) {
JComponent component = null;
String text = this.getToolTipText(event);
if (text == null) {
return null;
}
if (text.contains(ComponentToolTipManager.CUSTOM)) {
String[] values = text.split("-");
int myID = Integer.parseInt(values[1].trim());
for (PeakListRow row : peakList.getRows()) {
if (row.getID() == myID) {
component = new PeakSummaryComponent(row, peakList.getRawDataFiles(), true, false, false, true, false, ComponentToolTipManager.bg);
break;
}
}
} else {
text = "<html>" + text.replace("\n", "<br>") + "</html>";
JLabel label = new JLabel(text);
label.setFont(UIManager.getFont("ToolTip.font"));
JPanel panel = new JPanel();
panel.setBackground(ComponentToolTipManager.bg);
panel.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
panel.add(label);
component = panel;
}
return component;
}
Aggregations