BreadcrumbItem.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:SWET 作者:
private Point computeSizeOfTextAndImages() {
    int width = 0, height = 0;
    final boolean textISNotEmpty = getText() != null && !getText().equals("");

    if (textISNotEmpty) {
        final GC gc = new GC(this.parentBreadcrumb);
        gc.setFont(this.parentBreadcrumb.getFont());
        final Point extent = gc.stringExtent(getText());
        gc.dispose();
        width += extent.x;
        height = extent.y;
    }

    final Point imageSize = computeMaxWidthAndHeightForImages(getImage(),
            this.selectionImage, this.disabledImage);

    if (imageSize.x != -1) {
        width += imageSize.x;
        height = Math.max(imageSize.y, height);
        if (textISNotEmpty) {
            width += MARGIN * 2;
        }
    }
    width += MARGIN;
    return new Point(width, height);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号