protected Rectangle getBubbleSize (int type, Dimension d)
    {
        switch (ChatLogic.modeOf(type)) {
        case ChatLogic.SHOUT:
        case ChatLogic.THINK:
        case ChatLogic.EMOTE:
            // extra room for these two monsters
            return new Rectangle(d.width + (PAD * 4), d.height + (PAD * 4));

        default:
            return new Rectangle(d.width + (PAD * 2), d.height + (PAD * 2));
        }
    }
protected Rectangle getBubbleSize ( int type , Dimension d ) { switch ( ChatLogic . modeOf ( type ) ) { case ChatLogic . SHOUT : case ChatLogic . THINK : case ChatLogic . EMOTE : return new Rectangle ( d . width + ( PAD * 4 ) , d . height + ( PAD * 4 ) ) ; default : return new Rectangle ( d . width + ( PAD * 2 ) , d . height + ( PAD * 2 ) ) ; } }
Calculate the size of the chat bubble based on the dimensions of the label and the type of
chat. It will be turned into a shape later, but we manipulate it for a while as just a
rectangle (which are easier to move about and do intersection tests with, and besides the
Shape interface has no way to translate).