return new JLabel("No renderer found for null entry");
}
// Border border = null;
Factory factory = null;
try {
factory = (Factory) Class.forName(value.getFactoryName()).newInstance();
} catch (Exception e) {
SimSystem.report(e);
return null;
}
JPanel outerPanel = new JPanel(new BorderLayout());
applyTemplate(template, outerPanel);
// if (border != null) {
// outerPanel.setBorder(border);
// }
JLabel nameLabel = new JLabel(factory.getReadableName());
nameLabel.setFont(font);
nameLabel.setForeground(foreground);
nameLabel.setBackground(background);
nameLabel.setOpaque(false);
outerPanel.add(nameLabel, BorderLayout.PAGE_START);
// retrieve parameters
Map<String, ParameterBlock> parameters =
value.getParameters().getSubBlocks();
// the panel that holds the parameter summary
Box innerPanel = new Box(BoxLayout.PAGE_AXIS);
innerPanel.setBackground(background);
innerPanel.setOpaque(false);
innerPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
innerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 0));
for (Entry<String, ParameterBlock> param : parameters.entrySet()) {
String paramName = param.getKey();
String paramText;
Object paramVal = param.getValue().getValue();
paramText = paramVal != null ? paramVal.toString() : "(null)";
if (paramVal instanceof String) {
try {
Factory fac =
(Factory) Class.forName((String) paramVal).newInstance();
paramText = fac.getReadableName();
} catch (Exception e) {
SimSystem.report(e);
}
}