com.pegacat.vcf
Class Skin

java.lang.Object
  |
  +--com.pegacat.vcf.Skin

public class Skin
extends java.lang.Object

A utility grab bag class allowing a common access point to different gifs that make up a 'skin'.

A skin is simply a large .png file the various regions of which correspond to button backgrounds, window backgrounds, general backgrounds and so on.

Normally the main background is a 100x100 base pane that is found in the top left corner of the skin, and is tesselated around the back of the main client frame. However, if a large background image is desired, an auxiliary skin file with the name .background.png can be created, and this will be used instead. (i.e. a pair of files are created; myskin.png and myskin.background.png.)


Field Summary
static int backgroundTileSize
           
static int buttonHeight
           
static int buttonStart
           
static int buttonWidth
           
static int connectionDialogHeight
           
static int connectionDialogStart
           
static int connectionDialogWidth
           
static int iconStart
           
static int logoSize
           
static int logoStart
           
static java.lang.String skinDirectory
           
 int tileHeight
           
 int tileWidth
           
static int welcomeHeight
           
static int welcomeStartX
           
static int welcomeStartY
           
static int welcomeWidth
           
 
Constructor Summary
Skin(java.lang.String fileName, java.awt.Frame baseFrame)
           
 
Method Summary
 int getBackgroundTileHeight()
           
 int getBackgroundTileWidth()
           
 java.awt.Image[] getButton()
          Returns a set of 4 small buttons images 50 x 100 pixels, in order normal, highlit, pressed, and inactive.
 java.awt.Image getConnectionDialog()
          Returns a small (400 x 300) image used as the backdrop to the connection dialog box.
 int getHeight()
          Returns the total height of the skin (useful for determining if any 'extra' graphics have been added).
 java.awt.Image getIcon()
          Returns a 16 x 16 icon for decorating the top left of the main window.
 java.awt.Image getLogo()
          Returns the welcome image used as a place holder on the main window.
 java.awt.Image getRegion(java.awt.Rectangle region)
          Skins may be any size greater than the minimum required.
 java.awt.Image getSkin()
          Returns the entire skin image.
 java.awt.Image getTesselatedBackground()
          Returns a generic background image 'tile' of size 100 x 100, (or arbitrary if using a separate image...)
 java.awt.Image getWelcome()
          Returns the welcome image used as a place holder on the main window.
 int getWidth()
          Returns the total width of the skin (useful for determining if any 'extra' graphics have been added).
static java.awt.Image loadImage(java.awt.Image image, java.awt.Component component)
          Utility function that fully loads an image before returning.
static java.awt.Image loadImage(java.lang.String fileName, java.awt.Component component)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

backgroundTileSize

public static final int backgroundTileSize

connectionDialogStart

public static final int connectionDialogStart

connectionDialogWidth

public static final int connectionDialogWidth

connectionDialogHeight

public static final int connectionDialogHeight

buttonStart

public static final int buttonStart

buttonWidth

public static final int buttonWidth

buttonHeight

public static final int buttonHeight

iconStart

public static final int iconStart

logoStart

public static final int logoStart

logoSize

public static final int logoSize

welcomeStartX

public static final int welcomeStartX

welcomeStartY

public static final int welcomeStartY

welcomeWidth

public static final int welcomeWidth

welcomeHeight

public static final int welcomeHeight

skinDirectory

public static final java.lang.String skinDirectory

tileWidth

public int tileWidth

tileHeight

public int tileHeight
Constructor Detail

Skin

public Skin(java.lang.String fileName,
            java.awt.Frame baseFrame)
Method Detail

getSkin

public java.awt.Image getSkin()
Returns the entire skin image.

getWidth

public int getWidth()
Returns the total width of the skin (useful for determining if any 'extra' graphics have been added).

getHeight

public int getHeight()
Returns the total height of the skin (useful for determining if any 'extra' graphics have been added).

getIcon

public java.awt.Image getIcon()
Returns a 16 x 16 icon for decorating the top left of the main window. (Remember that icons are always 16x16 in windoze land)

getWelcome

public java.awt.Image getWelcome()
Returns the welcome image used as a place holder on the main window.

getLogo

public java.awt.Image getLogo()
Returns the welcome image used as a place holder on the main window.

getBackgroundTileWidth

public int getBackgroundTileWidth()

getBackgroundTileHeight

public int getBackgroundTileHeight()

getTesselatedBackground

public java.awt.Image getTesselatedBackground()
Returns a generic background image 'tile' of size 100 x 100, (or arbitrary if using a separate image...)

getConnectionDialog

public java.awt.Image getConnectionDialog()
Returns a small (400 x 300) image used as the backdrop to the connection dialog box.

getButton

public java.awt.Image[] getButton()
Returns a set of 4 small buttons images 50 x 100 pixels, in order normal, highlit, pressed, and inactive. Text is superimposed on top of these.

getRegion

public java.awt.Image getRegion(java.awt.Rectangle region)
Skins may be any size greater than the minimum required. This returns the desired (non-standard) region, or null if it is outside the current image.

loadImage

public static java.awt.Image loadImage(java.awt.Image image,
                                       java.awt.Component component)
Utility function that fully loads an image before returning. Should only be used unthreaded to load local images! (Otherwise may hang program during extended loads.)
Parameters:
fileName - the name of the image file to load
component - an awt component, required for bizarre MediaTracker doo-hicky.
Returns:
returns the Image corresponding to the file, or null if it wasn't found.

loadImage

public static java.awt.Image loadImage(java.lang.String fileName,
                                       java.awt.Component component)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object