/**
   * Return a Fig that can be used to represent the given node.
   *
   * <p>
   *
   * @param gm The graph model for which we are rendering.
   * @param lay The layer in the graph on which we want this figure.
   * @param node The node to be rendered (an model element object)
   * @param styleAttributes an optional map of attributes to style the fig
   * @return The fig to be used, or <code>null</code> if we can't create one.
   */
  public FigNode getFigNodeFor(GraphModel gm, Layer lay, Object node, Map styleAttributes) {

    FigNodeModelElement figNode = null;

    // Create a new version of the relevant fig

    if (Model.getFacade().isAActor(node)) {
      figNode = new FigActor(gm, node);
    } else if (Model.getFacade().isAUseCase(node)) {
      figNode = new FigUseCase(gm, node);
    } else if (Model.getFacade().isAComment(node)) {
      figNode = new FigComment(gm, node);
    } else if (Model.getFacade().isAPackage(node)) {
      figNode = new FigPackage(gm, node);
    } else {
      LOG.debug(
          this.getClass().toString()
              + ": getFigNodeFor("
              + gm.toString()
              + ", "
              + lay.toString()
              + ", "
              + node.toString()
              + ") - cannot create this sort of node.");
      return null;
      // TODO: Shouldn't we throw an excdeption here?!?!
    }

    lay.add(figNode);
    figNode.setDiElement(GraphChangeAdapter.getInstance().createElement(gm, node));

    return figNode;
  }