当前位置: 首页>>代码示例>>Java>>正文


Java SMILElement类代码示例

本文整理汇总了Java中org.w3c.dom.smil.SMILElement的典型用法代码示例。如果您正苦于以下问题:Java SMILElement类的具体用法?Java SMILElement怎么用?Java SMILElement使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SMILElement类属于org.w3c.dom.smil包,在下文中一共展示了SMILElement类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDocumentElement

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
@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;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:12,代码来源:SmilDocumentImpl.java

示例2: getHead

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
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;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:12,代码来源:SmilDocumentImpl.java

示例3: createSmilDocument

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody body) {
  Log.w(TAG, "Creating SMIL document from PduBody.");

  SMILDocument document = new SmilDocumentImpl();

  SMILElement smilElement = (SMILElement) document.createElement("smil");
  document.appendChild(smilElement);

  SMILElement headElement = (SMILElement) document.createElement("head");
  smilElement.appendChild(headElement);

  SMILLayoutElement layoutElement = (SMILLayoutElement) document.createElement("layout");
  headElement.appendChild(layoutElement);

  SMILRootLayoutElement rootLayoutElement = (SMILRootLayoutElement) document.createElement("root-layout");
  rootLayoutElement.setWidth(ROOT_WIDTH);
  rootLayoutElement.setHeight(ROOT_HEIGHT);
  layoutElement.appendChild(rootLayoutElement);

  SMILElement bodyElement = (SMILElement) document.createElement("body");
  smilElement.appendChild(bodyElement);

  SMILParElement par = (SMILParElement) document.createElement("par");
  bodyElement.appendChild(par);

  for (int i=0; i<body.getPartsNum(); i++) {
    PduPart part = body.getPart(i);
    SMILRegionElement regionElement = getRegion(document, part);
    SMILMediaElement  mediaElement  = getMediaElement(document, part);

    if (regionElement != null) {
      ((SMILRegionMediaElement)mediaElement).setRegion(regionElement);
      layoutElement.appendChild(regionElement);
    }
    par.appendChild(mediaElement);
  }

  return document;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:40,代码来源:SmilUtil.java

示例4: createSmilDocument

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
public static SMILDocument createSmilDocument(SlideDeck deck) {
  Log.w(TAG, "Creating SMIL document from SlideDeck.");

  SMILDocument document = new SmilDocumentImpl();

  SMILElement smilElement = (SMILElement) document.createElement("smil");
  document.appendChild(smilElement);

  SMILElement headElement = (SMILElement) document.createElement("head");
  smilElement.appendChild(headElement);

  SMILLayoutElement layoutElement = (SMILLayoutElement) document.createElement("layout");
  headElement.appendChild(layoutElement);

  SMILRootLayoutElement rootLayoutElement = (SMILRootLayoutElement) document.createElement("root-layout");
  rootLayoutElement.setWidth(ROOT_WIDTH);
  rootLayoutElement.setHeight(ROOT_HEIGHT);
  layoutElement.appendChild(rootLayoutElement);

  SMILElement bodyElement = (SMILElement) document.createElement("body");
  smilElement.appendChild(bodyElement);

  SMILParElement par = (SMILParElement) document.createElement("par");
  bodyElement.appendChild(par);

  for (Slide slide : deck.getSlides()) {
    SMILRegionElement regionElement = slide.getSmilRegion(document);
    SMILMediaElement  mediaElement  = slide.getMediaElement(document);

    if (regionElement != null) {
      ((SMILRegionMediaElement)mediaElement).setRegion(regionElement);
      layoutElement.appendChild(regionElement);
    }
    par.appendChild(mediaElement);
  }

  return document;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:39,代码来源:SmilUtil.java

示例5: ElementParallelTimeContainerImpl

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
ElementParallelTimeContainerImpl(SMILElement element) {
    super(element);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:ElementParallelTimeContainerImpl.java

示例6: ElementTimeContainerImpl

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
ElementTimeContainerImpl(SMILElement element) {
    super(element);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:ElementTimeContainerImpl.java

示例7: ElementTimeImpl

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
ElementTimeImpl(SMILElement element) {
    mSmilElement = element;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:ElementTimeImpl.java

示例8: getBody

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
public SMILElement getBody() {
    Node rootElement = getDocumentElement();
    Node headElement = getHead();
    Node bodyElement = headElement.getNextSibling();
    if (bodyElement == null || !(bodyElement instanceof SMILElement)) {
        // The body doesn't exist. Create a new one.
        bodyElement = createElement("body");
        rootElement.appendChild(bodyElement);
    }

    // Initialize the real sequential time container, which is body.
    mSeqTimeContainer = new ElementSequentialTimeContainerImpl((SMILElement) bodyElement) {
        public NodeList getTimeChildren() {
            return getBody().getElementsByTagName("par");
        }

        public boolean beginElement() {
            Event startEvent = createEvent("Event");
            startEvent.initEvent(SMIL_DOCUMENT_START_EVENT, false, false);
            dispatchEvent(startEvent);
            return true;
        }

        public boolean endElement() {
            Event endEvent = createEvent("Event");
            endEvent.initEvent(SMIL_DOCUMENT_END_EVENT, false, false);
            dispatchEvent(endEvent);
            return true;
        }

        public void pauseElement() {
            // TODO Auto-generated method stub

        }

        public void resumeElement() {
            // TODO Auto-generated method stub

        }

        public void seekElement(float seekTo) {
            // TODO Auto-generated method stub

        }

        ElementTime getParentElementTime() {
            return null;
        }
    };

    return (SMILElement) bodyElement;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:53,代码来源:SmilDocumentImpl.java

示例9: ElementSequentialTimeContainerImpl

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
ElementSequentialTimeContainerImpl(SMILElement element) {
    super(element);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:ElementSequentialTimeContainerImpl.java

示例10: createSmilDocument

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
private static SMILDocument createSmilDocument(PduBody pb) {
    if (Config.LOGV) {
        Log.v(TAG, "Creating default SMIL document.");
    }

    SMILDocument document = new SmilDocumentImpl();

    // Create root element.
    // FIXME: Should we create root element in the constructor of document?
    SMILElement smil = (SMILElement) document.createElement("smil");
    smil.setAttribute("xmlns", "http://www.w3.org/2001/SMIL20/Language");
    document.appendChild(smil);

    // Create <head> and <layout> element.
    SMILElement head = (SMILElement) document.createElement("head");
    smil.appendChild(head);

    SMILLayoutElement layout = (SMILLayoutElement) document.createElement("layout");
    head.appendChild(layout);

    // Create <body> element and add a empty <par>.
    SMILElement body = (SMILElement) document.createElement("body");
    smil.appendChild(body);
    SMILParElement par = addPar(document);

    // Create media objects for the parts in PDU.
    int partsNum = pb.getPartsNum();
    if (partsNum == 0) {
        return document;
    }

    DrmManagerClient drmManagerClient = QKSMSApp.getApplication().getDrmManagerClient();

    boolean hasText = false;
    boolean hasMedia = false;
    for (int i = 0; i < partsNum; i++) {
        // Create new <par> element.
        if ((par == null) || (hasMedia && hasText)) {
            par = addPar(document);
            hasText = false;
            hasMedia = false;
        }

        PduPart part = pb.getPart(i);
        String contentType = new String(part.getContentType());

        if (ContentType.isDrmType(contentType)) {
            contentType = drmManagerClient.getOriginalMimeType(part.getDataUri());
        }

        if (contentType.equals(ContentType.TEXT_PLAIN)
                || contentType.equalsIgnoreCase(ContentType.APP_WAP_XHTML)
                || contentType.equals(ContentType.TEXT_HTML)) {
            SMILMediaElement textElement = createMediaElement(
                    ELEMENT_TAG_TEXT, document, part.generateLocation());
            par.appendChild(textElement);
            hasText = true;
        } else if (ContentType.isImageType(contentType)) {
            SMILMediaElement imageElement = createMediaElement(
                    ELEMENT_TAG_IMAGE, document, part.generateLocation());
            par.appendChild(imageElement);
            hasMedia = true;
        } else if (ContentType.isVideoType(contentType)) {
            SMILMediaElement videoElement = createMediaElement(
                    ELEMENT_TAG_VIDEO, document, part.generateLocation());
            par.appendChild(videoElement);
            hasMedia = true;
        } else if (ContentType.isAudioType(contentType)) {
            SMILMediaElement audioElement = createMediaElement(
                    ELEMENT_TAG_AUDIO, document, part.generateLocation());
            par.appendChild(audioElement);
            hasMedia = true;
        } else {
            // TODO: handle other media types.
            Log.w(TAG, "unsupport media type");
        }
    }

    return document;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:81,代码来源:SmilHelper.java

示例11: isMMSConformance

import org.w3c.dom.smil.SMILElement; //导入依赖的package包/类
/**
 * @return whether the Smil has MMS conformance layout.
 * Refer to MMS Conformance Document OMA-MMS-CONF-v1_2-20050301-A
 */
private static final boolean isMMSConformance(SMILDocument smilDoc) {
    SMILElement head = smilDoc.getHead();
    if (head == null) {
        // No 'head' element
        return false;
    }
    NodeList children = head.getChildNodes();
    if (children == null || children.getLength() != 1) {
        // The 'head' element should have only one child.
        return false;
    }
    Node layout = children.item(0);
    if (layout == null || !"layout".equals(layout.getNodeName())) {
        // The child is not layout element
        return false;
    }
    NodeList layoutChildren = layout.getChildNodes();
    if (layoutChildren == null) {
        // The 'layout' element has no child.
        return false;
    }
    int num = layoutChildren.getLength();
    if (num <= 0) {
        // The 'layout' element has no child.
        return false;
    }
    for (int i = 0; i < num; i++) {
        Node layoutChild = layoutChildren.item(i);
        if (layoutChild == null) {
            // The 'layout' child is null.
            return false;
        }
        String name = layoutChild.getNodeName();
        if ("root-layout".equals(name)) {
            continue;
        } else if ("region".equals(name)) {
            NamedNodeMap map = layoutChild.getAttributes();
            for (int j = 0; j < map.getLength(); j++) {
                Node node = map.item(j);
                if (node == null) {
                    return false;
                }
                String attrName = node.getNodeName();
                // The attr should be one of left, top, height, width, fit and id
                if ("left".equals(attrName) || "top".equals(attrName) ||
                        "height".equals(attrName) || "width".equals(attrName) ||
                        "fit".equals(attrName)) {
                    continue;
                } else if ("id".equals(attrName)) {
                    String value;
                    if (node instanceof AttrImpl) {
                        value = ((AttrImpl)node).getValue();
                    } else {
                        return false;
                    }
                    if ("Text".equals(value) || "Image".equals(value)) {
                        continue;
                    } else {
                        // The id attr is not 'Text' or 'Image'
                        return false;
                    }
                } else {
                    return false;
                }
            }
        } else {
            // The 'layout' element has the child other than 'root-layout' or 'region'
            return false;
        }
    }
    return true;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:77,代码来源:SlideshowActivity.java


注:本文中的org.w3c.dom.smil.SMILElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。