01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19: package org.apache.batik.dom.events;
20:
21: import org.w3c.dom.views.AbstractView;
22: import org.w3c.dom.smil.TimeEvent;
23:
24: /**
25: * An event class for SMIL timing events.
26: *
27: * @author <a href="mailto:cam%40mcc%2eid%2eau">Cameron McCormack</a>
28: * @version $Id: DOMTimeEvent.java 475477 2006-11-15 22:44:28Z cam $
29: */
30: public class DOMTimeEvent extends AbstractEvent implements TimeEvent {
31:
32: /**
33: * The view from which the event was generated.
34: */
35: protected AbstractView view;
36:
37: /**
38: * For repeat events this is the repeat iteration. Unused for the
39: * other time events.
40: */
41: protected int detail;
42:
43: /**
44: * Returns the view from which the event was generated.
45: */
46: public AbstractView getView() {
47: return view;
48: }
49:
50: /**
51: * Returns the repeat iteration if this is a repeat event.
52: */
53: public int getDetail() {
54: return detail;
55: }
56:
57: /**
58: * Initializes the values of the TimeEvent object.
59: */
60: public void initTimeEvent(String typeArg, AbstractView viewArg,
61: int detailArg) {
62: initEvent(typeArg, false, false);
63: this .view = viewArg;
64: this .detail = detailArg;
65: }
66:
67: /**
68: * Initializes the values of the TimeEvent object.
69: */
70: public void initTimeEventNS(String namespaceURIArg, String typeArg,
71: AbstractView viewArg, int detailArg) {
72: initEventNS(namespaceURIArg, typeArg, false, false);
73: this .view = viewArg;
74: this .detail = detailArg;
75: }
76:
77: /**
78: * Sets the timestamp of this time event. This is required for
79: * synchronization of time events in the SMIL timing model.
80: */
81: public void setTimestamp(long timeStamp) {
82: this.timeStamp = timeStamp;
83: }
84: }
|