solitaire
Class CardImageFactory

java.lang.Object
  extended by solitaire.CardImageFactory

public class CardImageFactory
extends java.lang.Object

Singleton class for retrieving card images. Images are loaded either explicitly or when a card image is first retrieved. All images are loaded in either case.


Method Summary
static CardImageFactory getFactory()
          Return the only (singleton) factory created.
 javax.swing.ImageIcon getImageIcon(java.lang.String name)
          Return the image for a specific card, where the name of the card conforms to contract in IGuiCard or is a constant from GuiConstants
 void loadImages()
          Load images of they are not already loaded.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public static CardImageFactory getFactory()
Return the only (singleton) factory created.

Returns:
the only factory for accessing card images.

loadImages

public void loadImages()
Load images of they are not already loaded.


getImageIcon

public javax.swing.ImageIcon getImageIcon(java.lang.String name)
Return the image for a specific card, where the name of the card conforms to contract in IGuiCard or is a constant from GuiConstants

Parameters:
name - is card id for returned image
Returns:
an image for the specified card, or joker if none found.

main

public static void main(java.lang.String[] args)