KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > workbench > chart > ChartAsset


1 // Copyright 2004, 2005 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.workbench.chart;
16
17 import java.io.InputStream JavaDoc;
18 import java.util.Locale JavaDoc;
19
20 import org.apache.tapestry.IComponent;
21 import org.apache.tapestry.IEngine;
22 import org.apache.tapestry.IRequestCycle;
23 import org.apache.tapestry.asset.AbstractAsset;
24 import org.apache.tapestry.engine.IEngineService;
25 import org.apache.tapestry.engine.ILink;
26
27 /**
28  * An asset used with the {@link ChartService}.
29  *
30  * @author Howard Lewis Ship
31  * @since 1.0.10
32  */

33
34 public class ChartAsset extends AbstractAsset
35 {
36     private IEngineService _chartService;
37
38     private IComponent _chartProvider;
39
40     public ChartAsset(IRequestCycle cycle, IComponent chartProvider)
41     {
42         super(null, null);
43
44         IEngine engine = cycle.getEngine();
45
46         _chartService = engine.getService(ChartService.SERVICE_NAME);
47         _chartProvider = chartProvider;
48     }
49
50     public String JavaDoc buildURL(IRequestCycle cycle)
51     {
52         ILink l = _chartService.getLink(cycle, _chartProvider);
53
54         return l.getURL();
55     }
56
57     public InputStream JavaDoc getResourceAsStream(IRequestCycle cycle)
58     {
59         return null;
60     }
61
62     public InputStream JavaDoc getResourceAsStream(IRequestCycle cycle, Locale JavaDoc locale)
63     {
64         return null;
65     }
66
67 }
Popular Tags