com.realtime.crossfire.jxclient.gui.button
Class ButtonImages

java.lang.Object
  extended by com.realtime.crossfire.jxclient.gui.button.ButtonImages

public class ButtonImages
extends java.lang.Object

A set of images to form a button image. The button image consists of a left, a middle, and a right part. Left and right parts have fixed size, the middle part is clipped or repeated to the button's width.


Field Summary
private  int height
          The button height.
private  java.awt.Image imageLeft
          The left border of the button.
private  java.awt.Image imageMiddle
          The background of the middle part of the button.
private  java.awt.Image imageRight
          The right border of the button.
private static int OFFSET
          Half the minimum width available for the text.
 
Constructor Summary
ButtonImages(java.awt.Image imageLeft, java.awt.Image imageMiddle, java.awt.Image imageRight)
          Creates a new instance.
 
Method Summary
 int getHeight()
          Returns the button's height.
 int getMinimumWidth()
          Returns the minimal possible button's width.
 void render(java.awt.Graphics g, int w)
          Draws the button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

height

private final int height
The button height.


imageLeft

@NotNull
private final java.awt.Image imageLeft
The left border of the button.


imageMiddle

@NotNull
private final java.awt.Image imageMiddle
The background of the middle part of the button.


imageRight

@NotNull
private final java.awt.Image imageRight
The right border of the button.


OFFSET

private static final int OFFSET
Half the minimum width available for the text.

See Also:
Constant Field Values
Constructor Detail

ButtonImages

public ButtonImages(@NotNull
                    java.awt.Image imageLeft,
                    @NotNull
                    java.awt.Image imageMiddle,
                    @NotNull
                    java.awt.Image imageRight)
Creates a new instance.

Parameters:
imageLeft - the left image
imageMiddle - the middle image
imageRight - the right image
Method Detail

getHeight

public int getHeight()
Returns the button's height.

Returns:
the height

getMinimumWidth

public int getMinimumWidth()
Returns the minimal possible button's width.

Returns:
the minimal button's width

render

public void render(@NotNull
                   java.awt.Graphics g,
                   int w)
Draws the button.

Parameters:
g - the graphics to paint into
w - the button width