|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.common.resources.ResourceManager
public class ResourceManager
Class for getting resources (images, audio etc).
Constructor Summary | |
---|---|
ResourceManager()
|
Method Summary | |
---|---|
static java.awt.Color |
getColor(java.lang.String resource)
Returns the Color with the given name. |
static java.awt.Image |
getGrayscaleImage(java.lang.String resource,
java.awt.Dimension size)
Returns the a grayscale version of the image specified by the given name. |
static java.awt.Image |
getGrayscaleImage(java.lang.String resource,
double scale)
Returns the grayscale version of the image specified by the given name. |
static java.awt.Image |
getImage(java.lang.String resource)
Returns the image specified by the given name. |
static java.awt.Image |
getImage(java.lang.String resource,
java.awt.Dimension size)
Returns the image specified by the given name. |
static java.awt.Image |
getImage(java.lang.String resource,
double scale)
Returns the image specified by the given name. |
static javax.swing.ImageIcon |
getImageIcon(java.lang.String resource)
Creates an ImageIcon for the image of
the given name. |
static SimpleZippedAnimation |
getSimpleZippedAnimation(java.lang.String resource)
Returns the animation specified by the given name. |
static SimpleZippedAnimation |
getSimpleZippedAnimation(java.lang.String resource,
double scale)
Returns the animation specified by the given name. |
static Video |
getVideo(java.lang.String resource)
Gets the Video represented by the given resource. |
static void |
preload(java.awt.Dimension windowSize)
Preload resources. |
static void |
setBaseMapping(ResourceMapping _baseMapping)
Sets the mappings specified in the date/base-directory |
static void |
setCampaignMapping(ResourceMapping _campaignMapping)
Sets the mappings specified in a campaign. |
static void |
setModMappings(java.util.List<ResourceMapping> _modMappings)
Sets the mappings specified by mods. |
static void |
setScenarioMapping(ResourceMapping _scenarioMapping)
Sets the mappings specified in a scenario. |
static void |
setTcMapping(ResourceMapping _tcMapping)
Sets the mappings specified for a Total Conversion (TC). |
static void |
startBackgroundPreloading(java.awt.Dimension windowSize)
Starts background preloading of resources. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ResourceManager()
Method Detail |
---|
public static void setBaseMapping(ResourceMapping _baseMapping)
_baseMapping
- The mapping between IDs and files.public static void setTcMapping(ResourceMapping _tcMapping)
_tcMapping
- The mapping between IDs and files.public static void setModMappings(java.util.List<ResourceMapping> _modMappings)
_modMappings
- A list of the mapping between IDs and files.public static void setCampaignMapping(ResourceMapping _campaignMapping)
_campaignMapping
- The mapping between IDs and files.public static void setScenarioMapping(ResourceMapping _scenarioMapping)
_scenarioMapping
- The mapping between IDs and files.public static void preload(java.awt.Dimension windowSize)
background preloading thread
is started.
windowSize
- public static void startBackgroundPreloading(java.awt.Dimension windowSize)
windowSize
- The window size to use when scaling
full screen size images.public static SimpleZippedAnimation getSimpleZippedAnimation(java.lang.String resource)
resource
- The name of the resource to return.
resource
or null
if there is no animation
identified by that name.public static Video getVideo(java.lang.String resource)
Video
represented by the given resource.
Video
in it's original size.public static SimpleZippedAnimation getSimpleZippedAnimation(java.lang.String resource, double scale)
resource
- The name of the resource to return.scale
- The size of the requested animation (with 1
being normal size, 2 twice the size, 0.5 half the
size etc). Rescaling will be performed unless using 1.
resource
or null
if there is no animation
identified by that name.public static java.awt.Image getImage(java.lang.String resource)
resource
- The name of the resource to return.
resource
or null
if there is no image
identified by that name.public static java.awt.Image getImage(java.lang.String resource, double scale)
resource
- The name of the resource to return.scale
- The size of the requested image (with 1 being normal size,
2 twice the size, 0.5 half the size etc). Rescaling
will be performed unless using 1.
resource
or null
if there is no image
identified by that name.public static java.awt.Image getImage(java.lang.String resource, java.awt.Dimension size)
resource
- The name of the resource to return.size
- The size of the requested image. Rescaling
will be performed if necessary.
resource
or null
if there is no image
identified by that name.public static java.awt.Image getGrayscaleImage(java.lang.String resource, java.awt.Dimension size)
resource
- The name of the resource to return.size
- The size of the requested image. Rescaling
will be performed if necessary.
resource
or null
if there is no image
identified by that name.public static java.awt.Image getGrayscaleImage(java.lang.String resource, double scale)
resource
- The name of the resource to return.scale
- The size of the requested image (with 1 being normal size,
2 twice the size, 0.5 half the size etc). Rescaling
will be performed unless using 1.
resource
or null
if there is no image
identified by that name.public static javax.swing.ImageIcon getImageIcon(java.lang.String resource)
ImageIcon
for the image of
the given name.
resource
- The name of the resource to return.
ImageIcon
created with the image
identified by resource
or
null
if there is no image identified
by that name.getImage(String)
public static java.awt.Color getColor(java.lang.String resource)
Color
with the given name.
resource
- The name of the resource to return.
Color
created with the image
identified by resource
or
null
if there is no color identified
by that name.getImage(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |