8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.webkit.graphics;
27
28 import java.util.HashMap;
29 import java.util.Map;
30
31 final class RenderMediaControls {
32 /**
33 * Media control part constants (types for the paintControl method)
34 */
35 private static final int PLAY_BUTTON = 1;
36 private static final int PAUSE_BUTTON = 2;
37 private static final int DISABLED_PLAY_BUTTON = 3;
38
39 private static final int MUTE_BUTTON = 4;
40 private static final int UNMUTE_BUTTON = 5;
41 private static final int DISABLED_MUTE_BUTTON = 6;
42
43 //private static final int FULLSCREEN_BUTTON = 7;
44
45 // background for control panel (except buttons)
46 //private static final int BACKGROUND = 8;
47
48 // Time slider track is rendered by paintTimeSliderTrack
49 private static final int TIME_SLIDER_TRACK = 9;
50 private static final int TIME_SLIDER_THUMB = 10;
51
52 private static final int VOLUME_CONTAINER = 11;
53 // Volume slider track is rendered by paintVolumeTrack
54 private static final int VOLUME_TRACK = 12;
55 private static final int VOLUME_THUMB = 13;
56
57 //private static final int CURRENT_TIME = 14;
58 //private static final int REMAINING_TIME = 15;
59
60 private static String getControlName(int control) {
61 switch (control) {
62 case PLAY_BUTTON: return "PLAY_BUTTON";
63 case PAUSE_BUTTON: return "PAUSE_BUTTON";
64 case DISABLED_PLAY_BUTTON: return "DISABLED_PLAY_BUTTON";
65
66 case MUTE_BUTTON: return "MUTE_BUTTON";
67 case UNMUTE_BUTTON: return "UNMUTE_BUTTON";
68 case DISABLED_MUTE_BUTTON: return "DISABLED_MUTE_BUTTON";
69
70 //case FULLSCREEN_BUTTON: return "FULLSCREEN_BUTTON";
71
72 //case BACKGROUND: return "BACKGROUND";
73
74 case TIME_SLIDER_TRACK: return "TIME_SLIDER_TRACK";
75 case TIME_SLIDER_THUMB: return "TIME_SLIDER_THUMB";
|
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 * questions.
24 */
25
26 package com.sun.webkit.graphics;
27
28 import java.lang.annotation.Native;
29 import java.util.HashMap;
30 import java.util.Map;
31
32 final class RenderMediaControls {
33 /**
34 * Media control part constants (types for the paintControl method)
35 */
36 @Native private static final int PLAY_BUTTON = 1;
37 @Native private static final int PAUSE_BUTTON = 2;
38 @Native private static final int DISABLED_PLAY_BUTTON = 3;
39
40 @Native private static final int MUTE_BUTTON = 4;
41 @Native private static final int UNMUTE_BUTTON = 5;
42 @Native private static final int DISABLED_MUTE_BUTTON = 6;
43
44 //@Native private static final int FULLSCREEN_BUTTON = 7;
45
46 // background for control panel (except buttons)
47 //@Native private static final int BACKGROUND = 8;
48
49 // Time slider track is rendered by paintTimeSliderTrack
50 @Native private static final int TIME_SLIDER_TRACK = 9;
51 @Native private static final int TIME_SLIDER_THUMB = 10;
52
53 @Native private static final int VOLUME_CONTAINER = 11;
54 // Volume slider track is rendered by paintVolumeTrack
55 @Native private static final int VOLUME_TRACK = 12;
56 @Native private static final int VOLUME_THUMB = 13;
57
58 //private static final int CURRENT_TIME = 14;
59 //private static final int REMAINING_TIME = 15;
60
61 private static String getControlName(int control) {
62 switch (control) {
63 case PLAY_BUTTON: return "PLAY_BUTTON";
64 case PAUSE_BUTTON: return "PAUSE_BUTTON";
65 case DISABLED_PLAY_BUTTON: return "DISABLED_PLAY_BUTTON";
66
67 case MUTE_BUTTON: return "MUTE_BUTTON";
68 case UNMUTE_BUTTON: return "UNMUTE_BUTTON";
69 case DISABLED_MUTE_BUTTON: return "DISABLED_MUTE_BUTTON";
70
71 //case FULLSCREEN_BUTTON: return "FULLSCREEN_BUTTON";
72
73 //case BACKGROUND: return "BACKGROUND";
74
75 case TIME_SLIDER_TRACK: return "TIME_SLIDER_TRACK";
76 case TIME_SLIDER_THUMB: return "TIME_SLIDER_THUMB";
|