blob: b02f9c586274c5202c2a496eac5c2779eb0c2caa [file] [log] [blame]
Xavier Ducrohetc810bea2010-12-20 08:22:47 -08001/*
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
21import java.awt.Stroke;
22
23/**
24 * Delegate implementing the native methods of android.graphics.SumPathEffect
25 *
26 * Through the layoutlib_create tool, the original native methods of SumPathEffect have been
27 * replaced by calls to methods of the same name in this delegate class.
28 *
29 * This class behaves like the original native implementation, but in Java, keeping previously
30 * native data into its own objects and mapping them to int that are sent back and forth between
31 * it and the original SumPathEffect class.
32 *
33 * Because this extends {@link Shader_Delegate}, there's no need to use a {@link DelegateManager},
34 * as all the Shader classes will be added to the manager owned by {@link Shader_Delegate}.
35 *
36 * @see Shader_Delegate
37 *
38 */
39public class SumPathEffect_Delegate extends PathEffect_Delegate {
40
41 // ---- delegate data ----
42
43 // ---- Public Helper methods ----
44
45 @Override
46 public Stroke getStroke(Paint_Delegate paint) {
47 // FIXME
48 return null;
49 }
50
51 @Override
52 public boolean isSupported() {
53 return false;
54 }
55
56 @Override
57 public String getSupportMessage() {
58 return "Sum Path Effects are not supported in Layout Preview mode.";
59 }
60
61 // ---- native methods ----
62
63 /*package*/ static int nativeCreate(int first, int second) {
64 SumPathEffect_Delegate newDelegate = new SumPathEffect_Delegate();
65 return sManager.addDelegate(newDelegate);
66 }
67
68 // ---- Private delegate/helper methods ----
69}