|
1 /* |
|
2 * Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package javax.microedition.m3g; |
|
20 |
|
21 public class KeyframeSequence extends Object3D |
|
22 { |
|
23 //------------------------------------------------------------------ |
|
24 // Static data |
|
25 //------------------------------------------------------------------ |
|
26 |
|
27 public static final int LINEAR = 176; |
|
28 public static final int SLERP = 177; |
|
29 public static final int SPLINE = 178; |
|
30 public static final int SQUAD = 179; |
|
31 public static final int STEP = 180; |
|
32 |
|
33 public static final int CONSTANT = 192; |
|
34 public static final int LOOP = 193; |
|
35 |
|
36 //------------------------------------------------------------------ |
|
37 // Constructor |
|
38 //------------------------------------------------------------------ |
|
39 |
|
40 public KeyframeSequence(int numKeyframes, |
|
41 int numComponents, |
|
42 int interpolation) |
|
43 { |
|
44 super(_ctor(Interface.getHandle(), |
|
45 numKeyframes, |
|
46 numComponents, |
|
47 interpolation)); |
|
48 } |
|
49 |
|
50 /** |
|
51 */ |
|
52 KeyframeSequence(int handle) |
|
53 { |
|
54 super(handle); |
|
55 } |
|
56 |
|
57 //------------------------------------------------------------------ |
|
58 // Public methods |
|
59 //------------------------------------------------------------------ |
|
60 |
|
61 public void setKeyframe(int index, int time, float[] value) |
|
62 { |
|
63 _setKeyframe(handle, index, time, value); |
|
64 } |
|
65 |
|
66 public void setValidRange(int first, int last) |
|
67 { |
|
68 _setValidRange(handle, first, last); |
|
69 } |
|
70 |
|
71 public void setDuration(int duration) |
|
72 { |
|
73 _setDuration(handle, duration); |
|
74 } |
|
75 |
|
76 public int getDuration() |
|
77 { |
|
78 return _getDuration(handle); |
|
79 } |
|
80 |
|
81 /** |
|
82 */ |
|
83 public void setRepeatMode(int mode) |
|
84 { |
|
85 _setRepeatMode(handle, mode); |
|
86 } |
|
87 |
|
88 /** |
|
89 */ |
|
90 public int getRepeatMode() |
|
91 { |
|
92 return _getRepeatMode(handle); |
|
93 } |
|
94 |
|
95 // M3G 1.1 Maintenance release getters |
|
96 |
|
97 public int getComponentCount() |
|
98 { |
|
99 return _getComponentCount(handle); |
|
100 } |
|
101 |
|
102 public int getInterpolationType() |
|
103 { |
|
104 return _getInterpolationType(handle); |
|
105 } |
|
106 |
|
107 public int getKeyframe(int index, float[] value) |
|
108 { |
|
109 return _getKeyframe(handle, index, value); |
|
110 } |
|
111 |
|
112 public int getKeyframeCount() |
|
113 { |
|
114 return _getKeyframeCount(handle); |
|
115 } |
|
116 |
|
117 public int getValidRangeFirst() |
|
118 { |
|
119 return _getValidRangeFirst(handle); |
|
120 } |
|
121 |
|
122 public int getValidRangeLast() |
|
123 { |
|
124 return _getValidRangeLast(handle); |
|
125 } |
|
126 |
|
127 |
|
128 //------------------------------------------------------------------ |
|
129 // Private methods |
|
130 //------------------------------------------------------------------ |
|
131 |
|
132 private native static int _ctor(int hInterface, |
|
133 int numKeyframes, |
|
134 int numComponents, |
|
135 int interpolation); |
|
136 private native static void _setValidRange(int handle, int first, int last); |
|
137 private native static void _setKeyframe(int handle, int index, int time, float[] value); |
|
138 private native static void _setDuration(int handle, int duration); |
|
139 private native static int _getDuration(int handle); |
|
140 private native static void _setRepeatMode(int handle, int mode); |
|
141 private native static int _getRepeatMode(int handle); |
|
142 |
|
143 // M3G 1.1 Maintenance release getters |
|
144 private native static int _getComponentCount(int handle); |
|
145 private native static int _getInterpolationType(int handle); |
|
146 private native static int _getKeyframe(int handle, int index, float[] value); |
|
147 private native static int _getKeyframeCount(int handle); |
|
148 private native static int _getValidRangeFirst(int handle); |
|
149 private native static int _getValidRangeLast(int handle); |
|
150 } |