本文整理汇总了Java中org.w3c.dom.smil.TimeList类的典型用法代码示例。如果您正苦于以下问题:Java TimeList类的具体用法?Java TimeList怎么用?Java TimeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TimeList类属于org.w3c.dom.smil包,在下文中一共展示了TimeList类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getImplicitDuration
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public float getImplicitDuration() {
float dur = -1.0F;
if (ENDSYNC_LAST.equals(getEndSync())) {
NodeList children = getTimeChildren();
for (int i = 0; i < children.getLength(); ++i) {
ElementTime child = (ElementTime) children.item(i);
TimeList endTimeList = child.getEnd();
for (int j = 0; j < endTimeList.getLength(); ++j) {
Time endTime = endTimeList.item(j);
if (endTime.getTimeType() == Time.SMIL_TIME_INDEFINITE) {
// Return "indefinite" here.
return -1.0F;
}
if (endTime.getResolved()) {
float end = (float)endTime.getResolvedOffset();
dur = (end > dur) ? end : dur;
}
}
}
} // Other endsync types are not supported now.
return dur;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:24,代码来源:ElementParallelTimeContainerImpl.java
示例2: getBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getBegin() {
String[] beginTimeStringList = mSmilElement.getAttribute("begin").split(";");
// TODO: Check other constraints on parsed values, e.g., "single, non-negative offset values
ArrayList<Time> beginTimeList = new ArrayList<Time>();
// Initialize Time instances and add them to Vector
for (int i = 0; i < beginTimeStringList.length; i++) {
try {
beginTimeList.add(new TimeImpl(beginTimeStringList[i], getBeginConstraints()));
} catch (IllegalArgumentException e) {
// Ignore badly formatted times
}
}
if (beginTimeList.size() == 0) {
/*
* What is the right default value?
*
* In MMS SMIL, this method may be called either on an instance of:
*
* 1 - ElementSequentialTimeContainer (The SMILDocument)
* 2 - ElementParallelTimeContainer (A Time-Child of the SMILDocument, which is a seq)
* 3 - ElementTime (A SMILMediaElement).
*
* 1 - In the first case, the default start time is obviously 0.
* 2 - In the second case, the specifications mentions that
* "For children of a sequence, the only legal value for begin is
* a (single) non-negative offset value. The default begin value is 0."
* 3 - In the third case, the specification mentions that
* "The default value of begin for children of a par is 0."
*
* In short, if no value is specified, the default is always 0.
*/
beginTimeList.add(new TimeImpl("0", TimeImpl.ALLOW_ALL));
}
return new TimeListImpl(beginTimeList);
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:38,代码来源:ElementTimeImpl.java
示例3: getEnd
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getEnd() {
ArrayList<Time> endTimeList = new ArrayList<Time>();
String[] endTimeStringList = mSmilElement.getAttribute("end").split(";");
int len = endTimeStringList.length;
if (!((len == 1) && (endTimeStringList[0].length() == 0))) { // Ensure the end field is set.
// Initialize Time instances and add them to Vector
for (int i = 0; i < len; i++) {
try {
endTimeList.add(new TimeImpl(endTimeStringList[i],
getEndConstraints()));
} catch (IllegalArgumentException e) {
// Ignore badly formatted times
Log.e(TAG, "Malformed time value.", e);
}
}
}
// "end" time is not specified
if (endTimeList.size() == 0) {
// Get duration
float duration = getDur();
if (duration < 0) {
endTimeList.add(new TimeImpl("indefinite", getEndConstraints()));
} else {
// Get begin
TimeList begin = getBegin();
for (int i = 0; i < begin.getLength(); i++) {
endTimeList.add(new TimeImpl(
// end = begin + dur
begin.item(i).getResolvedOffset() + duration + "s",
getEndConstraints()));
}
}
}
return new TimeListImpl(endTimeList);
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:40,代码来源:ElementTimeImpl.java
示例4: beginAndEndAreZero
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
private boolean beginAndEndAreZero() {
TimeList begin = getBegin();
TimeList end = getEnd();
if (begin.getLength() == 1 && end.getLength() == 1) {
Time beginTime = begin.item(0);
Time endTime = end.item(0);
return beginTime.getOffset() == 0. && endTime.getOffset() == 0.;
}
return false;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:11,代码来源:ElementTimeImpl.java
示例5: getBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
@Override
public TimeList getBegin() {
/*
* For children of a sequence, the only legal value for begin is
* a (single) non-negative offset value.
*/
TimeList beginTimeList = super.getBegin();
if (beginTimeList.getLength() > 1) {
ArrayList<Time> singleTimeContainer = new ArrayList<Time>();
singleTimeContainer.add(beginTimeList.item(0));
beginTimeList = new TimeListImpl(singleTimeContainer);
}
return beginTimeList;
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:15,代码来源:SmilParElementImpl.java
示例6: getBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getBegin() {
String[] beginTimeStringList = mSmilElement.getAttribute("begin").split(";");
// TODO: Check other constraints on parsed values, e.g., "single, non-negative offset values
ArrayList<Time> beginTimeList = new ArrayList<>();
// Initialize Time instances and add them to Vector
for (String aBeginTimeStringList : beginTimeStringList) {
try {
beginTimeList.add(new TimeImpl(aBeginTimeStringList, getBeginConstraints()));
} catch (IllegalArgumentException e) {
// Ignore badly formatted times
}
}
if (beginTimeList.isEmpty()) {
/*
* What is the right default value?
*
* In MMS SMIL, this method may be called either on an instance of:
*
* 1 - ElementSequentialTimeContainer (The SMILDocument)
* 2 - ElementParallelTimeContainer (A Time-Child of the SMILDocument, which is a seq)
* 3 - ElementTime (A SMILMediaElement).
*
* 1 - In the first case, the default start time is obviously 0.
* 2 - In the second case, the specifications mentions that
* "For children of a sequence, the only legal value for begin is
* a (single) non-negative offset value. The default begin value is 0."
* 3 - In the third case, the specification mentions that
* "The default value of begin for children of a par is 0."
*
* In short, if no value is specified, the default is always 0.
*/
beginTimeList.add(new TimeImpl("0", TimeImpl.ALLOW_ALL));
}
return new TimeListImpl(beginTimeList);
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:38,代码来源:ElementTimeImpl.java
示例7: getEnd
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getEnd() {
ArrayList<Time> endTimeList = new ArrayList<>();
String[] endTimeStringList = mSmilElement.getAttribute("end").split(";");
int len = endTimeStringList.length;
if (!((len == 1) && (endTimeStringList[0].length() == 0))) { // Ensure the end field is set.
// Initialize Time instances and add them to Vector
for (String anEndTimeStringList : endTimeStringList) {
try {
endTimeList.add(new TimeImpl(anEndTimeStringList,
getEndConstraints()));
} catch (IllegalArgumentException e) {
// Ignore badly formatted times
Log.e(TAG, "Malformed time value.", e);
}
}
}
// "end" time is not specified
if (endTimeList.isEmpty()) {
// Get duration
float duration = getDur();
if (duration < 0) {
endTimeList.add(new TimeImpl("indefinite", getEndConstraints()));
} else {
// Get begin
TimeList begin = getBegin();
for (int i = 0; i < begin.getLength(); i++) {
endTimeList.add(new TimeImpl(
// end = begin + dur
begin.item(i).getResolvedOffset() + duration + "s",
getEndConstraints()));
}
}
}
return new TimeListImpl(endTimeList);
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:40,代码来源:ElementTimeImpl.java
示例8: getBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
@Override
public TimeList getBegin() {
/*
* For children of a sequence, the only legal value for begin is
* a (single) non-negative offset value.
*/
TimeList beginTimeList = super.getBegin();
if (beginTimeList.getLength() > 1) {
ArrayList<Time> singleTimeContainer = new ArrayList<>();
singleTimeContainer.add(beginTimeList.item(0));
beginTimeList = new TimeListImpl(singleTimeContainer);
}
return beginTimeList;
}
开发者ID:moezbhatti,项目名称:qksms,代码行数:15,代码来源:SmilParElementImpl.java
示例9: setBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public void setBegin(TimeList begin) throws DOMException {
// TODO Implement this
mSmilElement.setAttribute("begin", "indefinite");
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:ElementTimeImpl.java
示例10: setEnd
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public void setEnd(TimeList end) throws DOMException {
// TODO Implement this
mSmilElement.setAttribute("end", "indefinite");
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:5,代码来源:ElementTimeImpl.java
示例11: getBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getBegin() {
return mSeqTimeContainer.getBegin();
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SmilDocumentImpl.java
示例12: getEnd
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public TimeList getEnd() {
return mSeqTimeContainer.getEnd();
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SmilDocumentImpl.java
示例13: setBegin
import org.w3c.dom.smil.TimeList; //导入依赖的package包/类
public void setBegin(TimeList begin) throws DOMException {
mSeqTimeContainer.setBegin(begin);
}
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:4,代码来源:SmilDocumentImpl.java
注:本文中的org.w3c.dom.smil.TimeList类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论