/** * Sets the {@link History} instance of this object to {@code null}. */ public void unsetHistory() { History oldHistory = null; if (history != null) { oldHistory = history; } history = null; firePropertyChange(TreeNodeChangeEvent.history, oldHistory, history); }
/** * Sets the value of the about String of this object. * * @param about the about String to set. */ public void setAbout(String about) { String oldAbout = this.about; this.about = about; firePropertyChange(TreeNodeChangeEvent.about, oldAbout, this.about); }
/** * Clears the {@link List} of {@link CVTerm}s. */ public void unsetCVTerms() { if (listOfCVTerms != null) { List<CVTerm> oldListOfCVTerms = listOfCVTerms; listOfCVTerms.clear(); listOfCVTerms = null; firePropertyChange(TreeNodeChangeEvent.unsetCVTerms, oldListOfCVTerms, listOfCVTerms); } }
/** * Removes the given {@link CVTerm}. * * @param cvTerm the {@link CVTerm} to remove * @return true if the {@link CVTerm} was successfully removed. */ public boolean removeCVTerm(CVTerm cvTerm) { if (listOfCVTerms == null) { listOfCVTerms = new ArrayList<CVTerm>(); } cvTerm.parent = null; boolean success = listOfCVTerms.remove(cvTerm); firePropertyChange(TreeNodeChangeEvent.removeCVTerm, cvTerm, null); return success; }
/** * Adds a {@link CVTerm}. * * @param cvTerm * the {@link CVTerm} to add. * @return {@code true} if the 'cvTerm' element has been added to the {@link List} * of {@link Qualifier}s. */ public boolean addCVTerm(CVTerm cvTerm) { if (listOfCVTerms == null) { listOfCVTerms = new ArrayList<CVTerm>(); } cvTerm.parent = this; boolean success = listOfCVTerms.add(cvTerm); firePropertyChange(TreeNodeChangeEvent.addCVTerm, null, cvTerm); return success; }
/** * Removes the {@link CVTerm} at the given index. * * @param index the index * @return the removed {@link CVTerm}. * @throws IndexOutOfBoundsException if the index is out of range (index < 0 || index >= size()) */ public CVTerm removeCVTerm(int index) { if (listOfCVTerms == null) { listOfCVTerms = new ArrayList<CVTerm>(); } CVTerm deletedCVTerm = listOfCVTerms.remove(index); deletedCVTerm.parent = null; firePropertyChange(TreeNodeChangeEvent.removeCVTerm, deletedCVTerm, null); return deletedCVTerm; }
/** * Sets the non RDF annotation String to {@code null}. */ public void unsetNonRDFannotation() { XMLNode oldNonRDFAnnotation = null; if (isSetNonRDFannotation()) { oldNonRDFAnnotation = nonRDFannotation; nonRDFannotation = null; firePropertyChange(TreeNodeChangeEvent.nonRDFAnnotation, oldNonRDFAnnotation, nonRDFannotation); } }
/** * Changes the {@link History} instance to 'history' * * @param history the history to set. */ public void setHistory(History history) { History oldHistory = this.history; this.history = history; this.history.parent = this; this.history.addAllChangeListeners(getListOfTreeNodeChangeListeners()); firePropertyChange(TreeNodeChangeEvent.history, oldHistory, this.history); }
/** * Sets the value of the non RDF annotations * * @param nonRDFAnnotation */ public void setNonRDFAnnotation(XMLNode nonRDFAnnotation) { XMLNode oldNonRDFAnnotation = null; if (nonRDFannotation != null) { oldNonRDFAnnotation = nonRDFannotation; } // test if the XMLNode has as first element 'annotation' if (!nonRDFAnnotation.getName().equals("annotation")) { XMLNode annotationXMLNode = new XMLNode(new XMLTriple("annotation", null, null), new XMLAttributes()); annotationXMLNode.addChild(new XMLNode("\n ")); annotationXMLNode.addChild(nonRDFAnnotation); nonRDFAnnotation = annotationXMLNode; } nonRDFannotation = nonRDFAnnotation; nonRDFannotation.setParent(this); firePropertyChange(TreeNodeChangeEvent.nonRDFAnnotation, oldNonRDFAnnotation, nonRDFannotation); }
/** * @param annotationToAppend */ public void appendNonRDFAnnotation(XMLNode annotationToAppend) { XMLNode oldNonRDFAnnotation = null; if (nonRDFannotation == null) { // check if the annotation contain an annotation top level element or not if (!annotationToAppend.getName().equals("annotation")) { XMLNode annotationXMLNode = new XMLNode(new XMLTriple("annotation", null, null), new XMLAttributes()); annotationXMLNode.addChild(new XMLNode("\n ")); annotationXMLNode.addChild(annotationToAppend); annotationToAppend = annotationXMLNode; annotationToAppend.setParent(this); } nonRDFannotation = annotationToAppend; } else { oldNonRDFAnnotation = nonRDFannotation.clone(); if (annotationToAppend.getName().equals("annotation")) { for (int i = 0; i < annotationToAppend.getChildCount(); i++) { XMLNode child = annotationToAppend.getChildAt(i); nonRDFannotation.addChild(child); } } else { nonRDFannotation.addChild(annotationToAppend); } } firePropertyChange(TreeNodeChangeEvent.nonRDFAnnotation, oldNonRDFAnnotation, nonRDFannotation); }