private class DiscardView.Resource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.awt.event.ActionListener |
_actionListener |
private java.awt.image.BufferedImage |
_blankDownImage |
private java.awt.image.BufferedImage |
_blankUpImage |
private boolean |
_canDecrease |
private boolean |
_canIncrease |
private int |
_discardAmount |
private javax.swing.JLabel |
_discardAmountLabel |
private javax.swing.JPanel |
_discardResourcePanel |
private javax.swing.JButton |
_downButton |
private java.awt.image.BufferedImage |
_downImage |
private int |
_maxAmount |
private javax.swing.JLabel |
_maxAmountLabel |
private java.awt.image.BufferedImage |
_resourceImage |
private ResourceType |
_type |
private javax.swing.JButton |
_upButton |
private java.awt.image.BufferedImage |
_upImage |
private static float |
A_OFFSET |
private static float |
A_SCALE |
private static float |
B_OFFSET |
private static float |
B_SCALE |
private static int |
BUTTON_SIZE |
private static float |
G_OFFSET |
private static float |
G_SCALE |
private static double |
IMAGE_SCALE |
private static int |
IMAGE_SIZE |
private static int |
LABEL_FONT_SIZE |
private static int |
LABEL_SIZE |
private static int |
PADDING |
private static float |
R_OFFSET |
private static float |
R_SCALE |
Constructor and Description |
---|
Resource() |
Resource(ResourceType type) |
Resource(ResourceType type,
int maxAmount,
int discardAmount,
boolean canIncrease,
boolean canDecrease) |
Modifier and Type | Method and Description |
---|---|
javax.swing.JComponent |
asJComponent() |
boolean |
canDecrease() |
boolean |
canIncrease() |
int |
getDiscardAmount() |
int |
getMaxAmount() |
ResourceType |
getType() |
void |
setDecrease(boolean canDecrease) |
void |
setDiscardAmount(int discardAmount) |
void |
setDownArrowImage(java.awt.image.BufferedImage downImage) |
void |
setIncrease(boolean canIncrease) |
void |
setMaxAmount(int maxAmount) |
void |
setResourceImage(java.awt.image.BufferedImage resourceImage) |
void |
setType(ResourceType type) |
void |
setUpArrowImage(java.awt.image.BufferedImage upImage) |
void |
update() |
private static final int PADDING
private static final int BUTTON_SIZE
private static final int LABEL_SIZE
private static final int LABEL_FONT_SIZE
private static final int IMAGE_SIZE
private static final double IMAGE_SCALE
private static final float R_SCALE
private static final float G_SCALE
private static final float B_SCALE
private static final float A_SCALE
private static final float R_OFFSET
private static final float G_OFFSET
private static final float B_OFFSET
private static final float A_OFFSET
private ResourceType _type
private int _discardAmount
private int _maxAmount
private boolean _canIncrease
private boolean _canDecrease
private java.awt.image.BufferedImage _resourceImage
private java.awt.image.BufferedImage _upImage
private java.awt.image.BufferedImage _blankUpImage
private java.awt.image.BufferedImage _downImage
private java.awt.image.BufferedImage _blankDownImage
private javax.swing.JLabel _discardAmountLabel
private javax.swing.JLabel _maxAmountLabel
private javax.swing.JButton _upButton
private javax.swing.JButton _downButton
private javax.swing.JPanel _discardResourcePanel
private java.awt.event.ActionListener _actionListener
public Resource()
public Resource(ResourceType type)
public Resource(ResourceType type, int maxAmount, int discardAmount, boolean canIncrease, boolean canDecrease)
public ResourceType getType()
public void setType(ResourceType type)
public int getDiscardAmount()
public void setDiscardAmount(int discardAmount)
public int getMaxAmount()
public void setMaxAmount(int maxAmount)
public boolean canIncrease()
public void setIncrease(boolean canIncrease)
public boolean canDecrease()
public void setDecrease(boolean canDecrease)
public void update()
public void setResourceImage(java.awt.image.BufferedImage resourceImage)
public void setUpArrowImage(java.awt.image.BufferedImage upImage)
public void setDownArrowImage(java.awt.image.BufferedImage downImage)
public javax.swing.JComponent asJComponent()