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.dom.svg;
20:
21: import java.awt.geom.AffineTransform;
22: import java.awt.geom.Rectangle2D;
23:
24: /**
25: * This interface is the placeholder for SVG application informations.
26: *
27: * @author <a href="mailto:stephane@hillion.org">Stephane Hillion</a>
28: * @version $Id: SVGContext.java 478249 2006-11-22 17:29:37Z dvholten $
29: */
30: public interface SVGContext {
31:
32: // Constants for percentage interpretation.
33: int PERCENTAGE_FONT_SIZE = 0;
34: int PERCENTAGE_VIEWPORT_WIDTH = 1;
35: int PERCENTAGE_VIEWPORT_HEIGHT = 2;
36: int PERCENTAGE_VIEWPORT_SIZE = 3;
37:
38: /**
39: * Returns the size of a px CSS unit in millimeters.
40: */
41: float getPixelUnitToMillimeter();
42:
43: /**
44: * Returns the size of a px CSS unit in millimeters.
45: * This will be removed after next release.
46: * @see #getPixelUnitToMillimeter()
47: */
48: float getPixelToMM();
49:
50: /**
51: * Returns the tight bounding box in current user space (i.e.,
52: * after application of the transform attribute, if any) on the
53: * geometry of all contained graphics elements, exclusive of
54: * stroke-width and filter effects).
55: */
56: Rectangle2D getBBox();
57:
58: /**
59: * Returns the transform from the global transform space to pixels.
60: */
61: AffineTransform getScreenTransform();
62:
63: /**
64: * Sets the transform to be used from the global transform space to pixels.
65: */
66: void setScreenTransform(AffineTransform at);
67:
68: /**
69: * Returns the transformation matrix from current user units
70: * (i.e., after application of the transform attribute, if any) to
71: * the viewport coordinate system for the nearestViewportElement.
72: */
73: AffineTransform getCTM();
74:
75: /**
76: * Returns the global transformation matrix from the current
77: * element to the root.
78: */
79: AffineTransform getGlobalTransform();
80:
81: /**
82: * Returns the width of the viewport which directly contains the
83: * associated element.
84: */
85: float getViewportWidth();
86:
87: /**
88: * Returns the height of the viewport which directly contains the
89: * associated element.
90: */
91: float getViewportHeight();
92:
93: /**
94: * Returns the font-size on the associated element.
95: */
96: float getFontSize();
97: }
|