TitleRenderer.java 文件源码

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

项目:neoscada 作者:
@Override
public void render ( final Graphics g, final Rectangle clientRectangle )
{
    if ( this.title == null || this.title.isEmpty () )
    {
        return;
    }

    g.setClipping ( this.rect );

    g.setFont ( createFont ( g.getResourceManager () ) );

    final Point size = g.textExtent ( this.title );

    final int x = this.rect.width / 2 - size.x / 2;
    final int y = this.padding;
    g.drawText ( this.title, this.rect.x + x, this.rect.y + y, null );

    g.setClipping ( clientRectangle );
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号