net.sf.magicproject.ui.component
Class MiniCard

java.lang.Object
  extended by javax.swing.ImageIcon
      extended by net.sf.magicproject.ui.component.MiniCard
All Implemented Interfaces:
java.io.Serializable, javax.accessibility.Accessible, javax.swing.Icon

public class MiniCard
extends javax.swing.ImageIcon

Since:
0.90
Author:
Fabrice Daugan
See Also:
Serialized Form

Field Summary
static int CARD_ICON_HEIGHT
          The height of icon.
static int CARD_ICON_WIDTH
          The width of icon.
 
Constructor Summary
MiniCard(java.awt.Image image, javax.swing.ImageIcon backImage)
          Create a new instance of this class.
 
Method Summary
 int getIconHeight()
          Gets the height of the icon.
 int getIconWidth()
          Gets the width of the icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paints the icon.
 
Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getImage, getImageLoadStatus, getImageObserver, setDescription, setImage, setImageObserver, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CARD_ICON_WIDTH

public static final int CARD_ICON_WIDTH
The width of icon.

See Also:
Constant Field Values

CARD_ICON_HEIGHT

public static final int CARD_ICON_HEIGHT
The height of icon.

See Also:
Constant Field Values
Constructor Detail

MiniCard

public MiniCard(java.awt.Image image,
                javax.swing.ImageIcon backImage)
Create a new instance of this class.

Parameters:
image - the image to display.
backImage - the background image behing the card.
Method Detail

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paints the icon. The top-left corner of the icon is drawn at the point (x, y) in the coordinate space of the graphics context g. If this icon has no image observer, this method uses the c component as the observer.

Specified by:
paintIcon in interface javax.swing.Icon
Overrides:
paintIcon in class javax.swing.ImageIcon
Parameters:
c - the component to be used as the observer if this icon has no image observer
g - the graphics context
x - the X coordinate of the icon's top-left corner
y - the Y coordinate of the icon's top-left corner

getIconWidth

public int getIconWidth()
Gets the width of the icon.

Specified by:
getIconWidth in interface javax.swing.Icon
Overrides:
getIconWidth in class javax.swing.ImageIcon
Returns:
the width in pixels of this icon

getIconHeight

public int getIconHeight()
Gets the height of the icon.

Specified by:
getIconHeight in interface javax.swing.Icon
Overrides:
getIconHeight in class javax.swing.ImageIcon
Returns:
the height in pixels of this icon


Copyright © 2003-2007 Magic-Project. All Rights Reserved.