use of net.sf.mzmine.framework.CustomTextPane in project mzmine2 by mzmine.
the class SpectralMatchPanel method extractMetaData.
private JPanel extractMetaData(String title, SpectralDBEntry entry, DBEntryField[] other) {
JPanel panelOther = new JPanel();
panelOther.setLayout(new BoxLayout(panelOther, BoxLayout.Y_AXIS));
panelOther.setBackground(Color.WHITE);
panelOther.setAlignmentY(Component.TOP_ALIGNMENT);
panelOther.setAlignmentX(Component.TOP_ALIGNMENT);
for (DBEntryField db : other) {
Object o = entry.getField(db).orElse("N/A");
if (!o.equals("N/A")) {
CustomTextPane textPane = new CustomTextPane(true);
textPane.setText(db.toString() + ": " + o.toString());
panelOther.add(textPane);
}
}
JLabel otherInfo = new JLabel(title);
otherInfo.setFont(headerFont);
JPanel pn = new JPanel(new BorderLayout());
pn.setBackground(Color.WHITE);
pn.add(otherInfo, BorderLayout.NORTH);
pn.add(panelOther, BorderLayout.CENTER);
JPanel pn1 = new JPanel(new BorderLayout());
pn1.add(pn, BorderLayout.NORTH);
pn1.setBackground(Color.WHITE);
return pn1;
}
Aggregations