本文整理汇总了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;未经允许,请勿转载。 |
请发表评论