jezuch.utils.starmapper2
Class ImageParameters

java.lang.Object
  |
  +--jezuch.utils.starmapper2.Parameters
        |
        +--jezuch.utils.starmapper2.ImageParameters
All Implemented Interfaces:
java.io.Serializable

public class ImageParameters
extends Parameters

Objects of this class contain instructions for Starmapper about generation of output image, such as image size, map clip etc. It also defines some abstract image sizes, like proportional to the other dimension, or "1-1" which means "one pixel per one map light year".
This is a subclass of Parameters.
List of reserved parameters is dependent on StarmapperLib version; accepted parameters are subject to check if given value is valid.
List of parameters for version 2.0 is: width (int), height (int), draw.names (boolean) and clip (ImageParameters.Clip).

Since:
2.0
Version:
2.0
Author:
Krzysztof Sobolewski
See Also:
Parameters, ImageParameters.Clip, Serialized Form

Nested Class Summary
static class ImageParameters.Clip
          Instances of this class encapsulate a Starmapper's map clip.
 
Nested classes inherited from class jezuch.utils.starmapper2.Parameters
Parameters.ParamHandler
 
Field Summary
static int MAP_SIZE
          An "abstract" image dimension that means "one pixel per map light year".
static int OUT_IMG_DATABAR
          A constant value that defines the space between right map edge and right image border, used for list of player names and year timestamp.
static int PROPORTIONAL
          An "abstract" image dimension that sets the dimension proportionally to the other one; two proportional dimensions are equal to two "map size" dimensions.
 
Fields inherited from class jezuch.utils.starmapper2.Parameters
BOOLEAN_PARAM_HANDLER, params, reservedKeys
 
Constructor Summary
ImageParameters()
          Construct ImageParameters instace with default values: image size 640x480, do not draw names and without clip.
 
Method Summary
 int calcHeight(java.awt.Rectangle mapBounds)
          Calculates image height by applying "abstract" image dimensions if they are defined.
 int calcWidth(java.awt.Rectangle mapBounds)
          Calculates image width by applying "abstract" image dimensions if they are defined.
 
Methods inherited from class jezuch.utils.starmapper2.Parameters
getBoolean, getInt, getObject, getString, setBoolean, setInt, setObject, setString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_SIZE

public static final int MAP_SIZE
An "abstract" image dimension that means "one pixel per map light year".

See Also:
Constant Field Values

OUT_IMG_DATABAR

public static final int OUT_IMG_DATABAR
A constant value that defines the space between right map edge and right image border, used for list of player names and year timestamp.

See Also:
Constant Field Values

PROPORTIONAL

public static final int PROPORTIONAL
An "abstract" image dimension that sets the dimension proportionally to the other one; two proportional dimensions are equal to two "map size" dimensions.

See Also:
Constant Field Values
Constructor Detail

ImageParameters

public ImageParameters()
Construct ImageParameters instace with default values: image size 640x480, do not draw names and without clip.

Method Detail

calcHeight

public int calcHeight(java.awt.Rectangle mapBounds)
Calculates image height by applying "abstract" image dimensions if they are defined.

Parameters:
mapBounds - Rectangle containing map size and location
Returns:
calculated image height

calcWidth

public int calcWidth(java.awt.Rectangle mapBounds)
Calculates image width by applying "abstract" image dimensions if they are defined.

Parameters:
mapBounds - Rectangle containing map size and location
Returns:
calculated image width