01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19: package org.apache.batik.bridge;
20:
21: import org.apache.batik.gvt.GraphicsNode;
22: import org.w3c.dom.Element;
23:
24: /**
25: * Bridge class for creating, building, and updating a <tt>GraphicsNode</tt>
26: * according to an <tt>Element</tt>.
27: *
28: * @author <a href="mailto:tkormann@apache.org">Thierry Kormann</a>
29: * @version $Id: GraphicsNodeBridge.java 475477 2006-11-15 22:44:28Z cam $
30: */
31: public interface GraphicsNodeBridge extends Bridge {
32:
33: /**
34: * Creates a <tt>GraphicsNode</tt> according to the specified parameters.
35: * This is called before children have been added to the
36: * returned GraphicsNode (obviously since you construct and return it).
37: *
38: * @param ctx the bridge context to use
39: * @param e the element that describes the graphics node to build
40: * @return a graphics node that represents the specified element
41: */
42: GraphicsNode createGraphicsNode(BridgeContext ctx, Element e);
43:
44: /**
45: * Builds using the specified BridgeContext and element, the
46: * specified graphics node. This is called after all the children
47: * of the node have been constructed and added, so it is safe to
48: * do work that depends on being able to see your children nodes
49: * in this method.
50: *
51: * @param ctx the bridge context to use
52: * @param e the element that describes the graphics node to build
53: * @param node the graphics node to build
54: */
55: void buildGraphicsNode(BridgeContext ctx, Element e,
56: GraphicsNode node);
57:
58: /**
59: * Returns true if the bridge handles container element, false
60: * otherwise.
61: */
62: boolean isComposite();
63:
64: /**
65: * Returns true if the graphics node has to be displayed, false
66: * otherwise.
67: */
68: boolean getDisplay(Element e);
69:
70: /**
71: * Returns the Bridge instance to be used for a single DOM
72: * element. For example, a static Bridge (i.e., a Bridge for
73: * static SVG content) will always return the same instance.
74: * A dynamic Bridge will return a new instance on each call.
75: *
76: * <!> FIX ME: Move to Bridge
77: */
78: Bridge getInstance();
79:
80: }
|