本文整理汇总了Java中org.fit.cssbox.layout.ReplacedImage类的典型用法代码示例。如果您正苦于以下问题:Java ReplacedImage类的具体用法?Java ReplacedImage怎么用?Java ReplacedImage使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ReplacedImage类属于org.fit.cssbox.layout包,在下文中一共展示了ReplacedImage类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BlockReplacedBoxView
import org.fit.cssbox.layout.ReplacedImage; //导入依赖的package包/类
/**
* Instantiates a new block replaced box view.
*
* @param elem
* the element
*/
public BlockReplacedBoxView(Element elem)
{
// bonus : spravit klikaciu mapu :)
super(elem);
content = ((BlockReplacedBox) box).getContentObj();
if (content instanceof ReplacedImage)
{
repImage = (ReplacedImage) content;
}
else
{
repImage = null;
}
loadElementAttributes();
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:24,代码来源:BlockReplacedBoxView.java
示例2: InlineReplacedBoxView
import org.fit.cssbox.layout.ReplacedImage; //导入依赖的package包/类
public InlineReplacedBoxView(Element elem)
{
super(elem);
content = ((InlineReplacedBox) box).getContentObj();
if (content instanceof ReplacedImage)
{
repImage = (ReplacedImage) content;
}
else
{
repImage = null;
}
loadElementAttributes();
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:17,代码来源:InlineReplacedBoxView.java
示例3: insertImg
import org.fit.cssbox.layout.ReplacedImage; //导入依赖的package包/类
/**
* Draws image gained from <img> tag to OUTPUT
*/
private void insertImg (ReplacedBox box, int i, float plusOffset, float plusHeight) {
ReplacedContent cont = box.getContentObj();
if (cont != null) {
if (cont instanceof ReplacedImage) {
BufferedImage img = ((ReplacedImage) cont).getBufferedImage();
float pageStart = i*pageFormat.getHeight();
float pageEnd = (i+1)*pageFormat.getHeight();
Rectangle cb = ((Box) box).getAbsoluteContentBounds();
if (img != null && cb.y*resCoef < pageEnd && (cb.y+img.getHeight())*resCoef+plusHeight+plusOffset > pageStart) {
// calculates resized coordinates in CSSBox form
float startX = cb.x*resCoef;
float startY = (cb.y*resCoef+plusOffset+plusHeight)-i*pageFormat.getHeight();
float width = (float)cb.getWidth()*resCoef;
float height = (float)cb.getHeight()*resCoef+plusHeight;
// inserts image
insertImagePDFBox(img, startX, startY, width, height);
}
}
}
}
开发者ID:radkovo,项目名称:CSSBoxPdf,代码行数:28,代码来源:PDFRenderer.java
注:本文中的org.fit.cssbox.layout.ReplacedImage类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论