当前位置: 首页>>代码示例>>Java>>正文


Java BlockReplacedBox类代码示例

本文整理汇总了Java中org.fit.cssbox.layout.BlockReplacedBox的典型用法代码示例。如果您正苦于以下问题:Java BlockReplacedBox类的具体用法?Java BlockReplacedBox怎么用?Java BlockReplacedBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BlockReplacedBox类属于org.fit.cssbox.layout包,在下文中一共展示了BlockReplacedBox类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: BlockReplacedBoxView

import org.fit.cssbox.layout.BlockReplacedBox; //导入依赖的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: buildBlockReplacedBox

import org.fit.cssbox.layout.BlockReplacedBox; //导入依赖的package包/类
private void buildBlockReplacedBox(List<ElementSpec> elements, BlockReplacedBox box)
{
    // some content
    org.w3c.dom.Element elem = box.getElement();
    String text = "";
    // add some textual info, if picture
    if ("img".equalsIgnoreCase(elem.getTagName()))
    {
        text = " [" + elem.getAttribute("alt") + " Location: "
                + elem.getAttribute("src") + "] ";
    }

    MutableAttributeSet attr = new SimpleAttributeSet();
    attr.addAttribute(SwingBoxDocument.ElementNameAttribute, Constants.BLOCK_REPLACED_BOX);
    attr.addAttribute(Constants.ATTRIBUTE_BOX_REFERENCE, box);
    attr.addAttribute(Constants.ATTRIBUTE_ANCHOR_REFERENCE, new Anchor());
    attr.addAttribute(Constants.ATTRIBUTE_REPLACED_CONTENT,
            box.getContentObj());

    elements.add(new ElementSpec(attr, ElementSpec.ContentType, text.toCharArray(), 0, text.length()));
}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:22,代码来源:ContentReader.java

示例3: buildReplacedBox

import org.fit.cssbox.layout.BlockReplacedBox; //导入依赖的package包/类
private SimpleAttributeSet buildReplacedBox(ReplacedBox box)
{
    SimpleAttributeSet attr = new SimpleAttributeSet();
    if (box instanceof BlockReplacedBox)
        attr.addAttribute(SwingBoxDocument.ElementNameAttribute, Constants.BLOCK_REPLACED_BOX);
    else if (box instanceof InlineBlockReplacedBox)
        attr.addAttribute(SwingBoxDocument.ElementNameAttribute, Constants.INLINE_BLOCK_REPLACED_BOX);
    else
        attr.addAttribute(SwingBoxDocument.ElementNameAttribute, Constants.INLINE_REPLACED_BOX);
    attr.addAttribute(Constants.ATTRIBUTE_BOX_REFERENCE, box);
    attr.addAttribute(Constants.ATTRIBUTE_ANCHOR_REFERENCE, new Anchor());
    attr.addAttribute(Constants.ATTRIBUTE_REPLACED_CONTENT, box.getContentObj());

    return attr;
}
 
开发者ID:radkovo,项目名称:SwingBox,代码行数:16,代码来源:ContentReader.java

示例4: buildElements

import org.fit.cssbox.layout.BlockReplacedBox; //导入依赖的package包/类
private void buildElements(List<ElementSpec> elements, ElementBox box)
{
    Box tmp;

    int total = box.getEndChild();
    for (int i = box.getStartChild(); i < total; i++)
    {
        tmp = box.getSubBox(i);

        if (tmp instanceof TextBox)
        { // -- text box
            buildText(elements, (TextBox) tmp);
        }
        else if (tmp instanceof InlineReplacedBox)
        { // -- inline boxes
            buildInlineReplacedBox(elements, (InlineReplacedBox) tmp);
        }
        else if (tmp instanceof InlineBox)
        {
            buildInlineBox(elements, (InlineBox) tmp);
        }
        else if (tmp instanceof Viewport)
        { // -- the boxes
            buildViewport(elements, (Viewport) tmp);
        }
        else if (tmp instanceof BlockReplacedBox)
        {
            buildBlockReplacedBox(elements, (BlockReplacedBox) tmp);
        }
        else if (tmp instanceof TableBox)
        { // -- tables
            buildTableBox(elements, (TableBox) tmp);
        }
        else if (tmp instanceof TableCaptionBox)
        {
            buildTableCaptionBox(elements, (TableCaptionBox) tmp);
        }
        else if (tmp instanceof TableBodyBox)
        {
            buildTableBodyBox(elements, (TableBodyBox) tmp);
        }
        else if (tmp instanceof TableRowBox)
        {
            buildTableRowBox(elements, (TableRowBox) tmp);
        }
        else if (tmp instanceof TableCellBox)
        {
            buildTableCellBox(elements, (TableCellBox) tmp);
        }
        else if (tmp instanceof TableColumnGroup)
        {
            buildTableColumnGroup(elements, (TableColumnGroup) tmp);
        }
        else if (tmp instanceof TableColumn)
        {
            buildTableColumn(elements, (TableColumn) tmp);
        }
        else if (tmp instanceof BlockTableBox)
        {
            buildBlockTableBox(elements, (BlockTableBox) tmp);
        }
        else if (tmp instanceof ListItemBox)
        {
            buildListItemBox(elements, (ListItemBox) tmp);
        }
        else if (tmp instanceof BlockBox)
        {
            buildBlockBox(elements, (BlockBox) tmp);
        }
        else
        {
            // todo log this !
            System.err.println("Unknowen BOX : " + tmp.getClass().getName());
        }

    }

}
 
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:79,代码来源:ContentReader.java


注:本文中的org.fit.cssbox.layout.BlockReplacedBox类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。