LightingColorFilter_Delegate.java revision d43909c7503e11eb335a452d296a10804bb01fd6
1/*
2 * Copyright (C) 2010 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.graphics;
18
19import com.android.layoutlib.bridge.impl.DelegateManager;
20
21/**
22 * Delegate implementing the native methods of android.graphics.LightingColorFilter
23 *
24 * Through the layoutlib_create tool, the original native methods of LightingColorFilter have
25 * been replaced by calls to methods of the same name in this delegate class.
26 *
27 * This class behaves like the original native implementation, but in Java, keeping previously
28 * native data into its own objects and mapping them to int that are sent back and forth between
29 * it and the original LightingColorFilter class.
30 *
31 * Because this extends {@link ColorFilter_Delegate}, there's no need to use a
32 * {@link DelegateManager}, as all the Shader classes will be added to the manager
33 * owned by {@link ColorFilter_Delegate}.
34 *
35 * @see ColorFilter_Delegate
36 *
37 */
38public class LightingColorFilter_Delegate extends ColorFilter_Delegate {
39
40    // ---- delegate data ----
41
42    // ---- Public Helper methods ----
43
44    @Override
45    public boolean isSupported() {
46        return false;
47    }
48
49    @Override
50    public String getSupportMessage() {
51        return "Lighting Color Filters are not supported.";
52    }
53
54    // ---- native methods ----
55
56    /*package*/ static int native_CreateLightingFilter(int mul, int add) {
57        LightingColorFilter_Delegate newDelegate = new LightingColorFilter_Delegate();
58        return sManager.addDelegate(newDelegate);
59    }
60
61    /*package*/ static int nCreateLightingFilter(int nativeFilter, int mul, int add) {
62        // pass
63        return 0;
64    }
65
66    // ---- Private delegate/helper methods ----
67}
68