• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SMILDocument类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: parseRegionLength

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private int parseRegionLength(String length, boolean horizontal) {
    if (length.endsWith("px")) {
        length = length.substring(0, length.indexOf("px"));
        return Integer.parseInt(length);
    } else if (length.endsWith("%")) {
        double value = 0.01*Integer.parseInt(length.substring(0, length.length() - 1));
        if (horizontal) {
            value *= ((SMILDocument) getOwnerDocument()).getLayout().getRootLayout().getWidth();
        } else {
            value *= ((SMILDocument) getOwnerDocument()).getLayout().getRootLayout().getHeight();
        }
        return (int) Math.round(value);
    } else {
        return Integer.parseInt(length);
    }
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:17,代码来源:SmilRegionElementImpl.java


示例2: getRegion

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private static SMILRegionElement getRegion(SMILDocument document, PduPart part) {
  if (PartParser.isAudio(part)) return null;

  SMILRegionElement region = (SMILRegionElement) document.createElement("region");
  if (PartParser.isText(part)) {
    region.setId("Text");
    region.setTop(SmilUtil.ROOT_HEIGHT);
    region.setHeight(50);
  } else {
    region.setId("Image");
    region.setTop(0);
    region.setHeight(SmilUtil.ROOT_HEIGHT);
  }
  region.setLeft(0);
  region.setWidth(SmilUtil.ROOT_WIDTH);
  region.setFit("meet");
  return region;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:19,代码来源:SmilUtil.java


示例3: getMediaElement

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private static SMILMediaElement getMediaElement(SMILDocument document, PduPart part) {
  final String tag;
  if (PartParser.isImage(part)) {
    tag = "img";
  } else if (PartParser.isAudio(part)) {
    tag = "audio";
  } else if (PartParser.isVideo(part)) {
    tag = "video";
  } else if (PartParser.isText(part)) {
    tag = "text";
  } else {
    tag = "ref";
  }
  return createMediaElement(tag, document, new String(part.getName() == null
                                                      ? new byte[]{}
                                                      : part.getName()));
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:18,代码来源:SmilUtil.java


示例4: getDocument

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
public static SMILDocument getDocument(PduBody pb) {
    // Find SMIL part in the message.
    PduPart smilPart = findSmilPart(pb);
    SMILDocument document = null;

    // Try to load SMIL document from existing part.
    if (smilPart != null) {
        document = getSmilDocument(smilPart);
    }

    if (document == null) {
        // Create a new SMIL document.
        document = createSmilDocument(pb);
    }

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


示例5: createSmilDocument

import org.w3c.dom.smil.SMILDocument; //导入依赖的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


示例6: getSmilRegion

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
@Override
public SMILRegionElement getSmilRegion(SMILDocument document) {
  SMILRegionElement region = (SMILRegionElement) document.createElement("region");
  region.setId("Image");
  region.setLeft(0);
  region.setTop(0);
  region.setWidth(SmilUtil.ROOT_WIDTH);
  region.setHeight(SmilUtil.ROOT_HEIGHT);
  region.setFit("meet");
  return region;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:12,代码来源:VideoSlide.java


示例7: getSmilRegion

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
@Override
public SMILRegionElement getSmilRegion(SMILDocument document) {
  SMILRegionElement region = (SMILRegionElement) document.createElement("region");
  region.setId("Text");
  region.setLeft(0);
  region.setTop(SmilUtil.ROOT_HEIGHT);
  region.setWidth(SmilUtil.ROOT_WIDTH);
  region.setHeight(50);
  region.setFit("meet");
  return region;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:12,代码来源:TextSlide.java


示例8: createSmilDocument

import org.w3c.dom.smil.SMILDocument; //导入依赖的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


示例9: validateDocument

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private void validateDocument(SMILDocument doc) {
    /*
     * Calling getBody() will create "smil", "head", and "body" elements if they
     * are not present. It will also initialize the SequentialTimeElementContainer
     * member of SMILDocument, which could not be set on creation of the document.
     * @see com.android.mms.dom.smil.SmilDocumentImpl#getBody()
     */
    doc.getBody();

    /*
     * Calling getLayout() will create "layout" element if it is not present.
     * @see com.android.mms.dom.smil.SmilDocumentImpl#getLayout()
     */
    doc.getLayout();
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:16,代码来源:SmilXmlParser.java


示例10: addPar

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
public static SMILParElement addPar(SMILDocument document) {
    SMILParElement par = (SMILParElement) document.createElement("par");
    // Set duration to eight seconds by default.
    par.setDur(8.0f);
    document.getBody().appendChild(par);
    return par;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:8,代码来源:SmilHelper.java


示例11: createMediaElement

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
public static SMILMediaElement createMediaElement(
        String tag, SMILDocument document, String src) {
    SMILMediaElement mediaElement =
            (SMILMediaElement) document.createElement(tag);
    mediaElement.setSrc(escapeXML(src));
    return mediaElement;
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:8,代码来源:SmilHelper.java


示例12: SlideshowModel

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private SlideshowModel (
        LayoutModel layouts, ArrayList<SlideModel> slides,
        SMILDocument documentCache, PduBody pbCache,
        Context context) {
    mLayout = layouts;
    mSlides = slides;
    mContext = context;

    mDocumentCache = documentCache;
    mPduBodyCache = pbCache;
    for (SlideModel slide : mSlides) {
        increaseMessageSize(slide.getSlideSize());
        slide.setParent(this);
    }
}
 
开发者ID:moezbhatti,项目名称:qksms,代码行数:16,代码来源:SlideshowModel.java


示例13: getSmilRegion

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
@Override
public SMILRegionElement getSmilRegion(SMILDocument document) {
    SMILRegionElement region = (SMILRegionElement) document.createElement("region");
    region.setId("Image");
    region.setLeft(0);
    region.setTop(0);
    region.setWidth(SmilUtil.ROOT_WIDTH);
    region.setHeight(SmilUtil.ROOT_HEIGHT);
    region.setFit("meet");
    return region;
}
 
开发者ID:Securecom,项目名称:Securecom-Messaging,代码行数:12,代码来源:OtherSlide.java


示例14: createMediaElement

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
private static SMILMediaElement createMediaElement(String tag, SMILDocument document, String src) {
  SMILMediaElement mediaElement = (SMILMediaElement) document.createElement(tag);
  mediaElement.setSrc(escapeXML(src));
  return mediaElement;
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:6,代码来源:SmilUtil.java


示例15: getMediaElement

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
@Override
public SMILMediaElement getMediaElement(SMILDocument document) {
  return SmilUtil.createMediaElement("video", document, new String(getPart().getName()));
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:VideoSlide.java


示例16: getSmilRegion

import org.w3c.dom.smil.SMILDocument; //导入依赖的package包/类
@Override
public SMILRegionElement getSmilRegion(SMILDocument document) {
  return null;
}
 
开发者ID:redcracker,项目名称:TextSecure,代码行数:5,代码来源:AudioSlide.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java RequestLogs类代码示例发布时间:2022-05-22
下一篇:
Java JacksonJodaDateFormat类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap