|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.resources.Resource
net.sf.freecol.common.resources.ChipResource
public class ChipResource
A Resource wrapping a "Chip", that is a small
BufferedImage indicating the owner of a unit or
mission, or the alarm of a native settlement. The URI
is expected to look like this "urn:chip:mission:red:black", for
example.
Resource,
Color| Field Summary | |
|---|---|
private java.awt.Color |
background
Describe background here. |
private java.awt.Color |
foreground
Describe foreground here. |
static int |
HEIGHT
|
private java.awt.image.BufferedImage |
image
Describe chip here. |
private java.util.Map<java.lang.Double,java.awt.Image> |
scaledImages
|
static java.lang.String |
SCHEME
|
private java.lang.String |
type
Describe type here. |
static int |
WIDTH
|
| Constructor Summary | |
|---|---|
private |
ChipResource(java.lang.String type,
java.awt.Color bg,
java.awt.Color fg)
|
(package private) |
ChipResource(java.net.URI resourceLocator)
Do not use directly. |
| Method Summary | |
|---|---|
static ChipResource |
colorChip(java.awt.Color color)
|
private void |
createAlarmChip(boolean visited)
|
private void |
createColorChip()
|
private void |
createMissionChip()
|
java.awt.Color |
getBackground()
Get the Background value. |
java.awt.Color |
getForeground()
Get the Foreground value. |
java.awt.Image |
getImage()
Get the Image value. |
java.awt.Image |
getImage(double scale)
|
java.lang.String |
getType()
Get the Type value. |
static ChipResource |
missionChip(java.awt.Color color,
boolean expert)
|
void |
preload()
Preloading is a noop for this resource type. |
void |
setBackground(java.awt.Color newBackground)
Set the Background value. |
void |
setForeground(java.awt.Color newForeground)
Set the Foreground value. |
| Methods inherited from class net.sf.freecol.common.resources.Resource |
|---|
getResourceLocator |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SCHEME
public static final int WIDTH
public static final int HEIGHT
private java.awt.Color foreground
private java.awt.Color background
private java.awt.image.BufferedImage image
private final java.lang.String type
private java.util.Map<java.lang.Double,java.awt.Image> scaledImages
| Constructor Detail |
|---|
private ChipResource(java.lang.String type,
java.awt.Color bg,
java.awt.Color fg)
ChipResource(java.net.URI resourceLocator)
resourceLocator - The URI used when loading this
resource.ResourceFactory.createResource(URI)| Method Detail |
|---|
public void preload()
preload in class Resourcepublic final java.awt.Color getForeground()
Foreground value.
Color valuepublic final void setForeground(java.awt.Color newForeground)
Foreground value.
newForeground - The new Foreground value.public final java.awt.Color getBackground()
Background value.
Color valuepublic final void setBackground(java.awt.Color newBackground)
Background value.
newBackground - The new Background value.public final java.lang.String getType()
Type value.
String valuepublic final java.awt.Image getImage()
Image value.
BufferedImage valuepublic final java.awt.Image getImage(double scale)
private void createColorChip()
private void createMissionChip()
private void createAlarmChip(boolean visited)
public static ChipResource colorChip(java.awt.Color color)
public static ChipResource missionChip(java.awt.Color color,
boolean expert)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||