本文整理汇总了Java中org.w3c.dom.smil.ElementTime类的典型用法代码示例。如果您正苦于以下问题:Java ElementTime类的具体用法?Java ElementTime怎么用?Java ElementTime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementTime类属于org.w3c.dom.smil包,在下文中一共展示了ElementTime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getImplicitDuration
import org.w3c.dom.smil.ElementTime; //导入依赖的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;
}
示例2: seekActiveMedia
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized void seekActiveMedia() {
for (int i = mActiveElements.size() - 1; i >= 0; i--) {
ElementTime element = mActiveElements.get(i);
if (element instanceof SmilParElementImpl) {
return;
}
double offset = getOffsetTime(element);
if ((offset >= 0) && (offset <= mCurrentTime)) {
if (LOCAL_LOGV) {
Log.v(TAG, "[SEEK] " + " at " + mCurrentTime
+ " " + element);
}
element.seekElement( (float) (mCurrentTime - offset) );
}
}
}
示例3: getFillDefault
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public short getFillDefault() {
String fillDefault = mSmilElement.getAttribute(FILLDEFAULT_ATTRIBUTE_NAME);
if (fillDefault.equalsIgnoreCase(FILL_REMOVE_ATTRIBUTE)) {
return FILL_REMOVE;
} else if (fillDefault.equalsIgnoreCase(FILL_FREEZE_ATTRIBUTE)) {
return FILL_FREEZE;
} else if (fillDefault.equalsIgnoreCase(FILL_AUTO_ATTRIBUTE)) {
return FILL_AUTO;
} else if (fillDefault.equalsIgnoreCase(FILL_HOLD_ATTRIBUTE)) {
// FIXME handle it as freeze for now
return FILL_FREEZE;
} else if (fillDefault.equalsIgnoreCase(FILL_TRANSITION_ATTRIBUTE)) {
// FIXME handle it as freeze for now
return FILL_FREEZE;
} else {
/*
* fillDefault = inherit
* Specifies that the value of this attribute (and of the fill behavior) are
* inherited from the fillDefault value of the parent element.
* This is the default value.
*/
ElementTime parent = getParentElementTime();
if (parent == null) {
/*
* fillDefault = auto
* If there is no parent element, the value is "auto".
*/
return FILL_AUTO;
} else {
return ((ElementTimeImpl) parent).getFillDefault();
}
}
}
示例4: getActiveChildrenAt
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public NodeList getActiveChildrenAt(float instant) {
NodeList allChildren = this.getTimeChildren();
ArrayList<Node> nodes = new ArrayList<Node>();
for (int i = 0; i < allChildren.getLength(); i++) {
instant -= ((ElementTime) allChildren.item(i)).getDur();
if (instant < 0) {
nodes.add(allChildren.item(i));
return new NodeListImpl(nodes);
}
}
return new NodeListImpl(nodes);
}
示例5: getDur
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public float getDur() {
float dur = super.getDur();
if (dur == 0) {
NodeList children = getTimeChildren();
for (int i = 0; i < children.getLength(); ++i) {
ElementTime child = (ElementTime) children.item(i);
if (child.getDur() < 0) {
// Return "indefinite" since containing a child whose duration is indefinite.
return -1.0F;
}
dur += child.getDur();
}
}
return dur;
}
示例6: init
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public synchronized void init(ElementTime root) {
mRoot = root;
mAllEntries = getTimeline(mRoot, 0, Long.MAX_VALUE);
mMediaTimeUpdatedEvent = ((DocumentEvent) mRoot).createEvent("Event");
mMediaTimeUpdatedEvent.initEvent(MEDIA_TIME_UPDATED_EVENT, false, false);
mActiveElements = new ArrayList<>();
}
示例7: getOffsetTime
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized double getOffsetTime(ElementTime element) {
for (int i = mCurrentSlide; i < mCurrentElement; i++) {
TimelineEntry entry = mAllEntries.get(i);
if (element.equals(entry.getElement())) {
return entry.getOffsetTime() * 1000; // in ms
}
}
return -1;
}
示例8: seekActiveMedia
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized void seekActiveMedia() {
for (int i = mActiveElements.size() - 1; i >= 0; i--) {
ElementTime element = mActiveElements.get(i);
if (element instanceof SmilParElementImpl) {
return;
}
double offset = getOffsetTime(element);
if ((offset >= 0) && (offset <= mCurrentTime)) {
if (LOCAL_LOGV) Log.v(TAG, "[SEEK] " + " at " + mCurrentTime
+ " " + element);
element.seekElement( (float) (mCurrentTime - offset) );
}
}
}
示例9: endActiveElements
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized void endActiveElements() {
for (int i = mActiveElements.size() - 1; i >= 0; i--) {
ElementTime element = mActiveElements.get(i);
if (LOCAL_LOGV) Log.v(TAG, "[STOP] " + " at " + mCurrentTime + " " + element);
element.endElement();
}
}
示例10: pauseActiveElements
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized void pauseActiveElements() {
for (int i = mActiveElements.size() - 1; i >= 0; i--) {
ElementTime element = mActiveElements.get(i);
if (LOCAL_LOGV) Log.v(TAG, "[PAUSE] " + " at " + mCurrentTime + " " + element);
element.pauseElement();
}
}
示例11: resumeActiveElements
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
private synchronized void resumeActiveElements() {
int size = mActiveElements.size();
for (int i = 0; i < size; i++) {
ElementTime element = mActiveElements.get(i);
if (LOCAL_LOGV) Log.v(TAG, "[RESUME] " + " at " + mCurrentTime + " " + element);
element.resumeElement();
}
}
示例12: getFillDefault
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public short getFillDefault() {
String fillDefault = mSmilElement.getAttribute(FILLDEFAULT_ATTRIBUTE_NAME);
if (fillDefault.equalsIgnoreCase(FILL_REMOVE_ATTRIBUTE)) {
return FILL_REMOVE;
} else if (fillDefault.equalsIgnoreCase(FILL_FREEZE_ATTRIBUTE)) {
return FILL_FREEZE;
} else if (fillDefault.equalsIgnoreCase(FILL_AUTO_ATTRIBUTE)) {
return FILL_AUTO;
} else if (fillDefault.equalsIgnoreCase(FILL_HOLD_ATTRIBUTE)) {
// FIXME handle it as freeze for now
return FILL_FREEZE;
} else if (fillDefault.equalsIgnoreCase(FILL_TRANSITION_ATTRIBUTE)) {
// FIXME handle it as freeze for now
return FILL_FREEZE;
} else {
/*
* fillDefault = inherit
* Specifies that the value of this attribute (and of the fill behavior) are
* inherited from the fillDefault value of the parent element.
* This is the default value.
*/
ElementTime parent = getParentElementTime();
if (parent == null) {
/*
* fillDefault = auto
* If there is no parent element, the value is "auto".
*/
return FILL_AUTO;
} else {
return parent.getFillDefault();
}
}
}
示例13: handleEvent
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public void handleEvent(Event evt) {
if (evt.getType().equals(SmilParElementImpl.SMIL_SLIDE_START_EVENT)) {
if (LOCAL_LOGV) {
Log.v(TAG, "Start to play slide: " + this);
}
mVisible = true;
} else if (mFill != ElementTime.FILL_FREEZE) {
if (LOCAL_LOGV) {
Log.v(TAG, "Stop playing slide: " + this);
}
mVisible = false;
}
notifyModelChanged(false);
}
示例14: handleEvent
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
public void handleEvent(Event evt) {
if (evt.getType().equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
mVisible = true;
} else if (mFill != ElementTime.FILL_FREEZE) {
mVisible = false;
}
notifyModelChanged(false);
}
示例15: handleEvent
import org.w3c.dom.smil.ElementTime; //导入依赖的package包/类
@Override
public void handleEvent(Event evt) {
if (evt.getType().equals(SmilMediaElementImpl.SMIL_MEDIA_START_EVENT)) {
mVisible = true;
} else if (mFill != ElementTime.FILL_FREEZE) {
mVisible = false;
}
notifyModelChanged(false);
}