* @param msg
* New star message for a single star.
* @return The summary component for this star.
*/
private Component createSummary(NewStarMessage msg) {
StarInfo starInfo = msg.getStarInfo();
JTextArea summaryTextArea = new JTextArea();
summaryTextArea.setEditable(false);
summaryTextArea
.setBorder(BorderFactory.createTitledBorder("Summary for "
+ starInfo.getDesignation()));
StringBuffer summaryBuf = new StringBuffer();
summaryBuf.append("Source Type: ");
summaryBuf.append(msg.getStarInfo().getRetriever().getSourceType());
summaryBuf.append("\n");
summaryBuf.append("Source Name: ");
summaryBuf.append(msg.getStarInfo().getRetriever().getSourceName());
summaryBuf.append("; loaded: ");
summaryBuf.append(msg.getLoadDate().toString());
summaryBuf.append("\n");
if (starInfo.getAuid() != null) {
summaryBuf.append("AUID: ");
summaryBuf.append(starInfo.getAuid());
summaryBuf.append("\n");
}
if (starInfo.getPeriod() != null) {
summaryBuf.append("Period: ");
summaryBuf.append(starInfo.getPeriod());
summaryBuf.append(" days\n");
}
if (starInfo.getEpoch() != null) {
summaryBuf.append("Epoch: ");
summaryBuf.append(starInfo.getEpoch());
summaryBuf.append("\n");
}
if (starInfo.getVarType() != null) {
summaryBuf.append("Variable Type: ");
summaryBuf.append(starInfo.getVarType());
summaryBuf.append("\n");
}
if (starInfo.getSpectralType() != null) {
summaryBuf.append("Spectral Type: ");
summaryBuf.append(starInfo.getSpectralType());
summaryBuf.append("\n");
}
if (starInfo.getDiscoverer() != null) {
summaryBuf.append("Discoverer: ");
summaryBuf.append(starInfo.getDiscoverer());
summaryBuf.append("\n");
}
if (starInfo.getRA() != null) {
summaryBuf.append(starInfo.getRA());
summaryBuf.append("\n");
}
if (starInfo.getDec() != null) {
summaryBuf.append(starInfo.getDec());
summaryBuf.append("\n");
}
summaryTextArea.setText(summaryBuf.toString());