Package org.jamesii.core.factories

Examples of org.jamesii.core.factories.Factory


      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);
        }
      }
View Full Code Here

TOP

Related Classes of org.jamesii.core.factories.Factory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.