Class Shop

java.lang.Object
  |
  +--java.awt.Component
        |
        +--Shop
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class Shop
extends java.awt.Component

Defines the Shop where the Player can buy Items, Save Heal his Monsters, and Switch Monsters from Home to his Hand.

See Also:
ShopEndEvent, SaveEvent, Player, Serialized Form

Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
Shop(Player p, java.awt.Image bg)
          Construct a Shop Object with a Player and an Image.
 
Method Summary
 void addSaveListener(SaveListener bl)
          Add a Class to fire SaveEvent into
 void addShopEndListener(ShopEndListener bl)
          Add a Class to fire ShopEndEvents into
 void paint(java.awt.Graphics g)
          Draw the Shop, and handle selection highlighting
 void processEvent(java.awt.AWTEvent e)
          Handle Events that are passed into this.
 void removeSaveListener(SaveEvent bl)
          Removes a Class to fire SaveEvent into
 void removeShopListener(ShopEndListener bl)
          Removes a Class to fire ShopEndEvents into
 void update(java.awt.Graphics g)
          Overriden to only call paint without first painting a background first, removes the flicker effect
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Shop

public Shop(Player p,
            java.awt.Image bg)
Construct a Shop Object with a Player and an Image.

Parameters:
p - the Player to use
bg - the Image of the Shop
Method Detail

processEvent

public void processEvent(java.awt.AWTEvent e)
Handle Events that are passed into this. Overrides implementation for KeyEvent.KEY_PRESSED and KeyEvent.KEY_RELEASED, allows super to deal with the rest

Overrides:
processEvent in class java.awt.Component
Parameters:
e - the AWTEvent to handle
See Also:
AWTEvent

update

public void update(java.awt.Graphics g)
Overriden to only call paint without first painting a background first, removes the flicker effect

Overrides:
update in class java.awt.Component
Parameters:
g - the Graphics

paint

public void paint(java.awt.Graphics g)
Draw the Shop, and handle selection highlighting

Overrides:
paint in class java.awt.Component
Parameters:
g - the Graphics

addShopEndListener

public void addShopEndListener(ShopEndListener bl)
Add a Class to fire ShopEndEvents into

Parameters:
bl - the Class that wishes to be informed
See Also:
ShopEndListener, ShopEndEvent

removeShopListener

public void removeShopListener(ShopEndListener bl)
Removes a Class to fire ShopEndEvents into

Parameters:
bl - the Class that wishes to not be informed anymore
See Also:
ShopEndListener, ShopEndEvent

addSaveListener

public void addSaveListener(SaveListener bl)
Add a Class to fire SaveEvent into

Parameters:
bl - the Class that wishes to be informed
See Also:
SaveListener, SaveEvent

removeSaveListener

public void removeSaveListener(SaveEvent bl)
Removes a Class to fire SaveEvent into

Parameters:
bl - the Class that wishes to not be informed anymore
See Also:
SaveListener, SaveEvent