當前位置: 首頁>>代碼示例>>Java>>正文


Java Rectangle.TOP屬性代碼示例

本文整理匯總了Java中com.lowagie.text.Rectangle.TOP屬性的典型用法代碼示例。如果您正苦於以下問題:Java Rectangle.TOP屬性的具體用法?Java Rectangle.TOP怎麽用?Java Rectangle.TOP使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.lowagie.text.Rectangle的用法示例。


在下文中一共展示了Rectangle.TOP屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addBorder

/**
 * Adds borders to the RtfBorderGroup
 * 
 * @param bordersToAdd The borders to add (Rectangle.LEFT, Rectangle.RIGHT, Rectangle.TOP, Rectangle.BOTTOM, Rectangle.BOX)
 * @param borderStyle The style of border to add (from RtfBorder)
 * @param borderWidth The border width to use
 * @param borderColor The border color to use
 */
public void addBorder(int bordersToAdd, int borderStyle, float borderWidth, Color borderColor) {
    if((bordersToAdd & Rectangle.LEFT) == Rectangle.LEFT) {
        setBorder(RtfBorder.LEFT_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.TOP) == Rectangle.TOP) {
        setBorder(RtfBorder.TOP_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.RIGHT) == Rectangle.RIGHT) {
        setBorder(RtfBorder.RIGHT_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.BOTTOM) == Rectangle.BOTTOM) {
        setBorder(RtfBorder.BOTTOM_BORDER, borderStyle, borderWidth, borderColor);
    }
    if((bordersToAdd & Rectangle.BOX) == Rectangle.BOX && this.borderType == RtfBorder.ROW_BORDER) {
        setBorder(RtfBorder.VERTICAL_BORDER, borderStyle, borderWidth, borderColor);
        setBorder(RtfBorder.HORIZONTAL_BORDER, borderStyle, borderWidth, borderColor);
    }
}
 
開發者ID:albfernandez,項目名稱:itext2,代碼行數:26,代碼來源:RtfBorderGroup.java

示例2: removeBorder

/**
 * Removes borders from the list of borders
 * 
 * @param bordersToRemove The borders to remove (from Rectangle)
 */
public void removeBorder(int bordersToRemove) {
    if((bordersToRemove & Rectangle.LEFT) == Rectangle.LEFT) {
        this.borders.remove(Integer.valueOf(RtfBorder.LEFT_BORDER));
    }
    if((bordersToRemove & Rectangle.TOP) == Rectangle.TOP) {
        this.borders.remove(Integer.valueOf(RtfBorder.TOP_BORDER));
    }
    if((bordersToRemove & Rectangle.RIGHT) == Rectangle.RIGHT) {
        this.borders.remove(Integer.valueOf(RtfBorder.RIGHT_BORDER));
    }
    if((bordersToRemove & Rectangle.BOTTOM) == Rectangle.BOTTOM) {
        this.borders.remove(Integer.valueOf(RtfBorder.BOTTOM_BORDER));
    }
    if((bordersToRemove & Rectangle.BOX) == Rectangle.BOX && this.borderType == RtfBorder.ROW_BORDER) {
        this.borders.remove(Integer.valueOf(RtfBorder.VERTICAL_BORDER));
        this.borders.remove(Integer.valueOf(RtfBorder.HORIZONTAL_BORDER));
    }
}
 
開發者ID:albfernandez,項目名稱:itext2,代碼行數:23,代碼來源:RtfBorderGroup.java

示例3: getBorderWidthInside

/**
 * Gets the amount of the border for the specified side that is inside the Rectangle.
 * For non-variable width borders this is only 1/2 the border width on that side.  This
 * always returns 0 if {@link #useBorderPadding} is false;
 * @param side the side to check.  One of the side constants in {@link com.lowagie.text.Rectangle}
 * @return the borderwidth inside the cell
 */
private float getBorderWidthInside(int side) {
    float width = 0f;
    if (useBorderPadding) {
        switch (side) {
            case Rectangle.LEFT:
                width = getBorderWidthLeft();
                break;

            case Rectangle.RIGHT:
                width = getBorderWidthRight();
                break;

            case Rectangle.TOP:
                width = getBorderWidthTop();
                break;

            default:    // default and BOTTOM
                width = getBorderWidthBottom();
                break;
        }
        // non-variable (original style) borders overlap the rectangle (only 1/2 counts)
        if (!isUseVariableBorders()) {
            width = width / 2f;
        }
    }
    return width;
}
 
開發者ID:albfernandez,項目名稱:itext2,代碼行數:34,代碼來源:PdfCell.java


注:本文中的com.lowagie.text.Rectangle.TOP屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。