protected final void addElement(Element element, boolean addRelationships) { if (element == null) { throw new IllegalArgumentException("An element must be specified."); } if (getModel().contains(element)) { elementViews.add(new ElementView(element)); if (addRelationships) { addRelationships(element); } } else { throw new IllegalArgumentException("The element named " + element.getName() + " does not exist in the model associated with this view."); } }