use of org.w3c.dom.Node in project Signal-Android by WhisperSystems.
the class SmilDocumentImpl method getLayout.
public SMILLayoutElement getLayout() {
Node headElement = getHead();
Node layoutElement = null;
// Find the layout element under <code>HEAD</code>
layoutElement = headElement.getFirstChild();
while ((layoutElement != null) && !(layoutElement instanceof SMILLayoutElement)) {
layoutElement = layoutElement.getNextSibling();
}
if (layoutElement == null) {
// The layout doesn't exist. Create a default one.
layoutElement = new SmilLayoutElementImpl(this, "layout");
headElement.appendChild(layoutElement);
}
return (SMILLayoutElement) layoutElement;
}
use of org.w3c.dom.Node in project Signal-Android by WhisperSystems.
the class SmilDocumentImpl method getHead.
/*
* SMILElement Interface
*/
public SMILElement getHead() {
Node rootElement = getDocumentElement();
Node headElement = rootElement.getFirstChild();
if (headElement == null || !(headElement instanceof SMILElement)) {
// The head doesn't exist. Create a new one.
headElement = createElement("head");
rootElement.appendChild(headElement);
}
return (SMILElement) headElement;
}
use of org.w3c.dom.Node in project Signal-Android by WhisperSystems.
the class SmilDocumentImpl method getDocumentElement.
@Override
public SMILElement getDocumentElement() {
Node rootElement = getFirstChild();
if (rootElement == null || !(rootElement instanceof SMILElement)) {
// The root doesn't exist. Create a new one.
rootElement = createElement("smil");
appendChild(rootElement);
}
return (SMILElement) rootElement;
}
use of org.w3c.dom.Node in project Android-GoogleDirectionAndPlaceLibrary by akexorcist.
the class GoogleDirection method getStartAddress.
public String getStartAddress(Document doc) {
NodeList nl1 = doc.getElementsByTagName("start_address");
Node node1 = nl1.item(0);
if (isLogging)
Log.i("GoogleDirection", "StartAddress : " + node1.getTextContent());
return node1.getTextContent();
}
use of org.w3c.dom.Node in project Android-GoogleDirectionAndPlaceLibrary by akexorcist.
the class GoogleDirection method getTotalDistanceText.
public String getTotalDistanceText(Document doc) {
NodeList nl1 = doc.getElementsByTagName("distance");
Node node1 = nl1.item(nl1.getLength() - 1);
NodeList nl2 = node1.getChildNodes();
Node node2 = nl2.item(getNodeIndex(nl2, "text"));
if (isLogging)
Log.i("GoogleDirection", "TotalDuration : " + node2.getTextContent());
return node2.getTextContent();
}
Aggregations