本文整理汇总了Java中org.apache.batik.dom.svg.SVGOMDocument类的典型用法代码示例。如果您正苦于以下问题:Java SVGOMDocument类的具体用法?Java SVGOMDocument怎么用?Java SVGOMDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SVGOMDocument类属于org.apache.batik.dom.svg包,在下文中一共展示了SVGOMDocument类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initCSSEngine
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
/**
* Call before querying for CSS properties. If document has CSS engine installed returns null. Client is responsible to dispose bridge context if it was
* returned by this method.
*/
public BridgeContext initCSSEngine() {
if (this.document == null) {
return null;
}
SVGOMDocument sd = (SVGOMDocument) this.document;
if (sd.getCSSEngine() != null) {
return null;
}
class BridgeContextEx extends BridgeContext {
public BridgeContextEx() {
super(SimpleImageTranscoder.this.userAgent);
BridgeContextEx.this.setDocument(SimpleImageTranscoder.this.document);
BridgeContextEx.this.initializeDocument(SimpleImageTranscoder.this.document);
}
}
return new BridgeContextEx();
}
开发者ID:eclipse,项目名称:triquetrum,代码行数:23,代码来源:SimpleImageTranscoder.java
示例2: initCSSEngine
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
/**
* Call before querying for CSS properties. If document has CSS engine installed returns null. Client is responsible to
* dispose bridge context if it was returned by this method.
*/
public BridgeContext initCSSEngine() {
if (this.document == null) {
return null;
}
SVGOMDocument sd = (SVGOMDocument) this.document;
if (sd.getCSSEngine() != null) {
return null;
}
class BridgeContextEx extends BridgeContext {
public BridgeContextEx() {
super(SimpleImageTranscoder.this.userAgent);
BridgeContextEx.this.setDocument(SimpleImageTranscoder.this.document);
BridgeContextEx.this.initializeDocument(SimpleImageTranscoder.this.document);
}
}
return new BridgeContextEx();
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:SimpleImageTranscoder.java
示例3: createBridgeContext
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public BridgeContext createBridgeContext(SVGOMDocument doc) {
// Make sure any 'sub bridge contexts' also have our bridges.
return new PDFBridgeContext(getUserAgent(), getDocumentLoader(),
fontInfo,
getImageManager(),
getImageSessionContext(),
linkTransform);
}
开发者ID:pellcorp,项目名称:fop,代码行数:11,代码来源:PDFBridgeContext.java
示例4: createImageInfo
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
private ImageInfo createImageInfo(String uri, ImageContext context, SVGDocument doc) {
Element e = doc.getRootElement();
float pxUnitToMillimeter = UnitConv.IN2MM / context.getSourceResolution();
UserAgent userAg = new SimpleSVGUserAgent(pxUnitToMillimeter,
new AffineTransform()) {
/** {@inheritDoc} */
public void displayMessage(String message) {
log.debug(message);
}
};
BridgeContext ctx = new BridgeContext(userAg);
UnitProcessor.Context uctx = UnitProcessor.createContext(ctx, e);
String s;
// 'width' attribute - default is 100%
s = e.getAttributeNS(null, SVGOMDocument.SVG_WIDTH_ATTRIBUTE);
if (s.length() == 0) {
s = SVGOMDocument.SVG_SVG_WIDTH_DEFAULT_VALUE;
}
float width = UnitProcessor.svgHorizontalLengthToUserSpace(
s, SVGOMDocument.SVG_WIDTH_ATTRIBUTE, uctx);
// 'height' attribute - default is 100%
s = e.getAttributeNS(null, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE);
if (s.length() == 0) {
s = SVGOMDocument.SVG_SVG_HEIGHT_DEFAULT_VALUE;
}
float height = UnitProcessor.svgVerticalLengthToUserSpace(
s, SVGOMDocument.SVG_HEIGHT_ATTRIBUTE, uctx);
int widthMpt = (int)Math.round(px2mpt(width, context.getSourceResolution()));
int heightMpt = (int)Math.round(px2mpt(height, context.getSourceResolution()));
ImageInfo info = new ImageInfo(uri, MimeConstants.MIME_SVG);
ImageSize size = new ImageSize();
size.setSizeInMillipoints(widthMpt, heightMpt);
//Set the resolution to that of the FOUserAgent
size.setResolution(context.getSourceResolution());
size.calcPixelsFromSize();
info.setSize(size);
//The whole image had to be loaded for this, so keep it
ImageXMLDOM xmlImage = new ImageXMLDOM(info,
doc, BatikImageFlavors.SVG_DOM);
info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, xmlImage);
return info;
}
开发者ID:pellcorp,项目名称:fop,代码行数:50,代码来源:PreloaderSVG.java
示例5: createBridgeContext
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
/** {@inheritDoc} */
public BridgeContext createBridgeContext(SVGOMDocument doc) {
return createBridgeContext();
}
开发者ID:pellcorp,项目名称:fop,代码行数:5,代码来源:GenericFOPBridgeContext.java
示例6: createDocument
import org.apache.batik.dom.svg.SVGOMDocument; //导入依赖的package包/类
private static SVGOMDocument createDocument() {
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
String svgNS = SVGDOMImplementation.SVG_NAMESPACE_URI;
return (SVGOMDocument) impl.createDocument(svgNS, "svg", null);
}
开发者ID:JetBrains,项目名称:jetpad-projectional-open-source,代码行数:6,代码来源:SvgRootDocumentMapper.java
注:本文中的org.apache.batik.dom.svg.SVGOMDocument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论